Browse Source

*** empty log message ***

Jan Janak 23 years ago
parent
commit
ccd7433451
6 changed files with 13 additions and 18 deletions
  1. 6 9
      parser/digest/digest.c
  2. 1 3
      parser/digest/digest.h
  3. 1 1
      parser/parse_hname2.h
  4. 1 1
      parser/parse_uri.h
  5. 3 3
      parser/parse_via.h
  6. 1 1
      trim.h

+ 6 - 9
parser/digest/digest.c

@@ -6,7 +6,7 @@
 
 #include "digest.h"
 #include "../../mem/mem.h"  /* pkg_malloc */
-#include "../../dprint.h"
+#include "../../dprint.h"   /* Guess what */
 #include <stdio.h>          /* printf */
 
 
@@ -14,15 +14,8 @@ static inline int new_credentials(struct hdr_field* _h)
 {
 	auth_body_t* b;
 
-	b = (auth_body_t*)(_h->parsed);
-
-	if (b) {
-		DBG("parse_credentials(): Credentials already parsed\n");
-		return -1;
-	}
-
 	b = (auth_body_t*)pkg_malloc(sizeof(auth_body_t));
-	if (!b) {
+	if (b == 0) {
 		LOG(L_ERR, "parse_credentials(): No memory left\n");
 		return -2;
 	}
@@ -42,6 +35,10 @@ int parse_credentials(struct hdr_field* _h)
 {
 	int res;
 
+	if (_h->parsed) {
+		return 0;  /* Already parsed */
+	}
+
 	if (new_credentials(_h) < 0) {
 		LOG(L_ERR, "parse_credentials(): Can't create new credentials\n");
 		return -1;

+ 1 - 3
parser/digest/digest.h

@@ -16,9 +16,7 @@ typedef struct auth_body {
 	     /* This is pointer to header field containing
 	      * parsed authorized digest credentials. This
 	      * pointer is set in sip_msg->{authorization,proxy_auth}
-	      * hooks if the authorized credentials are in another
-	      * header field (a SIP message may contain many digest
-	      * credentials with different realms).
+	      * hooks.
 	      *
 	      * This is necessary for functions called after
 	      * {www,proxy}_authorize, these functions need to know

+ 1 - 1
parser/parse_hname2.h

@@ -20,4 +20,4 @@ char* parse_hname2(char* begin, char* end, struct hdr_field* hdr);
 void init_hfname_parser(void);
 
 
-#endif
+#endif /* PARSE_HNAME2_H */

+ 1 - 1
parser/parse_uri.h

@@ -30,4 +30,4 @@ int parse_uri(char *buf, int len, struct sip_uri* uri);
 
 void free_uri(struct sip_uri* u);
 
-#endif
+#endif /* PARSE_URI_H */

+ 3 - 3
parser/parse_via.h

@@ -2,8 +2,8 @@
  * $Id$
  */
 
-#ifndef PARSE_VIA
-#define PARSE_VIA
+#ifndef PARSE_VIA_H
+#define PARSE_VIA_H
 
 #include "../str.h"
 
@@ -62,4 +62,4 @@ char* parse_via(char* buffer, char* end, struct via_body *vb);
 void free_via_list(struct via_body *vb);
 
 
-#endif
+#endif /* PARSE_VIA_H */

+ 1 - 1
trim.h

@@ -73,4 +73,4 @@ static inline void trim(str* _s)
 }
 
 
-#endif
+#endif /* TRIM_H */