summaryrefslogtreecommitdiff
path: root/pjsip-apps
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-09-27 08:35:08 +0000
committerBenny Prijono <bennylp@teluu.com>2010-09-27 08:35:08 +0000
commitc850d430469b470fc4b2d029fcb4f34d90cbb0f9 (patch)
treefdcb666c1c514951fc1ccef366b1e05968b047bb /pjsip-apps
parentdfb5e40e66d2c0169adb3e0d22f2e83b9e842994 (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')
-rw-r--r--pjsip-apps/src/samples/httpdemo.c16
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)