[svn-commits] trunk r19466 - /trunk/channels/chan_sip.c
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Tue Apr 11 17:17:39 MST 2006
Author: rizzo
Date: Tue Apr 11 19:17:37 2006
New Revision: 19466
URL: http://svn.digium.com/view/asterisk?rev=19466&view=rev
Log:
reindent block properly
Modified:
trunk/channels/chan_sip.c
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=19466&r1=19465&r2=19466&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Apr 11 19:17:37 2006
@@ -3937,47 +3937,47 @@
if (ast_strlen_zero(oh))
break;
- if (!copied) { /* Only check for empty rport in topmost via header */
- char iabuf[INET_ADDRSTRLEN];
- char *rport;
-
- /* Find ;rport; (empty request) */
- rport = strstr(oh, ";rport");
- if (rport && *(rport+6) == '=')
- rport = NULL; /* We already have a parameter to rport */
-
- if (rport && ast_test_flag(&p->flags[0], SIP_NAT) == SIP_NAT_ALWAYS) {
- /* We need to add received port - rport */
- char tmp[256], *end;
-
- ast_copy_string(tmp, oh, sizeof(tmp));
-
- rport = strstr(tmp, ";rport");
-
- if (rport) {
- end = strchr(rport + 1, ';');
- if (end)
- memmove(rport, end, strlen(end) + 1);
- else
- *rport = '\0';
- }
-
- /* Add rport to first VIA header if requested */
- /* Whoo hoo! Now we can indicate port address translation too! Just
- another RFC (RFC3581). I'll leave the original comments in for
- posterity. */
- snprintf(new, sizeof(new), "%s;received=%s;rport=%d",
- tmp, ast_inet_ntoa(iabuf, sizeof(iabuf), p->recv.sin_addr),
- ntohs(p->recv.sin_port));
- } else {
- /* We should *always* add a received to the topmost via */
- snprintf(new, sizeof(new), "%s;received=%s",
- oh, ast_inet_ntoa(iabuf, sizeof(iabuf), p->recv.sin_addr));
+ if (!copied) { /* Only check for empty rport in topmost via header */
+ char iabuf[INET_ADDRSTRLEN];
+ char *rport;
+
+ /* Find ;rport; (empty request) */
+ rport = strstr(oh, ";rport");
+ if (rport && *(rport+6) == '=')
+ rport = NULL; /* We already have a parameter to rport */
+
+ if (rport && ast_test_flag(&p->flags[0], SIP_NAT) == SIP_NAT_ALWAYS) {
+ /* We need to add received port - rport */
+ char tmp[256], *end;
+
+ ast_copy_string(tmp, oh, sizeof(tmp));
+
+ rport = strstr(tmp, ";rport");
+
+ if (rport) {
+ end = strchr(rport + 1, ';');
+ if (end)
+ memmove(rport, end, strlen(end) + 1);
+ else
+ *rport = '\0';
}
- oh = new; /* the header to copy */
- } /* else add the following via headers untouched */
- add_header(req, field, oh);
- copied++;
+
+ /* Add rport to first VIA header if requested */
+ /* Whoo hoo! Now we can indicate port address translation too! Just
+ another RFC (RFC3581). I'll leave the original comments in for
+ posterity. */
+ snprintf(new, sizeof(new), "%s;received=%s;rport=%d",
+ tmp, ast_inet_ntoa(iabuf, sizeof(iabuf), p->recv.sin_addr),
+ ntohs(p->recv.sin_port));
+ } else {
+ /* We should *always* add a received to the topmost via */
+ snprintf(new, sizeof(new), "%s;received=%s",
+ oh, ast_inet_ntoa(iabuf, sizeof(iabuf), p->recv.sin_addr));
+ }
+ oh = new; /* the header to copy */
+ } /* else add the following via headers untouched */
+ add_header(req, field, oh);
+ copied++;
}
if (!copied) {
ast_log(LOG_NOTICE, "No header field '%s' present to copy\n", field);
More information about the svn-commits
mailing list