From 1361f0e88138653d2437f45ddf940206ed0e93b7 Mon Sep 17 00:00:00 2001 From: Jakub Sławiński Date: Thu, 6 Apr 2006 23:34:51 +0200 Subject: v0.8.1 - Fixed: enableproxy option in server's config file - Added: clients idle time - Added: 'maxidle' option - Modified: task scheduling subsystem has been completely rewritten - Fixed: segmentation fault in http tunnels after multiple simultaneous POST connections from the same source - Fixed: unexpected connection close when http proxy was too slow - Fixed: SIGSEGV in http proxy mode under cygwin - Added: enabled the SO_KEEPALIVE option for all the sockets used by the apf - Added: 60 seconds timeout for SSL_connect --- src/http_proxy_functions.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/http_proxy_functions.c') diff --git a/src/http_proxy_functions.c b/src/http_proxy_functions.c index 495d7d8..509b0a1 100644 --- a/src/http_proxy_functions.c +++ b/src/http_proxy_functions.c @@ -284,9 +284,11 @@ read_message(int fd, int length, connection* client, char* tab, int ptr) int tmp = 0; while (j < length) { if (client->curreceived + length-j > client->toreceive) { - writen(fd, (unsigned char*) (tab+ptr+j), client->toreceive - client->curreceived); - j += client->toreceive - client->curreceived; - client->curreceived += client->toreceive - client->curreceived; + if (client->toreceive - client->curreceived > 0) { + writen(fd, (unsigned char*) (tab+ptr+j), client->toreceive - client->curreceived); + j += client->toreceive - client->curreceived; + client->curreceived += client->toreceive - client->curreceived; + } if (client->read_state == 0) { switch (tab[ptr + j]) { case 'M': { @@ -311,6 +313,13 @@ read_message(int fd, int length, connection* client, char* tab, int ptr) ++j; break; } + case 'A': { + ++j; + if (client->state == C_CLOSED) { + client->state = C_OPEN; + } + break; + } default: { return 1; } @@ -332,7 +341,7 @@ read_message(int fd, int length, connection* client, char* tab, int ptr) } } } - else { + else if (length-j > 0) { client->curreceived += length-j; writen(fd, (unsigned char*) (tab+ptr+j), length-j); j += length-j; @@ -342,7 +351,7 @@ read_message(int fd, int length, connection* client, char* tab, int ptr) } /* - * Function name: clear sslFd + * Function name: clear_sslFd * Description: Close the socket encapsulated in SslFd structure, remove this file descriptor * from fd_set and clear ssl structure. * Arguments: sf - pointer to SslFd structure -- cgit v1.1