|
Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
|
HTTP/1.1 request parsing for the HTTP transport. More...
Namespaces | |
| namespace | Sonde |
| Embeddable Model Context Protocol server for Qt applications. | |
Functions | |
| ParseStatus | Sonde::Http::anonymous_namespace{httpparser.cpp}::readSizedBody (const QByteArray &buffer, qsizetype bodyStart, const ParseLimits &limits, Request *req, qsizetype *consumed, int *errorStatus) |
| Reads a body by Content-Length (no header means an empty body). | |
| ParseStatus | Sonde::Http::anonymous_namespace{httpparser.cpp}::readChunkedBody (const QByteArray &buffer, qsizetype bodyStart, const ParseLimits &limits, Request *req, qsizetype *consumed, int *errorStatus) |
| Reads a chunked body. | |
| qsizetype | Sonde::Http::anonymous_namespace{httpparser.cpp}::endOfTrailers (const QByteArray &buffer, qsizetype pos) |
Skips the trailer section after the last chunk, which starts at pos. | |
| bool | Sonde::Http::parseHead (const QByteArray &head, Request *request) |
| Parses the request line and headers. | |
| qsizetype | Sonde::Http::decodeChunked (const QByteArray &buffer, qsizetype from, qsizetype maxBody, QByteArray *out) |
Decodes a chunked body that starts at from in buffer. | |
| ParseStatus | Sonde::Http::parseRequest (QByteArray *buffer, const ParseLimits &limits, Request *request, int *errorStatus) |
Parses one request from the front of buffer, and removes it when complete. | |
| QByteArray | Sonde::Http::reasonPhrase (int status) |
| The reason phrase of an HTTP status code, e.g. "Not Found". | |
| bool | Sonde::Http::bearerTokenMatches (const QByteArray &authorization, const QByteArray &token) |
| Whether an Authorization header carries Bearer <token>. | |
HTTP/1.1 request parsing for the HTTP transport.
| bool Sonde::Http::bearerTokenMatches | ( | const QByteArray & | authorization, |
| const QByteArray & | token ) |
Whether an Authorization header carries Bearer <token>.
Compares in time that depends only on the lengths, not on how much of the token matches, so the token can't be guessed byte by byte from timing.
| qsizetype Sonde::Http::decodeChunked | ( | const QByteArray & | buffer, |
| qsizetype | from, | ||
| qsizetype | maxBody, | ||
| QByteArray * | out ) |
Decodes a chunked body that starts at from in buffer.
from), 0 if more data is needed, or -1 if the body is malformed or larger than maxBody. | bool Sonde::Http::parseHead | ( | const QByteArray & | head, |
| Request * | request ) |
Parses the request line and headers.
| ParseStatus Sonde::Http::parseRequest | ( | QByteArray * | buffer, |
| const ParseLimits & | limits, | ||
| Request * | request, | ||
| int * | errorStatus ) |
Parses one request from the front of buffer, and removes it when complete.
| buffer | Received bytes. |
| limits | Size limits. |
| request | Receives the request. |
| errorStatus | Receives the HTTP status to respond with on ParseStatus::Error. |