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 66
 int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info) 
67 67
 {
68 68
 	struct sip_msg* msg;
69
+	int ret;
69 70
 #ifdef STATS
70 71
 	int skipped = 1;
71 72
 	struct timeval tvb, tve;	
... ...
@@ -102,7 +104,11 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
102 102
 	/* if some of the callbacks said not to continue with
103 103
 	   script processing, don't do so
104 104
 	*/
105
-	if (exec_pre_cb(msg)==0) goto error;
105
+	ret=exec_pre_cb(msg);
106
+	if (ret<=0){
107
+		if (ret<0) goto error;
108
+		else goto end; /* drop the message -- no error -- andrei */
109
+	}
106 110
 
107 111
 	/* ... and clear branches from previous message */
108 112
 	clear_branches();
... ...
@@ -170,6 +176,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
170 170
 		DBG("succesfully ran reply processing...(%d usec)\n", diff);
171 171
 #endif
172 172
 	}
173
+end:
173 174
 #ifdef STATS
174 175
 	skipped = 0;
175 176
 #endif