diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-03-20 00:34:28 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-20 00:34:28 -0700 |
| commit | 3a836b4800337567735b2619075d8bb4e9f21c4d (patch) | |
| tree | ab80d1a4f48e7401ad04dfb7855ad654e3761f63 /lib/std/http | |
| parent | 7057bffc14602add697eb566b83934b7ad3fd81c (diff) | |
| parent | 8c94950c2496a5fa69f35b0f06f221e2c12339cf (diff) | |
| download | zig-3a836b4800337567735b2619075d8bb4e9f21c4d.tar.gz zig-3a836b4800337567735b2619075d8bb4e9f21c4d.zip | |
Merge pull request #19354 from ziglang/std.posix
extract std.posix from std.os
Diffstat (limited to 'lib/std/http')
| -rw-r--r-- | lib/std/http/Client.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/http/Client.zig b/lib/std/http/Client.zig index 339afdb96e..0e70b839b4 100644 --- a/lib/std/http/Client.zig +++ b/lib/std/http/Client.zig @@ -220,7 +220,7 @@ pub const Connection = struct { pub const Protocol = enum { plain, tls }; - pub fn readvDirectTls(conn: *Connection, buffers: []std.os.iovec) ReadError!usize { + pub fn readvDirectTls(conn: *Connection, buffers: []std.posix.iovec) ReadError!usize { return conn.tls_client.readv(conn.stream, buffers) catch |err| { // https://github.com/ziglang/zig/issues/2473 if (mem.startsWith(u8, @errorName(err), "TlsAlert")) return error.TlsAlert; @@ -234,7 +234,7 @@ pub const Connection = struct { }; } - pub fn readvDirect(conn: *Connection, buffers: []std.os.iovec) ReadError!usize { + pub fn readvDirect(conn: *Connection, buffers: []std.posix.iovec) ReadError!usize { if (conn.protocol == .tls) { if (disable_tls) unreachable; @@ -252,7 +252,7 @@ pub const Connection = struct { pub fn fill(conn: *Connection) ReadError!void { if (conn.read_end != conn.read_start) return; - var iovecs = [1]std.os.iovec{ + var iovecs = [1]std.posix.iovec{ .{ .iov_base = &conn.read_buf, .iov_len = conn.read_buf.len }, }; const nread = try conn.readvDirect(&iovecs); @@ -288,7 +288,7 @@ pub const Connection = struct { return available_read; } - var iovecs = [2]std.os.iovec{ + var iovecs = [2]std.posix.iovec{ .{ .iov_base = buffer.ptr, .iov_len = buffer.len }, .{ .iov_base = &conn.read_buf, .iov_len = conn.read_buf.len }, }; @@ -1387,7 +1387,7 @@ pub fn connectTcp(client: *Client, host: []const u8, port: u16, protocol: Connec return &conn.data; } -pub const ConnectUnixError = Allocator.Error || std.os.SocketError || error{NameTooLong} || std.os.ConnectError; +pub const ConnectUnixError = Allocator.Error || std.posix.SocketError || error{NameTooLong} || std.posix.ConnectError; /// Connect to `path` as a unix domain socket. This will reuse a connection if one is already open. /// |
