| author | |
| committer | |
| log | 7b6ec3e3548dadc597b6aa396d70ba4c6595da26 |
| tree | 729277affbd435d8fa8e90e5e460af63ae6f82af |
| parent | 9ba65592d64f53d886b00402659cfce775ea77d3 |
4 files changed, 11 insertions(+), 14 deletions(-)
lib/std/json.zig+1-4| ... | @@ -2111,10 +2111,7 @@ test "parse into struct with duplicate field" { | ... | @@ -2111,10 +2111,7 @@ test "parse into struct with duplicate field" { |
| 2111 | const ballast = try testing.allocator.alloc(u64, 1); | 2111 | const ballast = try testing.allocator.alloc(u64, 1); |
| 2112 | defer testing.allocator.free(ballast); | 2112 | defer testing.allocator.free(ballast); |
| 2113 | 2113 | ||
| 2114 | const options_first = ParseOptions{ | 2114 | const options_first = ParseOptions{ .allocator = testing.allocator, .duplicate_field_behavior = .UseFirst }; |
| 2115 | .allocator = testing.allocator, | ||
| 2116 | .duplicate_field_behavior = .UseFirst, | ||
| 2117 | }; | ||
| 2118 | 2115 | ||
| 2119 | const options_last = ParseOptions{ | 2116 | const options_last = ParseOptions{ |
| 2120 | .allocator = testing.allocator, | 2117 | .allocator = testing.allocator, |
lib/std/x/net/tcp.zig+6-6| ... | @@ -145,15 +145,15 @@ pub const Client = struct { | ... | @@ -145,15 +145,15 @@ pub const Client = struct { |
| 145 | /// Writes multiple I/O vectors with a prepended message header to the socket | 145 | /// Writes multiple I/O vectors with a prepended message header to the socket |
| 146 | /// with a set of flags specified. It returns the number of bytes that are | 146 | /// with a set of flags specified. It returns the number of bytes that are |
| 147 | /// written to the socket. | 147 | /// written to the socket. |
| 148 | pub fn writeVectorized(self: Client, msg: Socket.Message, flags: u32) !usize { | 148 | pub fn writeMessage(self: Client, msg: Socket.Message, flags: u32) !usize { |
| 149 | return self.socket.writeVectorized(msg, flags); | 149 | return self.socket.writeMessage(msg, flags); |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | /// Read multiple I/O vectors with a prepended message header from the socket | 152 | /// Read multiple I/O vectors with a prepended message header from the socket |
| 153 | /// with a set of flags specified. It returns the number of bytes that were | 153 | /// with a set of flags specified. It returns the number of bytes that were |
| 154 | /// read into the buffer provided. | 154 | /// read into the buffer provided. |
| 155 | pub fn readVectorized(self: Client, msg: *Socket.Message, flags: u32) !usize { | 155 | pub fn readMessage(self: Client, msg: *Socket.Message, flags: u32) !usize { |
| 156 | return self.socket.readVectorized(msg, flags); | 156 | return self.socket.readMessage(msg, flags); |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | /// Query and return the latest cached error on the client's underlying socket. | 159 | /// Query and return the latest cached error on the client's underlying socket. |
| ... | @@ -400,7 +400,7 @@ test "tcp/client: read and write multiple vectors" { | ... | @@ -400,7 +400,7 @@ test "tcp/client: read and write multiple vectors" { |
| 400 | defer conn.deinit(); | 400 | defer conn.deinit(); |
| 401 | 401 | ||
| 402 | const message = "hello world"; | 402 | const message = "hello world"; |
| 403 | _ = try conn.client.writeVectorized(Socket.Message.fromBuffers(&[_]Buffer{ | 403 | _ = try conn.client.writeMessage(Socket.Message.fromBuffers(&[_]Buffer{ |
| 404 | Buffer.from(message[0 .. message.len / 2]), | 404 | Buffer.from(message[0 .. message.len / 2]), |
| 405 | Buffer.from(message[message.len / 2 ..]), | 405 | Buffer.from(message[message.len / 2 ..]), |
| 406 | }), 0); | 406 | }), 0); |
| ... | @@ -410,7 +410,7 @@ test "tcp/client: read and write multiple vectors" { | ... | @@ -410,7 +410,7 @@ test "tcp/client: read and write multiple vectors" { |
| 410 | Buffer.from(buf[0 .. message.len / 2]), | 410 | Buffer.from(buf[0 .. message.len / 2]), |
| 411 | Buffer.from(buf[message.len / 2 ..]), | 411 | Buffer.from(buf[message.len / 2 ..]), |
| 412 | }); | 412 | }); |
| 413 | _ = try client.readVectorized(&msg, 0); | 413 | _ = try client.readMessage(&msg, 0); |
| 414 | 414 | ||
| 415 | try testing.expectEqualStrings(message, buf[0..message.len]); | 415 | try testing.expectEqualStrings(message, buf[0..message.len]); |
| 416 | } | 416 | } |
lib/std/x/os/socket_posix.zig+2-2| ... | @@ -78,14 +78,14 @@ pub fn Mixin(comptime Socket: type) type { | ... | @@ -78,14 +78,14 @@ pub fn Mixin(comptime Socket: type) type { |
| 78 | /// Writes multiple I/O vectors with a prepended message header to the socket | 78 | /// Writes multiple I/O vectors with a prepended message header to the socket |
| 79 | /// with a set of flags specified. It returns the number of bytes that are | 79 | /// with a set of flags specified. It returns the number of bytes that are |
| 80 | /// written to the socket. | 80 | /// written to the socket. |
| 81 | pub fn writeVectorized(self: Socket, msg: Socket.Message, flags: u32) !usize { | 81 | pub fn writeMessage(self: Socket, msg: Socket.Message, flags: u32) !usize { |
| 82 | return os.sendmsg(self.fd, msg, flags); | 82 | return os.sendmsg(self.fd, msg, flags); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | /// Read multiple I/O vectors with a prepended message header from the socket | 85 | /// Read multiple I/O vectors with a prepended message header from the socket |
| 86 | /// with a set of flags specified. It returns the number of bytes that were | 86 | /// with a set of flags specified. It returns the number of bytes that were |
| 87 | /// read into the buffer provided. | 87 | /// read into the buffer provided. |
| 88 | pub fn readVectorized(self: Socket, msg: *Socket.Message, flags: u32) !usize { | 88 | pub fn readMessage(self: Socket, msg: *Socket.Message, flags: u32) !usize { |
| 89 | while (true) { | 89 | while (true) { |
| 90 | const rc = os.system.recvmsg(self.fd, msg, @intCast(c_int, flags)); | 90 | const rc = os.system.recvmsg(self.fd, msg, @intCast(c_int, flags)); |
| 91 | return switch (os.errno(rc)) { | 91 | return switch (os.errno(rc)) { |
lib/std/x/os/socket_windows.zig+2-2| ... | @@ -254,7 +254,7 @@ pub fn Mixin(comptime Socket: type) type { | ... | @@ -254,7 +254,7 @@ pub fn Mixin(comptime Socket: type) type { |
| 254 | /// Writes multiple I/O vectors with a prepended message header to the socket | 254 | /// Writes multiple I/O vectors with a prepended message header to the socket |
| 255 | /// with a set of flags specified. It returns the number of bytes that are | 255 | /// with a set of flags specified. It returns the number of bytes that are |
| 256 | /// written to the socket. | 256 | /// written to the socket. |
| 257 | pub fn writeVectorized(self: Socket, msg: Socket.Message, flags: u32) !usize { | 257 | pub fn writeMessage(self: Socket, msg: Socket.Message, flags: u32) !usize { |
| 258 | const call = try windows.loadWinsockExtensionFunction(ws2_32.LPFN_WSASENDMSG, self.fd, ws2_32.WSAID_WSASENDMSG); | 258 | const call = try windows.loadWinsockExtensionFunction(ws2_32.LPFN_WSASENDMSG, self.fd, ws2_32.WSAID_WSASENDMSG); |
| 259 | 259 | ||
| 260 | var num_bytes: u32 = undefined; | 260 | var num_bytes: u32 = undefined; |
| ... | @@ -291,7 +291,7 @@ pub fn Mixin(comptime Socket: type) type { | ... | @@ -291,7 +291,7 @@ pub fn Mixin(comptime Socket: type) type { |
| 291 | /// Read multiple I/O vectors with a prepended message header from the socket | 291 | /// Read multiple I/O vectors with a prepended message header from the socket |
| 292 | /// with a set of flags specified. It returns the number of bytes that were | 292 | /// with a set of flags specified. It returns the number of bytes that were |
| 293 | /// read into the buffer provided. | 293 | /// read into the buffer provided. |
| 294 | pub fn readVectorized(self: Socket, msg: *Socket.Message, flags: u32) !usize { | 294 | pub fn readMessage(self: Socket, msg: *Socket.Message, flags: u32) !usize { |
| 295 | const call = try windows.loadWinsockExtensionFunction(ws2_32.LPFN_WSARECVMSG, self.fd, ws2_32.WSAID_WSARECVMSG); | 295 | const call = try windows.loadWinsockExtensionFunction(ws2_32.LPFN_WSARECVMSG, self.fd, ws2_32.WSAID_WSARECVMSG); |
| 296 | 296 | ||
| 297 | var num_bytes: u32 = undefined; | 297 | var num_bytes: u32 = undefined; |