Procházet zdrojové kódy

- ( "forward" ported from 0.9.0): reverted to the old way of checking
response.dst.send_sock in t_retransmit_reply & reply_light (this fixes some
t_newtran/new retrans. races)

Andrei Pelinescu-Onciul před 20 roky
rodič
revize
4c35b97175
3 změnil soubory, kde provedl 20 přidání a 14 odebrání
  1. 1 1
      Makefile.defs
  2. 0 1
      modules/tm/t_lookup.c
  3. 19 12
      modules/tm/t_reply.c

+ 1 - 1
Makefile.defs

@@ -59,7 +59,7 @@ MAIN_NAME=ser
 VERSION = 0
 PATCHLEVEL = 10
 SUBLEVEL =   99
-EXTRAVERSION = -dev15-tcp
+EXTRAVERSION = -dev16-tcp
 
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")

+ 0 - 1
modules/tm/t_lookup.c

@@ -84,7 +84,6 @@
 #include "defs.h"
 
 
-#include <assert.h>
 #include "../../comp_defs.h"
 #include "../../dprint.h"
 #include "../../config.h"

+ 19 - 12
modules/tm/t_reply.c

@@ -64,10 +64,11 @@
  *  2004-10-01  added a new param.: restart_fr_on_each_reply (andrei)
  *  2005-03-01  force for statefull replies the incoming interface of 
  *              the request (bogdan)
+ *  2005-09-01  reverted to the old way of checking response.dst.send_sock
+ *               in t_retransmit_reply & reply_light (andrei)
  */
 
 
-#include <assert.h>
 
 #include "../../comp_defs.h"
 #include "../../hash_func.h"
@@ -411,16 +412,19 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len,
 	   not yet, don't try to retransmit
 	*/
 	/*
-	   response.dst.send_sock is valid all the time now, as it's taken
-	   from original request -bogdan
+	   response.dst.send_sock might be unset if the process that created
+	   the original transaction has not finished initialising the 
+	   retransmission buffer (see t_newtran/ init_rb).
+	   If reply_to_via is set and via contains a host name (and not an ip)
+	   the chances for this increase a lot.
+	 */
 	if (!trans->uas.response.dst.send_sock) {
 		LOG(L_ERR, "ERROR: _reply_light: no resolved dst to send reply to\n");
 	} else {
-	*/
-	assert(trans->uas.response.dst.send_sock);
-	SEND_PR_BUFFER( rb, buf, len );
-	DBG("DEBUG: reply sent out. buf=%p: %.9s..., shmem=%p: %.9s\n", 
-		buf, buf, rb->buffer, rb->buffer );
+		SEND_PR_BUFFER( rb, buf, len );
+		DBG("DEBUG: reply sent out. buf=%p: %.9s..., shmem=%p: %.9s\n", 
+			buf, buf, rb->buffer, rb->buffer );
+	}
 	pkg_free( buf ) ;
 	DBG("DEBUG: _reply_light: finished\n");
 	return 1;
@@ -870,15 +874,18 @@ int t_retransmit_reply( struct cell *t )
 	/* first check if we managed to resolve topmost Via -- if
 	   not yet, don't try to retransmit
 	*/
-	/* response.dst.send_sock is valid all the time now, as it's taken
-	   from original request -bogdan
+	/*
+	   response.dst.send_sock might be unset if the process that created
+	   the original transaction has not finished initialising the 
+	   retransmission buffer (see t_newtran/ init_rb).
+	   If reply_to_via is set and via contains a host name (and not an ip)
+	   the chances for this increase a lot.
+	 */
 	if (!t->uas.response.dst.send_sock) {
 		LOG(L_WARN, "WARNING: t_retransmit_reply: "
 			"no resolved dst to retransmit\n");
 		return -1;
 	}
-	*/
-	assert(t->uas.response.dst.send_sock);
 
 	/* we need to lock the transaction as messages from
 	   upstream may change it continuously