treesummaryrefslogcommitdiff
path: root/src/http.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/http.zig')
-rw-r--r--src/http.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/http.zig b/src/http.zig
index bc8f3b1..c14f16d 100644
--- a/src/http.zig
+++ b/src/http.zig
@@ -67,7 +67,13 @@ pub const Server = struct {
var closed = false;
var req = Request{ .fd = ready_socket };
- const read = posix.read(ready_socket, buf) catch 0;
+ var read: usize = 0;
+ while (true) {
+ const newly_read = posix.read(ready_socket, buf[read..]) catch 0;
+ read += newly_read;
+ if (newly_read == 0)
+ break;
+ }
if (read == 0) {
closed = true;
} else {