[asterisk-commits] rizzo: branch rizzo/astobj2 r47383 -
/team/rizzo/astobj2/channels/chan_sip.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Nov 9 10:17:37 MST 2006
Author: rizzo
Date: Thu Nov 9 11:17:37 2006
New Revision: 47383
URL: http://svn.digium.com/view/asterisk?view=rev&rev=47383
Log:
fix the cleaning up code in do_monitor for the astobj2 case.
Now calls work.
Still some memory leak to investigate.
Modified:
team/rizzo/astobj2/channels/chan_sip.c
Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=47383&r1=47382&r2=47383
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Thu Nov 9 11:17:37 2006
@@ -15000,11 +15000,11 @@
/* becaues this is deadlock-prone, we need to try and unlock if failed */
if (!p->owner || !ast_channel_trylock(p->owner))
break; /* locking succeeded */
+ ast_verbose("loop %d p %p chan %p trylock failed\n", lockretry, p, p->owner);
if (option_debug)
ast_log(LOG_DEBUG, "Failed to grab owner channel lock, trying again. (SIP call %s)\n", p->callid);
sip_pvt_unlock(p);
- pvt_unref(p); /* release the reference */
- p = NULL; /* because we don't have a good value anymore */
+ p = pvt_unref(p); /* release the reference, no good anymore */
/* Sleep for a very short amount of time */
usleep(1);
}
@@ -15014,7 +15014,6 @@
get_header(&req, "Call-ID"));
transmit_response(p, "503 Server error", &req); /* We must respond according to RFC 3261 sec 12.2 */
/* XXX We could add retry-after to make sure they come back */
- append_history(p, "LockFail", "Owner lock failed, transaction failed.");
return 1;
}
p->recv = sin;
@@ -15200,12 +15199,10 @@
sip_pvt_lock(cur);
check_rtp_timeout(cur, t);
if (ast_test_flag(&cur->flags[0], SIP_NEEDDESTROY) && !cur->packets && !cur->owner) {
- sip_pvt_unlock(cur);
ao2_unlink(dialogs, cur);
- ao2_ref(cur, -1);
- __sip_destroy(cur);
- } else
- ao2_ref(cur, -1);
+ }
+ sip_pvt_unlock(cur);
+ ao2_ref(cur, -1);
}
}
#else
More information about the asterisk-commits
mailing list