Browse code

- minor tcp fix: some bug detection code (which should never be triggered) is more robust now

Andrei Pelinescu-Onciul authored on 27/01/2007 08:01:07
Showing 1 changed files
... ...
@@ -787,8 +787,7 @@ get_fd:
787 787
 				goto release_c;
788 788
 			}
789 789
 			DBG("tcp_send, c= %p, n=%d\n", c, n);
790
-			tmp=c;
791
-			n=receive_fd(unix_tcp_sock, &c, sizeof(c), &fd, MSG_WAITALL);
790
+			n=receive_fd(unix_tcp_sock, &tmp, sizeof(tmp), &fd, MSG_WAITALL);
792 791
 			if (n<=0){
793 792
 				LOG(L_ERR, "BUG: tcp_send: failed to get fd(receive_fd):"
794 793
 							" %s (%d)\n", strerror(errno), errno);
... ...
@@ -797,10 +796,10 @@ get_fd:
797 797
 			}
798 798
 			if (c!=tmp){
799 799
 				LOG(L_CRIT, "BUG: tcp_send: get_fd: got different connection:"
800
-						"  %p (id= %d, refcnt=%d state=%d != "
801
-						"  %p (id= %d, refcnt=%d state=%d (n=%d)\n",
800
+						"  %p (id= %d, refcnt=%d state=%d) != "
801
+						"  %p (n=%d)\n",
802 802
 						  c,   c->id,   atomic_get(&c->refcnt),   c->state,
803
-						  tmp, tmp->id, atomic_get(&tmp->refcnt), tmp->state, n
803
+						  tmp, n
804 804
 				   );
805 805
 				n=-1; /* fail */
806 806
 				goto end;