enhanced intercept handling in httpd

This commit is contained in:
2015-09-28 07:33:46 +00:00
parent 1f6fbd4f9f
commit 74ab14974b
5 changed files with 78 additions and 19 deletions

View File

@ -514,9 +514,17 @@ static int get_server_root (
{
root->type = QSE_HTTPD_SERVERSTD_ROOT_PROXY;
root->u.proxy.dst.nwad = qinfo->client->orgdst_addr;
/* if TPROXY is used, set the source to the original source.
root->u.proxy.src.nwad = qinfo->client->remote_addr;
qse_setnwadport (&root->u.proxy.src.nwad, 0);*/
if (qse_nwadequal(&qinfo->client->orgdst_addr, &qinfo->client->local_addr))
{
/* if the local address is the same as the original
* destination and INTERCEPTED is set, it's probably
* TPROXYed. if TPROXY is used, set the source to the
* original source. */
root->u.proxy.src.nwad = qinfo->client->remote_addr;
/* well, i don't keep the port number, though */
qse_setnwadport (&root->u.proxy.src.nwad, 0);
}
if (mth == QSE_HTTP_CONNECT)
root->u.proxy.flags |= QSE_HTTPD_RSRC_PROXY_RAW;