summaryrefslogtreecommitdiff
path: root/net/sipsak/patches/patch-aa
blob: a418eda77e87ad41b7f4ae357eea3e1ea8d3f876 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
$NetBSD: patch-aa,v 1.1.1.1 2005/08/11 17:58:33 drochner Exp $

--- shoot.c.orig	2005-07-29 01:04:15.000000000 +0200
+++ shoot.c
@@ -340,7 +340,7 @@ int recv_message(char *buf, int size) {
 #endif
 	*(buf+ ret) = '\0';
 	if (ret > 0) {
-		if (!inv_trans && (regexec(&proexp, rec, 0, 0, 0) != REG_NOERROR)) {
+		if (!inv_trans && (regexec(&proexp, rec, 0, 0, 0) != 0)) {
 			retryAfter = SIP_T1;
 		}
 		/* store the biggest delay if one occured */
@@ -407,7 +407,7 @@ void handle_3xx(struct sockaddr_in *tadr
 	/* we'll try to handle 301 and 302 here, other 3xx are to complex */
 	regcomp(&redexp, "^SIP/[0-9]\\.[0-9] 30[125] ", 
 			REG_EXTENDED|REG_NOSUB|REG_ICASE);
-	if (regexec(&redexp, rec, 0, 0, 0) == REG_NOERROR) {
+	if (regexec(&redexp, rec, 0, 0, 0) == 0) {
 		/* try to find the contact in the redirect */
 		contact = uri_from_contact(rec);
 		if (contact==NULL) {
@@ -451,7 +451,7 @@ void trace_reply()
 {
 	char *contact;
 
-	if (regexec(&tmhexp, rec, 0, 0, 0) == REG_NOERROR) {
+	if (regexec(&tmhexp, rec, 0, 0, 0) == 0) {
 		/* we received 483 to many hops */
 		printf("%i: ", namebeg);
 		if (verbose > 2) {
@@ -470,7 +470,7 @@ void trace_reply()
 		set_maxforw(req, namebeg);
 		return;
 	}
-	else if (regexec(&proexp, rec, 0, 0, 0) == REG_NOERROR) {
+	else if (regexec(&proexp, rec, 0, 0, 0) == 0) {
 		/* we received a provisional response */
 		printf("%i: ", namebeg);
 		if (verbose > 2) {
@@ -504,7 +504,7 @@ void trace_reply()
 		else {
 			printf("\twithout Contact header\n");
 		}
-		if (regexec(&okexp, rec, 0, 0, 0) == REG_NOERROR)
+		if (regexec(&okexp, rec, 0, 0, 0) == 0)
 			on_success(rec);
 		else
 			exit_code(1);
@@ -516,7 +516,7 @@ void handle_default()
 {
 	/* in the normal send and reply case anything other 
 	   then 1xx will be treated as final response*/
-	if (regexec(&proexp, rec, 0, 0, 0) == REG_NOERROR) {
+	if (regexec(&proexp, rec, 0, 0, 0) == 0) {
 		if (verbose > 1) {
 			printf("%s\n\n", rec);
 			printf("** reply received ");
@@ -564,7 +564,7 @@ void handle_default()
 		else if (timing) {
 			printf("%.3f ms\n", deltaT(&firstsendt, &recvtime));
 		}
-		if (regexec(&okexp, rec, 0, 0, 0) == REG_NOERROR) {
+		if (regexec(&okexp, rec, 0, 0, 0) == 0) {
 			on_success(rec);
 		}
 		else {
@@ -578,7 +578,7 @@ void handle_randtrash()
 {
 	/* in randomzing trash we are expexting 4?? error codes
 	   everything else should not be normal */
-	if (regexec(&errexp, rec, 0, 0, 0) == REG_NOERROR) {
+	if (regexec(&errexp, rec, 0, 0, 0) == 0) {
 		if (verbose > 2)
 			printf("received:\n%s\n", rec);
 		if (verbose > 1) {
@@ -620,7 +620,7 @@ void handle_usrloc()
 	char *crlf;
 	char ruri[11+12+20]; //FIXME: username length 20 should be dynamic
 
-	if (regexec(&proexp, rec, 0, 0, 0) == REG_NOERROR) {
+	if (regexec(&proexp, rec, 0, 0, 0) == 0) {
 		if (verbose > 2) {
 			print_message_line(rec);
 			printf("ignoring provisional response\n\n");
@@ -638,7 +638,7 @@ void handle_usrloc()
 			case REG_REP:
 				/* we have sent a register and look 
 				   at the response now */
-				if (regexec(&okexp, rec, 0, 0, 0) == REG_NOERROR) {
+				if (regexec(&okexp, rec, 0, 0, 0) == 0) {
 					if (verbose > 1) {
 						printf ("\tOK\n");
 					}
@@ -748,7 +748,7 @@ void handle_usrloc()
 					dontsend=1;
 					return;
 				}
-				if (regexec(&okexp, rec, 0, 0, 0) == REG_NOERROR) {
+				if (regexec(&okexp, rec, 0, 0, 0) == 0) {
 					if (verbose > 1) {
 						printf("\t200 OK received\n");
 					}
@@ -891,7 +891,7 @@ void handle_usrloc()
 					dontsend=1;
 					return;
 				}
-				if (regexec(&okexp, rec, 0, 0, 0) == REG_NOERROR) {
+				if (regexec(&okexp, rec, 0, 0, 0) == 0) {
 					if (verbose > 1) {
 						printf("  reply received\n\n");
 					}
@@ -986,7 +986,7 @@ void handle_usrloc()
 					dontsend=1;
 					return;
 				}
-				if (regexec(&okexp, rec, 0, 0, 0) == REG_NOERROR) {
+				if (regexec(&okexp, rec, 0, 0, 0) == 0) {
 					if (verbose > 1) {
 						printf("   OK\n\n");
 					}
@@ -1313,7 +1313,7 @@ void shoot(char *buf, int buff_size)
 				}
 				/* send ACK for non-provisional reply on INVITE */
 				if ((STRNCASECMP(req, "INVITE", 6)==0) && 
-						(regexec(&replyexp, rec, 0, 0, 0) == REG_NOERROR) && 
+						(regexec(&replyexp, rec, 0, 0, 0) == 0) && 
 						(regexec(&proexp, rec, 0, 0, 0) == REG_NOMATCH)) { 
 					build_ack(req, rec);
 					dontsend = 0;
@@ -1331,7 +1331,7 @@ void shoot(char *buf, int buff_size)
 					dontsend = 1;
 					continue;
 					}
-				else if (regexec(&authexp, rec, 0, 0, 0) == REG_NOERROR) {
+				else if (regexec(&authexp, rec, 0, 0, 0) == 0) {
 					if (!username) {
 						printf("%s\nerror: received 401 but cannot "
 							"authentication without a username\n", rec);
@@ -1346,7 +1346,7 @@ void shoot(char *buf, int buff_size)
 					continue;
 				} /* if auth...*/
 				/* lets see if received a redirect */
-				if (redirects == 1 && regexec(&redexp, rec, 0, 0, 0) == REG_NOERROR) {
+				if (redirects == 1 && regexec(&redexp, rec, 0, 0, 0) == 0) {
 					handle_3xx(&addr);
 				} /* if redircts... */
 				else if (trace == 1) {