net: http: add numeric http status code to response struct

Add numeric http status code to the response struct to allow for
easier processing by the caller.   Textual status already exists.

Signed-off-by: Justin Morton <justin.morton@nordicsemi.no>
This commit is contained in:
Justin Morton 2021-04-13 14:00:12 -07:00 committed by Jukka Rissanen
commit 35f598ba93
2 changed files with 7 additions and 0 deletions

View file

@ -176,6 +176,8 @@ static int on_status(struct http_parser *parser, const char *at, size_t length)
if (req->internal.response.http_cb &&
req->internal.response.http_cb->on_status) {
req->internal.response.http_cb->on_status(parser, at, length);
req->internal.response.http_status_code =
(uint16_t)parser->status_code;
}
return 0;