Commit d910ece6 authored by deuce's avatar deuce
Browse files

Do not add 0 bytes to the ring buffer.

parent ca3e20cb
......@@ -428,8 +428,10 @@ static int writebuf(http_session_t *session, const char *buf, size_t len)
while(!terminate_server && sent < len) {
avail=RingBufFree(&session->outbuf);
if(!avail)
if(!avail) {
SLEEP(1);
continue;
}
if(avail > len-sent)
avail=len-sent;
sent+=RingBufWrite(&(session->outbuf), ((char *)buf)+sent, avail);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment