req->offset = 0;
/* read websocket traffic */
- do {
+ if(req->open)
+ do {
got = sread(sock, reqbuf + req->offset, REQBUFSIZ - req->offset);
if(got > 0)
req->offset += got;
- logmsg("Got: %d", (int)got);
if((got == -1) && ((EAGAIN == errno) || (EWOULDBLOCK == errno))) {
int rc;
fd_set output;
struct timeval timeout = {1, 0}; /* 1000 ms */
+ logmsg("Got EAGAIN from sread");
FD_ZERO(&input);
FD_ZERO(&output);
got = 0;
logmsg("=> persistent connection request ended, awaits new request\n");
return 1;
}
+ else {
+ logmsg("=> NOT a persistent connection, close close CLOSE\n");
+ }
return -1;
}