Hey, I just found evhttp's pretty picky about HTTP request without correct protocol version. For example, "GET /status.php\r\n", instead of "GET /status.php HTTP/1.1\r\n". So I'm suggesting this change,
--- http.c 2008-12-19 14:27:27.000000000 -0800 +++ /var/users/hzhao/hphp/external/libevent/libevent-1.4.9-stable/http.c 2009-04-18 23:06:53.413896000 -0700 @@ -1259,11 +1259,13 @@ if (line == NULL) return (-1); uri = strsep(&line, " "); - if (line == NULL) - return (-1); + if (line == NULL) { + version = "HTTP/1.0"; + } else { version = strsep(&line, " "); if (line != NULL) return (-1); + } This is how Apache handles it, and this was why some of our hardware sending bad HTTP requests to Apache server without any problems, then when I switched to evhttp, it wasn't forgiving enough. /* Avoid sscanf in the common case */ if (len == 8 && pro[0] == 'H' && pro[1] == 'T' && pro[2] == 'T' && pro[3] == 'P' && pro[4] == '/' && apr_isdigit(pro[5]) && pro[6] == '.' && apr_isdigit(pro[7])) { r->proto_num = HTTP_VERSION(pro[5] - '0', pro[7] - '0'); } else if (3 == sscanf(r->protocol, "%4s/%u.%u", http, &major, &minor) && (strcasecmp("http", http) == 0) && (minor < HTTP_VERSION(1, 0)) ) /* don't allow HTTP/0.1000 */ r->proto_num = HTTP_VERSION(major, minor); else r->proto_num = HTTP_VERSION(1, 0); Thanks for looking into this! -Haiping _______________________________________________ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users