Re: apache 2.2 mod_proxy_http disable buffering

2007-12-08 Thread Ruediger Pluem


On 12/07/2007 10:19 PM, Pavel Stano wrote:

>>
>>
> 
> thanks for patch, problem is solved
>

Committed to trunk as r602349 
(http://svn.apache.org/viewcvs.cgi?rev=602349&view=rev)
and added to the backport proposal as r602439
(http://svn.apache.org/viewcvs.cgi?rev=602439&view=rev).

Regards

Rüdiger




Re: apache 2.2 mod_proxy_http disable buffering

2007-12-07 Thread Pavel Stano
Plüm wrote:
> 
>> -Ursprüngliche Nachricht-
>> Von: Plüm, Rüdiger, VF-Group 
>> Gesendet: Freitag, 7. Dezember 2007 11:22
>> An: dev@httpd.apache.org
>> Betreff: Re: apache 2.2 mod_proxy_http disable buffering
>>
>>
>>
>>
>>> -Ursprüngliche Nachricht-
>>> Von: Pavel Stano 
>>> Gesendet: Freitag, 7. Dezember 2007 02:48
>>> An: dev@httpd.apache.org
>>> Betreff: Re: apache 2.2 mod_proxy_http disable buffering
>>>
>>>
>>> Ruediger Pluem wrote:
>>>> You are correct. This is only fixed in trunk so far. You 
>>> are affected by
>>>> PR41056 
>> (https://issues.apache.org/bugzilla/show_bug.cgi?id=41056).
>>>> I just proposed the patch from trunk for backport. Please find the
>>>> patch attached for your convenience.
>>>>
>>> thanks for patch, it works, but it looks that it create 
>>> another problem,
>>> do not backport it yet to 2.2.x
>>>
>>> proxy (2.2.6 with this patch) sometimes dont send data to 
>> client, just
>>> headers from backend, data are lost (blank page in browser)
>>> it took me some time to reproduce it at 100%
>>> it happend when proxy read headers in first read() and data 
>> in second
>>> and others read()
>> Do you have any kind of cgi script, php script, jsp that can reproduce
>> this behaviour?
> 
> Meanwhile I was able to reproduce the behaviour. Many thanks for the detailed
> analysis. It was very helpful. Could you please try the following additional
> patch, in addition to the one from me you already applied and check if the
> problem is now solved? The patch is against trunk, but it should work against
> 2.2.x without a problem.
> 
> Regards
> 
> Rüdiger
> 
> 

thanks for patch, problem is solved

-- 
Pavel Stano


Re: apache 2.2 mod_proxy_http disable buffering

2007-12-07 Thread Plüm , Rüdiger , VF-Group


> -Ursprüngliche Nachricht-
> Von: Plüm, Rüdiger, VF-Group 
> Gesendet: Freitag, 7. Dezember 2007 11:22
> An: dev@httpd.apache.org
> Betreff: Re: apache 2.2 mod_proxy_http disable buffering
> 
> 
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: Pavel Stano 
> > Gesendet: Freitag, 7. Dezember 2007 02:48
> > An: dev@httpd.apache.org
> > Betreff: Re: apache 2.2 mod_proxy_http disable buffering
> > 
> > 
> > Ruediger Pluem wrote:
> > > 
> > > You are correct. This is only fixed in trunk so far. You 
> > are affected by
> > > PR41056 
> (https://issues.apache.org/bugzilla/show_bug.cgi?id=41056).
> > > I just proposed the patch from trunk for backport. Please find the
> > > patch attached for your convenience.
> > > 
> > 
> > thanks for patch, it works, but it looks that it create 
> > another problem,
> > do not backport it yet to 2.2.x
> > 
> > proxy (2.2.6 with this patch) sometimes dont send data to 
> client, just
> > headers from backend, data are lost (blank page in browser)
> > it took me some time to reproduce it at 100%
> > it happend when proxy read headers in first read() and data 
> in second
> > and others read()
> 
> Do you have any kind of cgi script, php script, jsp that can reproduce
> this behaviour?

Meanwhile I was able to reproduce the behaviour. Many thanks for the detailed
analysis. It was very helpful. Could you please try the following additional
patch, in addition to the one from me you already applied and check if the
problem is now solved? The patch is against trunk, but it should work against
2.2.x without a problem.

Regards

Rüdiger




chunk_fix.diff
Description: chunk_fix.diff


Re: apache 2.2 mod_proxy_http disable buffering

2007-12-07 Thread Plüm , Rüdiger , VF-Group


> -Ursprüngliche Nachricht-
> Von: Pavel Stano 
> Gesendet: Freitag, 7. Dezember 2007 02:48
> An: dev@httpd.apache.org
> Betreff: Re: apache 2.2 mod_proxy_http disable buffering
> 
> 
> Ruediger Pluem wrote:
> > 
> > You are correct. This is only fixed in trunk so far. You 
> are affected by
> > PR41056 (https://issues.apache.org/bugzilla/show_bug.cgi?id=41056).
> > I just proposed the patch from trunk for backport. Please find the
> > patch attached for your convenience.
> > 
> 
> thanks for patch, it works, but it looks that it create 
> another problem,
> do not backport it yet to 2.2.x
> 
> proxy (2.2.6 with this patch) sometimes dont send data to client, just
> headers from backend, data are lost (blank page in browser)
> it took me some time to reproduce it at 100%
> it happend when proxy read headers in first read() and data in second
> and others read()

Do you have any kind of cgi script, php script, jsp that can reproduce
this behaviour?

> 
> problem does not happend when proxy in first read() read headers WITH
> some data, in my case it is 99% of all time
> 
> here is strace output from proxy when happend that problem
> 
> ... proxy send request to backend
> 11902 writev(14, [{"GET /~stanojr/tmp/p/ HTTP/1.1\r\n", 31}, {"Host:
> xxx.xx\r\n", 21}, {"X-Forwarded-For: 1.2.3.4, 1.2.3.4\r\n", 47},
> {"Max-Forwards: 10\r\n", 18}, {"X-Forwarded-Host: xxx.xx\r\n", 33},
> {"X-Forwarded-Server: xxx.xx\r\n", 35}, {"Connection: Keep-Alive\r\n",
> 24}, {"\r\n", 2}], 8) = 211
> 11902 read(14, 0x7576c8, 8000)  = -1 EAGAIN (Resource
> temporarily unavailable)
> 11902 poll([{fd=14, events=POLLIN, revents=POLLIN}], 1, 60) = 1
> 
> ... proxy read headers from backend (no data)
> 11902 read(14, "HTTP/1.1 200 OK\r\nDate: Fri, 07 Dec 2007 01:35:42
> GMT\r\nServer: Apache\r\nVary: User-Agent\r\nConnection:
> close\r\nTransfer-Encoding: chunked\r\nContent-Type: 
> text/html\r\n\r\n",
> 8000) = 162
> 11902 read(14, 0x7576c8, 8000)  = -1 EAGAIN (Resource
> temporarily unavailable)
> 
> ... proxy send headers to client
> 11902 writev(11, [{"HTTP/1.1 200 OK\r\nDate: Fri, 07 Dec 2007 01:35:42
> GMT\r\nServer: Apache\r\nVary: User-Agent\r\nContent-Type:
> text/html\r\nConnection: close\r\n\r\n", 134}], 1) = 134

Hm, we neither sent a Transfer-Encoding nor a valid Content-Length. This is
no valid HTTP/1.1 response.

Regards

Rüdiger



Re: apache 2.2 mod_proxy_http disable buffering

2007-12-06 Thread Pavel Stano
Ruediger Pluem wrote:
> 
> You are correct. This is only fixed in trunk so far. You are affected by
> PR41056 (https://issues.apache.org/bugzilla/show_bug.cgi?id=41056).
> I just proposed the patch from trunk for backport. Please find the
> patch attached for your convenience.
> 

thanks for patch, it works, but it looks that it create another problem,
do not backport it yet to 2.2.x

proxy (2.2.6 with this patch) sometimes dont send data to client, just
headers from backend, data are lost (blank page in browser)
it took me some time to reproduce it at 100%
it happend when proxy read headers in first read() and data in second
and others read()

problem does not happend when proxy in first read() read headers WITH
some data, in my case it is 99% of all time

here is strace output from proxy when happend that problem

... proxy send request to backend
11902 writev(14, [{"GET /~stanojr/tmp/p/ HTTP/1.1\r\n", 31}, {"Host:
xxx.xx\r\n", 21}, {"X-Forwarded-For: 1.2.3.4, 1.2.3.4\r\n", 47},
{"Max-Forwards: 10\r\n", 18}, {"X-Forwarded-Host: xxx.xx\r\n", 33},
{"X-Forwarded-Server: xxx.xx\r\n", 35}, {"Connection: Keep-Alive\r\n",
24}, {"\r\n", 2}], 8) = 211
11902 read(14, 0x7576c8, 8000)  = -1 EAGAIN (Resource
temporarily unavailable)
11902 poll([{fd=14, events=POLLIN, revents=POLLIN}], 1, 60) = 1

... proxy read headers from backend (no data)
11902 read(14, "HTTP/1.1 200 OK\r\nDate: Fri, 07 Dec 2007 01:35:42
GMT\r\nServer: Apache\r\nVary: User-Agent\r\nConnection:
close\r\nTransfer-Encoding: chunked\r\nContent-Type: text/html\r\n\r\n",
8000) = 162
11902 read(14, 0x7576c8, 8000)  = -1 EAGAIN (Resource
temporarily unavailable)

... proxy send headers to client
11902 writev(11, [{"HTTP/1.1 200 OK\r\nDate: Fri, 07 Dec 2007 01:35:42
GMT\r\nServer: Apache\r\nVary: User-Agent\r\nContent-Type:
text/html\r\nConnection: close\r\n\r\n", 134}], 1) = 134
11902 read(14, 0x7576c8, 8000)  = -1 EAGAIN (Resource
temporarily unavailable)
11902 poll([{fd=14, events=POLLIN, revents=POLLIN}], 1, 60) = 1

... proxy read data from backend (AA)
11902 read(14, "6\r\nAA\r\n0\r\n\r\n", 8000) = 16
11902 read(14, "", 8000)= 0

... proxy send to client nothing (actually it show 0, sometimes it show
blank page)
11902 writev(11, [{"0\r\n\r\n", 5}], 1) = 5
11902 close(14) = 0

-- 
Pavel Stano


Re: apache 2.2 mod_proxy_http disable buffering

2007-12-03 Thread Ruediger Pluem


On 12/03/2007 06:52 PM, Pavel Stano wrote:
> Ruediger Pluem wrote:
>> On 12/03/2007 05:54 PM, Pavel Stano wrote:
>>> Plüm wrote:
>>>>> -Ursprüngliche Nachricht-
>>>>> Von: Pavel Stano 
>>>>> Gesendet: Montag, 3. Dezember 2007 09:53
>>>>> An: dev@httpd.apache.org
>>>>> Betreff: apache 2.2 mod_proxy_http disable buffering
>>>>>
>>>>>
>>>>> hello,
>>>>>
>>>>> it is possible to disable buffering in mod_proxy_http ?
>>>>> or something like flush after each received data (i want this 
>>>> At least with 2.2.6 (possibly earlier 2.2.x versions) it has autoflushing.
>>>> This means once there is no more data available for reading in the response
>>>> stream from the backend it flushes what it got so far. So if your php 
>>>> script
>>>> on the backend generates its response in blocks with pause times between 
>>>> them
>>>> each of them will be send to the client immediately.
>>>>
>>>> Regards
>>>>
>>>> Rüdiger
>>> i have 2.2.6, but it dont work, proxy send me data after end of request
>>>
>>> i have very simple php script (or .cgi, i try it too)
>>> >> echo 'A';
>>> echo 'B';
>>> sleep(5);
>>> echo 'C';
>>> ?>
>>> php buffering is configured ok, when i connect with telnet to backend
>>> server a request a.php, it work as expected
>>> it show immedietaly headers and AB and after 5 second it show C and
>>> close connection
>>>
>>> when i connect to reverse proxy and request a.php, 5 second is silent
>>> and after that it send me response
>>>
>>> maybe a bug in mod_proxy_http ? (or not a bug but broken feature :))


You are correct. This is only fixed in trunk so far. You are affected by
PR41056 (https://issues.apache.org/bugzilla/show_bug.cgi?id=41056).
I just proposed the patch from trunk for backport. Please find the
patch attached for your convenience.

Regards

Rüdiger


Index: modules/http/http_filters.c
===
--- modules/http/http_filters.c	(Revision 600596)
+++ modules/http/http_filters.c	(Arbeitskopie)
@@ -64,7 +64,8 @@
 enum {
 BODY_NONE,
 BODY_LENGTH,
-BODY_CHUNK
+BODY_CHUNK,
+BODY_CHUNK_PART
 } state;
 int eos_sent;
 } http_ctx_t;
@@ -212,8 +213,15 @@
 bb = apr_brigade_create(f->r->pool, f->c->bucket_alloc);
 
 rv = ap_get_brigade(f->next, bb, AP_MODE_GETLINE,
-APR_BLOCK_READ, 0);
+block, 0);
 
+/* for timeout */
+if (block == APR_NONBLOCK_READ &&
+( (rv == APR_SUCCESS && APR_BRIGADE_EMPTY(bb)) ||
+  (APR_STATUS_IS_EAGAIN(rv)) )) {
+return APR_EAGAIN;
+}
+
 if (rv == APR_SUCCESS) {
 /* We have to check the length of the brigade we got back.
  * We will not accept partial or blank lines.
@@ -274,7 +282,7 @@
 APR_BRIGADE_INSERT_TAIL(b, e);
 ctx->eos_sent = 1;
 return APR_SUCCESS;
-case BODY_CHUNK:
+case BODY_CHUNK: case BODY_CHUNK_PART:
 {
 char line[30];
 apr_bucket_brigade *bb;
@@ -284,14 +292,30 @@
 bb = apr_brigade_create(f->r->pool, f->c->bucket_alloc);
 
 /* We need to read the CRLF after the chunk.  */
-rv = ap_get_brigade(f->next, bb, AP_MODE_GETLINE,
-APR_BLOCK_READ, 0);
-apr_brigade_cleanup(bb);
+if (ctx->state == BODY_CHUNK) {
+rv = ap_get_brigade(f->next, bb, AP_MODE_GETLINE,
+block, 0);
+apr_brigade_cleanup(bb);
+if (block == APR_NONBLOCK_READ &&
+(APR_STATUS_IS_EAGAIN(rv))) {
+return APR_EAGAIN;
+}
+} else {
+rv = APR_SUCCESS;
+}
 
 if (rv == APR_SUCCESS) {
 /* Read the real chunk line. */
 rv = ap_get_brigade(f->next, bb, AP_MODE_GETLINE,
-APR_BLOCK_READ, 0);
+block, 0);
+/* Test timeout */
+if (block == APR_NONBLOCK_READ &&
+( (rv == APR_SUCCESS && APR_BRIGADE_EMPTY(bb)) ||
+  (APR_STATUS_IS_EAGAIN(rv)) )) {
+ctx->state = BODY_CHUNK_PART;
+return APR_EAGAIN;
+}
+ctx->state = BODY_CHUNK;
 if (rv == APR_SUCCESS) {
 rv = apr_brigade_flatten(bb, line, &len);
 if (rv == APR_SUCCESS) {


Re: apache 2.2 mod_proxy_http disable buffering

2007-12-03 Thread Pavel Stano
Ruediger Pluem wrote:
> 
> On 12/03/2007 05:54 PM, Pavel Stano wrote:
>> Plüm wrote:
>>>> -Ursprüngliche Nachricht-
>>>> Von: Pavel Stano 
>>>> Gesendet: Montag, 3. Dezember 2007 09:53
>>>> An: dev@httpd.apache.org
>>>> Betreff: apache 2.2 mod_proxy_http disable buffering
>>>>
>>>>
>>>> hello,
>>>>
>>>> it is possible to disable buffering in mod_proxy_http ?
>>>> or something like flush after each received data (i want this 
>>> At least with 2.2.6 (possibly earlier 2.2.x versions) it has autoflushing.
>>> This means once there is no more data available for reading in the response
>>> stream from the backend it flushes what it got so far. So if your php script
>>> on the backend generates its response in blocks with pause times between 
>>> them
>>> each of them will be send to the client immediately.
>>>
>>> Regards
>>>
>>> Rüdiger
>> i have 2.2.6, but it dont work, proxy send me data after end of request
>>
>> i have very simple php script (or .cgi, i try it too)
>> > echo 'A';
>> echo 'B';
>> sleep(5);
>> echo 'C';
>> ?>
>> php buffering is configured ok, when i connect with telnet to backend
>> server a request a.php, it work as expected
>> it show immedietaly headers and AB and after 5 second it show C and
>> close connection
>>
>> when i connect to reverse proxy and request a.php, 5 second is silent
>> and after that it send me response
>>
>> maybe a bug in mod_proxy_http ? (or not a bug but broken feature :))
>>
>> here is strace from that proxy
>>
>> ... we write request to backend
>> 22112 17:06:47.916530 writev(12, [{"GET /a.php HTTP/1.1\r\n", 21},
>> {"Host: rtfm.home\r\n", 17}, {"Max-Forwards: 10\r\n", 18},
>> {"X-Forwarded-For: 127.0.0.1\r\n", 28}, {"X-Forwarded-Host:
>> rtfm.home\r\n", 29}, {"X-Forwarded-Server: rtfm.home\r\n", 31},
>> {"Connection: Keep-Alive\r\n", 24}, {"\r\n", 2}], 8) = 170
>>
>> ... we got answer (headers and AB)
>> 22112 17:06:47.920203 read(12, "HTTP/1.1 200 OK\r\nDate: Mon, 03 D"...,
>> 8000) = 156
>> 22112 17:06:47.920418 poll( 
>>
>> ... here we want send first data to client, but we just wait for data
>> >from backend
>>
>> ... after 5 seconds we got C and send everything to client
>> 22112 17:06:52.920176 <... poll resumed> [{fd=12, events=POLLIN,
>> revents=POLLIN}], 1, 6) = 1
>> 22112 17:06:52.920232 read(12, "1\r\nC\r\n3\r\n \n\n\r\n0\r\n\r\n",
>> 8000) = 19
>> 22112 17:06:52.920315 close(12) = 0
>> 22112 17:06:52.920414 writev(11, [{"HTTP/1.1 200 OK\r\nDate: Mon, 03
>> D"..., 139}, {"A", 1}, {"B", 1}, {"C", 1}, {" \n\n", 3}], 5) = 145
>> 22112 17:06:52.920561 times({tms_utime=0, tms_stime=0, tms_cutime=0,
>> tms_cstime=0}) = 432369321
>> 22112 17:06:52.920626 shutdown(11, 1 /* send */) = 0
> 
> Please provide a gdb backtrace of the process when it waits for data from
> the backend (http://httpd.apache.org/dev/debugging.html).
> 
> Regards
> 
> Rüdiger
> 

here is backtrace

Thread 3 (Thread 0x41001950 (LWP 23592)):
#0  0x2ac75a2bbbe6 in poll () from /lib/libc.so.6
#1  0x2ac759889b44 in apr_wait_for_io_or_timeout (f=,
s=, for_read=-1) at support/unix/waitio.c:51
#2  0x2ac75988572a in apr_socket_recv (sock=0x6c92e8, buf=0x724868
"", len=0x40ffca88)
at network_io/unix/sendrecv.c:87
#3  0x2ac7595390b4 in socket_bucket_read (a=0x711008,
str=0x40ffca90, len=0x40ffca88,
block=) at buckets/apr_buckets_socket.c:36
#4  0x2ac759537b5a in apr_brigade_split_line (bbOut=, bbIn=0x71b948,
block=APR_BLOCK_READ, maxbytes=8192) at buckets/apr_brigade.c:292
#5  0x00434117 in ap_core_input_filter (f=0x70fb70, b=0x71bb00,
mode=AP_MODE_GETLINE,
block=APR_BLOCK_READ, readbytes=0) at core_filters.c:155
#6  0x004685f8 in ap_http_filter (f=0x71ba68, b=0x70fe38,
mode=AP_MODE_READBYTES,
block=APR_NONBLOCK_READ, readbytes=8192) at http_filters.c:292
#7  0x0045c049 in ap_proxy_http_process_response (p=0x70e798,
r=0x712828,
backend=0x651a78, origin=0x70f388, conf=0x6bf8a0,
server_portstr=0x41000de0 "")
at mod_proxy_http.c:1494
#8  0x0045d592 in proxy_http_handler (r=0x712828, worker=,
conf=0x6bf8a0, url=0x70f380 "/a.php", proxyname=0x0,
proxyport=)
at mod_proxy_http.c:1742
#9  0x0044fde0 in proxy_run_scheme_handler (r

Re: apache 2.2 mod_proxy_http disable buffering

2007-12-03 Thread Ruediger Pluem


On 12/03/2007 05:54 PM, Pavel Stano wrote:
> Plüm wrote:
>>> -Ursprüngliche Nachricht-
>>> Von: Pavel Stano 
>>> Gesendet: Montag, 3. Dezember 2007 09:53
>>> An: dev@httpd.apache.org
>>> Betreff: apache 2.2 mod_proxy_http disable buffering
>>>
>>>
>>> hello,
>>>
>>> it is possible to disable buffering in mod_proxy_http ?
>>> or something like flush after each received data (i want this 
>> At least with 2.2.6 (possibly earlier 2.2.x versions) it has autoflushing.
>> This means once there is no more data available for reading in the response
>> stream from the backend it flushes what it got so far. So if your php script
>> on the backend generates its response in blocks with pause times between them
>> each of them will be send to the client immediately.
>>
>> Regards
>>
>> Rüdiger
> 
> i have 2.2.6, but it dont work, proxy send me data after end of request
> 
> i have very simple php script (or .cgi, i try it too)
>  echo 'A';
> echo 'B';
> sleep(5);
> echo 'C';
> ?>
> php buffering is configured ok, when i connect with telnet to backend
> server a request a.php, it work as expected
> it show immedietaly headers and AB and after 5 second it show C and
> close connection
> 
> when i connect to reverse proxy and request a.php, 5 second is silent
> and after that it send me response
> 
> maybe a bug in mod_proxy_http ? (or not a bug but broken feature :))
> 
> here is strace from that proxy
> 
> ... we write request to backend
> 22112 17:06:47.916530 writev(12, [{"GET /a.php HTTP/1.1\r\n", 21},
> {"Host: rtfm.home\r\n", 17}, {"Max-Forwards: 10\r\n", 18},
> {"X-Forwarded-For: 127.0.0.1\r\n", 28}, {"X-Forwarded-Host:
> rtfm.home\r\n", 29}, {"X-Forwarded-Server: rtfm.home\r\n", 31},
> {"Connection: Keep-Alive\r\n", 24}, {"\r\n", 2}], 8) = 170
> 
> ... we got answer (headers and AB)
> 22112 17:06:47.920203 read(12, "HTTP/1.1 200 OK\r\nDate: Mon, 03 D"...,
> 8000) = 156
> 22112 17:06:47.920418 poll( 
> 
> ... here we want send first data to client, but we just wait for data
>>from backend
> 
> ... after 5 seconds we got C and send everything to client
> 22112 17:06:52.920176 <... poll resumed> [{fd=12, events=POLLIN,
> revents=POLLIN}], 1, 6) = 1
> 22112 17:06:52.920232 read(12, "1\r\nC\r\n3\r\n \n\n\r\n0\r\n\r\n",
> 8000) = 19
> 22112 17:06:52.920315 close(12) = 0
> 22112 17:06:52.920414 writev(11, [{"HTTP/1.1 200 OK\r\nDate: Mon, 03
> D"..., 139}, {"A", 1}, {"B", 1}, {"C", 1}, {" \n\n", 3}], 5) = 145
> 22112 17:06:52.920561 times({tms_utime=0, tms_stime=0, tms_cutime=0,
> tms_cstime=0}) = 432369321
> 22112 17:06:52.920626 shutdown(11, 1 /* send */) = 0

Please provide a gdb backtrace of the process when it waits for data from
the backend (http://httpd.apache.org/dev/debugging.html).

Regards

Rüdiger



Re: apache 2.2 mod_proxy_http disable buffering

2007-12-03 Thread Pavel Stano
Plüm wrote:
> 
>> -Ursprüngliche Nachricht-
>> Von: Pavel Stano 
>> Gesendet: Montag, 3. Dezember 2007 09:53
>> An: dev@httpd.apache.org
>> Betreff: apache 2.2 mod_proxy_http disable buffering
>>
>>
>> hello,
>>
>> it is possible to disable buffering in mod_proxy_http ?
>> or something like flush after each received data (i want this 
> 
> At least with 2.2.6 (possibly earlier 2.2.x versions) it has autoflushing.
> This means once there is no more data available for reading in the response
> stream from the backend it flushes what it got so far. So if your php script
> on the backend generates its response in blocks with pause times between them
> each of them will be send to the client immediately.
> 
> Regards
> 
> Rüdiger

i have 2.2.6, but it dont work, proxy send me data after end of request

i have very simple php script (or .cgi, i try it too)

php buffering is configured ok, when i connect with telnet to backend
server a request a.php, it work as expected
it show immedietaly headers and AB and after 5 second it show C and
close connection

when i connect to reverse proxy and request a.php, 5 second is silent
and after that it send me response

maybe a bug in mod_proxy_http ? (or not a bug but broken feature :))

here is strace from that proxy

... we write request to backend
22112 17:06:47.916530 writev(12, [{"GET /a.php HTTP/1.1\r\n", 21},
{"Host: rtfm.home\r\n", 17}, {"Max-Forwards: 10\r\n", 18},
{"X-Forwarded-For: 127.0.0.1\r\n", 28}, {"X-Forwarded-Host:
rtfm.home\r\n", 29}, {"X-Forwarded-Server: rtfm.home\r\n", 31},
{"Connection: Keep-Alive\r\n", 24}, {"\r\n", 2}], 8) = 170

... we got answer (headers and AB)
22112 17:06:47.920203 read(12, "HTTP/1.1 200 OK\r\nDate: Mon, 03 D"...,
8000) = 156
22112 17:06:47.920418 poll( 

... here we want send first data to client, but we just wait for data
from backend

... after 5 seconds we got C and send everything to client
22112 17:06:52.920176 <... poll resumed> [{fd=12, events=POLLIN,
revents=POLLIN}], 1, 6) = 1
22112 17:06:52.920232 read(12, "1\r\nC\r\n3\r\n \n\n\r\n0\r\n\r\n",
8000) = 19
22112 17:06:52.920315 close(12) = 0
22112 17:06:52.920414 writev(11, [{"HTTP/1.1 200 OK\r\nDate: Mon, 03
D"..., 139}, {"A", 1}, {"B", 1}, {"C", 1}, {" \n\n", 3}], 5) = 145
22112 17:06:52.920561 times({tms_utime=0, tms_stime=0, tms_cutime=0,
tms_cstime=0}) = 432369321
22112 17:06:52.920626 shutdown(11, 1 /* send */) = 0

maybe can someone look at the code if it can be fixed with some small
patch ? i dont understand yet those buckets and brigades

thanks

-- 
Pavel Stano


Re: apache 2.2 mod_proxy_http disable buffering

2007-12-03 Thread Plüm , Rüdiger , VF-Group


> -Ursprüngliche Nachricht-
> Von: Pavel Stano 
> Gesendet: Montag, 3. Dezember 2007 09:53
> An: dev@httpd.apache.org
> Betreff: apache 2.2 mod_proxy_http disable buffering
> 
> 
> hello,
> 
> it is possible to disable buffering in mod_proxy_http ?
> or something like flush after each received data (i want this 

At least with 2.2.6 (possibly earlier 2.2.x versions) it has autoflushing.
This means once there is no more data available for reading in the response
stream from the backend it flushes what it got so far. So if your php script
on the backend generates its response in blocks with pause times between them
each of them will be send to the client immediately.

Regards

Rüdiger


apache 2.2 mod_proxy_http disable buffering

2007-12-03 Thread Pavel Stano
hello,

it is possible to disable buffering in mod_proxy_http ?
or something like flush after each received data (i want this option per
directory or virtualhost or via enviroment)

i have apache worker for static files and it proxy requests for php
scripts to apache prefork
problem is, that first apache with proxy, buffer data from backend
apache  and send data only at end of request (or after buffer is full)
i google about this, but nothing useful found

there is flushpackets option, but only for mod_proxy_ajp, i need this
for http

thanks
-- 
Pavel Stano