From ed2cdcaa873d5ffa2d4f204f36f137ee591f127a Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 3 Nov 2014 15:33:15 +0000 Subject: [PATCH] added qse_htrd_geterrnum(). changed a log message in xli/err.c --- qse/cmd/http/httpd.c | 1 + qse/include/qse/cmn/mbwc.h | 2 +- qse/include/qse/http/htrd.h | 4 ++++ qse/lib/http/htrd.c | 6 ++++++ qse/lib/http/httpd-proxy.c | 6 ++++-- qse/lib/xli/err.c | 2 +- qse/lib/xli/read.c | 4 ++-- 7 files changed, 19 insertions(+), 6 deletions(-) diff --git a/qse/cmd/http/httpd.c b/qse/cmd/http/httpd.c index 11ec9ea9..c2cc81cd 100644 --- a/qse/cmd/http/httpd.c +++ b/qse/cmd/http/httpd.c @@ -2272,6 +2272,7 @@ static int close_config_file (qse_httpd_t* httpd) return 0; } + static void set_limit (qse_httpd_t* httpd, const qse_char_t* name, int what) { qse_xli_pair_t* pair; diff --git a/qse/include/qse/cmn/mbwc.h b/qse/include/qse/cmn/mbwc.h index 00519f04..740a6f43 100644 --- a/qse/include/qse/cmn/mbwc.h +++ b/qse/include/qse/cmn/mbwc.h @@ -454,7 +454,7 @@ QSE_EXPORT qse_mchar_t* qse_wcsntombsdup ( QSE_EXPORT qse_mchar_t* qse_wcsatombsdup ( const qse_wchar_t* wcs[], - qse_size_t* mbslen, + qse_size_t* mbslen, qse_mmgr_t* mmgr ); diff --git a/qse/include/qse/http/htrd.h b/qse/include/qse/http/htrd.h index 3dbd0a18..ba24bae4 100644 --- a/qse/include/qse/http/htrd.h +++ b/qse/include/qse/http/htrd.h @@ -145,6 +145,10 @@ QSE_EXPORT void* qse_htrd_getxtn ( qse_htrd_t* htrd ); +QSE_EXPORT qse_htrd_errnum_t qse_htrd_geterrnum ( + qse_htrd_t* htrd +); + QSE_EXPORT void qse_htrd_clear ( qse_htrd_t* htrd ); diff --git a/qse/lib/http/htrd.c b/qse/lib/http/htrd.c index 7fc5ed8c..c67cceb0 100644 --- a/qse/lib/http/htrd.c +++ b/qse/lib/http/htrd.c @@ -475,6 +475,12 @@ void* qse_htrd_getxtn (qse_htrd_t* htrd) return QSE_XTN (htrd); } + +qse_htrd_errnum_t qse_htrd_geterrnum (qse_htrd_t* htrd) +{ + return htrd->errnum; +} + int qse_htrd_getoption (qse_htrd_t* htrd) { return htrd->option; diff --git a/qse/lib/http/httpd-proxy.c b/qse/lib/http/httpd-proxy.c index 87cb618c..8591d7eb 100644 --- a/qse/lib/http/httpd-proxy.c +++ b/qse/lib/http/httpd-proxy.c @@ -1796,8 +1796,10 @@ static int task_main_proxy_2 ( { if (qse_htrd_feed (proxy->peer_htrd, proxy->buf, proxy->buflen) <= -1) { - if (httpd->opt.trait & QSE_HTTPD_LOGACT) - log_proxy_error (proxy, "proxy feed error - "); + #if defined(QSE_HTTPD_DEBUG) + HTTPD_DBGOUT3 ("Failed to feed proxy peer response to handler - %d [%.*hs]\n", + qse_htrd_geterrnum(proxy->peer_htrd), (int)proxy->buflen, proxy->buf); + #endif goto oops; } diff --git a/qse/lib/xli/err.c b/qse/lib/xli/err.c index a2e954b2..20fc8b47 100644 --- a/qse/lib/xli/err.c +++ b/qse/lib/xli/err.c @@ -57,7 +57,7 @@ const qse_char_t* qse_xli_dflerrstr ( QSE_T("no alias for '${0}'"), QSE_T("illegal value for '${0}'"), QSE_T("no value for '${0}'"), - QSE_T("too many string segments for '${0}'") + QSE_T("uncomplying number of string segments for '${0}'") }; return (errnum >= 0 && errnum < QSE_COUNTOF(errstr))? diff --git a/qse/lib/xli/read.c b/qse/lib/xli/read.c index 45e7379d..e2b6de6d 100644 --- a/qse/lib/xli/read.c +++ b/qse/lib/xli/read.c @@ -869,7 +869,7 @@ static int read_pair (qse_xli_t* xli, const qse_char_t* keytag) { /* too many string segments for the key */ qse_xli_seterror (xli, QSE_XLI_ESTRSEG, (const qse_cstr_t*)&key, &kloc); - goto oops; + goto oops; } /* semicolon read. turn off NSTR */ @@ -879,7 +879,7 @@ static int read_pair (qse_xli_t* xli, const qse_char_t* keytag) else { qse_xli_seterror (xli, QSE_XLI_EPAVAL, QSE_STR_XSTR(xli->tok.name), &xli->tok.loc); - goto oops; + goto oops; }