Function readerExpectContinue [src]
In the case that the request contains "expect: 100-continue", this
function writes the continuation header, which means it can fail with a
write error. After sending the continuation header, it sets the
request's expect field to null.
Asserts that this function is only called once.
See readerExpectNone for an infallible alternative that cannot write
to the server output stream.
Prototype
pub fn readerExpectContinue(request: *Request, buffer: []u8) ExpectContinueError!*Reader
Parameters
request: *Request
buffer: []u8
Possible Errors
The client sent an expect HTTP header value other than "100-continue".
Failed to write "HTTP/1.1 100 Continue\r\n\r\n" to the stream.
Source
pub fn readerExpectContinue(request: *Request, buffer: []u8) ExpectContinueError!*Reader {
const flush = request.head.expect != null;
try writeExpectContinue(request);
if (flush) try request.server.out.flush();
return readerExpectNone(request, buffer);
}