From 58baaa98a86467c085369d898fe910182a228354 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Mon, 13 Aug 2012 14:48:06 -0700 Subject: [PATCH] refresh --- meta | 7 +++--- patches/fork-connect | 55 ++++++++++++++++++-------------------------- patches/refresh-temp | 30 ------------------------ 3 files changed, 25 insertions(+), 67 deletions(-) delete mode 100644 patches/refresh-temp diff --git a/meta b/meta index 1e751056..baad7034 100644 --- a/meta +++ b/meta @@ -1,12 +1,11 @@ Version: 1 -Previous: 7bd5a625ce7ee41fdd43138a19bc342d4778792c -Head: 9800a8c1c11466127a93b2b6ee60ba74e08d946f +Previous: 966b1635ddb88accb66c6e9265b47488e5011df5 +Head: 1bd37069db8ad3555c9fd59b2bb956f95eba066e Applied: real-close: 3409f8d6af187d25c63a5d1f8ee8bff5f14555e2 dup2: ca5813e7cf95dee5933fc417e4a34d26f2b01824 oobinline: ac51c1095f505373a6ec54b8f1d990259fb34d97 - fork-connect: b8fc073e29458b3df2dd57d4f3284a9392575479 - refresh-temp: 9800a8c1c11466127a93b2b6ee60ba74e08d946f + fork-connect: 1bd37069db8ad3555c9fd59b2bb956f95eba066e Unapplied: dbg-out: 04273ee712db4d53efb390462c1b738bb54a57df fstat: a62c653906870422edef5f6388dac9f76c953e35 diff --git a/patches/fork-connect b/patches/fork-connect index aea92bc6..46f17468 100644 --- a/patches/fork-connect +++ b/patches/fork-connect @@ -1,5 +1,5 @@ Bottom: 3ea2748a5c41b11a2e7033c56bddd938d2770b6c -Top: b325ccfd975dd153285cfe5ba9f66efd16427780 +Top: 3513087cec3ea33b2826cc40e6f7fcdcafbab00c Author: Sean Hefty Date: 2012-08-10 21:44:39 -0700 @@ -28,7 +28,7 @@ Signed-off-by: Sean Hefty --- diff --git a/src/preload.c b/src/preload.c -index b18d310..2b115d3 100644 +index b18d310..76c473b 100644 --- a/src/preload.c +++ b/src/preload.c @@ -99,12 +99,20 @@ static int fork_support; @@ -132,32 +132,32 @@ index b18d310..2b115d3 100644 - type = fd_get(socket, &fd); - if (type == fd_rsocket || type == fd_fork) { + if (fd_get(socket, &fd) == fd_rsocket) { -+ index = fd_open(); -+ if (index < 0) -+ return index; -+ -+ ret = raccept(fd, addr, addrlen); -+ if (ret < 0) { -+ fd_close(index, &fd); -+ return ret; -+ } -+ -+ fd_store(index, ret, fd_rsocket, fd_ready); -+ return index; -+ } else if (fd_gets(socket) == fd_fork_listen) { index = fd_open(); if (index < 0) return index; - ret = (type == fd_rsocket) ? raccept(fd, addr, addrlen) : - real.accept(fd, addr, addrlen); -+ ret = real.accept(fd, addr, addrlen); ++ ret = raccept(fd, addr, addrlen); if (ret < 0) { fd_close(index, &fd); return ret; } - fd_store(index, ret, type); ++ fd_store(index, ret, fd_rsocket, fd_ready); ++ return index; ++ } else if (fd_gets(socket) == fd_fork_listen) { ++ index = fd_open(); ++ if (index < 0) ++ return index; ++ ++ ret = real.accept(fd, addr, addrlen); ++ if (ret < 0) { ++ fd_close(index, &fd); ++ return ret; ++ } ++ + fd_store(index, ret, fd_normal, fd_fork_passive); return index; } else { @@ -211,13 +211,13 @@ index b18d310..2b115d3 100644 + real.fcntl(sfd, F_SETFL, flags); + if ((ret != sizeof msg) || msg) + goto err2; - -- real.close(fd); -- return rconnect(ret, addr, addrlen); ++ + ret = rconnect(ret, &addr, len); + if (ret) + goto err2; -+ + +- real.close(fd); +- return rconnect(ret, addr, addrlen); + set_rsocket_options(dfd); + copysockopts(dfd, sfd, &rs, &real); + real.shutdown(sfd, SHUT_RDWR); @@ -250,15 +250,6 @@ index b18d310..2b115d3 100644 goto sclose; } -@@ -527,7 +574,7 @@ static void fork_passive(int socket) - goto lclose; - - msg = 0; -- len = real.write(sfd, &msg, sizeof msg); -+ len = real.write(sfd, &msg, sizeof msgs); - if (len != sizeof msg) - goto lclose; - @@ -537,14 +584,11 @@ static void fork_passive(int socket) goto lclose; } @@ -296,11 +287,9 @@ index b18d310..2b115d3 100644 *fd = fdi->fd; return fdi->type; -@@ -576,11 +622,9 @@ static inline enum fd_type fd_fork_get(int index, int *fd) - int connect(int socket, const struct sockaddr *addr, socklen_t addrlen) +@@ -577,10 +623,7 @@ int connect(int socket, const struct sockaddr *addr, socklen_t addrlen) { int fd, ret; -+ long flags; - switch (fd_get(socket, &fd)) { - case fd_fork: @@ -310,7 +299,7 @@ index b18d310..2b115d3 100644 ret = rconnect(fd, addr, addrlen); if (!ret || errno == EINPROGRESS) return ret; -@@ -591,9 +635,8 @@ int connect(int socket, const struct sockaddr *addr, socklen_t addrlen) +@@ -591,9 +634,8 @@ int connect(int socket, const struct sockaddr *addr, socklen_t addrlen) rclose(fd); fd = ret; diff --git a/patches/refresh-temp b/patches/refresh-temp deleted file mode 100644 index bc4102e0..00000000 --- a/patches/refresh-temp +++ /dev/null @@ -1,30 +0,0 @@ -Bottom: b325ccfd975dd153285cfe5ba9f66efd16427780 -Top: 3513087cec3ea33b2826cc40e6f7fcdcafbab00c -Author: Sean Hefty -Date: 2012-08-13 14:48:06 -0700 - -Refresh of fork-connect - ---- - -diff --git a/src/preload.c b/src/preload.c -index 2b115d3..76c473b 100644 ---- a/src/preload.c -+++ b/src/preload.c -@@ -574,7 +574,7 @@ static void fork_passive(int socket) - goto lclose; - - msg = 0; -- len = real.write(sfd, &msg, sizeof msgs); -+ len = real.write(sfd, &msg, sizeof msg); - if (len != sizeof msg) - goto lclose; - -@@ -622,7 +622,6 @@ static inline enum fd_type fd_fork_get(int index, int *fd) - int connect(int socket, const struct sockaddr *addr, socklen_t addrlen) - { - int fd, ret; -- long flags; - - if (fd_get(socket, &fd) == fd_rsocket) { - ret = rconnect(fd, addr, addrlen); -- 2.41.0