req->type = type;
if (evhttp_parse_http_version(version, req) < 0)
- return (-1);
+ return -1;
if ((req->uri = mm_strdup(uri)) == NULL) {
event_debug(("%s: mm_strdup", __func__));
- return (-1);
+ return -1;
}
if (type == EVHTTP_REQ_CONNECT) {
!evhttp_find_vhost(req->evcon->http_server, NULL, hostname))
req->flags |= EVHTTP_PROXY_REQUEST;
- return (0);
+ return 0;
}
const char *
char *line;
enum message_read_status status = ALL_DATA_READ;
- size_t line_length;
+ size_t len;
/* XXX try */
- line = evbuffer_readln(buffer, &line_length, EVBUFFER_EOL_CRLF);
+ line = evbuffer_readln(buffer, &len, EVBUFFER_EOL_CRLF);
if (line == NULL) {
if (req->evcon != NULL &&
evbuffer_get_length(buffer) > req->evcon->max_headers_size)
return (MORE_DATA_EXPECTED);
}
- if (req->evcon != NULL &&
- line_length > req->evcon->max_headers_size) {
+ if (req->evcon != NULL && len > req->evcon->max_headers_size) {
mm_free(line);
return (DATA_TOO_LONG);
}
- req->headers_size = line_length;
+ req->headers_size = len;
switch (req->kind) {
case EVHTTP_REQUEST:
enum message_read_status status = MORE_DATA_EXPECTED;
struct evkeyvalq* headers = req->input_headers;
- size_t line_length;
- while ((line = evbuffer_readln(buffer, &line_length, EVBUFFER_EOL_CRLF))
+ size_t len;
+ while ((line = evbuffer_readln(buffer, &len, EVBUFFER_EOL_CRLF))
!= NULL) {
char *skey, *svalue;
- req->headers_size += line_length;
+ req->headers_size += len;
if (req->evcon != NULL &&
req->headers_size > req->evcon->max_headers_size) {