source: trunk/dports/perl/p5-cgi-speedycgi/files/patch-src_speedy_main.c @ 21494

Last change on this file since 21494 was 21494, checked in by eridius@…, 13 years ago

Massive update to svn properties on files:
All patchfiles have svn:eol-style removed.
All files that are not in fact able to be executed have svn:executable removed
All binary files have svn:eol-style removed (and are probably corrupt)
All binary files have svn:mime-type set to application/octet-stream
All files which are not patchfiles or binary files have svn:eol-style set to native
All Portfiles have svn:eol-style set to native and svn:executable removed

File size: 967 bytes
Line 
1--- src/speedy_main.c   2005/08/31 19:56:57     1.1
2+++ src/speedy_main.c   2005/08/31 19:57:42
3@@ -299,6 +299,7 @@
4     /* Copy streams */
5     while (1) {
6        /* Do reads/writes */
7+        int close_stdout_delayed = 0;
8        for (i = 0; i < NUMFDS; ++i) {
9            register CopyBuf *b = cb + i;
10            int do_read  = my_canread(b) &&
11@@ -346,10 +347,17 @@
12                /* Try to close files now, so we can wake up the backend
13                 * and do more I/O before dropping into select
14                 */
15-               if (!do_read && !do_write)
16-                   try_close(b);
17-           }
18-       }
19+               if (!do_read && !do_write) {
20+                    if (i == 1)
21+                        /* delay closing STDOUT until all the other fds are closed */
22+                        close_stdout_delayed = 1;
23+                    else
24+                       try_close(b);
25+                }
26+            }
27+        }
28+        if (close_stdout_delayed)
29+            try_close(cb+1);
30 
31        /* All done with reads/writes after backend exited */
32        if (backend_exited) {
Note: See TracBrowser for help on using the repository browser.