+ if (!strcmp(data, "expect")) {
+ if (!strcasecmp(val, "100-continue"))
+ r->expect_cont = true;
+ else {
+ uh_header_error(cl, 412, "Precondition Failed");
+ return;
+ }
+ } else if (!strcmp(data, "content-length")) {
+ r->content_length = strtoul(val, &err, 0);
+ if (err && *err) {
+ uh_header_error(cl, 400, "Bad Request");
+ return;
+ }
+ } else if (!strcmp(data, "transfer-encoding")) {
+ if (!strcmp(val, "chunked"))
+ r->transfer_chunked = true;
+ } else if (!strcmp(data, "connection")) {
+ if (!strcasecmp(val, "close"))
+ r->connection_close = true;
+ } else if (!strcmp(data, "user-agent")) {
+ char *str;
+
+ if (strstr(val, "Opera"))
+ r->ua = UH_UA_OPERA;
+ else if ((str = strstr(val, "MSIE ")) != NULL) {
+ r->ua = UH_UA_MSIE_NEW;
+ if (str[5] && str[6] == '.') {
+ switch (str[5]) {
+ case '6':
+ if (strstr(str, "SV1"))
+ break;
+ /* fall through */
+ case '5':
+ case '4':
+ r->ua = UH_UA_MSIE_OLD;
+ break;
+ }
+ }
+ }
+ else if (strstr(val, "Chrome/"))
+ r->ua = UH_UA_CHROME;
+ else if (strstr(val, "Safari/") && strstr(val, "Mac OS X"))
+ r->ua = UH_UA_SAFARI;
+ else if (strstr(val, "Gecko/"))
+ r->ua = UH_UA_GECKO;
+ else if (strstr(val, "Konqueror"))
+ r->ua = UH_UA_KONQUEROR;
+ }
+
+