#include "webcit.h"
#include "webserver.h"
-extern int DisableGzip;
long MaxRead = -1; /* should we do READ scattered or all at once? */
/*
if (is_https) {
int ntries = 0;
- if (StrLength(Hdr->ReadBuf) > 0) {
+ if (StrLength(Hdr->ReadBuf) > 0)
+ {
pchs = ChrPtr(Hdr->ReadBuf);
pch = strchr(pchs, '\n');
if (pch != NULL) {
retval = client_read_sslbuffer(Hdr->ReadBuf, SLEEPING);
pchs = ChrPtr(Hdr->ReadBuf);
pch = strchr(pchs, '\n');
+ if (pch == NULL)
+ retval = 0;
}
if (retval == 0) {
sleeeeeeeeeep(1);
retval = client_read_sslbuffer(Hdr->ReadBuf, timeout);
if (retval >= 0) {
StrBufAppendBuf(Target, Hdr->ReadBuf, 0); /* todo: Buf > bytes? */
-#ifdef HTTP_TRACING
- write(2, "\033[32m", 5);
- write(2, buf, bytes);
- write(2, "\033[30m", 5);
-#endif
return 1;
}
else {
return retval;
}
-#ifdef HTTP_TRACING
- write(2, "\033[32m", 5);
- write(2, buf, bytes);
- write(2, "\033[30m", 5);
-#endif
return 1;
}
}
#endif
-
-#ifdef HTTP_TRACING
-
- write(2, "\033[34m", 5);
- write(2, ptr, StrLength(WCC->WBuf));
- write(2, "\033[30m", 5);
-#endif
if (WCC->Hdr->http_sock == -1)
return -1;
fdflags = fcntl(WC->Hdr->http_sock, F_GETFL);
count = StrLength(WCC->WBuf);
eptr = ptr + count;
-#ifdef HTTP_TRACING
-
- write(2, "\033[34m", 5);
- write(2, ptr, StrLength(WCC->WBuf));
- write(2, "\033[30m", 5);
-#endif
-
while ((ptr < eptr) && (WCC->Hdr->http_sock != -1)) {
if ((fdflags & O_NONBLOCK) == O_NONBLOCK) {
FD_ZERO(&wset);
{
FreeStrBuf(&sess->CLineBuf);
FreeStrBuf(&sess->ReadBuf);
+ sess->connected = 0;
sess->ReadPos = NULL;
FreeStrBuf(&sess->MigrateReadLineBuf);
if (sess->serv_sock > 0) {
syslog(LOG_DEBUG, "Closing socket %d", sess->serv_sock);
close(sess->serv_sock);
}
+ sess->serv_sock = -1;
}