diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-09-25 20:54:39 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-09-25 20:54:39 +0200 |
commit | 123486ac617ac298fdecb1fbdbc504ac84118718 (patch) | |
tree | 837d72872a23607ae2f6994a6fe8a61a0dc2dbe1 /src/blogc-runserver/httpd-utils.c | |
parent | 1a94d1f0f7e1403fd76ff09fbdb0d79c766d1a5c (diff) | |
download | blogc-123486ac617ac298fdecb1fbdbc504ac84118718.tar.gz blogc-123486ac617ac298fdecb1fbdbc504ac84118718.tar.bz2 blogc-123486ac617ac298fdecb1fbdbc504ac84118718.zip |
runserver: implemented a thread pool and fixed few bugs
Diffstat (limited to 'src/blogc-runserver/httpd-utils.c')
-rw-r--r-- | src/blogc-runserver/httpd-utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/blogc-runserver/httpd-utils.c b/src/blogc-runserver/httpd-utils.c index e935668..8d9c024 100644 --- a/src/blogc-runserver/httpd-utils.c +++ b/src/blogc-runserver/httpd-utils.c @@ -24,9 +24,9 @@ br_readline(int socket) char buffer[READLINE_BUFFER_SIZE]; ssize_t len; - while ((len = read(socket, buffer, READLINE_BUFFER_SIZE)) != -1) { + while ((len = read(socket, buffer, READLINE_BUFFER_SIZE)) > 0) { for (ssize_t i = 0; i < len; i++) { - if (buffer[i] == '\r' || buffer[i] == '\n') + if (buffer[i] == '\r' || buffer[i] == '\n' || buffer[i] == '\0') goto end; bc_string_append_c(rv, buffer[i]); } |