|
|
b9a4805 |
From: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
b9a4805 |
Date: Fri, 11 Jan 2013 14:32:19 +0400
|
|
|
fa3f242 |
Subject: [PATCH] Don't modify interim return value.
|
|
|
b9a4805 |
|
|
|
b9a4805 |
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
b9a4805 |
|
|
|
b9a4805 |
diff --git a/modules/sipmsgops/codecs.c b/modules/sipmsgops/codecs.c
|
|
|
a0d9bac |
index ac6b14f..274bff7 100644
|
|
|
b9a4805 |
--- a/modules/sipmsgops/codecs.c
|
|
|
b9a4805 |
+++ b/modules/sipmsgops/codecs.c
|
|
|
b9a4805 |
@@ -349,8 +349,6 @@ static int do_for_all_streams(struct sip_msg* msg, str* str1,str * str2,
|
|
|
b9a4805 |
|
|
|
b9a4805 |
}
|
|
|
b9a4805 |
|
|
|
b9a4805 |
- if( rez <0 )
|
|
|
b9a4805 |
- rez = 0;
|
|
|
b9a4805 |
return rez;
|
|
|
b9a4805 |
}
|
|
|
b9a4805 |
|
|
|
a0d9bac |
@@ -688,7 +686,7 @@ int codec_find (struct sip_msg* msg, char* str1 )
|
|
|
b9a4805 |
LM_DBG("searching for codec <%.*s> \n",res.len,res.s);
|
|
|
b9a4805 |
|
|
|
b9a4805 |
if( do_for_all_streams( msg, &res, NULL, NULL,
|
|
|
b9a4805 |
- FIND, DESC_NAME) == 0)
|
|
|
b9a4805 |
+ FIND, DESC_NAME) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
|
|
|
b9a4805 |
return 1;
|
|
|
a0d9bac |
@@ -699,7 +697,7 @@ int codec_find_re (struct sip_msg* msg, char* str1 )
|
|
|
b9a4805 |
{
|
|
|
b9a4805 |
|
|
|
b9a4805 |
if( do_for_all_streams(msg, NULL, NULL, (regex_t*)str1,
|
|
|
b9a4805 |
- FIND, DESC_REGEXP) == 0)
|
|
|
b9a4805 |
+ FIND, DESC_REGEXP) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
|
|
|
b9a4805 |
return 1;
|
|
|
a0d9bac |
@@ -726,7 +724,7 @@ int codec_find_clock (struct sip_msg* msg, char* str1,char * str2 )
|
|
|
b9a4805 |
codec.len,codec.s,clock.len,clock.s);
|
|
|
b9a4805 |
|
|
|
b9a4805 |
if( do_for_all_streams( msg, &codec, &clock, NULL,
|
|
|
b9a4805 |
- FIND, DESC_NAME_AND_CLOCK) == 0)
|
|
|
b9a4805 |
+ FIND, DESC_NAME_AND_CLOCK) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
|
|
|
b9a4805 |
return 1;
|
|
|
a0d9bac |
@@ -746,7 +744,7 @@ int codec_delete (struct sip_msg* msg, char* str1 )
|
|
|
b9a4805 |
LM_DBG("deleting codec <%.*s> \n",res.len,res.s);
|
|
|
b9a4805 |
|
|
|
b9a4805 |
if( do_for_all_streams( msg, &res, NULL, NULL,
|
|
|
b9a4805 |
- DELETE, DESC_NAME) == 0)
|
|
|
b9a4805 |
+ DELETE, DESC_NAME) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
return 1;
|
|
|
b9a4805 |
}
|
|
|
a0d9bac |
@@ -755,7 +753,7 @@ int codec_delete (struct sip_msg* msg, char* str1 )
|
|
|
b9a4805 |
int codec_delete_re (struct sip_msg* msg, char* str1 )
|
|
|
b9a4805 |
{
|
|
|
b9a4805 |
if( do_for_all_streams( msg, NULL, NULL, (regex_t*) str1,
|
|
|
b9a4805 |
- DELETE, DESC_REGEXP) == 0)
|
|
|
b9a4805 |
+ DELETE, DESC_REGEXP) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
return 1;
|
|
|
b9a4805 |
}
|
|
|
a0d9bac |
@@ -764,7 +762,7 @@ int codec_delete_re (struct sip_msg* msg, char* str1 )
|
|
|
b9a4805 |
int codec_delete_except_re (struct sip_msg* msg, char* str1 )
|
|
|
b9a4805 |
{
|
|
|
b9a4805 |
if( do_for_all_streams( msg, NULL, NULL, (regex_t*) str1,
|
|
|
b9a4805 |
- DELETE, DESC_REGEXP_COMPLEMENT) == 0)
|
|
|
b9a4805 |
+ DELETE, DESC_REGEXP_COMPLEMENT) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
return 1;
|
|
|
b9a4805 |
}
|
|
|
a0d9bac |
@@ -790,7 +788,7 @@ int codec_delete_clock (struct sip_msg* msg, char* str1 ,char * str2)
|
|
|
b9a4805 |
codec.len,codec.s,clock.len,clock.s);
|
|
|
b9a4805 |
|
|
|
b9a4805 |
if( do_for_all_streams( msg, &codec, &clock, NULL,
|
|
|
b9a4805 |
- DELETE, DESC_NAME_AND_CLOCK) == 0)
|
|
|
b9a4805 |
+ DELETE, DESC_NAME_AND_CLOCK) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
return 1;
|
|
|
b9a4805 |
}
|
|
|
a0d9bac |
@@ -809,7 +807,7 @@ int codec_move_up (struct sip_msg* msg, char* str1)
|
|
|
b9a4805 |
LM_DBG("moving up codec <%.*s> \n",res.len,res.s);
|
|
|
b9a4805 |
|
|
|
b9a4805 |
if( do_for_all_streams( msg, &res, NULL, NULL,
|
|
|
b9a4805 |
- ADD_TO_FRONT, DESC_NAME) == 0)
|
|
|
b9a4805 |
+ ADD_TO_FRONT, DESC_NAME) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
return 1;
|
|
|
b9a4805 |
}
|
|
|
a0d9bac |
@@ -818,7 +816,7 @@ int codec_move_up (struct sip_msg* msg, char* str1)
|
|
|
b9a4805 |
int codec_move_up_re (struct sip_msg* msg, char* str1)
|
|
|
b9a4805 |
{
|
|
|
b9a4805 |
if( do_for_all_streams( msg, NULL, NULL, (regex_t*)str1,
|
|
|
b9a4805 |
- ADD_TO_FRONT, DESC_REGEXP) == 0)
|
|
|
b9a4805 |
+ ADD_TO_FRONT, DESC_REGEXP) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
return 1;
|
|
|
b9a4805 |
}
|
|
|
a0d9bac |
@@ -844,7 +842,7 @@ int codec_move_up_clock (struct sip_msg* msg, char* str1 ,char * str2)
|
|
|
b9a4805 |
codec.len,codec.s,clock.len,clock.s);
|
|
|
b9a4805 |
|
|
|
b9a4805 |
if( do_for_all_streams( msg, &codec, &clock, NULL,
|
|
|
b9a4805 |
- ADD_TO_FRONT, DESC_NAME_AND_CLOCK) == 0)
|
|
|
b9a4805 |
+ ADD_TO_FRONT, DESC_NAME_AND_CLOCK) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
return 1;
|
|
|
b9a4805 |
}
|
|
|
a0d9bac |
@@ -863,7 +861,7 @@ int codec_move_down (struct sip_msg* msg, char* str1)
|
|
|
b9a4805 |
LM_DBG("moving down codec <%.*s> \n",res.len,res.s);
|
|
|
b9a4805 |
|
|
|
b9a4805 |
if( do_for_all_streams( msg, &res, NULL, NULL,
|
|
|
b9a4805 |
- ADD_TO_BACK, DESC_NAME) == 0)
|
|
|
b9a4805 |
+ ADD_TO_BACK, DESC_NAME) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
return 1;
|
|
|
b9a4805 |
}
|
|
|
a0d9bac |
@@ -872,7 +870,7 @@ int codec_move_down (struct sip_msg* msg, char* str1)
|
|
|
b9a4805 |
int codec_move_down_re (struct sip_msg* msg, char* str1)
|
|
|
b9a4805 |
{
|
|
|
b9a4805 |
if( do_for_all_streams( msg, NULL, NULL, (regex_t*)str1,
|
|
|
b9a4805 |
- ADD_TO_BACK, DESC_REGEXP) == 0)
|
|
|
b9a4805 |
+ ADD_TO_BACK, DESC_REGEXP) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
return 1;
|
|
|
b9a4805 |
}
|
|
|
a0d9bac |
@@ -898,7 +896,7 @@ int codec_move_down_clock (struct sip_msg* msg, char* str1 ,char * str2)
|
|
|
b9a4805 |
codec.len,codec.s,clock.len,clock.s);
|
|
|
b9a4805 |
|
|
|
b9a4805 |
if( do_for_all_streams( msg, &codec, &clock, NULL,
|
|
|
b9a4805 |
- ADD_TO_BACK, DESC_NAME_AND_CLOCK) == 0)
|
|
|
b9a4805 |
+ ADD_TO_BACK, DESC_NAME_AND_CLOCK) <= 0)
|
|
|
b9a4805 |
return -1;
|
|
|
b9a4805 |
return 1;
|
|
|
b9a4805 |
}
|