changed logging messages

This commit is contained in:
hyung-hwan 2014-10-16 13:44:19 +00:00
parent a97cce7d70
commit c4df310ee7
2 changed files with 13 additions and 2 deletions

View File

@ -480,15 +480,18 @@ static int get_server_root (
if (qinfo->client->status & QSE_HTTPD_CLIENT_INTERCEPTED)
{
printf ("intercepted....\n");
/* transparent proxying */
if (loccfg->proxy.allow_intercept <= 0)
{
printf ("intercepted. not allowed...\n");
root->type = QSE_HTTPD_SERVERSTD_ROOT_ERROR;
root->u.error.code = 403; /* forbidden */
return 0;
}
else if (loccfg->proxy.allow_intercept <= 1)
{
printf ("intercepted. not allowed to go thru...\n");
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.
@ -502,6 +505,7 @@ static int get_server_root (
goto proxy_ok;
}
printf ("intercepted. to be handled locally ...\n");
}
if (mth == QSE_HTTP_CONNECT)
@ -537,6 +541,7 @@ static int get_server_root (
}
}
printf ("qpath ===> [%s]\n",qpath);
if ((loccfg->proxy.allow_http && qse_mbszcasecmp (qpath, QSE_MT("http://"), (proto_len = 7)) == 0) ||
(loccfg->proxy.allow_https && qse_mbszcasecmp (qpath, QSE_MT("https://"), (proto_len = 8)) == 0))
{

View File

@ -1884,7 +1884,7 @@ static int task_main_proxy_1 (
httpd->errnum == QSE_HTTPD_ECONN) http_errnum = 403;
if (httpd->opt.trait & QSE_HTTPD_LOGACT)
log_proxy_error (proxy, "proxy connect error - ");
log_proxy_error (proxy, "proxy peer connect error - ");
goto oops;
}
@ -2309,6 +2309,12 @@ static int task_main_proxy (
proxy->res_consumed = 0;
proxy->res_pending = 0;
{
char buf[100];
qse_nwadtombs (&proxy->peer.nwad, buf, QSE_COUNTOF(buf), QSE_NWADTOMBS_ALL);
printf ("OPENDING PEER: [%s]\n", buf);
}
httpd->errnum = QSE_HTTPD_ENOERR;
n = httpd->opt.scb.peer.open (httpd, &proxy->peer);
if (n <= -1)
@ -2319,7 +2325,7 @@ static int task_main_proxy (
httpd->errnum == QSE_HTTPD_ECONN) http_errnum = 403;
if (httpd->opt.trait & QSE_HTTPD_LOGACT)
log_proxy_error (proxy, "proxy connect error - ");
log_proxy_error (proxy, "proxy peer initial connect error - ");
goto oops;
}