[svn-commits] oej: branch oej/sip_request_size_8556 r64653 - in
/team/oej/sip_request_size_...
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Wed May 16 07:57:41 MST 2007
Author: oej
Date: Wed May 16 09:57:40 2007
New Revision: 64653
URL: http://svn.digium.com/view/asterisk?view=rev&rev=64653
Log:
Fixes, fixes, fixes
Modified:
team/oej/sip_request_size_8556/ (props changed)
team/oej/sip_request_size_8556/channels/chan_sip.c
Propchange: team/oej/sip_request_size_8556/
------------------------------------------------------------------------------
automerge = http://edvina.net/training/
Modified: team/oej/sip_request_size_8556/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/sip_request_size_8556/channels/chan_sip.c?view=diff&rev=64653&r1=64652&r2=64653
==============================================================================
--- team/oej/sip_request_size_8556/channels/chan_sip.c (original)
+++ team/oej/sip_request_size_8556/channels/chan_sip.c Wed May 16 09:57:40 2007
@@ -1630,11 +1630,8 @@
if(p->initreq.data)
free(p->initreq.data); /* De-allocate memory before we overwrite */
/* Use this as the basis */
- ast_log(LOG_DEBUG, "++++++++++++ 1. Data now: %s\n++++\n", req->data);
copy_request(&p->initreq, req);
- ast_log(LOG_DEBUG, "++++++++++++ 2. Data now: %s\n++++\n", req->data);
parse_request(&p->initreq);
- ast_log(LOG_DEBUG, "++++++++++++ 3. Data now: %s\n++++\n", req->data);
if (ast_test_flag(req, SIP_PKT_DEBUG))
ast_verbose("%d headers, %d lines\n", p->initreq.headers, p->initreq.lines);
}
@@ -2179,6 +2176,7 @@
memset(dst, 0, sizeof(*dst));
dst->data = ast_calloc(1, src->datasize);
memcpy(dst->data, src->data, src->datasize);
+ dst->datasize = src->datasize;
dst->len = src->len;
parse_request(dst);
}
@@ -2213,6 +2211,8 @@
parse_copy(&tmp, req);
append_history(p, reliable ? "TxRespRel" : "TxResp", "%s / %s - %s", tmp.data, get_header(&tmp, "CSeq"),
(tmp.method == SIP_RESPONSE || tmp.method == SIP_UNKNOWN) ? tmp.rlPart2 : sip_methods[tmp.method].text);
+ if (tmp.data)
+ free(tmp.data);
}
res = (reliable) ?
__sip_reliable_xmit(p, seqno, 1, req->data, req->len, (reliable == XMIT_CRITICAL), req->method) :
@@ -2244,6 +2244,8 @@
struct sip_request tmp;
parse_copy(&tmp, req);
append_history(p, reliable ? "TxReqRel" : "TxReq", "%s / %s - %s", tmp.data, get_header(&tmp, "CSeq"), sip_methods[tmp.method].text);
+ if (tmp.data)
+ free(tmp.data);
}
res = (reliable) ?
__sip_reliable_xmit(p, seqno, 0, req->data, req->len, (reliable > 1), req->method) :
@@ -7273,7 +7275,7 @@
} else {
r->regstate = REG_STATE_UNREGISTERED;
r->timeout = -1;
- res=transmit_register(r, SIP_REGISTER, NULL, NULL);
+ res = transmit_register(r, SIP_REGISTER, NULL, NULL);
}
manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelDriver: SIP\r\nUsername: %s\r\nDomain: %s\r\nStatus: %s\r\n", r->username, r->hostname, regstate2str(r->regstate));
ASTOBJ_UNREF(r, sip_registry_destroy);
@@ -14946,10 +14948,11 @@
ast_log(LOG_WARNING, "Recv error: %s\n", strerror(errno));
return 1;
}
+ ast_log(LOG_DEBUG, "++++ SIPSOCK READ %d\n", res);
packetbuffer[res] = '\0';
req.data = ast_calloc(1, res + 1);
req.datasize = res + 1;
- memcpy(req.data, packetbuffer, res + 1);
+ memcpy(&req.data, packetbuffer, res + 1);
req.len = res;
if(sip_debug_test_addr(&sin)) /* Set the debug flag early on packet level */
ast_set_flag(&req, SIP_PKT_DEBUG);
More information about the svn-commits
mailing list