mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2024-12-04 14:46:31 -05:00
bugfixes for httpp_parse_response
svn path=/trunk/httpp/; revision=3834
This commit is contained in:
parent
815158a582
commit
cf0e4947ca
@ -162,15 +162,14 @@ int httpp_parse_response(http_parser_t *parser, char *http_data, unsigned long l
|
||||
return 0;
|
||||
}
|
||||
|
||||
httpp_setvar(parser, HTTPP_VAR_ERROR_CODE, resp_code);
|
||||
code = atoi(resp_code);
|
||||
if(code < 200 || code >= 300) {
|
||||
httpp_setvar(parser, HTTPP_VAR_ERROR_MESSAGE, message);
|
||||
free(data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
httpp_setvar(parser, HTTPP_VAR_URI, uri);
|
||||
httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "RELAY");
|
||||
httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "NONE");
|
||||
|
||||
parse_headers(parser, line, lines);
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#define HTTPP_VAR_URI "__uri"
|
||||
#define HTTPP_VAR_REQ_TYPE "__req_type"
|
||||
#define HTTPP_VAR_ERROR_MESSAGE "__errormessage"
|
||||
#define HTTPP_VAR_ERROR_CODE "__errorcode"
|
||||
|
||||
typedef enum httpp_request_type_tag {
|
||||
httpp_req_none, httpp_req_get, httpp_req_post, httpp_req_head, httpp_req_source, httpp_req_play, httpp_req_stats, httpp_req_unknown
|
||||
|
Loading…
Reference in New Issue
Block a user