From c850d430469b470fc4b2d029fcb4f34d90cbb0f9 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 27 Sep 2010 08:35:08 +0000 Subject: Implemented and closed #1136: added HTTP authentication support git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3321 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/src/samples/httpdemo.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'pjsip-apps/src') diff --git a/pjsip-apps/src/samples/httpdemo.c b/pjsip-apps/src/samples/httpdemo.c index 739dc077..2df02d85 100644 --- a/pjsip-apps/src/samples/httpdemo.c +++ b/pjsip-apps/src/samples/httpdemo.c @@ -45,10 +45,24 @@ static FILE *f = NULL; static void on_response(pj_http_req *http_req, const pj_http_resp *resp) { - PJ_UNUSED_ARG(http_req); + unsigned i; + + PJ_UNUSED_ARG(http_req); PJ_LOG(3,(THIS_FILE, "%.*s %d %.*s", (int)resp->version.slen, resp->version.ptr, resp->status_code, (int)resp->reason.slen, resp->reason.ptr)); + + for (i=0; iheaders.count; ++i) { + const pj_http_header_elmt *h = &resp->headers.header[i]; + + if (!pj_stricmp2(&h->name, "Content-Length") || + !pj_stricmp2(&h->name, "Content-Type")) + { + PJ_LOG(3,(THIS_FILE, "%.*s: %.*s", + (int)h->name.slen, h->name.ptr, + (int)h->value.slen, h->value.ptr)); + } + } } static void on_send_data(pj_http_req *http_req, void **data, pj_size_t *size) -- cgit v1.2.3