Re: Serve multiple websites (not sub-domains) from port 80

2022-04-05 Thread kumar2000s
You should use Name based hosting and that will serve your purpose.

On Mon, Apr 4, 2022 at 8:48 PM A  wrote:

> Hi,
>
> I am planning to make changes to Apache web server so that it can serve
> multiple websites (not sub-domains) from port 80.
>
> This will save money for someone who has more than one website. That
> person need not buy more than one hosting plan, one hosting plan will
> suffice.
>
> Based on the incoming base URL, Apache web server will decide from which
> directory to serve the index file or other files. There will be a user file
> where user can list which website is mapped to which directory.
>
> For example:
>
> abcd:com:/abcd
> xyz.com:/xyz
>
> I am not familiar with Apache web server code so can someone point me to
> few files which I need to modify to implement this feature.
>
> Regards,
> Amit
>


Re: Current status of mod_h2 test suite?

2022-04-05 Thread Stefan Eissing



> Am 05.04.2022 um 14:08 schrieb Rainer Jung :
> 
> Thaks, will switch to that one. Should have reembered it ...

All fine. Hit me with questions if it gives you problems.

> 
> Am 05.04.2022 um 14:04 schrieb Stefan Eissing:
>>> Am 05.04.2022 um 14:01 schrieb Rainer Jung :
>>> 
>>> Hi Stefan,
>>> 
>>> Am 05.04.2022 um 13:49 schrieb Stefan Eissing:
 Which test suite, the one in trunk or the one from github? Both work best 
 against the respective source.
>>> 
>>> the test suite in
>>> 
>>> https://svn.apache.org/repos/asf/httpd/test/mod_h2/trunk
>> Oh, forgot about that one. Should remove it.
>>> 
>>> Which one would you recommend to test http2 in a 2.4.x release (candidate)?
>> The one in ^/httpd/httpd/branches/2.4.x/test/modules/http2
>> This is the one (and the corresponding in trunk) that also runs as part of 
>> our travis CI.
>> There is a README.pytest in test with some advice to set it up and use.
>> Kind Regards,
>> Stefan
>>> 
>>> Thanks and regards,
>>> 
>>> Rainer
>>> 
> Am 05.04.2022 um 13:47 schrieb Rainer Jung :
> 
> I try to make the mod_h2 test suite run for me. Some difficulties are 
> expected due to my non-standard setup, but the first test that seems to 
> fail in a way I am not directly blaming myself is
> 
> fuzz header
> * on http://test.example.org:12345: super-long...--- gen/expect_431 
> 2022-04-05 13:25:40.081886486 +0200
> +++ gen/result  2022-04-05 13:25:40.138887222 +0200
> @@ -1,2 +1,2 @@
> ---> 0:1 GET / -> 431 0
> +--> 0:1 GET / -> 431 273
> 0/0/1/0/0 (2/3/4/5/0xx)
> 
> It seems the test expects 0 body bytes but the web server sends:
> 
>  2.0//EN">\n\n431 Request Header Fields Too 
> Large\n\nRequest Header Fields Too 
> Large\nThe server refused this request because\nthe request 
> header fields are too large.\n\n
> 
> which doesn't look like an error. So is this test broken? Is the general 
> expectation, that other fuzzing tests will succeed?
> 
> Thanks for the test suite anyways. All tests before that first fuzzing 
> test work.
> 
> Best regards,
> 
> Rainer



Re: Current status of mod_h2 test suite?

2022-04-05 Thread Rainer Jung

Thaks, will switch to that one. Should have reembered it ...

Am 05.04.2022 um 14:04 schrieb Stefan Eissing:




Am 05.04.2022 um 14:01 schrieb Rainer Jung :

Hi Stefan,

Am 05.04.2022 um 13:49 schrieb Stefan Eissing:

Which test suite, the one in trunk or the one from github? Both work best 
against the respective source.


the test suite in

https://svn.apache.org/repos/asf/httpd/test/mod_h2/trunk


Oh, forgot about that one. Should remove it.


Which one would you recommend to test http2 in a 2.4.x release (candidate)?


The one in ^/httpd/httpd/branches/2.4.x/test/modules/http2

This is the one (and the corresponding in trunk) that also runs as part of our 
travis CI.

There is a README.pytest in test with some advice to set it up and use.

Kind Regards,
Stefan



Thanks and regards,

Rainer


Am 05.04.2022 um 13:47 schrieb Rainer Jung :

I try to make the mod_h2 test suite run for me. Some difficulties are expected 
due to my non-standard setup, but the first test that seems to fail in a way I 
am not directly blaming myself is

fuzz header
* on http://test.example.org:12345: super-long...--- gen/expect_431 2022-04-05 
13:25:40.081886486 +0200
+++ gen/result  2022-04-05 13:25:40.138887222 +0200
@@ -1,2 +1,2 @@
---> 0:1 GET / -> 431 0
+--> 0:1 GET / -> 431 273
0/0/1/0/0 (2/3/4/5/0xx)

It seems the test expects 0 body bytes but the web server sends:

\n\n431 Request Header Fields Too 
Large\n\nRequest Header Fields Too Large\nThe server refused this request because\nthe request 
header fields are too large.\n\n

which doesn't look like an error. So is this test broken? Is the general 
expectation, that other fuzzing tests will succeed?

Thanks for the test suite anyways. All tests before that first fuzzing test 
work.

Best regards,

Rainer


Re: Current status of mod_h2 test suite?

2022-04-05 Thread Stefan Eissing



> Am 05.04.2022 um 14:01 schrieb Rainer Jung :
> 
> Hi Stefan,
> 
> Am 05.04.2022 um 13:49 schrieb Stefan Eissing:
>> Which test suite, the one in trunk or the one from github? Both work best 
>> against the respective source.
> 
> the test suite in
> 
> https://svn.apache.org/repos/asf/httpd/test/mod_h2/trunk

Oh, forgot about that one. Should remove it.
> 
> Which one would you recommend to test http2 in a 2.4.x release (candidate)?

The one in ^/httpd/httpd/branches/2.4.x/test/modules/http2

This is the one (and the corresponding in trunk) that also runs as part of our 
travis CI.

There is a README.pytest in test with some advice to set it up and use.

Kind Regards,
Stefan

> 
> Thanks and regards,
> 
> Rainer
> 
>>> Am 05.04.2022 um 13:47 schrieb Rainer Jung :
>>> 
>>> I try to make the mod_h2 test suite run for me. Some difficulties are 
>>> expected due to my non-standard setup, but the first test that seems to 
>>> fail in a way I am not directly blaming myself is
>>> 
>>> fuzz header
>>> * on http://test.example.org:12345: super-long...--- gen/expect_431 
>>> 2022-04-05 13:25:40.081886486 +0200
>>> +++ gen/result  2022-04-05 13:25:40.138887222 +0200
>>> @@ -1,2 +1,2 @@
>>> ---> 0:1 GET / -> 431 0
>>> +--> 0:1 GET / -> 431 273
>>> 0/0/1/0/0 (2/3/4/5/0xx)
>>> 
>>> It seems the test expects 0 body bytes but the web server sends:
>>> 
>>> >> 2.0//EN">\n\n431 Request Header Fields Too 
>>> Large\n\nRequest Header Fields Too 
>>> Large\nThe server refused this request because\nthe request header 
>>> fields are too large.\n\n
>>> 
>>> which doesn't look like an error. So is this test broken? Is the general 
>>> expectation, that other fuzzing tests will succeed?
>>> 
>>> Thanks for the test suite anyways. All tests before that first fuzzing test 
>>> work.
>>> 
>>> Best regards,
>>> 
>>> Rainer



Re: Current status of mod_h2 test suite?

2022-04-05 Thread Rainer Jung

Hi Stefan,

Am 05.04.2022 um 13:49 schrieb Stefan Eissing:

Which test suite, the one in trunk or the one from github? Both work best 
against the respective source.


the test suite in

https://svn.apache.org/repos/asf/httpd/test/mod_h2/trunk

Which one would you recommend to test http2 in a 2.4.x release (candidate)?

Thanks and regards,

Rainer


Am 05.04.2022 um 13:47 schrieb Rainer Jung :

I try to make the mod_h2 test suite run for me. Some difficulties are expected 
due to my non-standard setup, but the first test that seems to fail in a way I 
am not directly blaming myself is

fuzz header
* on http://test.example.org:12345: super-long...--- gen/expect_431 2022-04-05 
13:25:40.081886486 +0200
+++ gen/result  2022-04-05 13:25:40.138887222 +0200
@@ -1,2 +1,2 @@
---> 0:1 GET / -> 431 0
+--> 0:1 GET / -> 431 273
0/0/1/0/0 (2/3/4/5/0xx)

It seems the test expects 0 body bytes but the web server sends:

\n\n431 Request Header Fields Too 
Large\n\nRequest Header Fields Too Large\nThe server refused this request because\nthe request 
header fields are too large.\n\n

which doesn't look like an error. So is this test broken? Is the general 
expectation, that other fuzzing tests will succeed?

Thanks for the test suite anyways. All tests before that first fuzzing test 
work.

Best regards,

Rainer


Re: Current status of mod_h2 test suite?

2022-04-05 Thread Stefan Eissing
Which test suite, the one in trunk or the one from github? Both work best 
against the respective source.

> Am 05.04.2022 um 13:47 schrieb Rainer Jung :
> 
> I try to make the mod_h2 test suite run for me. Some difficulties are 
> expected due to my non-standard setup, but the first test that seems to fail 
> in a way I am not directly blaming myself is
> 
> fuzz header
> * on http://test.example.org:12345: super-long...--- gen/expect_431 
> 2022-04-05 13:25:40.081886486 +0200
> +++ gen/result  2022-04-05 13:25:40.138887222 +0200
> @@ -1,2 +1,2 @@
> ---> 0:1 GET / -> 431 0
> +--> 0:1 GET / -> 431 273
> 0/0/1/0/0 (2/3/4/5/0xx)
> 
> It seems the test expects 0 body bytes but the web server sends:
> 
> \n\n431 
> Request Header Fields Too Large\n\nRequest Header 
> Fields Too Large\nThe server refused this request because\nthe 
> request header fields are too large.\n\n
> 
> which doesn't look like an error. So is this test broken? Is the general 
> expectation, that other fuzzing tests will succeed?
> 
> Thanks for the test suite anyways. All tests before that first fuzzing test 
> work.
> 
> Best regards,
> 
> Rainer



Current status of mod_h2 test suite?

2022-04-05 Thread Rainer Jung
I try to make the mod_h2 test suite run for me. Some difficulties are 
expected due to my non-standard setup, but the first test that seems to 
fail in a way I am not directly blaming myself is


fuzz header
 * on http://test.example.org:12345: super-long...--- gen/expect_431 
2022-04-05 13:25:40.081886486 +0200

+++ gen/result  2022-04-05 13:25:40.138887222 +0200
@@ -1,2 +1,2 @@
---> 0:1 GET / -> 431 0
+--> 0:1 GET / -> 431 273
 0/0/1/0/0 (2/3/4/5/0xx)

It seems the test expects 0 body bytes but the web server sends:

2.0//EN">\n\n431 Request Header Fields Too 
Large\n\nRequest Header Fields Too 
Large\nThe server refused this request because\nthe request 
header fields are too large.\n\n


which doesn't look like an error. So is this test broken? Is the general 
expectation, that other fuzzing tests will succeed?


Thanks for the test suite anyways. All tests before that first fuzzing 
test work.


Best regards,

Rainer


Re: svn commit: r1899552 - in /httpd/httpd/trunk: modules/http/ modules/proxy/ test/modules/http1/ test/modules/http1/htdocs/ test/modules/http1/htdocs/cgi/ test/modules/http1/htdocs/cgi/files/ test/m

2022-04-05 Thread Stefan Eissing



> Am 05.04.2022 um 10:20 schrieb Ruediger Pluem :
> 
> 
> 
> On 4/5/22 9:53 AM, Stefan Eissing wrote:
>> 
>> 
>>> Am 05.04.2022 um 09:34 schrieb Ruediger Pluem :
>>> 
>>> 
>>> 
>>> On 4/5/22 9:13 AM, Stefan Eissing wrote:
 
 
> Am 04.04.2022 um 16:07 schrieb Ruediger Pluem :
> 
> 
> 
> On 4/4/22 1:08 PM, ic...@apache.org wrote:
>> Author: icing
>> Date: Mon Apr 4 11:08:58 2022
>> New Revision: 1899552
>> 
>> URL: http://svn.apache.org/viewvc?rev=1899552=rev
>> Log:
>> *) mod_http: genereate HEADERS buckets for trailers
>> mod_proxy: forward trailers on chunked request encoding
>> test: add http/1.x test cases in pytest
>> 
>> 
>> Added:
>> httpd/httpd/trunk/test/modules/http1/
>> httpd/httpd/trunk/test/modules/http1/__init__.py
>> httpd/httpd/trunk/test/modules/http1/conftest.py
>> httpd/httpd/trunk/test/modules/http1/env.py
>> httpd/httpd/trunk/test/modules/http1/htdocs/
>> httpd/httpd/trunk/test/modules/http1/htdocs/cgi/
>> httpd/httpd/trunk/test/modules/http1/htdocs/cgi/files/
>> httpd/httpd/trunk/test/modules/http1/htdocs/cgi/files/empty.txt
>> httpd/httpd/trunk/test/modules/http1/htdocs/cgi/hello.py (with props)
>> httpd/httpd/trunk/test/modules/http1/htdocs/cgi/upload.py (with props)
>> httpd/httpd/trunk/test/modules/http1/mod_h1test/
>> httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.c
>> httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.slo
>> httpd/httpd/trunk/test/modules/http1/test_001_alive.py
>> httpd/httpd/trunk/test/modules/http1/test_003_get.py
>> httpd/httpd/trunk/test/modules/http1/test_004_post.py
>> httpd/httpd/trunk/test/modules/http1/test_005_trailers.py
>> httpd/httpd/trunk/test/modules/http1/test_006_unsafe.py
>> httpd/httpd/trunk/test/modules/http1/test_007_strict.py
>> Modified:
>> httpd/httpd/trunk/modules/http/http_filters.c
>> httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
>> httpd/httpd/trunk/test/modules/http2/env.py
>> httpd/httpd/trunk/test/pyhttpd/conf.py
>> httpd/httpd/trunk/test/pyhttpd/env.py
>> 
>> Modified: httpd/httpd/trunk/modules/http/http_filters.c
>> URL: 
>> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=1899552=1899551=1899552=diff
>> ==
>> --- httpd/httpd/trunk/modules/http/http_filters.c (original)
>> +++ httpd/httpd/trunk/modules/http/http_filters.c Mon Apr 4 11:08:58 2022
>> @@ -1312,6 +1312,15 @@ AP_DECLARE_NONSTD(int) ap_send_http_trac
>> return DONE;
>> }
>> 
>> +static apr_bucket *create_trailers_bucket(request_rec *r, 
>> apr_bucket_alloc_t *bucket_alloc)
>> +{
>> + if (r->trailers_out && !apr_is_empty_table(r->trailers_out)) {
>> + ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, "sending trailers");
>> + return ap_bucket_headers_create(r->trailers_out, r->pool, 
>> bucket_alloc);
>> + }
>> + return NULL;
>> +}
>> +
>> typedef struct header_filter_ctx {
>> int headers_sent;
>> } header_filter_ctx;
>> @@ -1323,7 +1332,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
>> conn_rec *c = r->connection;
>> int header_only = (r->header_only || 
>> AP_STATUS_IS_HEADER_ONLY(r->status));
>> const char *protocol = NULL;
>> - apr_bucket *e;
>> + apr_bucket *e, *eos = NULL;
>> apr_bucket_brigade *b2;
>> header_struct h;
>> header_filter_ctx *ctx = f->ctx;
>> @@ -1364,6 +1373,10 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
>> eb = e->data;
>> continue;
>> }
>> + if (APR_BUCKET_IS_EOS(e)) {
>> + if (!eos) eos = e;
>> + continue;
>> + }
>> /*
>> * If we see an EOC bucket it is a signal that we should get out
>> * of the way doing nothing.
>> @@ -1416,6 +1429,22 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
>> goto out;
>> }
>> 
>> + if (eos) {
>> + /* on having seen EOS and added possible trailers, we
>> + * can remove this filter.
>> + */
>> + e = create_trailers_bucket(r, b->bucket_alloc);
>> + if (e) {
>> + APR_BUCKET_INSERT_BEFORE(eos, e);
>> + }
>> + ap_remove_output_filter(f);
>> + }
>> +
>> + if (ctx->headers_sent) {
>> + /* we did already the stuff below, just pass on */
>> + return ap_pass_brigade(f->next, b);
>> + }
>> +
> 
> I guess this does not work for header_only requests with trailing headers.
 
 The thought came up if we want/need/may support that. Can/should a 304 
 have trailers if the unconditional request had?
>>> 
>>> What about HEAD requests where the corresponding GET has trailers?
>> 
>> Looking at https://datatracker.ietf.org/doc/draft-ietf-httpbis-semantics/
>> 
>> ch. 15.3.5 "204 No Content": "A 204 response is terminated by the end of the 
>> header section; it
>> 

Re: svn commit: r1899552 - in /httpd/httpd/trunk: modules/http/ modules/proxy/ test/modules/http1/ test/modules/http1/htdocs/ test/modules/http1/htdocs/cgi/ test/modules/http1/htdocs/cgi/files/ test/m

2022-04-05 Thread Ruediger Pluem



On 4/5/22 9:53 AM, Stefan Eissing wrote:
> 
> 
>> Am 05.04.2022 um 09:34 schrieb Ruediger Pluem :
>>
>>
>>
>> On 4/5/22 9:13 AM, Stefan Eissing wrote:
>>>
>>>
 Am 04.04.2022 um 16:07 schrieb Ruediger Pluem :



 On 4/4/22 1:08 PM, ic...@apache.org wrote:
> Author: icing
> Date: Mon Apr 4 11:08:58 2022
> New Revision: 1899552
>
> URL: http://svn.apache.org/viewvc?rev=1899552=rev
> Log:
> *) mod_http: genereate HEADERS buckets for trailers
> mod_proxy: forward trailers on chunked request encoding
> test: add http/1.x test cases in pytest
>
>
> Added:
> httpd/httpd/trunk/test/modules/http1/
> httpd/httpd/trunk/test/modules/http1/__init__.py
> httpd/httpd/trunk/test/modules/http1/conftest.py
> httpd/httpd/trunk/test/modules/http1/env.py
> httpd/httpd/trunk/test/modules/http1/htdocs/
> httpd/httpd/trunk/test/modules/http1/htdocs/cgi/
> httpd/httpd/trunk/test/modules/http1/htdocs/cgi/files/
> httpd/httpd/trunk/test/modules/http1/htdocs/cgi/files/empty.txt
> httpd/httpd/trunk/test/modules/http1/htdocs/cgi/hello.py (with props)
> httpd/httpd/trunk/test/modules/http1/htdocs/cgi/upload.py (with props)
> httpd/httpd/trunk/test/modules/http1/mod_h1test/
> httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.c
> httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.slo
> httpd/httpd/trunk/test/modules/http1/test_001_alive.py
> httpd/httpd/trunk/test/modules/http1/test_003_get.py
> httpd/httpd/trunk/test/modules/http1/test_004_post.py
> httpd/httpd/trunk/test/modules/http1/test_005_trailers.py
> httpd/httpd/trunk/test/modules/http1/test_006_unsafe.py
> httpd/httpd/trunk/test/modules/http1/test_007_strict.py
> Modified:
> httpd/httpd/trunk/modules/http/http_filters.c
> httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
> httpd/httpd/trunk/test/modules/http2/env.py
> httpd/httpd/trunk/test/pyhttpd/conf.py
> httpd/httpd/trunk/test/pyhttpd/env.py
>
> Modified: httpd/httpd/trunk/modules/http/http_filters.c
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=1899552=1899551=1899552=diff
> ==
> --- httpd/httpd/trunk/modules/http/http_filters.c (original)
> +++ httpd/httpd/trunk/modules/http/http_filters.c Mon Apr 4 11:08:58 2022
> @@ -1312,6 +1312,15 @@ AP_DECLARE_NONSTD(int) ap_send_http_trac
> return DONE;
> }
>
> +static apr_bucket *create_trailers_bucket(request_rec *r, 
> apr_bucket_alloc_t *bucket_alloc)
> +{
> + if (r->trailers_out && !apr_is_empty_table(r->trailers_out)) {
> + ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, "sending trailers");
> + return ap_bucket_headers_create(r->trailers_out, r->pool, bucket_alloc);
> + }
> + return NULL;
> +}
> +
> typedef struct header_filter_ctx {
> int headers_sent;
> } header_filter_ctx;
> @@ -1323,7 +1332,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
> conn_rec *c = r->connection;
> int header_only = (r->header_only || AP_STATUS_IS_HEADER_ONLY(r->status));
> const char *protocol = NULL;
> - apr_bucket *e;
> + apr_bucket *e, *eos = NULL;
> apr_bucket_brigade *b2;
> header_struct h;
> header_filter_ctx *ctx = f->ctx;
> @@ -1364,6 +1373,10 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
> eb = e->data;
> continue;
> }
> + if (APR_BUCKET_IS_EOS(e)) {
> + if (!eos) eos = e;
> + continue;
> + }
> /*
> * If we see an EOC bucket it is a signal that we should get out
> * of the way doing nothing.
> @@ -1416,6 +1429,22 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
> goto out;
> }
>
> + if (eos) {
> + /* on having seen EOS and added possible trailers, we
> + * can remove this filter.
> + */
> + e = create_trailers_bucket(r, b->bucket_alloc);
> + if (e) {
> + APR_BUCKET_INSERT_BEFORE(eos, e);
> + }
> + ap_remove_output_filter(f);
> + }
> +
> + if (ctx->headers_sent) {
> + /* we did already the stuff below, just pass on */
> + return ap_pass_brigade(f->next, b);
> + }
> +

 I guess this does not work for header_only requests with trailing headers.
>>>
>>> The thought came up if we want/need/may support that. Can/should a 304 have 
>>> trailers if the unconditional request had?
>>
>> What about HEAD requests where the corresponding GET has trailers?
> 
> Looking at https://datatracker.ietf.org/doc/draft-ietf-httpbis-semantics/
> 
> ch. 15.3.5 "204 No Content": "A 204 response is terminated by the end of the 
> header section; it
>cannot contain content or trailers."
> 
> 
> ch. 15.4.5 "304": "A 304 response is terminated by the end of the header 
> section; it
>cannot contain content or trailers."
> 
> ch. 9.3.2.  "HEAD": "However, a server 

Re: svn commit: r1899552 - in /httpd/httpd/trunk: modules/http/ modules/proxy/ test/modules/http1/ test/modules/http1/htdocs/ test/modules/http1/htdocs/cgi/ test/modules/http1/htdocs/cgi/files/ test/m

2022-04-05 Thread Stefan Eissing



> Am 05.04.2022 um 09:34 schrieb Ruediger Pluem :
> 
> 
> 
> On 4/5/22 9:13 AM, Stefan Eissing wrote:
>> 
>> 
>>> Am 04.04.2022 um 16:07 schrieb Ruediger Pluem :
>>> 
>>> 
>>> 
>>> On 4/4/22 1:08 PM, ic...@apache.org wrote:
 Author: icing
 Date: Mon Apr 4 11:08:58 2022
 New Revision: 1899552
 
 URL: http://svn.apache.org/viewvc?rev=1899552=rev
 Log:
 *) mod_http: genereate HEADERS buckets for trailers
 mod_proxy: forward trailers on chunked request encoding
 test: add http/1.x test cases in pytest
 
 
 Added:
 httpd/httpd/trunk/test/modules/http1/
 httpd/httpd/trunk/test/modules/http1/__init__.py
 httpd/httpd/trunk/test/modules/http1/conftest.py
 httpd/httpd/trunk/test/modules/http1/env.py
 httpd/httpd/trunk/test/modules/http1/htdocs/
 httpd/httpd/trunk/test/modules/http1/htdocs/cgi/
 httpd/httpd/trunk/test/modules/http1/htdocs/cgi/files/
 httpd/httpd/trunk/test/modules/http1/htdocs/cgi/files/empty.txt
 httpd/httpd/trunk/test/modules/http1/htdocs/cgi/hello.py (with props)
 httpd/httpd/trunk/test/modules/http1/htdocs/cgi/upload.py (with props)
 httpd/httpd/trunk/test/modules/http1/mod_h1test/
 httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.c
 httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.slo
 httpd/httpd/trunk/test/modules/http1/test_001_alive.py
 httpd/httpd/trunk/test/modules/http1/test_003_get.py
 httpd/httpd/trunk/test/modules/http1/test_004_post.py
 httpd/httpd/trunk/test/modules/http1/test_005_trailers.py
 httpd/httpd/trunk/test/modules/http1/test_006_unsafe.py
 httpd/httpd/trunk/test/modules/http1/test_007_strict.py
 Modified:
 httpd/httpd/trunk/modules/http/http_filters.c
 httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
 httpd/httpd/trunk/test/modules/http2/env.py
 httpd/httpd/trunk/test/pyhttpd/conf.py
 httpd/httpd/trunk/test/pyhttpd/env.py
 
 Modified: httpd/httpd/trunk/modules/http/http_filters.c
 URL: 
 http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=1899552=1899551=1899552=diff
 ==
 --- httpd/httpd/trunk/modules/http/http_filters.c (original)
 +++ httpd/httpd/trunk/modules/http/http_filters.c Mon Apr 4 11:08:58 2022
 @@ -1312,6 +1312,15 @@ AP_DECLARE_NONSTD(int) ap_send_http_trac
 return DONE;
 }
 
 +static apr_bucket *create_trailers_bucket(request_rec *r, 
 apr_bucket_alloc_t *bucket_alloc)
 +{
 + if (r->trailers_out && !apr_is_empty_table(r->trailers_out)) {
 + ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, "sending trailers");
 + return ap_bucket_headers_create(r->trailers_out, r->pool, bucket_alloc);
 + }
 + return NULL;
 +}
 +
 typedef struct header_filter_ctx {
 int headers_sent;
 } header_filter_ctx;
 @@ -1323,7 +1332,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
 conn_rec *c = r->connection;
 int header_only = (r->header_only || AP_STATUS_IS_HEADER_ONLY(r->status));
 const char *protocol = NULL;
 - apr_bucket *e;
 + apr_bucket *e, *eos = NULL;
 apr_bucket_brigade *b2;
 header_struct h;
 header_filter_ctx *ctx = f->ctx;
 @@ -1364,6 +1373,10 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
 eb = e->data;
 continue;
 }
 + if (APR_BUCKET_IS_EOS(e)) {
 + if (!eos) eos = e;
 + continue;
 + }
 /*
 * If we see an EOC bucket it is a signal that we should get out
 * of the way doing nothing.
 @@ -1416,6 +1429,22 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
 goto out;
 }
 
 + if (eos) {
 + /* on having seen EOS and added possible trailers, we
 + * can remove this filter.
 + */
 + e = create_trailers_bucket(r, b->bucket_alloc);
 + if (e) {
 + APR_BUCKET_INSERT_BEFORE(eos, e);
 + }
 + ap_remove_output_filter(f);
 + }
 +
 + if (ctx->headers_sent) {
 + /* we did already the stuff below, just pass on */
 + return ap_pass_brigade(f->next, b);
 + }
 +
>>> 
>>> I guess this does not work for header_only requests with trailing headers.
>> 
>> The thought came up if we want/need/may support that. Can/should a 304 have 
>> trailers if the unconditional request had?
> 
> What about HEAD requests where the corresponding GET has trailers?

Looking at https://datatracker.ietf.org/doc/draft-ietf-httpbis-semantics/

ch. 15.3.5 "204 No Content": "A 204 response is terminated by the end of the 
header section; it
   cannot contain content or trailers."


ch. 15.4.5 "304": "A 304 response is terminated by the end of the header 
section; it
   cannot contain content or trailers."

ch. 9.3.2.  "HEAD": "However, a server MAY omit header fields for which a value 
is
   determined only while generating the content."


The first 2 are pretty clear. On HEAD responses, the server internally only 

Re: svn commit: r1899390 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h

2022-04-05 Thread jean-frederic clere

On 01/04/2022 13:41, Jim Jagielski wrote:
It was added in anticipation of the capability to be folded in, and done 
so "now" so that it would;t require any API changes.


Unless it's actually breaking something, I'd vote to simply keep it


OK I will try to propose some code to create the balancers I am still 
stuck how to create the memory slots for the workers of the those 
dynamic balancers.




On Apr 1, 2022, at 3:42 AM, jean-frederic clere > wrote:


On 01/04/2022 08:47, jean-frederic clere wrote:

On 31/03/2022 12:59, Ruediger Pluem wrote:



On 3/31/22 12:34 PM, Stefan Eissing wrote:



Am 31.03.2022 um 11:55 schrieb Ruediger Pluem >:




On 3/31/22 11:11 AM, Ruediger Pluem wrote:



On 3/30/22 4:42 PM, jfcl...@apache.org 
 wrote:

Author: jfclere
Date: Wed Mar 30 14:42:14 2022
New Revision: 1899390

URL: http://svn.apache.org/viewvc?rev=1899390=rev 


Log:
Add WorkerBalancerGrowth. To allow creation of workers
to dynamically added balancers.

Modified:
httpd/httpd/trunk/CHANGES
httpd/httpd/trunk/modules/proxy/mod_proxy.c
httpd/httpd/trunk/modules/proxy/mod_proxy.h

Modified: httpd/httpd/trunk/CHANGES
URL: 
http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1899390=1899389=1899390=diff 


==
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Wed Mar 30 14:42:14 2022
@@ -1,6 +1,10 @@
-*- coding: utf-8 -*-
Changes with Apache 2.5.1

+ *) mod_proxy: Add WorkerBalancerGrowth to allow adding workers to
+ balancer created dynamically or via "empty" balancer://../ >

+ [Jean-Frederic Clere]


I am not sure why this is needed. You can already do this via

 growth=10>



Or

>
ProxySet growth=10



FYI: Travis trunk also fails almost completely. Does not seem to 
accept a proxy configuration.


This is because the if

+  if (!ap_strchr_c(conf->p, ':'))
+  return apr_pstrcat(cmd->pool, thiscmd->name,
+  "> arguments are not supported for non url.",
+  NULL);

should not return with an error, but just encapsulate the remainder 
of the block. And I think the further

return apr_pstrcat are also wrong.

But as said I am not sure about the purpose at all as you can 
already do, what the patch should provide if I understand the patch

correctly.
The purpose was to be able to add a balancer in the balancer-manager 
handle but that needs to pre-create the mutex and the slots for the 
workers.

While looking to that I noted that:
>

was doing nothing, the balancer is ignored, I should I revert the 
patch and add an error message if there is an empty entry like this one?


There is also the BalancerGrowth directive that does nothing else than 
creating a memory slot for balancers we never add/create in the 
balancer-manager, I am tempted to remove it...


Would it be better to add the missing logic? I have some pieces in 
mod_proxy_cluster (https://github.com/modcluster/mod_proxy_cluster 
that could use the logic.


Regards

Rüdiger



--
Cheers

Jean-Frederic





--
Cheers

Jean-Frederic



Re: svn commit: r1899552 - in /httpd/httpd/trunk: modules/http/ modules/proxy/ test/modules/http1/ test/modules/http1/htdocs/ test/modules/http1/htdocs/cgi/ test/modules/http1/htdocs/cgi/files/ test/m

2022-04-05 Thread Ruediger Pluem



On 4/5/22 9:13 AM, Stefan Eissing wrote:
> 
> 
>> Am 04.04.2022 um 16:07 schrieb Ruediger Pluem :
>>
>>
>>
>> On 4/4/22 1:08 PM, ic...@apache.org wrote:
>>> Author: icing
>>> Date: Mon Apr  4 11:08:58 2022
>>> New Revision: 1899552
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1899552=rev
>>> Log:
>>>  *) mod_http: genereate HEADERS buckets for trailers
>>> mod_proxy: forward trailers on chunked request encoding
>>> test: add http/1.x test cases in pytest
>>>
>>>
>>> Added:
>>>httpd/httpd/trunk/test/modules/http1/
>>>httpd/httpd/trunk/test/modules/http1/__init__.py
>>>httpd/httpd/trunk/test/modules/http1/conftest.py
>>>httpd/httpd/trunk/test/modules/http1/env.py
>>>httpd/httpd/trunk/test/modules/http1/htdocs/
>>>httpd/httpd/trunk/test/modules/http1/htdocs/cgi/
>>>httpd/httpd/trunk/test/modules/http1/htdocs/cgi/files/
>>>httpd/httpd/trunk/test/modules/http1/htdocs/cgi/files/empty.txt
>>>httpd/httpd/trunk/test/modules/http1/htdocs/cgi/hello.py   (with props)
>>>httpd/httpd/trunk/test/modules/http1/htdocs/cgi/upload.py   (with props)
>>>httpd/httpd/trunk/test/modules/http1/mod_h1test/
>>>httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.c
>>>httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.slo
>>>httpd/httpd/trunk/test/modules/http1/test_001_alive.py
>>>httpd/httpd/trunk/test/modules/http1/test_003_get.py
>>>httpd/httpd/trunk/test/modules/http1/test_004_post.py
>>>httpd/httpd/trunk/test/modules/http1/test_005_trailers.py
>>>httpd/httpd/trunk/test/modules/http1/test_006_unsafe.py
>>>httpd/httpd/trunk/test/modules/http1/test_007_strict.py
>>> Modified:
>>>httpd/httpd/trunk/modules/http/http_filters.c
>>>httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
>>>httpd/httpd/trunk/test/modules/http2/env.py
>>>httpd/httpd/trunk/test/pyhttpd/conf.py
>>>httpd/httpd/trunk/test/pyhttpd/env.py
>>>
>>> Modified: httpd/httpd/trunk/modules/http/http_filters.c
>>> URL: 
>>> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=1899552=1899551=1899552=diff
>>> ==
>>> --- httpd/httpd/trunk/modules/http/http_filters.c (original)
>>> +++ httpd/httpd/trunk/modules/http/http_filters.c Mon Apr  4 11:08:58 2022
>>> @@ -1312,6 +1312,15 @@ AP_DECLARE_NONSTD(int) ap_send_http_trac
>>> return DONE;
>>> }
>>>
>>> +static apr_bucket *create_trailers_bucket(request_rec *r, 
>>> apr_bucket_alloc_t *bucket_alloc)
>>> +{
>>> +if (r->trailers_out && !apr_is_empty_table(r->trailers_out)) {
>>> +ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, "sending trailers");
>>> +return ap_bucket_headers_create(r->trailers_out, r->pool, 
>>> bucket_alloc);
>>> +}
>>> +return NULL;
>>> +}
>>> +
>>> typedef struct header_filter_ctx {
>>> int headers_sent;
>>> } header_filter_ctx;
>>> @@ -1323,7 +1332,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
>>> conn_rec *c = r->connection;
>>> int header_only = (r->header_only || 
>>> AP_STATUS_IS_HEADER_ONLY(r->status));
>>> const char *protocol = NULL;
>>> -apr_bucket *e;
>>> +apr_bucket *e, *eos = NULL;
>>> apr_bucket_brigade *b2;
>>> header_struct h;
>>> header_filter_ctx *ctx = f->ctx;
>>> @@ -1364,6 +1373,10 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
>>> eb = e->data;
>>> continue;
>>> }
>>> +if (APR_BUCKET_IS_EOS(e)) {
>>> +if (!eos) eos = e;
>>> +continue;
>>> +}
>>> /*
>>>  * If we see an EOC bucket it is a signal that we should get out
>>>  * of the way doing nothing.
>>> @@ -1416,6 +1429,22 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
>>> goto out;
>>> }
>>>
>>> +if (eos) {
>>> +/* on having seen EOS and added possible trailers, we
>>> + * can remove this filter.
>>> + */
>>> +e = create_trailers_bucket(r, b->bucket_alloc);
>>> +if (e) {
>>> +APR_BUCKET_INSERT_BEFORE(eos, e);
>>> +}
>>> +ap_remove_output_filter(f);
>>> +}
>>> +
>>> +if (ctx->headers_sent) {
>>> +/* we did already the stuff below, just pass on */
>>> +return ap_pass_brigade(f->next, b);
>>> +}
>>> +
>>
>> I guess this does not work for header_only requests with trailing headers.
> 
> The thought came up if we want/need/may support that. Can/should a 304 have 
> trailers if the unconditional request had?

What about HEAD requests where the corresponding GET has trailers?

Regards

Rüdiger


Re: svn commit: r1899552 - in /httpd/httpd/trunk: modules/http/ modules/proxy/ test/modules/http1/ test/modules/http1/htdocs/ test/modules/http1/htdocs/cgi/ test/modules/http1/htdocs/cgi/files/ test/m

2022-04-05 Thread Stefan Eissing



> Am 04.04.2022 um 16:07 schrieb Ruediger Pluem :
> 
> 
> 
> On 4/4/22 1:08 PM, ic...@apache.org wrote:
>> Author: icing
>> Date: Mon Apr  4 11:08:58 2022
>> New Revision: 1899552
>> 
>> URL: http://svn.apache.org/viewvc?rev=1899552=rev
>> Log:
>>  *) mod_http: genereate HEADERS buckets for trailers
>> mod_proxy: forward trailers on chunked request encoding
>> test: add http/1.x test cases in pytest
>> 
>> 
>> Added:
>>httpd/httpd/trunk/test/modules/http1/
>>httpd/httpd/trunk/test/modules/http1/__init__.py
>>httpd/httpd/trunk/test/modules/http1/conftest.py
>>httpd/httpd/trunk/test/modules/http1/env.py
>>httpd/httpd/trunk/test/modules/http1/htdocs/
>>httpd/httpd/trunk/test/modules/http1/htdocs/cgi/
>>httpd/httpd/trunk/test/modules/http1/htdocs/cgi/files/
>>httpd/httpd/trunk/test/modules/http1/htdocs/cgi/files/empty.txt
>>httpd/httpd/trunk/test/modules/http1/htdocs/cgi/hello.py   (with props)
>>httpd/httpd/trunk/test/modules/http1/htdocs/cgi/upload.py   (with props)
>>httpd/httpd/trunk/test/modules/http1/mod_h1test/
>>httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.c
>>httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.slo
>>httpd/httpd/trunk/test/modules/http1/test_001_alive.py
>>httpd/httpd/trunk/test/modules/http1/test_003_get.py
>>httpd/httpd/trunk/test/modules/http1/test_004_post.py
>>httpd/httpd/trunk/test/modules/http1/test_005_trailers.py
>>httpd/httpd/trunk/test/modules/http1/test_006_unsafe.py
>>httpd/httpd/trunk/test/modules/http1/test_007_strict.py
>> Modified:
>>httpd/httpd/trunk/modules/http/http_filters.c
>>httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
>>httpd/httpd/trunk/test/modules/http2/env.py
>>httpd/httpd/trunk/test/pyhttpd/conf.py
>>httpd/httpd/trunk/test/pyhttpd/env.py
>> 
>> Modified: httpd/httpd/trunk/modules/http/http_filters.c
>> URL: 
>> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=1899552=1899551=1899552=diff
>> ==
>> --- httpd/httpd/trunk/modules/http/http_filters.c (original)
>> +++ httpd/httpd/trunk/modules/http/http_filters.c Mon Apr  4 11:08:58 2022
>> @@ -1312,6 +1312,15 @@ AP_DECLARE_NONSTD(int) ap_send_http_trac
>> return DONE;
>> }
>> 
>> +static apr_bucket *create_trailers_bucket(request_rec *r, 
>> apr_bucket_alloc_t *bucket_alloc)
>> +{
>> +if (r->trailers_out && !apr_is_empty_table(r->trailers_out)) {
>> +ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, "sending trailers");
>> +return ap_bucket_headers_create(r->trailers_out, r->pool, 
>> bucket_alloc);
>> +}
>> +return NULL;
>> +}
>> +
>> typedef struct header_filter_ctx {
>> int headers_sent;
>> } header_filter_ctx;
>> @@ -1323,7 +1332,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
>> conn_rec *c = r->connection;
>> int header_only = (r->header_only || 
>> AP_STATUS_IS_HEADER_ONLY(r->status));
>> const char *protocol = NULL;
>> -apr_bucket *e;
>> +apr_bucket *e, *eos = NULL;
>> apr_bucket_brigade *b2;
>> header_struct h;
>> header_filter_ctx *ctx = f->ctx;
>> @@ -1364,6 +1373,10 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
>> eb = e->data;
>> continue;
>> }
>> +if (APR_BUCKET_IS_EOS(e)) {
>> +if (!eos) eos = e;
>> +continue;
>> +}
>> /*
>>  * If we see an EOC bucket it is a signal that we should get out
>>  * of the way doing nothing.
>> @@ -1416,6 +1429,22 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
>> goto out;
>> }
>> 
>> +if (eos) {
>> +/* on having seen EOS and added possible trailers, we
>> + * can remove this filter.
>> + */
>> +e = create_trailers_bucket(r, b->bucket_alloc);
>> +if (e) {
>> +APR_BUCKET_INSERT_BEFORE(eos, e);
>> +}
>> +ap_remove_output_filter(f);
>> +}
>> +
>> +if (ctx->headers_sent) {
>> +/* we did already the stuff below, just pass on */
>> +return ap_pass_brigade(f->next, b);
>> +}
>> +
> 
> I guess this does not work for header_only requests with trailing headers.

The thought came up if we want/need/may support that. Can/should a 304 have 
trailers if the unconditional request had?

I added the king to CC, to see if he has an opinion.

Kind Regards,
Stefan

> 
>> /*
>>  * Now that we are ready to send a response, we need to combine the two
>>  * header field tables into a single table.  If we don't do this, our
> 
> Regards
> 
> Rüdiger
>