Skip to content

Commit

Permalink
topoh: coherent whitespacing and indentation
Browse files Browse the repository at this point in the history
(cherry picked from commit 66ab19a)
  • Loading branch information
miconda committed Jun 25, 2017
1 parent a9d6ffa commit ee4c2a7
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/modules/topoh/Makefile
@@ -1,7 +1,7 @@
#
# topoh module makefile
#
#
#
# WARNING: do not run this directly, it should be run by the master Makefile

include ../../Makefile.defs
Expand Down
2 changes: 1 addition & 1 deletion src/modules/topoh/api.h
Expand Up @@ -19,7 +19,7 @@

/*!
* \file
* \brief Kamailio topoh ::
* \brief Kamailio topoh ::
* \ingroup topoh
* Module: \ref topoh
*/
Expand Down
25 changes: 12 additions & 13 deletions src/modules/topoh/doc/topoh.xml
Expand Up @@ -9,29 +9,28 @@
]>

<book xmlns:xi="http://www.w3.org/2001/XInclude">
<bookinfo>
<bookinfo>
<title>topoh Module</title>
<productname class="trade">sip-router.org</productname>
<authorgroup>
<author>
<author>
<firstname>Daniel-Constantin</firstname>
<surname>Mierla</surname>
<email>miconda@gmail.com</email>
</author>
<editor>
</author>
<editor>
<firstname>Daniel-Constantin</firstname>
<surname>Mierla</surname>
<email>miconda@gmail.com</email>
</editor>
</editor>
</authorgroup>
<copyright>
<year>2009</year>
<holder>&fhg;</holder>
<year>2009</year>
<holder>&fhg;</holder>
</copyright>
</bookinfo>
<toc></toc>

<xi:include href="topoh_admin.xml"/>


</bookinfo>
<toc></toc>

<xi:include href="topoh_admin.xml"/>

</book>
2 changes: 1 addition & 1 deletion src/modules/topoh/th_mask.c
Expand Up @@ -18,7 +18,7 @@
*/
/*!
* \file
* \brief Kamailio topoh ::
* \brief Kamailio topoh ::
* \ingroup topoh
* Module: \ref topoh
*/
Expand Down
2 changes: 1 addition & 1 deletion src/modules/topoh/th_mask.h
Expand Up @@ -19,7 +19,7 @@

/*!
* \file
* \brief SIP-router topoh ::
* \brief SIP-router topoh ::
* \ingroup topoh
* Module: \ref topoh
*/
Expand Down
52 changes: 26 additions & 26 deletions src/modules/topoh/th_msg.c
Expand Up @@ -100,7 +100,7 @@ int th_get_param_value(str *in, str *name, str *value)
return 0;
}
}

if(params) free_params(params);
return 1;

Expand Down Expand Up @@ -188,7 +188,7 @@ int th_mask_via(sip_msg_t *msg)
LM_ERR("cannot encode via %d\n", i);
return -1;
}

LM_DBG("+body: %d: [%.*s]\n", out.len, out.len, out.s);
l=del_lump(msg, via->name.s-msg->buf, vlen, 0);
if (l==0)
Expand Down Expand Up @@ -221,15 +221,15 @@ int th_mask_callid(sip_msg_t *msg)
LM_ERR("cannot get Call-Id header\n");
return -1;
}

out.s = th_mask_encode(msg->callid->body.s, msg->callid->body.len,
&th_callid_prefix, &out.len);
if(out.s==NULL)
{
LM_ERR("cannot encode callid\n");
return -1;
}

l=del_lump(msg, msg->callid->body.s-msg->buf, msg->callid->body.len, 0);
if (l==0)
{
Expand All @@ -254,7 +254,7 @@ int th_mask_contact(sip_msg_t *msg)
char *p;
contact_t *c;

if(msg->contact==NULL)
if(msg->contact==NULL)
{
LM_DBG("no contact header\n");
return 0;
Expand All @@ -265,7 +265,7 @@ int th_mask_contact(sip_msg_t *msg)
LM_ERR("failed parsing contact header\n");
return -1;
}

c = ((contact_body_t*)msg->contact->parsed)->contacts;
in = c->uri;

Expand Down Expand Up @@ -293,7 +293,7 @@ int th_mask_contact(sip_msg_t *msg)
out.s = p;
out.len += 2;
}

l=del_lump(msg, in.s-msg->buf, in.len, 0);
if (l==0)
{
Expand Down Expand Up @@ -325,9 +325,9 @@ int th_mask_record_route(sip_msg_t *msg)
}
hdr = msg->record_route;
i = 0;
while(hdr!=NULL)
while(hdr!=NULL)
{
if (parse_rr(hdr) < 0)
if (parse_rr(hdr) < 0)
{
LM_ERR("failed to parse RR\n");
return -1;
Expand Down Expand Up @@ -416,7 +416,7 @@ int th_unmask_via(sip_msg_t *msg, str *cookie)
LM_ERR("cannot decode via %d\n", i);
return -1;
}

LM_DBG("+body: %d: [%.*s]\n", out.len, out.len, out.s);
if(i==2)
{
Expand All @@ -428,7 +428,7 @@ int th_unmask_via(sip_msg_t *msg, str *cookie)
return -1;

}

memset(via2, 0, sizeof(struct via_body));
memcpy(out.s+out.len, CRLF, CRLF_LEN);
out.s[out.len+CRLF_LEN]='X';
Expand Down Expand Up @@ -475,10 +475,10 @@ int th_unmask_callid(sip_msg_t *msg)
{
struct lump* l;
str out;

if(th_param_mask_callid==0)
return 0;

if(msg->callid==NULL)
{
LM_ERR("cannot get Call-Id header\n");
Expand All @@ -492,15 +492,15 @@ int th_unmask_callid(sip_msg_t *msg)
LM_DBG("call-id [%.*s] not encoded",msg->callid->body.len,msg->callid->body.s);
return 0;
}

out.s = th_mask_decode(msg->callid->body.s, msg->callid->body.len,
&th_callid_prefix, 0, &out.len);
if(out.s==NULL)
{
LM_ERR("cannot decode callid\n");
return -1;
}

l=del_lump(msg, msg->callid->body.s-msg->buf, msg->callid->body.len, 0);
if (l==0)
{
Expand Down Expand Up @@ -580,9 +580,9 @@ int th_flip_record_route(sip_msg_t *msg, int mode)
act = 0;
if(mode==1)
act = 2;
while(hdr!=NULL)
while(hdr!=NULL)
{
if (parse_rr(hdr) < 0)
if (parse_rr(hdr) < 0)
{
LM_ERR("failed to parse RR\n");
return -1;
Expand Down Expand Up @@ -673,9 +673,9 @@ int th_unmask_route(sip_msg_t *msg)
}
hdr = msg->route;
i = 0;
while(hdr!=NULL)
while(hdr!=NULL)
{
if (parse_rr(hdr) < 0)
if (parse_rr(hdr) < 0)
{
LM_ERR("failed to parse RR\n");
return -1;
Expand All @@ -691,7 +691,7 @@ int th_unmask_route(sip_msg_t *msg)
if (th_uri_prefix_checks
&& ((rr->nameaddr.uri.len<th_uri_prefix.len) ||
(strncasecmp(rr->nameaddr.uri.s,th_uri_prefix.s,
th_uri_prefix.len)!=0)))
th_uri_prefix.len)!=0)))
{
LM_DBG("rr %d is not encoded: [%.*s]", i,
rr->nameaddr.uri.len, rr->nameaddr.uri.s);
Expand All @@ -702,7 +702,7 @@ int th_unmask_route(sip_msg_t *msg)
if(th_get_uri_param_value(&rr->nameaddr.uri, &th_uparam_name,
&eval)<0 || eval.len<=0)
return -1;

out.s = th_mask_decode(eval.s, eval.len,
&th_uparam_prefix, 0, &out.len);

Expand Down Expand Up @@ -742,7 +742,7 @@ int th_unmask_ruri(sip_msg_t *msg)
/* Do nothing if ruri is not encoded */
if (th_uri_prefix_checks && ((REQ_LINE(msg).uri.len<th_uri_prefix.len) ||
(strncasecmp(REQ_LINE(msg).uri.s, th_uri_prefix.s,
th_uri_prefix.len)!=0)))
th_uri_prefix.len)!=0)))
{
LM_DBG("ruri [%.*s] is not encoded",REQ_LINE(msg).uri.len,REQ_LINE(msg).uri.s);
return 0;
Expand All @@ -751,15 +751,15 @@ int th_unmask_ruri(sip_msg_t *msg)
if(th_get_uri_param_value(&REQ_LINE(msg).uri, &th_uparam_name, &eval)<0
|| eval.len<=0)
return -1;

out.s = th_mask_decode(eval.s, eval.len,
&th_uparam_prefix, 0, &out.len);
if(out.s==NULL)
{
LM_ERR("cannot decode r-uri\n");
return -1;
}

LM_DBG("+decoded: %d: [%.*s]\n", out.len, out.len, out.s);
l=del_lump(msg, REQ_LINE(msg).uri.s-msg->buf, REQ_LINE(msg).uri.len, 0);
if (l==0)
Expand Down Expand Up @@ -941,7 +941,7 @@ int th_add_via_cookie(sip_msg_t *msg, struct via_body *via)
LM_ERR("failed adding cookie to via [%p]\n", via);
return -1;
}

out.len = 1+th_cookie_name.len+1+th_cookie_value.len+1;
out.s = (char*)pkg_malloc(out.len+1);
if(out.s==0)
Expand Down Expand Up @@ -1141,7 +1141,7 @@ int th_route_direction(sip_msg_t *msg)
LM_DBG("no route header - downstream\n");
return 0;
}
if (parse_rr(msg->route) < 0)
if (parse_rr(msg->route) < 0)
{
LM_ERR("failed to parse route header\n");
return -1;
Expand Down

0 comments on commit ee4c2a7

Please sign in to comment.