瀏覽代碼

- EINTR handled for tcp write (andrei)

Andrei Pelinescu-Onciul 22 年之前
父節點
當前提交
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
 VERSION = 0
 PATCHLEVEL = 8
 PATCHLEVEL = 8
 SUBLEVEL =   11
 SUBLEVEL =   11
-EXTRAVERSION = pre18
+EXTRAVERSION = pre19
 
 
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")

+ 1 - 1
TODO

@@ -100,7 +100,7 @@ optimizations:
 
 
 tcp stuff:
 tcp stuff:
 x tcp disable nagle 
 x tcp disable nagle 
-- set TOS to minimize delay
+x set TOS to minimize delay
 - tcp locking/atomic ops review
 - tcp locking/atomic ops review
 - tcp fix simultaneous connects (ser process is blocked until connect timeouts
 - tcp fix simultaneous connects (ser process is blocked until connect timeouts
  => possible DOS)
  => 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: after write: c= %p n=%d fd=%d\n",c, n, fd);
 	DBG("tcp_send: buf=\n%.*s\n", (int)len, buf);
 	DBG("tcp_send: buf=\n%.*s\n", (int)len, buf);
 	if (n<0){
 	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",
 		LOG(L_ERR, "ERROR: tcpsend: failed to send, n=%d: %s (%d)\n",
 				n, strerror(errno), errno);
 				n, strerror(errno), errno);
 		/* error on the connection , mark it as bad and set 0 timeout */
 		/* error on the connection , mark it as bad and set 0 timeout */