View | Details | Raw Unified | Return to bug 29159
Collapse All | Expand All

(-)mod_fastcgi/CHANGES (+33 lines)
Lines 1-3 Link Here
1
2.4.7
2
3
 *) *nix: On graceful restart, send SIGTERM, then wait 2sec before 
4
    removing any unix domain sockets.  Based on a patch by Bernd Wurst.
5
 
6
 *) Fix uid_t/gid_t compiler warnings.  [Artur Zaprzala <arturz ownmail.net>]
7
8
 *) A few more EINTR fixes. [Artur Zaprzala <arturz ownmail.net>]
9
10
 *) Don't let the Content-Length header propagate on errors or across
11
    redirects.  [Artur Zaprzala <arturz ownmail.net>]
12
13
 *) Fix pass-header handling (prefix with HTTP_).  Based on a patch by 
14
    [Christian Seiler <chris_se gmx.net>]
15
16
 *) Add an EOS bucket to the output filter chain.  Based on a patch by
17
    [Philipp Dunkel <p.dunkel i5invest.com>]
18
    
19
 *) Handle EINTR and EAGAIN in places AIX stress testing revealed 
20
    issues.  Based on a patch by [Rainer Jung <rainer.jung kippdata.de>]
21
22
 *) Fix process spawning on WIN under Apache 2.2.9 (an incompatible
23
    change was introduced in APR 1.3).  Patch by 
24
    [Tom Donovan <Tom tomdonovan.net>]
25
26
 *) Allow duplicate Status, Location and ContentType headers
27
    (consistent with mod_cgi).  Based on a patch by 
28
    [Christian Seiler <chris_se gmx.net>]
29
30
 *) Fix a spurious idle timeout error that occurred under unique 
31
    application timing and response size conditions.  Based on a 
32
    report and patch by [Joe Strout <joe strout.net>]
33
1
2.4.6
34
2.4.6
2
35
3
 *) Fix a bug I introduced in 2.4.4 that broke dynamic application
36
 *) Fix a bug I introduced in 2.4.4 that broke dynamic application
(-)mod_fastcgi/docs/mod_fastcgi.html (-7 / +7 lines)
Lines 1-6 Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2
<HTML>
2
<HTML>
3
    <!-- $Id: mod_fastcgi.html,v 1.37 2007/10/29 00:21:59 robs Exp $ -->
3
    <!-- $Id: mod_fastcgi.html,v 1.39 2008/09/22 00:28:56 robs Exp $ -->
4
    <HEAD>
4
    <HEAD>
5
        <TITLE>
5
        <TITLE>
6
            Apache module mod_fastcgi
6
            Apache module mod_fastcgi
Lines 391-399 Link Here
391
                <CODE><STRONG>-pass-header <EM>header</EM></STRONG> (none)</CODE>
391
                <CODE><STRONG>-pass-header <EM>header</EM></STRONG> (none)</CODE>
392
            </DT>
392
            </DT>
393
            <DD>
393
            <DD>
394
                The name of an HTTP Request Header to be passed in the <EM>request</EM> environment. This option makes
394
                The name of a Request Header to be passed in the <EM>request</EM> environment. This option makes
395
                available the contents of headers which are normally not available (e.g. Authorization) to a CGI
395
                available the contents of headers which are normally not available (e.g. Authorization) to a CGI
396
                environment.
396
                environment.  The passed header names are prefixed with "HTTP_" IAW the CGI specification.
397
            </DD>
397
            </DD>
398
            <DT>
398
            <DT>
399
                <CODE><STRONG>-port <EM>n</EM></STRONG> (none)</CODE>
399
                <CODE><STRONG>-port <EM>n</EM></STRONG> (none)</CODE>
Lines 623-631 Link Here
623
                <CODE><STRONG>-pass-header <EM>header</EM></STRONG> (none)</CODE>
623
                <CODE><STRONG>-pass-header <EM>header</EM></STRONG> (none)</CODE>
624
            </DT>
624
            </DT>
625
            <DD>
625
            <DD>
626
                The name of an HTTP Request Header to be passed in the <EM>request</EM> environment. This option makes
626
                The name of a Request Header to be passed in the <EM>request</EM> environment. This option makes
627
                available the contents of headers which are normally not available (e.g. Authorization) to a CGI
627
                available the contents of headers which are normally not available (e.g. Authorization) to a CGI
628
                environment.
628
                environment.  The passed header names are prefixed with "HTTP_" IAW the CGI specification.
629
            </DD>
629
            </DD>
630
            <DT>
630
            <DT>
631
                <CODE><STRONG>-priority <EM>n</EM></STRONG> (0)</CODE>
631
                <CODE><STRONG>-priority <EM>n</EM></STRONG> (0)</CODE>
Lines 803-811 Link Here
803
                <CODE><STRONG>-pass-header <EM>header</EM></STRONG> (none)</CODE>
803
                <CODE><STRONG>-pass-header <EM>header</EM></STRONG> (none)</CODE>
804
            </DT>
804
            </DT>
805
            <DD>
805
            <DD>
806
                The name of an HTTP Request Header to be passed in the <EM>request</EM> environment. This option makes
806
                The name of a Request Header to be passed in the <EM>request</EM> environment. This option makes
807
                available the contents of headers which are normally not available (e.g. Authorization) to a CGI
807
                available the contents of headers which are normally not available (e.g. Authorization) to a CGI
808
                environment.
808
                environment.  The passed header names are prefixed with "HTTP_" IAW the CGI specification.
809
            </DD>
809
            </DD>
810
            <DT>
810
            <DT>
811
                <CODE><STRONG>-socket <EM>filename</EM></STRONG> (none)</CODE>
811
                <CODE><STRONG>-socket <EM>filename</EM></STRONG> (none)</CODE>
(-)mod_fastcgi/fcgi_config.c (-5 / +5 lines)
Lines 1-5 Link Here
1
/*
1
/*
2
 * $Id: fcgi_config.c,v 1.53 2007/10/29 00:22:00 robs Exp $
2
 * $Id: fcgi_config.c,v 1.54 2009/09/28 12:33:14 robs Exp $
3
 */
3
 */
4
4
5
#define CORE_PRIVATE
5
#define CORE_PRIVATE
Lines 766-777 Link Here
766
    {
766
    {
767
        if (s->group == NULL)
767
        if (s->group == NULL)
768
        {
768
        {
769
            s->group = ap_psprintf(tp, "#%ld", fcgi_util_get_server_gid(cmd->server));
769
            s->group = ap_psprintf(tp, "#%ld", (long) fcgi_util_get_server_gid(cmd->server));
770
        }
770
        }
771
771
772
        if (s->user == NULL)
772
        if (s->user == NULL)
773
        {
773
        {
774
            s->user = ap_psprintf(p, "#%ld", fcgi_util_get_server_uid(cmd->server)); 
774
            s->user = ap_psprintf(p, "#%ld", (long) fcgi_util_get_server_uid(cmd->server)); 
775
        }
775
        }
776
776
777
        s->uid = ap_uname2id(s->user);
777
        s->uid = ap_uname2id(s->user);
Lines 959-970 Link Here
959
    {
959
    {
960
        if (s->group == NULL)
960
        if (s->group == NULL)
961
        {
961
        {
962
            s->group = ap_psprintf(tp, "#%ld", fcgi_util_get_server_gid(cmd->server));
962
            s->group = ap_psprintf(tp, "#%ld", (long) fcgi_util_get_server_gid(cmd->server));
963
        }
963
        }
964
964
965
        if (s->user == NULL)
965
        if (s->user == NULL)
966
        {
966
        {
967
            s->user = ap_psprintf(p, "#%ld", fcgi_util_get_server_uid(cmd->server));
967
            s->user = ap_psprintf(p, "#%ld", (long) fcgi_util_get_server_uid(cmd->server));
968
        }
968
        }
969
969
970
        s->uid = ap_uname2id(s->user);
970
        s->uid = ap_uname2id(s->user);
(-)mod_fastcgi/fcgi.h (-1 / +3 lines)
Lines 1-5 Link Here
1
/*
1
/*
2
 * $Id: fcgi.h,v 1.47 2007/09/23 16:33:29 robs Exp $
2
 * $Id: fcgi.h,v 1.48 2008/09/22 10:36:06 robs Exp $
3
 */
3
 */
4
4
5
#ifndef FCGI_H
5
#ifndef FCGI_H
Lines 81-86 Link Here
81
#define ap_copy_table apr_table_copy
81
#define ap_copy_table apr_table_copy
82
#define ap_cpystrn apr_cpystrn
82
#define ap_cpystrn apr_cpystrn
83
#define ap_destroy_pool apr_pool_destroy
83
#define ap_destroy_pool apr_pool_destroy
84
#define ap_isalnum apr_isalnum
84
#define ap_isspace apr_isspace
85
#define ap_isspace apr_isspace
85
#define ap_make_array apr_array_make
86
#define ap_make_array apr_array_make
86
#define ap_make_table apr_table_make
87
#define ap_make_table apr_table_make
Lines 100-105 Link Here
100
#define ap_table_set apr_table_set
101
#define ap_table_set apr_table_set
101
#define ap_table_setn apr_table_setn
102
#define ap_table_setn apr_table_setn
102
#define ap_table_unset apr_table_unset
103
#define ap_table_unset apr_table_unset
104
#define ap_toupper apr_toupper
103
105
104
#endif /* defined(ap_copy_table) */
106
#endif /* defined(ap_copy_table) */
105
107
(-)mod_fastcgi/fcgi_pm.c (-8 / +39 lines)
Lines 1-5 Link Here
1
/*
1
/*
2
 * $Id: fcgi_pm.c,v 1.93 2004/04/15 02:01:26 robs Exp $
2
 * $Id: fcgi_pm.c,v 1.96 2009/09/29 00:34:10 robs Exp $
3
 */
3
 */
4
4
5
5
Lines 32-37 Link Here
32
#ifdef WIN32
32
#ifdef WIN32
33
#ifdef APACHE2
33
#ifdef APACHE2
34
#include "mod_cgi.h"
34
#include "mod_cgi.h"
35
#include "apr_version.h"
35
#endif
36
#endif
36
#pragma warning ( disable : 4100 4102 )
37
#pragma warning ( disable : 4100 4102 )
37
static BOOL bTimeToDie = FALSE;  /* process termination flag */
38
static BOOL bTimeToDie = FALSE;  /* process termination flag */
Lines 129-135 Link Here
129
            ? dynamicMaxClassProcs
130
            ? dynamicMaxClassProcs
130
            : s->numProcesses;
131
            : s->numProcesses;
131
        
132
        
133
        /* Send TERM to all processes */
134
        for (i = 0; i < numChildren; i++, proc++) 
135
        {
136
            if (proc->state == FCGI_RUNNING_STATE) 
137
            {
138
                fcgi_kill(proc, SIGTERM);
139
            }
140
        }
141
142
        s = s->next;
143
    }
144
132
#ifndef WIN32
145
#ifndef WIN32
146
    
147
    s = fcgi_servers;
148
    while (s) 
149
    {
150
    	if (s->socket_path != NULL && s->directive != APP_CLASS_EXTERNAL) 
151
    	{
152
    	    struct timeval tv;
153
    	    
154
    	    /* sleep two seconds to let the children terminate themselves */
155
    	    tv.tv_sec = 2;
156
    	    tv.tv_usec = 0;
157
    	    ap_select(0, NULL, NULL, NULL, &tv);
158
    	    
159
    	    while (s) 
160
    	    {
133
        if (s->socket_path != NULL && s->directive != APP_CLASS_EXTERNAL) 
161
        if (s->socket_path != NULL && s->directive != APP_CLASS_EXTERNAL) 
134
        {
162
        {
135
            /* Remove the socket file */
163
            /* Remove the socket file */
Lines 140-159 Link Here
140
                    (s->directive == APP_CLASS_DYNAMIC) ? " (dynamic)" : "", s->fs_path);
168
                    (s->directive == APP_CLASS_DYNAMIC) ? " (dynamic)" : "", s->fs_path);
141
            }
169
            }
142
        }
170
        }
143
#endif
144
171
145
        /* Send TERM to all processes */
172
    	        s = s->next;
146
        for (i = 0; i < numChildren; i++, proc++) 
147
        {
148
            if (proc->state == FCGI_RUNNING_STATE) 
149
            {
150
                fcgi_kill(proc, SIGTERM);
151
            }
173
            }
174
    	    
175
    	    break;
152
        }
176
        }
153
        
177
        
154
        s = s->next;
178
        s = s->next;
155
    }
179
    }
156
180
181
#endif
182
157
#if defined(WIN32) && (WIN32_SHUTDOWN_GRACEFUL_WAIT > 0)
183
#if defined(WIN32) && (WIN32_SHUTDOWN_GRACEFUL_WAIT > 0)
158
184
159
    /*
185
    /*
Lines 559-564 Link Here
559
    if (apr_os_file_put(&file, &listen_handle, 0, tp))
585
    if (apr_os_file_put(&file, &listen_handle, 0, tp))
560
        goto CLEANUP;
586
        goto CLEANUP;
561
587
588
#if (APR_MAJOR_VERSION >= 1) && (APR_MINOR_VERSION >= 3)
589
    if (apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_NO_FILE, APR_NO_FILE))
590
        goto CLEANUP;
591
#endif    
592
    
562
    /* procattr is opaque so we have to use this - unfortuantely it dups */
593
    /* procattr is opaque so we have to use this - unfortuantely it dups */
563
    if (apr_procattr_child_in_set(procattr, file, NULL))
594
    if (apr_procattr_child_in_set(procattr, file, NULL))
564
        goto CLEANUP; 
595
        goto CLEANUP; 
(-)mod_fastcgi/fcgi_protocol.c (-2 / +32 lines)
Lines 1-5 Link Here
1
/*
1
/*
2
 * $Id: fcgi_protocol.c,v 1.25 2003/02/03 22:59:01 robs Exp $
2
 * $Id: fcgi_protocol.c,v 1.27 2008/09/23 14:48:13 robs Exp $
3
 */
3
 */
4
4
5
#include "fcgi.h"
5
#include "fcgi.h"
Lines 169-174 Link Here
169
    }
169
    }
170
}
170
}
171
171
172
/* copied from util_script.c */
173
static char *http2env(pool *a, const char *w)
174
{
175
    char *res = (char *) ap_palloc(a, sizeof("HTTP_") + strlen(w));
176
    char *cp = res;
177
    char c;
178
179
    *cp++ = 'H';
180
    *cp++ = 'T';
181
    *cp++ = 'T';
182
    *cp++ = 'P';
183
    *cp++ = '_';
184
185
    while ((c = *w++) != 0) {
186
        if (!ap_isalnum(c)) {
187
            *cp++ = '_';
188
        }
189
        else {
190
            *cp++ = (char) ap_toupper(c);
191
        }
192
    }
193
    *cp = 0;
194
195
    return res;
196
}
197
172
static void add_pass_header_vars(fcgi_request *fr)
198
static void add_pass_header_vars(fcgi_request *fr)
173
{
199
{
174
    const array_header *ph = fr->dynamic ? dynamic_pass_headers : fr->fs->pass_headers;
200
    const array_header *ph = fr->dynamic ? dynamic_pass_headers : fr->fs->pass_headers;
Lines 180-186 Link Here
180
        for ( ; i; --i, ++elt) {
206
        for ( ; i; --i, ++elt) {
181
            const char *val = ap_table_get(fr->r->headers_in, *elt);
207
            const char *val = ap_table_get(fr->r->headers_in, *elt);
182
            if (val) {
208
            if (val) {
183
                ap_table_setn(fr->r->subprocess_env, *elt, val);
209
            	const char *key = *elt;
210
#ifndef USE_BROKEN_PASS_HEADER
211
            	key = http2env(fr->r->pool, key);
212
#endif            	
213
                ap_table_setn(fr->r->subprocess_env, key, val);
184
            }
214
            }
185
        }
215
        }
186
    }
216
    }
(-)mod_fastcgi/mod_fastcgi.c (-24 / +66 lines)
Lines 3-9 Link Here
3
 *
3
 *
4
 *      Apache server module for FastCGI.
4
 *      Apache server module for FastCGI.
5
 *
5
 *
6
 *  $Id: mod_fastcgi.c,v 1.162 2007/11/12 23:00:10 robs Exp $
6
 *  $Id: mod_fastcgi.c,v 1.169 2008/11/09 14:31:03 robs Exp $
7
 *
7
 *
8
 *  Copyright (c) 1995-1996 Open Market, Inc.
8
 *  Copyright (c) 1995-1996 Open Market, Inc.
9
 *
9
 *
Lines 647-653 Link Here
647
{
647
{
648
    char *p, *next, *name, *value;
648
    char *p, *next, *name, *value;
649
    int len, flag;
649
    int len, flag;
650
    int hasContentType, hasStatus, hasLocation;
650
    int hasLocation = FALSE;
651
651
652
    ASSERT(fr->parseHeader == SCAN_CGI_READING_HEADERS);
652
    ASSERT(fr->parseHeader == SCAN_CGI_READING_HEADERS);
653
653
Lines 689-695 Link Here
689
     * Parse all the headers.
689
     * Parse all the headers.
690
     */
690
     */
691
    fr->parseHeader = SCAN_CGI_FINISHED;
691
    fr->parseHeader = SCAN_CGI_FINISHED;
692
    hasContentType = hasStatus = hasLocation = FALSE;
693
    next = (char *)fr->header->elts;
692
    next = (char *)fr->header->elts;
694
    for(;;) {
693
    for(;;) {
695
        next = get_header_line(name = next, TRUE);
694
        next = get_header_line(name = next, TRUE);
Lines 718-731 Link Here
718
        if (strcasecmp(name, "Status") == 0) {
717
        if (strcasecmp(name, "Status") == 0) {
719
            int statusValue = strtol(value, NULL, 10);
718
            int statusValue = strtol(value, NULL, 10);
720
719
721
            if (hasStatus) {
722
                goto DuplicateNotAllowed;
723
            }
724
            if (statusValue < 0) {
720
            if (statusValue < 0) {
725
                fr->parseHeader = SCAN_CGI_BAD_HEADER;
721
                fr->parseHeader = SCAN_CGI_BAD_HEADER;
726
                return ap_psprintf(r->pool, "invalid Status '%s'", value);
722
                return ap_psprintf(r->pool, "invalid Status '%s'", value);
727
            }
723
            }
728
            hasStatus = TRUE;
729
            r->status = statusValue;
724
            r->status = statusValue;
730
            r->status_line = ap_pstrdup(r->pool, value);
725
            r->status_line = ap_pstrdup(r->pool, value);
731
            continue;
726
            continue;
Lines 733-742 Link Here
733
728
734
        if (fr->role == FCGI_RESPONDER) {
729
        if (fr->role == FCGI_RESPONDER) {
735
            if (strcasecmp(name, "Content-type") == 0) {
730
            if (strcasecmp(name, "Content-type") == 0) {
736
                if (hasContentType) {
737
                    goto DuplicateNotAllowed;
738
                }
739
                hasContentType = TRUE;
740
#ifdef APACHE2                
731
#ifdef APACHE2                
741
                ap_set_content_type(r, value);
732
                ap_set_content_type(r, value);
742
#else
733
#else
Lines 745-756 Link Here
745
                continue;
736
                continue;
746
            }
737
            }
747
738
739
            /* 
740
             * Special case headers that should not persist on error 
741
             * or across redirects, i.e. use headers_out rather than
742
             * err_headers_out.
743
             */
744
748
            if (strcasecmp(name, "Location") == 0) {
745
            if (strcasecmp(name, "Location") == 0) {
749
                if (hasLocation) {
750
                    goto DuplicateNotAllowed;
751
                }
752
                hasLocation = TRUE;
746
                hasLocation = TRUE;
753
                ap_table_set(r->headers_out, "Location", value);
747
                ap_table_set(r->headers_out, name, value);
748
                continue;
749
            }
750
            
751
            if (strcasecmp(name, "Content-Length") == 0) {
752
                ap_table_set(r->headers_out, name, value);
754
                continue;
753
                continue;
755
            }
754
            }
756
755
Lines 841-850 Link Here
841
        *p = '\0';
840
        *p = '\0';
842
    fr->parseHeader = SCAN_CGI_BAD_HEADER;
841
    fr->parseHeader = SCAN_CGI_BAD_HEADER;
843
    return ap_psprintf(r->pool, "malformed header '%s'", name);
842
    return ap_psprintf(r->pool, "malformed header '%s'", name);
844
845
DuplicateNotAllowed:
846
    fr->parseHeader = SCAN_CGI_BAD_HEADER;
847
    return ap_psprintf(r->pool, "duplicate header '%s'", name);
848
}
843
}
849
844
850
/*
845
/*
Lines 1387-1394 Link Here
1387
    }
1382
    }
1388
1383
1389
    /* Connect */
1384
    /* Connect */
1390
    if (connect(fr->fd, (struct sockaddr *)socket_addr, socket_addr_len) == 0)
1385
    do {
1386
    	if (connect(fr->fd, (struct sockaddr *) socket_addr, socket_addr_len) == 0) {
1391
        goto ConnectionComplete;
1387
        goto ConnectionComplete;
1388
    	}
1389
    } while (errno == EINTR);    
1392
1390
1393
#ifdef WIN32
1391
#ifdef WIN32
1394
1392
Lines 1432-1438 Link Here
1432
            tval.tv_sec = dynamicPleaseStartDelay;
1430
            tval.tv_sec = dynamicPleaseStartDelay;
1433
            tval.tv_usec = 0;
1431
            tval.tv_usec = 0;
1434
1432
1435
            status = ap_select((fr->fd+1), &read_fds, &write_fds, NULL, &tval);
1433
            do {
1434
            	status = ap_select(fr->fd + 1, &read_fds, &write_fds, NULL, &tval);
1435
            } while (status < 0 && errno == EINTR);
1436
1436
            if (status < 0)
1437
            if (status < 0)
1437
                break;
1438
                break;
1438
1439
Lines 1461-1467 Link Here
1461
        FD_SET(fr->fd, &write_fds);
1462
        FD_SET(fr->fd, &write_fds);
1462
        read_fds = write_fds;
1463
        read_fds = write_fds;
1463
1464
1464
        status = ap_select((fr->fd+1), &read_fds, &write_fds, NULL, &tval);
1465
        do {
1466
        	status = ap_select(fr->fd + 1, &read_fds, &write_fds, NULL, &tval);
1467
        } while (status < 0 && errno == EINTR);
1465
1468
1466
        if (status == 0) {
1469
        if (status == 0) {
1467
            ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
1470
            ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
Lines 1762-1767 Link Here
1762
                }
1765
                }
1763
1766
1764
                client_send = 0;
1767
                client_send = 0;
1768
1769
                if (fcgi_protocol_dequeue(rp, fr))
1770
                {
1771
                    state = STATE_ERROR;
1772
                    break;
1773
                }
1765
            }
1774
            }
1766
1775
1767
            break;
1776
            break;
Lines 2107-2112 Link Here
2107
                }
2116
                }
2108
2117
2109
                client_send = 0;
2118
                client_send = 0;
2119
2120
                if (fcgi_protocol_dequeue(rp, fr))
2121
                {
2122
                    state = STATE_ERROR;
2123
                    break;
2124
                }
2110
            }
2125
            }
2111
2126
2112
            break;
2127
            break;
Lines 2193-2199 Link Here
2193
        }
2208
        }
2194
2209
2195
        /* wait on the socket */
2210
        /* wait on the socket */
2211
        do {
2196
        select_status = ap_select(nfds, &read_set, &write_set, NULL, &timeout);
2212
        select_status = ap_select(nfds, &read_set, &write_set, NULL, &timeout);
2213
        } while (select_status < 0 && errno == EINTR);
2197
2214
2198
        if (select_status < 0)
2215
        if (select_status < 0)
2199
        {
2216
        {
Lines 2264-2276 Link Here
2264
2281
2265
            if (rv < 0) 
2282
            if (rv < 0) 
2266
            {
2283
            {
2284
            	if (errno == EAGAIN) 
2285
            	{
2286
                    /* this reportedly occurs on AIX 5.2 sporadically */
2287
                    struct timeval tv;
2288
                    tv.tv_sec = 1;
2289
                    tv.tv_usec = 0;
2290
2291
            		ap_log_rerror(FCGI_LOG_INFO, r, "FastCGI: comm with server "
2292
            				"\"%s\" interrupted: read will be retried in 1 second", 
2293
            				fr->fs_path);
2294
            		
2295
                    /* avoid sleep/alarm interactions */
2296
                    ap_select(0, NULL, NULL, NULL, &tv);
2297
            	}
2298
            	else 
2299
            	{
2267
                ap_log_rerror(FCGI_LOG_ERR, r, "FastCGI: comm with server "
2300
                ap_log_rerror(FCGI_LOG_ERR, r, "FastCGI: comm with server "
2268
                    "\"%s\" aborted: read failed", fr->fs_path);
2301
                    "\"%s\" aborted: read failed", fr->fs_path);
2269
                state = STATE_ERROR;
2302
                state = STATE_ERROR;
2270
                break;
2303
                break;
2271
            }
2304
            }
2272
2305
            }
2273
            if (rv == 0) 
2306
            else if (rv == 0) 
2274
            {
2307
            {
2275
                fr->keepReadingFromFcgiApp = FALSE;
2308
                fr->keepReadingFromFcgiApp = FALSE;
2276
                state = STATE_CLIENT_SEND;
2309
                state = STATE_CLIENT_SEND;
Lines 2603-2609 Link Here
2603
            return HTTP_MOVED_TEMPORARILY;
2636
            return HTTP_MOVED_TEMPORARILY;
2604
2637
2605
        default:
2638
        default:
2639
#ifdef APACHE2        	
2640
	        {
2641
	        	apr_bucket_brigade *brigade = apr_brigade_create(r->pool, r->connection->bucket_alloc);
2642
	        	apr_bucket* bucket = apr_bucket_eos_create(r->connection->bucket_alloc);
2643
	        	APR_BRIGADE_INSERT_HEAD(brigade, bucket);
2644
	        	return ap_pass_brigade(r->output_filters, brigade); 
2645
	        }
2646
#else 
2606
            return OK;
2647
            return OK;
2648
#endif
2607
    }
2649
    }
2608
}
2650
}
2609
2651
(-)mod_fastcgi/mod_fastcgi.h (-2 / +2 lines)
Lines 1-5 Link Here
1
/*
1
/*
2
 * $Id: mod_fastcgi.h,v 1.53 2007/11/13 12:26:35 robs Exp $
2
 * $Id: mod_fastcgi.h,v 1.55 2009/09/29 00:31:55 robs Exp $
3
 */
3
 */
4
4
5
#ifndef MOD_FASTCGI_H
5
#ifndef MOD_FASTCGI_H
Lines 28-34 Link Here
28
 * If all of the applications are based on a version of the FastCGI 
28
 * If all of the applications are based on a version of the FastCGI 
29
 * application library that properly handles the shutdown event
29
 * application library that properly handles the shutdown event
30
 * (fcgi2 v2.2.4), this can be set to <= 0 to prevent the use of
30
 * (fcgi2 v2.2.4), this can be set to <= 0 to prevent the use of
31
 * TerminateProcess() entirely.  If non of the applications support the
31
 * TerminateProcess() entirely.  If none of the applications support the
32
 * termination event, this value can be set to 1.  It is highly reccomended
32
 * termination event, this value can be set to 1.  It is highly reccomended
33
 * that the termination event be supported, as TerminateProcess() is a 
33
 * that the termination event be supported, as TerminateProcess() is a 
34
 * brutal way of taking down an application.
34
 * brutal way of taking down an application.

Return to bug 29159