Fix parse failure observed with tvdevice sample.
Commit c40d2bc0c9
has a problem
at removing the parentheses in parser_parse_responseline.
Difference of pointers was used with intention, don't cast
them separately.
This commit is contained in:
parent
f7a801c3ae
commit
7178f300bb
@ -2,6 +2,15 @@
|
||||
Version 1.6.16
|
||||
*******************************************************************************
|
||||
|
||||
2012-03-14 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com>
|
||||
|
||||
Fix parse failure observed with tvdevice sample.
|
||||
|
||||
Commit c40d2bc0c9b60c43b641ac4669c7b8bbcd6134c5 has a problem
|
||||
at removing the parentheses in parser_parse_responseline.
|
||||
Difference of pointers was used with intention, don't cast
|
||||
them separately.
|
||||
|
||||
2012-03-14 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com>
|
||||
|
||||
Fix compile error on Windows.
|
||||
|
@ -249,7 +249,7 @@ static parse_status_t scanner_get_token(
|
||||
/* possibly more valid chars */
|
||||
return PARSE_INCOMPLETE;
|
||||
/* calc token length */
|
||||
token->length = (size_t)cursor - (size_t)token->buf;
|
||||
token->length = (size_t)(cursor - token->buf);
|
||||
} else if (c == ' ' || c == '\t') {
|
||||
token->buf = cursor++;
|
||||
token_type = TT_WHITESPACE;
|
||||
@ -258,7 +258,7 @@ static parse_status_t scanner_get_token(
|
||||
if (!scanner->entire_msg_loaded && cursor == null_terminator)
|
||||
/* possibly more chars */
|
||||
return PARSE_INCOMPLETE;
|
||||
token->length = (size_t)cursor - (size_t)token->buf;
|
||||
token->length = (size_t)(cursor - token->buf);
|
||||
} else if (c == TOKCHAR_CR) {
|
||||
/* scan CRLF */
|
||||
token->buf = cursor++;
|
||||
@ -304,7 +304,7 @@ static parse_status_t scanner_get_token(
|
||||
return PARSE_FAILURE;
|
||||
}
|
||||
if (got_end_quote)
|
||||
token->length = (size_t)cursor - (size_t)token->buf;
|
||||
token->length = (size_t)(cursor - token->buf);
|
||||
else { /* incomplete */
|
||||
|
||||
assert(cursor == null_terminator);
|
||||
@ -1414,7 +1414,7 @@ parse_status_t parser_parse_responseline(INOUT http_parser_t *parser)
|
||||
while (*p == ' ' || *p == '\t')
|
||||
p++;
|
||||
/* now, p is at start of status msg */
|
||||
n = line.length - (size_t)p - (size_t)line.buf;
|
||||
n = line.length - (size_t)(p - line.buf);
|
||||
if (membuffer_assign(&hmsg->status_msg, p, n) != 0) {
|
||||
/* out of mem */
|
||||
parser->http_error_code = HTTP_INTERNAL_SERVER_ERROR;
|
||||
|
Loading…
Reference in New Issue
Block a user