mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix HTTP url parsing bug. v4.0.261
This commit is contained in:
parent
34196ea7f7
commit
e0c8c199d5
3 changed files with 6 additions and 2 deletions
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 4
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 260
|
||||
#define VERSION_REVISION 261
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue