Browse code

*** empty log message ***

Jan Janak authored on 12/08/2002 12:16:46
Showing 6 changed files
... ...
@@ -6,7 +6,7 @@
6 6
 
7 7
 #include "digest.h"
8 8
 #include "../../mem/mem.h"  /* pkg_malloc */
9
-#include "../../dprint.h"
9
+#include "../../dprint.h"   /* Guess what */
10 10
 #include <stdio.h>          /* printf */
11 11
 
12 12
 
... ...
@@ -14,15 +14,8 @@ static inline int new_credentials(struct hdr_field* _h)
14 14
 {
15 15
 	auth_body_t* b;
16 16
 
17
-	b = (auth_body_t*)(_h->parsed);
18
-
19
-	if (b) {
20
-		DBG("parse_credentials(): Credentials already parsed\n");
21
-		return -1;
22
-	}
23
-
24 17
 	b = (auth_body_t*)pkg_malloc(sizeof(auth_body_t));
25
-	if (!b) {
18
+	if (b == 0) {
26 19
 		LOG(L_ERR, "parse_credentials(): No memory left\n");
27 20
 		return -2;
28 21
 	}
... ...
@@ -42,6 +35,10 @@ int parse_credentials(struct hdr_field* _h)
42 42
 {
43 43
 	int res;
44 44
 
45
+	if (_h->parsed) {
46
+		return 0;  /* Already parsed */
47
+	}
48
+
45 49
 	if (new_credentials(_h) < 0) {
46 50
 		LOG(L_ERR, "parse_credentials(): Can't create new credentials\n");
47 51
 		return -1;
... ...
@@ -16,9 +16,7 @@ typedef struct auth_body {
16 16
 	     /* This is pointer to header field containing
17 17
 	      * parsed authorized digest credentials. This
18 18
 	      * pointer is set in sip_msg->{authorization,proxy_auth}
19
-	      * hooks if the authorized credentials are in another
20
-	      * header field (a SIP message may contain many digest
21
-	      * credentials with different realms).
19
+	      * hooks.
22 20
 	      *
23 21
 	      * This is necessary for functions called after
24 22
 	      * {www,proxy}_authorize, these functions need to know
... ...
@@ -20,4 +20,4 @@ char* parse_hname2(char* begin, char* end, struct hdr_field* hdr);
20 20
 void init_hfname_parser(void);
21 21
 
22 22
 
23
-#endif
23
+#endif /* PARSE_HNAME2_H */
... ...
@@ -30,4 +30,4 @@ int parse_uri(char *buf, int len, struct sip_uri* uri);
30 30
 
31 31
 void free_uri(struct sip_uri* u);
32 32
 
33
-#endif
33
+#endif /* PARSE_URI_H */
... ...
@@ -2,8 +2,8 @@
2 2
  * $Id$
3 3
  */
4 4
 
5
-#ifndef PARSE_VIA
6
-#define PARSE_VIA
5
+#ifndef PARSE_VIA_H
6
+#define PARSE_VIA_H
7 7
 
8 8
 #include "../str.h"
9 9
 
... ...
@@ -62,4 +62,4 @@ char* parse_via(char* buffer, char* end, struct via_body *vb);
62 62
 void free_via_list(struct via_body *vb);
63 63
 
64 64
 
65
-#endif
65
+#endif /* PARSE_VIA_H */
... ...
@@ -73,4 +73,4 @@ static inline void trim(str* _s)
73 73
 }
74 74
 
75 75
 
76
-#endif
76
+#endif /* TRIM_H */