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 mod_proxy.h proxy_util.c
Date Tue, 14 Nov 2000 17:15:13 GMT
chuck       00/11/14 09:15:12

  Modified:    src/modules/proxy mod_proxy.h proxy_util.c
  Log:
  Simplify ap_proxy_doconnect(); now returns apr_status_t
  
  Revision  Changes    Path
  1.18      +1 -1      apache-2.0/src/modules/proxy/mod_proxy.h
  
  Index: mod_proxy.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/mod_proxy.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- mod_proxy.h	2000/11/11 18:34:09	1.17
  +++ mod_proxy.h	2000/11/14 17:15:11	1.18
  @@ -273,7 +273,7 @@
   int ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p);
   int ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p);
   int ap_proxy_is_word(struct dirconn_entry *This, apr_pool_t *p);
  -int ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, request_rec *r);
  +apr_status_t ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, request_rec
*r);
   int ap_proxy_garbage_init(server_rec *, apr_pool_t *);
   /* This function is called by ap_table_do() for all header lines */
   int ap_proxy_send_hdr_line(void *p, const char *key, const char *value);
  
  
  
  1.25      +12 -13    apache-2.0/src/modules/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_util.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- proxy_util.c	2000/11/11 18:34:10	1.24
  +++ proxy_util.c	2000/11/14 17:15:11	1.25
  @@ -1136,8 +1136,9 @@
       return host != NULL && ap_strstr_c(host, This->name) != NULL;
   }
   
  -int ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, request_rec *r)
  +apr_status_t ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, request_rec
*r)
   {
  +    apr_status_t rv;
       int i;
   
       for (i = 0; host[i] != '\0'; i++)
  @@ -1149,20 +1150,18 @@
           apr_set_ipaddr(sock, APR_REMOTE, host);
           host = NULL;
       }
  -    for(;;)
  +
  +    do
  +    {
  +        rv = apr_connect(sock, host);
  +    } while (APR_STATUS_IS_EINTR(rv));
  +
  +    if (rv != APR_SUCCESS)
       {
  -        apr_status_t rv = apr_connect(sock, host);
  -        if (APR_STATUS_IS_EINTR(rv))
  -            continue;
  -        else if (rv == APR_SUCCESS)
  -            return 0;
  -        else {
  -            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
  -                "proxy connect to %s port %d failed", host, port);
  -            return -1;
  -        }
  +        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  +            "proxy connect to %s port %d failed", host, port);
       }
  -    return -1;
  +    return rv;
   }
   
   /* This function is called by ap_table_do() for all header lines */
  
  
  

Mime
View raw message