Browse code

- use dedicated function to match header name

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5405 689a6050-402a-0410-94f2-e92a70836424

Daniel-Constantin Mierla authored on 31/12/2008 09:17:34
Showing 3 changed files
... ...
@@ -43,6 +43,7 @@
43 43
 #include "../../parser/parse_content.h" 
44 44
 #include "../../lock_ops.h"
45 45
 #include "../../hash_func.h"
46
+#include "../../cmpapi.h"
46 47
 #include "../../db/db.h"
47 48
 #include "presence.h"
48 49
 #include "notify.h"
... ...
@@ -343,8 +344,7 @@ int handle_publish(struct sip_msg* msg, char* sender_uri, char* str2)
343 343
 	hdr = msg->headers;
344 344
 	while (hdr!= NULL)
345 345
 	{
346
-		if(strncmp(hdr->name.s, "SIP-If-Match",12)==0|| 
347
-				strncmp(hdr->name.s,"Sip-If-Match",12)==0 )
346
+		if(cmp_hdrname_strzn(&hdr->name, "SIP-If-Match", 12)==0)
348 347
 		{
349 348
 			found = 1;
350 349
 			break;
... ...
@@ -31,6 +31,7 @@
31 31
 #include <libxml/parser.h>
32 32
 #include "../../parser/parse_content.h"
33 33
 #include "../../parser/parse_from.h"
34
+#include "../../cmpapi.h"
34 35
 #include "../pua/hash.h"
35 36
 #include "rls.h"
36 37
 #include "notify.h"
... ...
@@ -251,7 +252,7 @@ int rls_handle_notify(struct sip_msg* msg, char* c1, char* c2)
251 251
 	hdr = msg->headers;
252 252
 	while (hdr!= NULL)
253 253
 	{
254
-		if(strncmp(hdr->name.s, "Subscription-State", 18)==0)  
254
+		if(cmp_hdrname_strzn(&hdr->name, "Subscription-State", 18)==0)  
255 255
 		{
256 256
 			found = 1;
257 257
 			break;
... ...
@@ -33,6 +33,7 @@
33 33
 #include "../../ut.h"
34 34
 #include "../../dprint.h"
35 35
 #include "../../data_lump_rpl.h"
36
+#include "../../cmpapi.h"
36 37
 #include "../../parser/msg_parser.h"
37 38
 #include "../../parser/parse_event.h"
38 39
 #include "../../parser/parse_expires.h"
... ...
@@ -488,7 +489,7 @@ int rls_handle_subscribe(struct sip_msg* msg, char* s1, char* s2)
488 488
 	hdr= msg->headers;
489 489
 	while(hdr)
490 490
 	{
491
-		if(strncmp(hdr->name.s, "Support", 7)== 0)
491
+		if(cmp_hdrname_strzn(&hdr->name, "Support", 7)== 0)
492 492
 			break;
493 493
 		hdr= hdr->next;
494 494
 	}