static char *whitespace = " \t";
static STRING(whitespace) = " \t";
static char *process_headers(struct request *r){	static char *whitespace = " \t";	char *l, *m, *p, *s;	int a = r->cn->assbackwards;	r->user_agent = 0;	r->referer = 0;	r->from = 0;	r->authorization = 0;	r->cookie = 0;	r->host = 0;	r->in_content_type = 0;	r->in_content_length = 0;	r->path[0] = '\0';	r->path_translated[0] = '\0';	r->path_args[0] = '\0';	r->num_content = -1;	r->special = 0;	r->content_length = -1;	r->last_modified = 0;	r->ims = 0;	r->location = 0;	r->status_line = 0;	r->error = 0;	r->method_s = 0;	r->url = 0;	r->args = 0;	r->protocol = 0;	r->method = 0;	r->status = 0;	r->isindex = 0;	r->c = 0;	if ((l = getline(r->cn->input)) == 0)		return br_empty;	m = strtok(l, whitespace);	if (m == 0)		return br_empty;	if (strceq(m, get_method)) {		r->method = M_GET;		r->method_s = get_method;	}	else if (strceq(m, head_method)) {		if (a)			return br_bad_method;		r->method = M_HEAD;		r->method_s = head_method;	}	else if (strceq(m, post_method)) {		if (a)			return br_bad_method;		r->method = M_POST;		r->method_s = post_method;	}	else		return br_bad_method;	if ((r->url = strtok(0, whitespace)) == 0	    || strlen(r->url) > STRLEN)		return br_bad_url;	if ((s = strchr(r->url, '?')) != 0) {		r->args = s+1;		*s = '\0';	}	if (unescape_url(r->url, r->path) == -1	    || r->path[0] != '/')		return br_bad_url;	if (a)		r->protocol = old_protocol;	else {		p = strtok(0, whitespace);		if (p == 0 || strcasecmp(p, new_protocol))			return br_bad_protocol;		r->protocol = new_protocol;		while ((l = getline(r->cn->input)) != 0) {			if ((s = strchr(l, ':')) == 0)				continue;			*s++ = '\0';			while (isspace(*s))				++s;			if (*s == '\0')				continue;			if (strceq(l, "User-agent"))				r->user_agent = s;			else if (strceq(l, "Referer"))				r->referer = s;			else if (strceq(l, "From"))				r->from = s;			else if (strceq(l, "Authorization"))				r->authorization = s;			else if (strceq(l, "Cookie"))				r->cookie = s;			else if (strceq(l, "Host"))				r->host = s;			else if (keepalive				 && strceq (l, "Connection")				 && strceq(s, magic_word))				r->cn->keepalive = 1;			else if (r->method == M_GET) {				if (strceq(l, "If-modified-since")) {					r->ims = timerfc(s);					if (r->ims == (time_t) -1)						return br_bad_date;				}			}			else if (r->method == M_POST) {				if (strceq(l, "Content-type"))					r->in_content_type = s;				else if (strceq(l, "Content-length"))					r->in_content_length = s;			}		}	}	return 0;}