summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorLuigi Rizzo <rizzo@icir.org>2006-04-12 00:17:37 +0000
committerLuigi Rizzo <rizzo@icir.org>2006-04-12 00:17:37 +0000
commitb24bc86fc214deca575904f023fa45a33d6c3984 (patch)
treea84bb3f7dc1874201a2be3479abd32415089c928 /channels/chan_sip.c
parent86e8094c3cdad8df7dc4f562b33e47173e387d7c (diff)
reindent block properly
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@19466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index fbb6b70d9..ec5177033 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3937,47 +3937,47 @@ static int copy_via_headers(struct sip_pvt *p, struct sip_request *req, struct s
if (ast_strlen_zero(oh))
break;
- if (!copied) { /* Only check for empty rport in topmost via header */
- char iabuf[INET_ADDRSTRLEN];
- char *rport;
+ 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 */
+ /* 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;
+ 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));
+ ast_copy_string(tmp, oh, sizeof(tmp));
- rport = strstr(tmp, ";rport");
+ 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 (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);