diff options
author | Benny Prijono <bennylp@teluu.com> | 2010-09-27 08:35:08 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2010-09-27 08:35:08 +0000 |
commit | c850d430469b470fc4b2d029fcb4f34d90cbb0f9 (patch) | |
tree | fdcb666c1c514951fc1ccef366b1e05968b047bb /pjsip-apps/src/samples | |
parent | dfb5e40e66d2c0169adb3e0d22f2e83b9e842994 (diff) |
Implemented and closed #1136: added HTTP authentication support
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3321 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/samples')
-rw-r--r-- | pjsip-apps/src/samples/httpdemo.c | 16 |
1 files changed, 15 insertions, 1 deletions
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; i<resp->headers.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) |