sizeof(buffer) towards the end of proxy_connect.c
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88849
13f79535-47bb-0310-9956-
ffa450edef68
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;
"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
"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