diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-03-18 22:39:59 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-03-19 11:45:09 -0700 |
| commit | cd62005f19ff966d2c42de4daeb9a1e4b644bf76 (patch) | |
| tree | 4bb316708afaf79c971808df792d8fe86274789b /lib/std/http/Client.zig | |
| parent | 7057bffc14602add697eb566b83934b7ad3fd81c (diff) | |
| download | zig-cd62005f19ff966d2c42de4daeb9a1e4b644bf76.tar.gz zig-cd62005f19ff966d2c42de4daeb9a1e4b644bf76.zip | |
extract std.posix from std.os
closes #5019
Diffstat (limited to 'lib/std/http/Client.zig')
| -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. /// |
