Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions Http1ReaderBase.readResponseLine

1
2
3
4
5
6
module juptune.http.v1;

Result readResponseLine(
    Http1ResponseLine responseLine, 
    Http1ReadResponseConfig responseConfig = Http1ReadResponseConfig.init
);

Documentation

Reads the entire response line. This will configure the reader to be a response parser for the remainder of this message, until finishMessageis called.

State

This function must be called when the reader is in the startLinestate.

After this function is called, the reader will be in the maybeEndOfHeadersstate.

Notes

Under certain circumstances (such as config.isBodylessbeing true) the reader will act as if the response has no body, regardless of whatever the headers may suggest. You must still call readBodyto follow the correct state transitions.

Params

Throws

If an error occurs, the reader will be in an invalid state and should not be used again.

Anything the underlying I/O functions can throw. See juptune.event.io.IoError.

Http1Error.dataExceedsBufferif the response line is larger than the provided buffer.

Http1Error.badResponseVersionif the response version is missing, invalid, or specifies an unsupported version.

Http1Error.badResponseCodeif the response code is missing or invalid.

Http1Error.badResponseReasonif the response reason phrase is invalid.

Http1Error.badTransportif it is determined that the transport layer is in a bad state, or if the sender appears to be malicious/poorly coded.

Returns

A Resultdescribing if an error ocurred. Any Http1Errorwill contain a valid HTTP error response