httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ch...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/proxy proxy_connect.c proxy_ftp.c proxy_http.c
Date Tue, 14 Nov 2000 19:32:03 GMT
chuck       00/11/14 11:32:03

  Modified:    src/modules/proxy proxy_connect.c proxy_ftp.c proxy_http.c
  Log:
  Changes for previous ap_proxy_doconnect() calling
  
  Revision  Changes    Path
  1.15      +2 -2      apache-2.0/src/modules/proxy/proxy_connect.c
  
  Index: proxy_connect.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_connect.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- proxy_connect.c	2000/11/11 17:51:58	1.14
  +++ proxy_connect.c	2000/11/14 19:32:03	1.15
  @@ -180,11 +180,11 @@
       }
   
       if (ap_proxy_doconnect(sock, (char *)(proxyhost ? proxyhost : host),
  -      proxyport ? proxyport : port, r) == -1) {
  +      proxyport ? proxyport : port, r) != APR_SUCCESS) {
           apr_close_socket(sock);
           return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
               apr_pstrcat(r->pool, "Could not connect to remote machine:<br>",
  -            strerror(errno), NULL));
  +            proxyhost, NULL));
       }
   
       /* If we are connecting through a remote proxy, we need to pass
  
  
  
  1.22      +5 -4      apache-2.0/src/modules/proxy/proxy_ftp.c
  
  Index: proxy_ftp.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_ftp.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- proxy_ftp.c	2000/11/11 18:34:10	1.21
  +++ proxy_ftp.c	2000/11/14 19:32:03	1.22
  @@ -590,11 +590,11 @@
   #endif /*_OSD_POSIX*/
       }
   
  -    if (ap_proxy_doconnect(sock, host, port, r) == -1) {
  +    if (ap_proxy_doconnect(sock, host, port, r) != APR_SUCCESS) {
   	apr_close_socket(sock);
   	return ap_proxyerror(r, HTTP_BAD_GATEWAY, apr_pstrcat(r->pool,
   				"Could not connect to remote machine: ",
  -				strerror(errno), NULL));
  +				host, NULL));
       }
   
       f = ap_bcreate(p, B_RDWR);
  @@ -849,11 +849,12 @@
               ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL,
                            "FTP: contacting host %d.%d.%d.%d:%d",
                            h3, h2, h1, h0, pport);
  -            if (ap_proxy_doconnect(dsock, inet_ntoa(destaddr), pport, r) == -1) {
  +/* scary */
  +            if (ap_proxy_doconnect(dsock, inet_ntoa(destaddr), pport, r) == APR_SUCCESS)
{
   		return ap_proxyerror(r, HTTP_BAD_GATEWAY,
   		    apr_pstrcat(r->pool,
   		    "Could not connect to remote machine: ",
  -		    strerror(errno), NULL));
  +		    inet_ntoa(destaddr), NULL));
   	    }
   	    else {
   		pasvmode = 1;
  
  
  
  1.20      +5 -4      apache-2.0/src/modules/proxy/proxy_http.c
  
  Index: proxy_http.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_http.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- proxy_http.c	2000/11/11 18:34:10	1.19
  +++ proxy_http.c	2000/11/14 19:32:03	1.20
  @@ -174,6 +174,7 @@
       char *desthost;
       apr_socket_t *sock;
       int i, len, backasswards, content_length = -1;
  +    apr_status_t err;
       apr_array_header_t *reqhdrs_arr;
       apr_table_t *resp_hdrs = NULL;
       apr_table_entry_t *reqhdrs;
  @@ -256,19 +257,19 @@
   #endif
   
       if (proxyhost != NULL) {
  -        i = ap_proxy_doconnect(sock, (char *)proxyhost, proxyport, r);
  +        err = ap_proxy_doconnect(sock, (char *)proxyhost, proxyport, r);
       }
       else {
  -        i = ap_proxy_doconnect(sock, (char *)desthost, destport, r);
  +        err = ap_proxy_doconnect(sock, (char *)desthost, destport, r);
       }
   
  -    if (i == -1) {
  +    if (err != APR_SUCCESS) {
   	if (proxyhost != NULL)
   	    return DECLINED;	/* try again another way */
   	else
   	    return ap_proxyerror(r, HTTP_BAD_GATEWAY, apr_pstrcat(r->pool,
   				"Could not connect to remote machine: ",
  -				strerror(errno), NULL));
  +				desthost, NULL));
       }
   
       clear_connection(r->pool, r->headers_in);	/* Strip connection-based headers */
  
  
  

Mime
View raw message