| ... | ... | @@ -820,7 +820,7 @@ pub const Request = struct { |
| 820 | 820 | /// Sends and flushes a complete request as only HTTP head, no body. |
| 821 | 821 | pub fn sendBodiless(r: *Request) std.io.Writer.Error!void { |
| 822 | 822 | try sendBodilessUnflushed(r); |
| 823 | | try r.connection.?.writer.flush(); |
| 823 | try r.connection.?.flush(); |
| 824 | 824 | } |
| 825 | 825 | |
| 826 | 826 | /// Sends but does not flush a complete request as only HTTP head, no body. |
| ... | ... | @@ -830,9 +830,22 @@ pub const Request = struct { |
| 830 | 830 | try sendHead(r); |
| 831 | 831 | } |
| 832 | 832 | |
| 833 | /// Transfers the HTTP head over the connection and flushes. |
| 834 | /// |
| 835 | /// See also: |
| 836 | /// * `sendBodyUnflushed` |
| 837 | pub fn sendBody(r: *Request) std.io.Writer.Error!http.BodyWriter { |
| 838 | const result = try sendBodyUnflushed(r); |
| 839 | try r.connection.?.flush(); |
| 840 | return result; |
| 841 | } |
| 842 | |
| 833 | 843 | /// Transfers the HTTP head over the connection, which is not flushed until |
| 834 | 844 | /// `BodyWriter.flush` or `BodyWriter.end` is called. |
| 835 | | pub fn sendBody(r: *Request) std.io.Writer.Error!http.BodyWriter { |
| 845 | /// |
| 846 | /// See also: |
| 847 | /// * `sendBody` |
| 848 | pub fn sendBodyUnflushed(r: *Request) std.io.Writer.Error!http.BodyWriter { |
| 836 | 849 | assert(r.method.requestHasBody()); |
| 837 | 850 | try sendHead(r); |
| 838 | 851 | return .{ |