[asterisk-commits] rizzo: branch rizzo/astobj2 r47876 -
/team/rizzo/astobj2/channels/chan_sip.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Nov 21 03:30:17 MST 2006
Author: rizzo
Date: Tue Nov 21 04:30:17 2006
New Revision: 47876
URL: http://svn.digium.com/view/asterisk?view=rev&rev=47876
Log:
interpret all non-zero returns from handle_request() as errors.
No practical change as it only prints an error message.
See bug #8393
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=47876&r1=47875&r2=47876
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Tue Nov 21 04:30:17 2006
@@ -14844,7 +14844,7 @@
if (!p->expiry)
set_destroy(p);
}
- return 1;
+ return 1; /* XXX is this an invalid return ? should it be -1 ? */
}
/*! \brief Handle incoming REGISTER request */
@@ -14892,6 +14892,11 @@
/*! \brief Handle incoming SIP requests (methods)
\note This is where all incoming requests go first */
/* called with p and p->owner locked */
+/*
+ * Returns 0 on success,
+ * -1 on error (trapped by the caller)
+ * possibly other values as well.
+ */
static int handle_request(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int *recount, int *nounlock)
{
/* Called with p->lock held, as well as p->owner->lock if appropriate, keeping things
@@ -15051,7 +15056,7 @@
res = handle_request_message(p, req);
break;
case SIP_SUBSCRIBE:
- res = handle_request_subscribe(p, req, sin, seqno, e);
+ res = handle_request_subscribe(p, req, sin, seqno, e); /* XXX can return 1 */
break;
case SIP_REGISTER:
res = handle_request_register(p, req, sin, e);
@@ -15185,7 +15190,7 @@
append_history(p, "Rx", "%s / %s / %s", req.data, get_header(&req, "CSeq"), req.rlPart2);
nounlock = 0;
- if (handle_request(p, &req, &sin, &recount, &nounlock) == -1) {
+ if (handle_request(p, &req, &sin, &recount, &nounlock)) {
/* Request failed */
if (option_debug)
ast_log(LOG_DEBUG, "SIP message could not be handled, bad request: %-70.70s\n", p->callid[0] ? p->callid : "<no callid>");
More information about the asterisk-commits
mailing list