bad_request(agooCon c, int status, int line) {
    agooRes	res;
    const char *msg = agoo_http_code_message(status);

    if (NULL == (res = agoo_res_create(c))) {
	agoo_log_cat(&agoo_error_cat, "memory allocation of response failed on connection %llu @ %d.",
		     (unsigned long long)c->id, line);
    } else {
	char		buf[256];
	int		cnt = snprintf(buf, sizeof(buf),
				       "HTTP/1.1 %d %s\r\nConnection: Close\r\nContent-Length: 0\r\n\r\n", status, msg);
	agooText	message = agoo_text_create(buf, cnt);

	agoo_con_res_append(c, res);
	res->close = true;
	agoo_res_message_push(res, message);
    }
    return HEAD_ERR;
}
bad_request(agooCon c, int status, int line) {
    agooRes	res;
    const char *msg = agoo_http_code_message(status);

    if (NULL == (res = agoo_res_create(c))) {
	agoo_log_cat(&agoo_error_cat, "memory allocation of response failed on connection %llu @ %d.",
		     (unsigned long long)c->id, line);
    } else {
	char		buf[256];
	int		cnt = snprintf(buf, sizeof(buf),
				       "HTTP/1.1 %d %s\r\nConnection: Close\r\nContent-Length: 0\r\n\r\n", status, msg);
	agooText	message = agoo_text_create(buf, cnt);

	agoo_con_res_append(c, res);
	res->close = true;
	agoo_res_message_push(res, message);
    }
    return HEAD_ERR;
}