Skip to content
Snippets Groups Projects
Commit d910ece6 authored by deuce's avatar deuce
Browse files

Do not add 0 bytes to the ring buffer.

parent ca3e20cb
Branches
Tags
No related merge requests found
...@@ -428,8 +428,10 @@ static int writebuf(http_session_t *session, const char *buf, size_t len) ...@@ -428,8 +428,10 @@ static int writebuf(http_session_t *session, const char *buf, size_t len)
while(!terminate_server && sent < len) { while(!terminate_server && sent < len) {
avail=RingBufFree(&session->outbuf); avail=RingBufFree(&session->outbuf);
if(!avail) if(!avail) {
SLEEP(1); SLEEP(1);
continue;
}
if(avail > len-sent) if(avail > len-sent)
avail=len-sent; avail=len-sent;
sent+=RingBufWrite(&(session->outbuf), ((char *)buf)+sent, avail); sent+=RingBufWrite(&(session->outbuf), ((char *)buf)+sent, avail);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment