Browse code

- fixed exec_pre_cb check in receive_msg: when 0 drop w/o error!

Andrei Pelinescu-Onciul authored on 01/08/2003 19:08:22
Showing 2 changed files
... ...
@@ -40,7 +40,7 @@ export makefile_defs
40 40
 VERSION = 0
41 41
 PATCHLEVEL = 8
42 42
 SUBLEVEL =   11
43
-EXTRAVERSION = rc2
43
+EXTRAVERSION = rc3
44 44
 
45 45
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
46 46
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
... ...
@@ -32,6 +32,7 @@
32 32
  * 2003-02-07 undoed jiri's zero term. changes (they break tcp) (andrei)
33 33
  * 2003-02-10 moved zero-term in the calling functions (udp_receive &
34 34
  *            tcp_read_req)
35
+ * 2003-08-01 fixed exec_pre_cb returning 0 (drop, not an error!) (andrei)
35 36
  */
36 37
 
37 38
 
... ...
@@ -66,6 +67,7 @@ unsigned int msg_no=0;
66 67
 int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info) 
67 68
 {
68 69
 	struct sip_msg* msg;
70
+	int ret;
69 71
 #ifdef STATS
70 72
 	int skipped = 1;
71 73
 	struct timeval tvb, tve;	
... ...
@@ -102,7 +104,11 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
102 104
 	/* if some of the callbacks said not to continue with
103 105
 	   script processing, don't do so
104 106
 	*/
105
-	if (exec_pre_cb(msg)==0) goto error;
107
+	ret=exec_pre_cb(msg);
108
+	if (ret<=0){
109
+		if (ret<0) goto error;
110
+		else goto end; /* drop the message -- no error -- andrei */
111
+	}
106 112
 
107 113
 	/* ... and clear branches from previous message */
108 114
 	clear_branches();
... ...
@@ -170,6 +176,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
170 176
 		DBG("succesfully ran reply processing...(%d usec)\n", diff);
171 177
 #endif
172 178
 	}
179
+end:
173 180
 #ifdef STATS
174 181
 	skipped = 0;
175 182
 #endif