httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ch...@apache.org
Subject cvs commit: httpd-proxy/module-2.0 proxy_connect.c
Date Fri, 13 Apr 2001 17:46:54 GMT
chuck       01/04/13 10:46:54

  Modified:    module-2.0 proxy_connect.c
  Log:
  Not sure what I was thinking, but this clarifies the logic for nbytes >
  sizeof(buffer) towards the end of proxy_connect.c
  
  Revision  Changes    Path
  1.38      +13 -11    httpd-proxy/module-2.0/proxy_connect.c
  
  Index: proxy_connect.c
  ===================================================================
  RCS file: /home/cvs/httpd-proxy/module-2.0/proxy_connect.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- proxy_connect.c	2001/04/13 15:30:32	1.37
  +++ proxy_connect.c	2001/04/13 17:46:54	1.38
  @@ -106,7 +106,7 @@
       apr_socket_t *sock;
       apr_status_t err, rv;
       char buffer[HUGE_STRING_LEN];
  -    int i;
  +    int i, o;
       apr_size_t nbytes;
   
       apr_pollfd_t *pollfd;
  @@ -326,14 +326,15 @@
                                "proxy: CONNECT: sock was set");*/
                   nbytes = sizeof(buffer);
                   if (apr_recv(sock, buffer, &nbytes) == APR_SUCCESS) {
  -                    int o = 0;
  -                    while(nbytes)
  +                    o = 0;
  +                    i = nbytes;
  +                    while(i > 0)
                       {
  +                        nbytes = i;
   			if (apr_send(r->connection->client_socket, buffer + o, &nbytes) != APR_SUCCESS)
   			    break;
  -                        i = nbytes;
  -                        o += i;
  -                        nbytes -= i;
  +                        o += nbytes;
  +                        i -= nbytes;
                       }
                   }
                   else
  @@ -349,14 +350,15 @@
                                "proxy: CONNECT: client was set");*/
                   nbytes = sizeof(buffer);
                   if (apr_recv(r->connection->client_socket, buffer, &nbytes) ==
APR_SUCCESS) {
  -                    int o = 0;
  -                    while(nbytes)
  +                    o = 0;
  +                    i = nbytes;
  +                    while(i > 0)
                       {
  +			nbytes = i;
   			if (apr_send(sock, buffer + o, &nbytes) != APR_SUCCESS)
   			    break;
  -                        i = nbytes;
  -                        o += i;
  -                        nbytes -= i;
  +                        o += nbytes;
  +                        i -= nbytes;
                       }
                   }
                   else
  
  
  

Mime
View raw message