|
|
|
@ -76,6 +76,8 @@ srs_error_t SrsHttpParser::parse_message(ISrsReader* reader, ISrsHttpMessage** p
|
|
|
|
|
p_body_start = p_header_tail = NULL;
|
|
|
|
|
// We must reset the field name and value, because we may get a partial value in on_header_value.
|
|
|
|
|
field_name = field_value = "";
|
|
|
|
|
// Reset the url.
|
|
|
|
|
url = "";
|
|
|
|
|
// The header of the request.
|
|
|
|
|
srs_freep(header);
|
|
|
|
|
header = new SrsHttpHeader();
|
|
|
|
@ -220,7 +222,8 @@ int SrsHttpParser::on_url(http_parser* parser, const char* at, size_t length)
|
|
|
|
|
srs_assert(obj);
|
|
|
|
|
|
|
|
|
|
if (length > 0) {
|
|
|
|
|
obj->url = string(at, (int)length);
|
|
|
|
|
// Note that this function might be called for multiple times, and we got pieces of content.
|
|
|
|
|
obj->url.append(at, (int)length);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// When header parsed, we must save the position of start for body,
|
|
|
|
|