Module: sip-router Branch: master Commit: 4d5abbd5a1070ce45f5c7f31d758a70df686296c URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4d5abbd5...
Author: Andrei Pelinescu-Onciul andrei@iptel.org Committer: Andrei Pelinescu-Onciul andrei@iptel.org Date: Thu Sep 24 17:58:38 2009 +0200
tm: t_uac_wait rpc error path fixes
- fix no reply sent on t_uac() failure - free "delayed" context on t_uac() failure
---
modules/tm/rpc_uac.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/modules/tm/rpc_uac.c b/modules/tm/rpc_uac.c index 3dc34a9..f177094 100644 --- a/modules/tm/rpc_uac.c +++ b/modules/tm/rpc_uac.c @@ -493,6 +493,7 @@ static void rpc_t_uac(rpc_t* rpc, void* c, int reply_wait) body.s=0; body.len=0; + dctx=0; if (reply_wait && (rpc->capabilities == 0 || !(rpc->capabilities(c) & RPC_DELAYED_REPLY))) { rpc->fault(c, 600, "Reply wait/async mode not supported" @@ -604,6 +605,10 @@ static void rpc_t_uac(rpc_t* rpc, void* c, int reply_wait) uac_req.cb=rpc_uac_callback; uac_req.cbp=dctx; uac_req.cb_flags=TMCB_LOCAL_COMPLETED; + /* switch to dctx, in case adding the callback fails and we + want to still send a reply */ + rpc=&dctx->rpc; + c=dctx->reply_ctx; } ret = t_uac(&uac_req); @@ -616,6 +621,8 @@ static void rpc_t_uac(rpc_t* rpc, void* c, int reply_wait) } else { rpc->fault(c, 500, "RPC/UAC error"); } + if (dctx) + rpc->delayed_ctx_close(dctx); goto error01; } error01: