Re: svn commit: r1743577 [1/2] - in /httpd/httpd/branches/2.4.x: docs/manual/mod/mod_proxy_http2.xml modules/http2/NWGNUproxyht2 modules/http2/h2_proxy_session.c modules/http2/h2_proxy_session.h modul

2016-05-12 Thread Marion & Christophe JAILLET

Hi,

there are 2 valid issues spotted by smatch in debug logging message:

modules/http2/h2_proxy_session.c:339 on_data_chunk_recv() error: we 
previously assumed 'stream' could be null (see line 338)
modules/http2/h2_proxy_session.c:425 stream_data_read() error: we 
previously assumed 'stream' could be null (see line 424)


I'll also give a closer look at it tonight if no one fix it in the meantime.

CJ

Le 12/05/2016 à 23:31, j...@apache.org a écrit :

Author: jim
Date: Thu May 12 21:31:44 2016
New Revision: 1743577

URL: http://svn.apache.org/viewvc?rev=1743577&view=rev
Log:
Merge r1729208, r1735668, r1735668, r1735931, r1735935, r1735942 from trunk:

let proxy handler forward ALPN protocol strings for ssl proxy connections

Remove leftover comment

Remove leftover comment

APLOGNO update for mod_proxy_http2

fix APLOGNO at wrong place, me stupid

h2_proxy_session: fill in missing APLOGNO()s.
Submitted by: icing, jailletc36, jailletc36, icing, icing, ylavic
Reviewed/backported by: jim

Added:
 httpd/httpd/branches/2.4.x/docs/manual/mod/mod_proxy_http2.xml
 httpd/httpd/branches/2.4.x/modules/http2/NWGNUproxyht2
 httpd/httpd/branches/2.4.x/modules/http2/h2_proxy_session.c
 httpd/httpd/branches/2.4.x/modules/http2/h2_proxy_session.h
 httpd/httpd/branches/2.4.x/modules/http2/mod_proxy_http2.c
 httpd/httpd/branches/2.4.x/modules/http2/mod_proxy_http2.h





Re: End of the road of 2.2.x maintenance?

2016-05-12 Thread Kurt Newman
I’m guessing this e-mail is primarily focused on the dev side of things.

However, from a distributing side, cPanel’s migration from 2.2 to 2.4 for our 
customers was, for the most part, a non-eventful blip.

This isn’t meant to be a boasting seminar, but more of an appreciation for the 
great migration docs that helped us easily address the sticking points.
As a point of feedback, one of our biggest saviors was mod_access_compat.  This 
addressed an issue that impacted our customer's customizations; a facet that is 
out of our control.

Providing security back ports is certainly a welcome prospect, and providing 
them for a year before going EOL seems quite reasonable.

Thanks

> On May 10, 2016, at 1:38 PM, William A Rowe Jr  wrote:
> 
> It's been a year, and seems to be a good time to revisit this topic 
> while those folks who are present at ApacheCon can discuss f2f 
> the merits of bringing the 2.2.x chapter to a close, and share their
> thoughts back here on-list.
> 
> According to http://w3techs.com/technologies/history_details/ws-apache/2 
> 
> the inflection point of a majority of 2.4 instances over 2.2 appears
> to occur about 9 months from now.
> 
> OpenSUSE 13.1 adopted 2.4 way back in Nov of '13.
> 
> Ubuntu - 14.04 LTS, and Debian 8 (Jessie) switched to 2.4 in April '14.
> 
> RHEL / CentOS 7 are well over a year old, adopted 2.4 in June '14.
> Fedora 18 shipped 2.4 way back in Jan '13.
> 
> E.g. every user of the broadly distributed Linux releases will have had
> three full years to adopt 2.4 by June of 2017.  I expect the BSD world
> looks similar (modulo any Apache License 2.0 stupidity we are all 
> too familiar with.)  If someone in the BSD, Solaris and other spheres 
> wants to chime in here with those milestones, that would be great.
> 
> I am prepared to RM a final bug-fix release of 2.2 in conjunction with
> the next 2.4 release effort, to gather in any final requests for fixes
> before we move to a 12-month, security-fixes-only window on that branch.
> Once those 12 months expire, as we've done with 1.3 and 2.0, there's
> the possibility that relatively few committers would collect some critical
> patches/apply-to-2.2.xx final security fixes, but no further releases would 
> occur.
> 
> Are we ready to start the 12 month countdown as of the next/final bug
> fix release of 2.2, and highlight this in both the 2.2 and 2.4 announce
> broadcasts?
> 
> I'm hoping we conclude some fixes of 2.4 scoreboard regressions and
> get to the point of releasing 2.4 with mod_proxy_http2 sometime within
> the next month or so, and that we can reach a consensus about how
> we will proceed on the 2.2 branch, before we get to that release.
> 
> Feedback desired,
> 
> Cheers,
> 
> Bill



smime.p7s
Description: S/MIME cryptographic signature


Re: svn commit: r1743577 [1/2] - in /httpd/httpd/branches/2.4.x: docs/manual/mod/mod_proxy_http2.xml modules/http2/NWGNUproxyht2 modules/http2/h2_proxy_session.c modules/http2/h2_proxy_session.h modul

2016-05-12 Thread Marion & Christophe JAILLET

Hi all,

mod_proxy_http2 does not compile because of changes made in mod_hhtp2:

   - h2_ihash_is_empty vs h2_ihash_empty
   - h2_request_create vs h2_req_create
   - modified header files
   - ...

If not fixed in the mean time, I'll give a look at it tonight.


Do we need to go thru the formal voting process for fixing build failure 
on an experimental module?


CJ


Le 12/05/2016 à 23:31, j...@apache.org a écrit :

Author: jim
Date: Thu May 12 21:31:44 2016
New Revision: 1743577

URL: http://svn.apache.org/viewvc?rev=1743577&view=rev
Log:
Merge r1729208, r1735668, r1735668, r1735931, r1735935, r1735942 from trunk:

let proxy handler forward ALPN protocol strings for ssl proxy connections

Remove leftover comment

Remove leftover comment

APLOGNO update for mod_proxy_http2

fix APLOGNO at wrong place, me stupid

h2_proxy_session: fill in missing APLOGNO()s.
Submitted by: icing, jailletc36, jailletc36, icing, icing, ylavic
Reviewed/backported by: jim

Added:
 httpd/httpd/branches/2.4.x/docs/manual/mod/mod_proxy_http2.xml
 httpd/httpd/branches/2.4.x/modules/http2/NWGNUproxyht2
 httpd/httpd/branches/2.4.x/modules/http2/h2_proxy_session.c
 httpd/httpd/branches/2.4.x/modules/http2/h2_proxy_session.h
 httpd/httpd/branches/2.4.x/modules/http2/mod_proxy_http2.c
 httpd/httpd/branches/2.4.x/modules/http2/mod_proxy_http2.h






Re: Broken link on Apache.org

2016-05-12 Thread David Nalley
Hi Jerry,

Thanks for your report. I've forwarded this on to the Apache httpd
project who is responsible for maintaining that specific website.

Thanks,

--David

On Thu, May 12, 2016 at 6:16 PM, Jerry Lucas  wrote:
> Hello Webmaster,
>
>
>
> I found a broken link on the web page at
> http://httpd.apache.org/docs/current/misc/rewriteguide.html  Maybe it should
> be https://httpd.apache.org/docs/current/rewrite/
>
>
>
> I was doing some reading about setting up a 301 Redirect on my website and I
> watched an educational video from Google at
> https://support.google.com/webmasters/answer/93633  The bottom of the Google
> article points to two outdated version links on Apache.org at
> https://httpd.apache.org/docs/2.0/howto/htaccess.html  and
> https://httpd.apache.org/docs/2.0/misc/rewriteguide.html   Those pages
> announce at the top that they are old versions and direct the user to the
> current version.  But the link to the new rewrite guide page is broken where
> it reads:  You may follow this link to go to the current version of this
> document.
>
>
>
> Best regards,
>
>
>
> Jerry Lucas
>
> Colorado Springs
>
>


mod_proxy_hcheck backport

2016-05-12 Thread Jim Jagielski
Looking, begging, pleading for tests and votes :)


Re: [PATCH] mod_rewrite: support proxying via mod_proxy_http2

2016-05-12 Thread Stefan Eissing
Hmm, can someone with more brains than me on mod_rewrite look at the first 
patch if we want to add handling for h2: and h2c: uri schemes here or if there 
is a better way? Thanks.

-Stefan

> Am 12.05.2016 um 16:34 schrieb Evgeny Kotkov :
> 
> I noticed that it's currently impossible to use mod_proxy_http2 in
> conjunction with mod_rewrite's [P] request proxying:
> 
>RewriteEngine  On
>RewriteRule  ^/foo  h2c://hostname/bar  [P]
> 
> mod_proxy_http2 registers on h2:// and h2c:// proxy URLs [1], however,
> mod_rewrite needs an update to handle these as absolute URIs.  Without
> that, the configuration above is going to produce incorrectly rewritten
> rewritten URLs, e.g.:
> 
>   http://www.example.org/h2c://hostname/bar
> 
> I attached the patch with a fix for this issue.  The second patch adds
> the corresponding tests to the mod_http2 testing framework.
> 
> [1] 
> https://mail-archives.apache.org/mod_mbox/httpd-dev/201602.mbox/%30ea0e-00ce-430d-a01c-022e7a2ff...@greenbytes.de%3E
> 
> 
> Regards,
> Evgeny Kotkov
> 



Re: [PATCH] mod_proxy_http2: fix theoretically possible segfault when parsing URL

2016-05-12 Thread Stefan Eissing
Evgeny, both patches look fine. Thanks! Applied in r1743517.

Cheers,

  Stefan

> Am 12.05.2016 um 16:33 schrieb Evgeny Kotkov :
> 
> This patch fixes a theoretically possible segfault in mod_proxy_http2.
> 
> Please see the open_stream() function in h2_proxy_session.c:598.  If the
> call to apr_uri_parse() fails, some of the apr_uri_t's fields may be set
> to NULL, and this would cause a segfault in the following lines:
> 
>authority = puri.hostname;
>if (!ap_strchr_c(authority, ':') && puri.port
>...
> 
> Currently, the URIs are preprocessed by ap_proxy_canon_netloc() much earlier
> than opening the proxy stream, but this may not hold in the future.  As well
> as that, I think that there might be subtle differences between how these two
> functions handle invalid URIs, and that could also result in the crash.
> 
> I attached the patch with a fix for this issue.
> 
> While here, I also spotted an opportunity for a minor code cleanup.  There
> are a couple of places where a function returns an apr_status_t, but the
> calling site tests the result against the OK (hook return code).  I updated
> such places in the second patch.
> 
> 
> Regards,
> Evgeny Kotkov
> 



Re: [PATCH] mod_http2, mod_proxy_http2: fix CMake support

2016-05-12 Thread Stefan Eissing
Thanks Evgeny. Applied in trunk as r1743512.

To Jacob: mod_http2 should not be necessary as only OPTIONAL functions are used 
from it. mod_proxy_http2 is designed to work without mod_http2 being loaded 
(although it makes more sense if it is).

-Stefan

> Am 12.05.2016 um 16:54 schrieb Jacob Champion :
> 
> On 05/12/2016 07:31 AM, Evgeny Kotkov wrote:
>> @@ -451,11 +452,11 @@
>>  SET(mod_proxy_wstunnel_extra_libsmod_proxy)
>>  SET(mod_proxy_http2_requires   NGHTTP2_FOUND)
>>  SET(mod_proxy_http2_extra_defines  ssize_t=long)
>> -SET(mod_proxy_http2_extra_libs ${NGHTTP2_LIBRARIES})
>> +SET(mod_proxy_http2_extra_includes ${NGHTTP2_INCLUDE_DIR})
>> +SET(mod_proxy_http2_extra_libs ${NGHTTP2_LIBRARIES} mod_proxy)
>>  SET(mod_proxy_http2_extra_sources
>>modules/http2/h2_proxy_session.c   modules/http2/h2_util.c
>>  )
>> -SET(mod_proxy_http2_extra_libs   mod_proxy)
>>  SET(mod_ratelimit_extra_defines  AP_RL_DECLARE_EXPORT)
>>  SET(mod_sed_extra_sources
>>modules/filters/regexp.c   modules/filters/sed0.c
> 
> +1 especially to the _extra_libs change (see also my prior attempt [1] at a 
> patch for this). Should mod_http2 be added to the _extra_libs as well, or has 
> that dependency been broken? The last time I took a look at this was in 
> February, and I assume multiple things have changed since then.
> 
> I don't have Windows readily available to test this week, so I can't give a 
> "works for me" yet.
> 
> --Jacob
> 
> [1] 
> https://github.com/jchampio/httpd/commit/06edc06a42c8ccac5970cc7b4aa7cee84db346a2



Re: [PATCH] mod_http2, mod_proxy_http2: fix CMake support

2016-05-12 Thread Jacob Champion

On 05/12/2016 07:31 AM, Evgeny Kotkov wrote:

@@ -451,11 +452,11 @@
  SET(mod_proxy_wstunnel_extra_libsmod_proxy)
  SET(mod_proxy_http2_requires   NGHTTP2_FOUND)
  SET(mod_proxy_http2_extra_defines  ssize_t=long)
-SET(mod_proxy_http2_extra_libs ${NGHTTP2_LIBRARIES})
+SET(mod_proxy_http2_extra_includes ${NGHTTP2_INCLUDE_DIR})
+SET(mod_proxy_http2_extra_libs ${NGHTTP2_LIBRARIES} mod_proxy)
  SET(mod_proxy_http2_extra_sources
modules/http2/h2_proxy_session.c   modules/http2/h2_util.c
  )
-SET(mod_proxy_http2_extra_libs   mod_proxy)
  SET(mod_ratelimit_extra_defines  AP_RL_DECLARE_EXPORT)
  SET(mod_sed_extra_sources
modules/filters/regexp.c   modules/filters/sed0.c


+1 especially to the _extra_libs change (see also my prior attempt [1] 
at a patch for this). Should mod_http2 be added to the _extra_libs as 
well, or has that dependency been broken? The last time I took a look at 
this was in February, and I assume multiple things have changed since then.


I don't have Windows readily available to test this week, so I can't 
give a "works for me" yet.


--Jacob

[1] 
https://github.com/jchampio/httpd/commit/06edc06a42c8ccac5970cc7b4aa7cee84db346a2


Re: svn commit: r1742822 - /httpd/httpd/trunk/modules/http/http_core.c

2016-05-12 Thread William A Rowe Jr
On Sun, May 8, 2016 at 8:53 AM,  wrote:

> Author: rjung
> Date: Sun May  8 13:53:37 2016
> New Revision: 1742822
>
> URL: http://svn.apache.org/viewvc?rev=1742822&view=rev
> Log:
> Fix yet another case where we clobber the
> server-status request info when a timeout happens.
>
> Modified:
> httpd/httpd/trunk/modules/http/http_core.c
>
> Modified: httpd/httpd/trunk/modules/http/http_core.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_core.c?rev=1742822&r1=1742821&r2=1742822&view=diff
>
> ==
> --- httpd/httpd/trunk/modules/http/http_core.c (original)
> +++ httpd/httpd/trunk/modules/http/http_core.c Sun May  8 13:53:37 2016
> @@ -148,7 +148,8 @@ static int ap_process_http_async_connect
>  c->keepalive = AP_CONN_UNKNOWN;
>  /* process the request if it was read without error */
>
> -ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
> +ap_update_child_status(c->sbh, SERVER_BUSY_WRITE,
> +   r->the_request ? r : NULL);
>  if (r->status == HTTP_OK) {
>  cs->state = CONN_STATE_HANDLER;
>  ap_process_async_request(r);
> @@ -203,7 +204,8 @@ static int ap_process_http_sync_connecti
>  c->keepalive = AP_CONN_UNKNOWN;
>  /* process the request if it was read without error */
>
> -ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
> +ap_update_child_status(c->sbh, SERVER_BUSY_WRITE,
> +   r->the_request ? r : NULL);
>  if (r->status == HTTP_OK) {
>  if (cs)
>  cs->state = CONN_STATE_HANDLER;
>

I'd explained in another thread this week why this patch is invalid,
and I've gone ahead and reverted.

We agreed there is a defect here, what about the attached fix?
Index: modules/http/http_core.c
===
--- modules/http/http_core.c	(revision 1743511)
+++ modules/http/http_core.c	(working copy)
@@ -148,9 +148,9 @@
 c->keepalive = AP_CONN_UNKNOWN;
 /* process the request if it was read without error */
 
-ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
 if (r->status == HTTP_OK) {
 cs->state = CONN_STATE_HANDLER;
+ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
 ap_process_async_request(r);
 /* After the call to ap_process_request, the
  * request pool may have been deleted.  We set
@@ -203,10 +203,10 @@
 c->keepalive = AP_CONN_UNKNOWN;
 /* process the request if it was read without error */
 
-ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
 if (r->status == HTTP_OK) {
 if (cs)
 cs->state = CONN_STATE_HANDLER;
+ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
 ap_process_request(r);
 /* After the call to ap_process_request, the
  * request pool will have been deleted.  We set


[PATCH] mod_rewrite: support proxying via mod_proxy_http2

2016-05-12 Thread Evgeny Kotkov
I noticed that it's currently impossible to use mod_proxy_http2 in
conjunction with mod_rewrite's [P] request proxying:

RewriteEngine  On
RewriteRule  ^/foo  h2c://hostname/bar  [P]

mod_proxy_http2 registers on h2:// and h2c:// proxy URLs [1], however,
mod_rewrite needs an update to handle these as absolute URIs.  Without
that, the configuration above is going to produce incorrectly rewritten
rewritten URLs, e.g.:

   http://www.example.org/h2c://hostname/bar

I attached the patch with a fix for this issue.  The second patch adds
the corresponding tests to the mod_http2 testing framework.

[1] 
https://mail-archives.apache.org/mod_mbox/httpd-dev/201602.mbox/%30ea0e-00ce-430d-a01c-022e7a2ff...@greenbytes.de%3E


Regards,
Evgeny Kotkov
mod_rewrite: Add handling of 'h2' and 'h2c' schemes for mod_proxy_http2.

Index: modules/mappers/mod_rewrite.c
===
--- modules/mappers/mod_rewrite.c   (revision 1743495)
+++ modules/mappers/mod_rewrite.c   (working copy)
@@ -568,6 +568,14 @@ static unsigned is_absolute_uri(char *uri, int *su
 *sqs = 1;
 return 8;
 }
+else if (!ap_casecmpstrn(uri, "2://", 4)) {/* h2:// */
+*sqs = 1;
+return 5;
+}
+else if (!ap_casecmpstrn(uri, "2c://", 5)) {   /* h2c://*/
+*sqs = 1;
+return 6;
+}
 break;
 
 case 'l':
Cover the mod_rewrite's [P] proxying in mod_proxy_http2 tests.

Index: Makefile.am
===
--- Makefile.am (revision 1743495)
+++ Makefile.am (working copy)
@@ -223,6 +223,8 @@ proxytx: \
 h2proxytx: \
$(SERVER_DIR)/.test-setup
$(H2LOAD) -c 8 -t 8 -n 1000 -m 1 --npn-list=h2 
https://$(HTTPS_AUTH_2)/h2proxy/005.txt
+   $(H2LOAD) -c 8 -t 8 -n 1000 -m 1 --npn-list=h2 
https://$(HTTPS_AUTH_2)/h2proxy-rewrite/005.txt
+   $(H2LOAD) -c 8 -t 8 -n 1000 -m 1 
http://$(HTTP_AUTH)/h2cproxy-rewrite/005.txt
$(H2LOAD) -c 8 -t 8 -n 1000 -m 1 http://$(HTTP_AUTH)/h2cproxy/005.txt
 
 

Index: conf/sites/test.example.org.conf
===
--- conf/sites/test.example.org.conf(revision 1743495)
+++ conf/sites/test.example.org.conf(working copy)
@@ -135,8 +135,10 @@
 
 ProxyPass "/h2proxy" "balancer://h2-local"
 ProxyPassReverse "/h2proxy" "balancer://h2-local"
+RewriteRule /h2proxy-rewrite(.*) 
h2://test.example.org:SUBST_PORT_HTTPS_SUBST$1 [P]
 ProxyPass "/h2cproxy" "balancer://h2c-local"
 ProxyPassReverse "/h2cproxy" "balancer://h2c-local"
+RewriteRule /h2cproxy-rewrite(.*) 
h2c://test.example.org:SUBST_PORT_HTTP_SUBST$1 [P]
 
 
 = 2.4.19>
@@ -209,8 +211,10 @@
 
 ProxyPass "/h2proxy" "balancer://h2-local"
 ProxyPassReverse "/h2proxy" "balancer://h2-local"
+RewriteRule /h2proxy-rewrite(.*) 
h2://test.example.org:SUBST_PORT_HTTPS_SUBST$1 [P]
 ProxyPass "/h2cproxy" "balancer://h2c-local"
 ProxyPassReverse "/h2cproxy" "balancer://h2c-local"
+RewriteRule /h2cproxy-rewrite(.*) 
h2c://test.example.org:SUBST_PORT_HTTP_SUBST$1 [P]
 
 
 
Index: conf/sites/test2.example.org.conf
===
--- conf/sites/test2.example.org.conf   (revision 1743495)
+++ conf/sites/test2.example.org.conf   (working copy)
@@ -10,6 +10,8 @@
 DocumentRoot "SUBST_SERVER_ROOT_SUBST/htdocs/test.example.org"
 Protocols http/1.1 h2
 
+RewriteEngine on
+
 SSLEngine on
 SSLCertificateFile conf/ssl/test.example.org.pem
 SSLCertificateKeyFile conf/ssl/test.example.org.key
@@ -29,8 +31,10 @@
 
 ProxyPass "/h2proxy" "balancer://h2-local"
 ProxyPassReverse "/h2proxy" "balancer://h2-local"
+RewriteRule /h2proxy-rewrite(.*) 
h2://test.example.org:SUBST_PORT_HTTPS_SUBST$1 [P]
 ProxyPass "/h2cproxy" "balancer://h2c-local"
 ProxyPassReverse "/h2cproxy" "balancer://h2c-local"
+RewriteRule /h2cproxy-rewrite(.*) 
h2c://test.example.org:SUBST_PORT_HTTP_SUBST$1 [P]
 
 
 
@@ -59,8 +63,10 @@
 
 ProxyPass "/h2proxy" "balancer://h2-local"
 ProxyPassReverse "/h2proxy" "balancer://h2-local"
+RewriteRule /h2proxy-rewrite(.*) 
h2://test.example.org:SUBST_PORT_HTTPS_SUBST$1 [P]
 ProxyPass "/h2cproxy" "balancer://h2c-local"
 ProxyPassReverse "/h2cproxy" "balancer://h2c-local"
+RewriteRule /h2cproxy-rewrite(.*) 
h2c://test.example.org:SUBST_PORT_HTTP_SUBST$1 [P]
 
 
 
Index: test/test_common.sh
===
--- test/test_common.sh (revision 1743495)
+++ test/test_common.sh (working copy)
@@ -91,13 +91,13 @@ if min_version 2.4.19; then
 EXP_H1_HTT

[PATCH] mod_proxy_http2: fix theoretically possible segfault when parsing URL

2016-05-12 Thread Evgeny Kotkov
This patch fixes a theoretically possible segfault in mod_proxy_http2.

Please see the open_stream() function in h2_proxy_session.c:598.  If the
call to apr_uri_parse() fails, some of the apr_uri_t's fields may be set
to NULL, and this would cause a segfault in the following lines:

authority = puri.hostname;
if (!ap_strchr_c(authority, ':') && puri.port
...

Currently, the URIs are preprocessed by ap_proxy_canon_netloc() much earlier
than opening the proxy stream, but this may not hold in the future.  As well
as that, I think that there might be subtle differences between how these two
functions handle invalid URIs, and that could also result in the crash.

I attached the patch with a fix for this issue.

While here, I also spotted an opportunity for a minor code cleanup.  There
are a couple of places where a function returns an apr_status_t, but the
calling site tests the result against the OK (hook return code).  I updated
such places in the second patch.


Regards,
Evgeny Kotkov
mod_proxy_http2: Guard against theoretically possible segfault with
invalid URIs.

Index: modules/http2/h2_proxy_session.c
===
--- modules/http2/h2_proxy_session.c(revision 1743495)
+++ modules/http2/h2_proxy_session.c(working copy)
@@ -581,6 +581,7 @@ static apr_status_t open_stream(h2_proxy_session *
 h2_proxy_stream *stream;
 apr_uri_t puri;
 const char *authority, *scheme, *path;
+apr_status_t status;
 
 stream = apr_pcalloc(r->pool, sizeof(*stream));
 
@@ -595,7 +596,10 @@ static apr_status_t open_stream(h2_proxy_session *
 
 stream->req = h2_req_create(1, stream->pool, 0);
 
-apr_uri_parse(stream->pool, url, &puri);
+status = apr_uri_parse(stream->pool, url, &puri);
+if (status != APR_SUCCESS)
+return status;
+
 scheme = (strcmp(puri.scheme, "h2")? "http" : "https");
 authority = puri.hostname;
 if (!ap_strchr_c(authority, ':') && puri.port
mod_proxy_http2: Fix minor inconsistency when checking apr_status_t values.

Index: modules/http2/h2_proxy_session.c
===
--- modules/http2/h2_proxy_session.c(revision 1743495)
+++ modules/http2/h2_proxy_session.c(working copy)
@@ -763,7 +763,7 @@ apr_status_t h2_proxy_session_submit(h2_proxy_sess
 apr_status_t status;
 
 status = open_stream(session, url, r, &stream);
-if (status == OK) {
+if (status == APR_SUCCESS) {
 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03381)
   "process stream(%d): %s %s%s, original: %s", 
   stream->id, stream->req->method, 
Index: modules/http2/mod_proxy_http2.c
===
--- modules/http2/mod_proxy_http2.c (revision 1743495)
+++ modules/http2/mod_proxy_http2.c (working copy)
@@ -259,7 +259,7 @@ static apr_status_t add_request(h2_proxy_session *
 apr_table_setn(r->notes, "proxy-source-port", apr_psprintf(r->pool, "%hu",
ctx->p_conn->connection->local_addr->port));
 status = h2_proxy_session_submit(session, url, r);
-if (status != OK) {
+if (status != APR_SUCCESS) {
 ap_log_cerror(APLOG_MARK, APLOG_ERR, status, r->connection, 
APLOGNO(03351)
   "pass request body failed to %pI (%s) from %s (%s)",
   ctx->p_conn->addr, ctx->p_conn->hostname ? 


[PATCH] mod_http2, mod_proxy_http2: fix CMake support

2016-05-12 Thread Evgeny Kotkov
I noticed a few issues in CMakeLists.txt that currently prevent building
mod_http2 and mod_proxy_http2 — that is, missing includes and library
references.

The attached patch should fix them.


Regards,
Evgeny Kotkov
Fix CMake support for mod_http2 and mod_proxy_http2.

Index: CMakeLists.txt
===
--- CMakeLists.txt  (revision 1743495)
+++ CMakeLists.txt  (working copy)
@@ -396,6 +396,7 @@
 SET(mod_heartbeat_extra_libs mod_watchdog)
 SET(mod_http2_requires   NGHTTP2_FOUND)
 SET(mod_http2_extra_defines  ssize_t=long)
+SET(mod_http2_extra_includes ${NGHTTP2_INCLUDE_DIR})
 SET(mod_http2_extra_libs ${NGHTTP2_LIBRARIES})
 SET(mod_http2_extra_sources
   modules/http2/h2_alt_svc.c modules/http2/h2_bucket_eoc.c
@@ -451,11 +452,11 @@
 SET(mod_proxy_wstunnel_extra_libsmod_proxy)
 SET(mod_proxy_http2_requires   NGHTTP2_FOUND)
 SET(mod_proxy_http2_extra_defines  ssize_t=long)
-SET(mod_proxy_http2_extra_libs ${NGHTTP2_LIBRARIES})
+SET(mod_proxy_http2_extra_includes ${NGHTTP2_INCLUDE_DIR})
+SET(mod_proxy_http2_extra_libs ${NGHTTP2_LIBRARIES} mod_proxy)
 SET(mod_proxy_http2_extra_sources
   modules/http2/h2_proxy_session.c   modules/http2/h2_util.c
 )
-SET(mod_proxy_http2_extra_libs   mod_proxy)
 SET(mod_ratelimit_extra_defines  AP_RL_DECLARE_EXPORT)
 SET(mod_sed_extra_sources
   modules/filters/regexp.c   modules/filters/sed0.c