~ubuntu-branches/ubuntu/utopic/haproxy/utopic-proposed

« back to all changes in this revision

Viewing changes to debian/patches/closed-fd-remove.patch

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Cornet
  • Date: 2009-02-17 08:55:12 UTC
  • mfrom: (1.1.5 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090217085512-qmij51nun3rbxorz
Fix build without debian/patches directory (Closes: #515682) using
/usr/share/quilt/quilt.make.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
commit 116f4105d4fc6fbd8f2d0a139f691973332176de
2
 
Author: Willy Tarreau <w@1wt.eu>
3
 
Date:   Sat Aug 16 16:06:02 2008 +0200
4
 
 
5
 
    [BUG] ev_sepoll: closed file descriptors could persist in the spec list
6
 
    
7
 
    If __fd_clo() was called on a file descriptor which was previously
8
 
    disabled, it was not removed from the spec list. This apparently
9
 
    could not happen on previous code because the TCP states prevented
10
 
    this, but now it happens regularly. The effects are spec entries
11
 
    stuck populated, leading to busy loops.
12
 
    
13
 
    (cherry picked from commit 7a52a5c4680477272b2f34eaf5896b85746e6fd6)
14
 
 
15
 
diff --git a/src/ev_sepoll.c b/src/ev_sepoll.c
16
 
index 800ac0b..db35423 100644
17
 
--- a/src/ev_sepoll.c
18
 
+++ b/src/ev_sepoll.c
19
 
@@ -279,8 +279,7 @@ REGPRM1 static void __fd_rem(int fd)
20
 
  */
21
 
 REGPRM1 static void __fd_clo(int fd)
22
 
 {
23
 
-       if (fd_list[fd].e & FD_EV_RW_SL)
24
 
-               release_spec_entry(fd);
25
 
+       release_spec_entry(fd);
26
 
        fd_list[fd].e &= ~(FD_EV_MASK);
27
 
 }
28
 
 
29
 
@@ -325,7 +324,7 @@ REGPRM2 static void _do_poll(struct poller *p, struct timeval *exp)
30
 
                fdtab[fd].ev &= FD_POLL_STICKY;
31
 
                if ((eo & FD_EV_MASK_R) == FD_EV_SPEC_R) {
32
 
                        /* The owner is interested in reading from this FD */
33
 
-                       if (fdtab[fd].state != FD_STCLOSE && fdtab[fd].state != FD_STERROR) {
34
 
+                       if (fdtab[fd].state != FD_STERROR) {
35
 
                                /* Pretend there is something to read */
36
 
                                fdtab[fd].ev |= FD_POLL_IN;
37
 
                                if (!fdtab[fd].cb[DIR_RD].f(fd))
38
 
@@ -341,7 +340,7 @@ REGPRM2 static void _do_poll(struct poller *p, struct timeval *exp)
39
 
                
40
 
                if ((eo & FD_EV_MASK_W) == FD_EV_SPEC_W) {
41
 
                        /* The owner is interested in writing to this FD */
42
 
-                       if (fdtab[fd].state != FD_STCLOSE && fdtab[fd].state != FD_STERROR) {
43
 
+                       if (fdtab[fd].state != FD_STERROR) {
44
 
                                /* Pretend there is something to write */
45
 
                                fdtab[fd].ev |= FD_POLL_OUT;
46
 
                                if (!fdtab[fd].cb[DIR_WR].f(fd))