authorgravatar for jord_id@abv.bgJordyfel <jord_id@abv.bg> 2023-11-01 11:57:07+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-11-01 14:46:00+02:00
log61861ef3953a64a62868cde912e2ff56c2df441a
treea894047fe9aed29648ae70275cd4965fbd037720
parent084a7cf0285a17b94ccf7822a4b3496d401e6cd8

std.http: account for renames in docs


2 files changed, 11 insertions(+), 11 deletions(-)

lib/std/http/Client.zig+6-6
......@@ -521,7 +521,7 @@ pub const Response = struct {
521521
522522/// A HTTP request that has been sent.
523523///
524/// Order of operations: request -> start[ -> write -> finish] -> wait -> read
524/// Order of operations: open -> send[ -> write -> finish] -> wait -> read
525525pub const Request = struct {
526526 uri: Uri,
527527 client: *Client,
......@@ -754,7 +754,7 @@ pub const Request = struct {
754754 /// If `handle_redirects` is true and the request has no payload, then this function will automatically follow
755755 /// redirects. If a request payload is present, then this function will error with error.RedirectRequiresResend.
756756 ///
757 /// Must be called after `start` and, if any data was written to the request body, then also after `finish`.
757 /// Must be called after `send` and, if any data was written to the request body, then also after `finish`.
758758 pub fn wait(req: *Request) WaitError!void {
759759 while (true) { // handle redirects
760760 while (true) { // read headers
......@@ -943,7 +943,7 @@ pub const Request = struct {
943943 }
944944
945945 /// Write `bytes` to the server. The `transfer_encoding` field determines how data will be sent.
946 /// Must be called after `start` and before `finish`.
946 /// Must be called after `send` and before `finish`.
947947 pub fn write(req: *Request, bytes: []const u8) WriteError!usize {
948948 switch (req.transfer_encoding) {
949949 .chunked => {
......@@ -965,7 +965,7 @@ pub const Request = struct {
965965 }
966966
967967 /// Write `bytes` to the server. The `transfer_encoding` field determines how data will be sent.
968 /// Must be called after `start` and before `finish`.
968 /// Must be called after `send` and before `finish`.
969969 pub fn writeAll(req: *Request, bytes: []const u8) WriteError!void {
970970 var index: usize = 0;
971971 while (index < bytes.len) {
......@@ -976,7 +976,7 @@ pub const Request = struct {
976976 pub const FinishError = WriteError || error{MessageNotCompleted};
977977
978978 /// Finish the body of a request. This notifies the server that you have no more data to send.
979 /// Must be called after `start`.
979 /// Must be called after `send`.
980980 pub fn finish(req: *Request) FinishError!void {
981981 switch (req.transfer_encoding) {
982982 .chunked => try req.connection.?.writer().writeAll("0\r\n\r\n"),
......@@ -1308,7 +1308,7 @@ pub fn connectTunnel(
13081308 };
13091309}
13101310
1311// Prevents a dependency loop in request()
1311// Prevents a dependency loop in open()
13121312const ConnectErrorPartial = ConnectTcpError || error{ UnsupportedUrlScheme, ConnectionRefused };
13131313pub const ConnectError = ConnectErrorPartial || RequestError;
13141314
lib/std/http/Server.zig+5-5
......@@ -290,7 +290,7 @@ pub const Request = struct {
290290/// A HTTP response waiting to be sent.
291291///
292292/// [/ <----------------------------------- \]
293/// Order of operations: accept -> wait -> do [ -> write -> finish][ -> reset /]
293/// Order of operations: accept -> wait -> send [ -> write -> finish][ -> reset /]
294294/// \ -> read /
295295pub const Response = struct {
296296 version: http.Version = .@"HTTP/1.1",
......@@ -346,7 +346,7 @@ pub const Response = struct {
346346 // A connection is only keep-alive if the Connection header is present and it's value is not "close".
347347 // The server and client must both agree
348348 //
349 // do() defaults to using keep-alive if the client requests it.
349 // send() defaults to using keep-alive if the client requests it.
350350 const res_connection = res.headers.getFirstValue("connection");
351351 const res_keepalive = res_connection != null and !std.ascii.eqlIgnoreCase("close", res_connection.?);
352352
......@@ -610,7 +610,7 @@ pub const Response = struct {
610610 }
611611
612612 /// Write `bytes` to the server. The `transfer_encoding` request header determines how data will be sent.
613 /// Must be called after `start` and before `finish`.
613 /// Must be called after `send` and before `finish`.
614614 pub fn write(res: *Response, bytes: []const u8) WriteError!usize {
615615 switch (res.state) {
616616 .responded => {},
......@@ -637,7 +637,7 @@ pub const Response = struct {
637637 }
638638
639639 /// Write `bytes` to the server. The `transfer_encoding` request header determines how data will be sent.
640 /// Must be called after `start` and before `finish`.
640 /// Must be called after `send` and before `finish`.
641641 pub fn writeAll(req: *Response, bytes: []const u8) WriteError!void {
642642 var index: usize = 0;
643643 while (index < bytes.len) {
......@@ -648,7 +648,7 @@ pub const Response = struct {
648648 pub const FinishError = WriteError || error{MessageNotCompleted};
649649
650650 /// Finish the body of a request. This notifies the server that you have no more data to send.
651 /// Must be called after `start`.
651 /// Must be called after `send`.
652652 pub fn finish(res: *Response) FinishError!void {
653653 switch (res.state) {
654654 .responded => res.state = .finished,