various bug fixes
diff --git a/src/libhttpd/parse.c b/src/libhttpd/parse.c
index 5fd4092..8e8364b 100644
--- a/src/libhttpd/parse.c
+++ b/src/libhttpd/parse.c
@@ -198,7 +198,7 @@
 	memset(&h, 0, sizeof(h));
 	h.c = c;
 	alarm(timeout);
-	if(!hgethead(c, 1))
+	if(hgethead(c, 1) < 0)
 		return -1;
 	alarm(0);
 	h.hstart = c->hpos;