changed cohttpd to call qse_comparehttpversions() for version comparison

This commit is contained in:
hyung-hwan 2014-10-24 15:37:42 +00:00
parent 1f47f89062
commit 85dca3e39a
3 changed files with 3 additions and 4 deletions

View File

@ -517,7 +517,7 @@ static QSE_INLINE int task_main_getdir (
{
int keepalive_ignored = 0;
if (dir->keepalive && (dir->version.major < 1 || (dir->version.major == 1 && dir->version.minor <= 0)))
if (dir->keepalive && qse_comparehttpversions (&dir->version, &qse_http_v11) < 0)
{
/* this task does chunking when keepalive is set.
* chunking is not supported for http 1.0 or earlier.
@ -526,7 +526,6 @@ static QSE_INLINE int task_main_getdir (
keepalive_ignored = 1;
}
x = qse_httpd_entaskformat (
httpd, client, x,
QSE_MT("HTTP/%d.%d 200 OK\r\nServer: %s\r\nDate: %s\r\nConnection: %s\r\nContent-Type: text/html\r\n%s\r\n"),

View File

@ -1115,7 +1115,7 @@ qse_mbs_ncat (proxy->reqfwdbuf, spc, QSE_COUNTOF(spc));
proxy->resflags |= PROXY_RES_AWAIT_RESHDR;
if ((arg->req->flags & QSE_HTRE_ATTR_EXPECT100) &&
(arg->req->version.major > 1 || (arg->req->version.major == 1 && arg->req->version.minor >= 1)))
qse_comparehttpversions (&arg->req->version, &qse_http_v11) >= 0)
{
proxy->resflags |= PROXY_RES_AWAIT_100;
}

View File

@ -3153,7 +3153,7 @@ auth_ok:
/* if authentication is ok or no authentication is required,
* handle 'Expect: 100-continue' if it is contained in the header */
if ((req->flags & QSE_HTRE_ATTR_EXPECT) &&
(req->version.major > 1 || (req->version.major == 1 && req->version.minor >= 1)) &&
qse_comparehttpversions (&req->version, &qse_http_v11) >= 0 &&
qse_htre_getcontentlen(req) <= 0)
{
/* "Expect" in the header, version 1.1 or higher,