From fcbb1bb623e0b4f020beaa7be6725a3018a3a998 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Thu, 17 Nov 2022 19:48:07 -0800 Subject: [PATCH] Use read instead of recv on socket --- src/http/server.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/http/server.zig b/src/http/server.zig index 21a83be..b24ae75 100644 --- a/src/http/server.zig +++ b/src/http/server.zig @@ -38,7 +38,7 @@ pub const Stream = struct { os.closeSocket(self.socket); } - pub const ReadError = os.RecvFromError; + pub const ReadError = os.ReadError; pub const WriteError = os.SendError; pub const Reader = std.io.Reader(Stream, ReadError, read); @@ -48,7 +48,7 @@ pub const Stream = struct { if (std.io.is_async) @compileError("TODO: async not supported"); if (self.kind != .tcp) @panic("TODO"); - return os.recv(self.socket, buffer, 0); + return os.read(self.socket, buffer); } pub fn write(self: Stream, buffer: []const u8) WriteError!usize {