changed cohttpd to call qse_comparehttpversions() for version comparison
This commit is contained in:
		| @ -517,7 +517,7 @@ static QSE_INLINE int task_main_getdir ( | |||||||
| 	{ | 	{ | ||||||
| 		int keepalive_ignored = 0; | 		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. | 			/* this task does chunking when keepalive is set. | ||||||
| 			 * chunking is not supported for http 1.0 or earlier. | 			 * chunking is not supported for http 1.0 or earlier. | ||||||
| @ -526,7 +526,6 @@ static QSE_INLINE int task_main_getdir ( | |||||||
| 			keepalive_ignored = 1; | 			keepalive_ignored = 1; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  |  | ||||||
| 		x = qse_httpd_entaskformat ( | 		x = qse_httpd_entaskformat ( | ||||||
| 			httpd, client, x, | 			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"),  | 			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"),  | ||||||
|  | |||||||
| @ -1115,7 +1115,7 @@ qse_mbs_ncat (proxy->reqfwdbuf, spc, QSE_COUNTOF(spc)); | |||||||
|  |  | ||||||
| 		proxy->resflags |= PROXY_RES_AWAIT_RESHDR; | 		proxy->resflags |= PROXY_RES_AWAIT_RESHDR; | ||||||
| 		if ((arg->req->flags & QSE_HTRE_ATTR_EXPECT100) && | 		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; | 			proxy->resflags |= PROXY_RES_AWAIT_100; | ||||||
| 		} | 		} | ||||||
|  | |||||||
| @ -3153,7 +3153,7 @@ auth_ok: | |||||||
| 	/* if authentication is ok or no authentication is required, | 	/* if authentication is ok or no authentication is required, | ||||||
| 	 * handle 'Expect: 100-continue' if it is contained in the header */ | 	 * handle 'Expect: 100-continue' if it is contained in the header */ | ||||||
| 	if ((req->flags & QSE_HTRE_ATTR_EXPECT) && | 	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) | 	    qse_htre_getcontentlen(req) <= 0) | ||||||
| 	{ | 	{ | ||||||
| 		/* "Expect" in the header, version 1.1 or higher, | 		/* "Expect" in the header, version 1.1 or higher, | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user