aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-runserver/httpd-utils.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2016-09-25 20:54:39 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2016-09-25 20:54:39 +0200
commit123486ac617ac298fdecb1fbdbc504ac84118718 (patch)
tree837d72872a23607ae2f6994a6fe8a61a0dc2dbe1 /src/blogc-runserver/httpd-utils.c
parent1a94d1f0f7e1403fd76ff09fbdb0d79c766d1a5c (diff)
downloadblogc-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.c4
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]);
}