}
static CURLcode detect_line(struct h1_req_parser *parser,
- const char *buf, const size_t buflen,
+ const uint8_t *buf, const size_t buflen,
size_t *pnread)
{
const char *line_end;
line_end = memchr(buf, '\n', buflen);
if(!line_end)
return CURLE_AGAIN;
- parser->line = buf;
- parser->line_len = line_end - buf + 1;
+ parser->line = (const char *)buf;
+ parser->line_len = line_end - parser->line + 1;
*pnread = parser->line_len;
return CURLE_OK;
}
static CURLcode next_line(struct h1_req_parser *parser,
- const char *buf, const size_t buflen, int options,
+ const uint8_t *buf, const size_t buflen, int options,
size_t *pnread)
{
CURLcode result;
}
CURLcode Curl_h1_req_parse_read(struct h1_req_parser *parser,
- const char *buf, size_t buflen,
+ const uint8_t *buf, size_t buflen,
const char *scheme_default,
const char *custom_method,
int options, size_t *pnread)
void Curl_h1_req_parse_free(struct h1_req_parser *parser);
CURLcode Curl_h1_req_parse_read(struct h1_req_parser *parser,
- const char *buf, size_t buflen,
+ const uint8_t *buf, size_t buflen,
const char *scheme_default,
const char *custom_method,
int options, size_t *pnread);
if(result)
goto out;
- result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL,
+ result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL,
!data->state.http_ignorecustom ?
data->set.str[STRING_CUSTOMREQUEST] : NULL,
0, &nwritten);
goto out;
}
- result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL,
+ result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL,
!data->state.http_ignorecustom ?
data->set.str[STRING_CUSTOMREQUEST] : NULL,
0, pnwritten);
goto out;
}
- result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL,
+ result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL,
!data->state.http_ignorecustom ?
data->set.str[STRING_CUSTOMREQUEST] : NULL,
0, pnwritten);
DEBUGASSERT(stream);
- result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, blen, NULL,
+ result = Curl_h1_req_parse_read(&stream->h1, buf, blen, NULL,
!data->state.http_ignorecustom ?
data->set.str[STRING_CUSTOMREQUEST] : NULL,
0, pnwritten);
static void parse_success(const struct tcase *t)
{
struct h1_req_parser p;
- const char *buf;
+ const uint8_t *buf;
size_t buflen, i, in_len, in_consumed;
CURLcode err;
size_t nread;
Curl_h1_req_parse_init(&p, 1024);
in_len = in_consumed = 0;
for(i = 0; t->input[i]; ++i) {
- buf = t->input[i];
- buflen = strlen(buf);
+ buf = (const uint8_t *)t->input[i];
+ buflen = strlen(t->input[i]);
in_len += buflen;
err = Curl_h1_req_parse_read(&p, buf, buflen, t->default_scheme,
t->custom_method, 0, &nread);