diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-03-02 21:16:00 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-03-02 21:16:00 +0000 |
commit | d4f5064c25f3000771921ffc18ceab3810c3d9d2 (patch) | |
tree | fbf6cbfe2d4f2b40cba2893c818e9652b2a119a7 /pjsip/src/pjsip/sip_util.c | |
parent | 9c6c63de6a5564b32ee1239bb77ef605c8a69837 (diff) |
Changed pjsip_msg_body_clone(), added pjsip_msg_body_create()
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@266 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip/sip_util.c')
-rw-r--r-- | pjsip/src/pjsip/sip_util.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/pjsip/src/pjsip/sip_util.c b/pjsip/src/pjsip/sip_util.c index bb928b73..60f48681 100644 --- a/pjsip/src/pjsip/sip_util.c +++ b/pjsip/src/pjsip/sip_util.c @@ -1235,9 +1235,8 @@ PJ_DEF(pj_status_t) pjsip_endpt_respond_stateless( pjsip_endpoint *endpt, /* Add the message body, if any. */ if (body) { - tdata->msg->body = pj_pool_alloc(tdata->pool, sizeof(pjsip_msg_body)); - status = pjsip_msg_body_clone( tdata->pool, tdata->msg->body, body ); - if (status != PJ_SUCCESS) { + tdata->msg->body = pjsip_msg_body_clone( tdata->pool, body ); + if (tdata->msg->body == NULL) { pjsip_tx_data_dec_ref(tdata); return status; } @@ -1295,9 +1294,8 @@ PJ_DEF(pj_status_t) pjsip_endpt_respond( pjsip_endpoint *endpt, /* Add the message body, if any. */ if (body) { - tdata->msg->body = pj_pool_alloc(tdata->pool, sizeof(pjsip_msg_body)); - status = pjsip_msg_body_clone( tdata->pool, tdata->msg->body, body ); - if (status != PJ_SUCCESS) { + tdata->msg->body = pjsip_msg_body_clone( tdata->pool, body ); + if (tdata->msg->body == NULL) { pjsip_tx_data_dec_ref(tdata); return status; } @@ -1317,7 +1315,7 @@ PJ_DEF(pj_status_t) pjsip_endpt_respond( pjsip_endpoint *endpt, status = pjsip_tsx_send_msg(tsx, tdata); if (status != PJ_SUCCESS) { pjsip_tx_data_dec_ref(tdata); - } else { + } else if (p_tsx) { *p_tsx = tsx; } |