2
0
Эх сурвалжийг харах

- EINTR handled for tcp write (andrei)

Andrei Pelinescu-Onciul 22 жил өмнө
parent
commit
4290c43fcc
3 өөрчлөгдсөн 4 нэмэгдсэн , 2 устгасан
  1. 1 1
      Makefile.defs
  2. 1 1
      TODO
  3. 2 0
      tcp_main.c

+ 1 - 1
Makefile.defs

@@ -21,7 +21,7 @@
 VERSION = 0
 PATCHLEVEL = 8
 SUBLEVEL =   11
-EXTRAVERSION = pre18
+EXTRAVERSION = pre19
 
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")

+ 1 - 1
TODO

@@ -100,7 +100,7 @@ optimizations:
 
 tcp stuff:
 x tcp disable nagle 
-- set TOS to minimize delay
+x set TOS to minimize delay
 - tcp locking/atomic ops review
 - tcp fix simultaneous connects (ser process is blocked until connect timeouts
  => possible DOS)

+ 2 - 0
tcp_main.c

@@ -440,6 +440,8 @@ send_it:
 	DBG("tcp_send: after write: c= %p n=%d fd=%d\n",c, n, fd);
 	DBG("tcp_send: buf=\n%.*s\n", (int)len, buf);
 	if (n<0){
+		if (errno==EINTR) goto send_it; /* interrupted write, try again*/
+										/* keep the lock or lock/unlock again?*/
 		LOG(L_ERR, "ERROR: tcpsend: failed to send, n=%d: %s (%d)\n",
 				n, strerror(errno), errno);
 		/* error on the connection , mark it as bad and set 0 timeout */