Re: svn commit: r1753223 - /httpd/httpd/trunk/modules/http/http_protocol.c

2016-07-18 Thread Jim Jagielski
Beat me to the patch... :)

> On Jul 18, 2016, at 12:02 PM, William A Rowe Jr  wrote:
> 
> On Mon, Jul 18, 2016 at 11:00 AM, Jim Jagielski  wrote:
> Hrm. ap_method_registry_init lacks HEAD
> 
> And has no M_HEAD, it's M_GET. Resolved, reviewing the zany bytewise
> logic for any other missing identifiers.
> 
> Thanks for the catch. 
> 



Re: svn commit: r1753223 - /httpd/httpd/trunk/modules/http/http_protocol.c

2016-07-18 Thread William A Rowe Jr
On Mon, Jul 18, 2016 at 11:00 AM, Jim Jagielski  wrote:

> Hrm. ap_method_registry_init lacks HEAD


And has no M_HEAD, it's M_GET. Resolved, reviewing the zany bytewise
logic for any other missing identifiers.

Thanks for the catch.


Re: svn commit: r1753223 - /httpd/httpd/trunk/modules/http/http_protocol.c

2016-07-18 Thread Jim Jagielski
I am getting NUMEROUS errors on trunk... HEAD is returning 501. The
only test where this does NOT occur is:

"HEAD /modules/cgi/perl.pl HTTP/1.1" 200 8

Looks suspicious to me...


> On Jul 18, 2016, at 11:44 AM, Rüdiger Plüm  wrote:
> 
> 
> 
> On 07/18/2016 05:28 PM, William A Rowe Jr wrote:
>> On Mon, Jul 18, 2016 at 10:22 AM, Ruediger Pluem > > wrote:
>> 
>> 
>>On 07/18/2016 03:41 PM, wr...@apache.org  wrote:
>>> Author: wrowe
>>> Date: Mon Jul 18 13:41:26 2016
>>> New Revision: 1753223
>>> 
>>> URL: http://svn.apache.org/viewvc?rev=1753223=rev
>>> Log:
>>> Simplify; this code is executed one per request processed, saving
>>> an immeasurably small quantum of CPU of a server under load.
>>> 
>>> +int *methnum = apr_hash_get(methods_registry, method, len);
>> 
>>How do we ensure that methods_registry is not NULL or better that
>>ap_method_registry_init was called before?
>> 
>> 
>> Is the ap_method_registry_init in mod_http register_hooks() insufficient?
>> 
>> 
>> 
> 
> Doh. I missed that. Sorry for the noise.
> 
> Regards
> 
> Rüdiger



Re: svn commit: r1753223 - /httpd/httpd/trunk/modules/http/http_protocol.c

2016-07-18 Thread Jim Jagielski
Hrm. ap_method_registry_init lacks HEAD.

> On Jul 18, 2016, at 11:57 AM, William A Rowe Jr  wrote:
> 
> Investigating, should have it clearer w/in 1/2 an hr
> 
> 
> On Jul 18, 2016 10:54 AM, "Jim Jagielski"  wrote:
> I am getting NUMEROUS errors on trunk... HEAD is returning 501. The
> only test where this does NOT occur is:
> 
> "HEAD /modules/cgi/perl.pl HTTP/1.1" 200 8
> 
> Looks suspicious to me...
> 
> 
> > On Jul 18, 2016, at 11:44 AM, Rüdiger Plüm  wrote:
> >
> >
> >
> > On 07/18/2016 05:28 PM, William A Rowe Jr wrote:
> >> On Mon, Jul 18, 2016 at 10:22 AM, Ruediger Pluem  >> > wrote:
> >>
> >>
> >>On 07/18/2016 03:41 PM, wr...@apache.org  
> >> wrote:
> >>> Author: wrowe
> >>> Date: Mon Jul 18 13:41:26 2016
> >>> New Revision: 1753223
> >>>
> >>> URL: http://svn.apache.org/viewvc?rev=1753223=rev
> >>> Log:
> >>> Simplify; this code is executed one per request processed, saving
> >>> an immeasurably small quantum of CPU of a server under load.
> >>>
> >>> +int *methnum = apr_hash_get(methods_registry, method, len);
> >>
> >>How do we ensure that methods_registry is not NULL or better that
> >>ap_method_registry_init was called before?
> >>
> >>
> >> Is the ap_method_registry_init in mod_http register_hooks() insufficient?
> >>
> >>
> >>
> >
> > Doh. I missed that. Sorry for the noise.
> >
> > Regards
> >
> > Rüdiger
> 



Re: svn commit: r1753223 - /httpd/httpd/trunk/modules/http/http_protocol.c

2016-07-18 Thread Jim Jagielski
[Mon Jul 18 15:57:00.513202 2016] [core:error] [pid 6239:tid 123145317863424] 
[client 127.0.0.1:60655] AH00135: Invalid method in request HEAD 
/apache/etags/none/plus-mis/minus-ms/test.txt HTTP/1.1

> On Jul 18, 2016, at 11:57 AM, William A Rowe Jr  wrote:
> 
> Investigating, should have it clearer w/in 1/2 an hr
> 
> 
> On Jul 18, 2016 10:54 AM, "Jim Jagielski"  wrote:
> I am getting NUMEROUS errors on trunk... HEAD is returning 501. The
> only test where this does NOT occur is:
> 
> "HEAD /modules/cgi/perl.pl HTTP/1.1" 200 8
> 
> Looks suspicious to me...
> 
> 
> > On Jul 18, 2016, at 11:44 AM, Rüdiger Plüm  wrote:
> >
> >
> >
> > On 07/18/2016 05:28 PM, William A Rowe Jr wrote:
> >> On Mon, Jul 18, 2016 at 10:22 AM, Ruediger Pluem  >> > wrote:
> >>
> >>
> >>On 07/18/2016 03:41 PM, wr...@apache.org  
> >> wrote:
> >>> Author: wrowe
> >>> Date: Mon Jul 18 13:41:26 2016
> >>> New Revision: 1753223
> >>>
> >>> URL: http://svn.apache.org/viewvc?rev=1753223=rev
> >>> Log:
> >>> Simplify; this code is executed one per request processed, saving
> >>> an immeasurably small quantum of CPU of a server under load.
> >>>
> >>> +int *methnum = apr_hash_get(methods_registry, method, len);
> >>
> >>How do we ensure that methods_registry is not NULL or better that
> >>ap_method_registry_init was called before?
> >>
> >>
> >> Is the ap_method_registry_init in mod_http register_hooks() insufficient?
> >>
> >>
> >>
> >
> > Doh. I missed that. Sorry for the noise.
> >
> > Regards
> >
> > Rüdiger
> 



Re: svn commit: r1753223 - /httpd/httpd/trunk/modules/http/http_protocol.c

2016-07-18 Thread William A Rowe Jr
Investigating, should have it clearer w/in 1/2 an hr

On Jul 18, 2016 10:54 AM, "Jim Jagielski"  wrote:

> I am getting NUMEROUS errors on trunk... HEAD is returning 501. The
> only test where this does NOT occur is:
>
> "HEAD /modules/cgi/perl.pl HTTP/1.1" 200 8
>
> Looks suspicious to me...
>
>
> > On Jul 18, 2016, at 11:44 AM, Rüdiger Plüm  wrote:
> >
> >
> >
> > On 07/18/2016 05:28 PM, William A Rowe Jr wrote:
> >> On Mon, Jul 18, 2016 at 10:22 AM, Ruediger Pluem  > wrote:
> >>
> >>
> >>On 07/18/2016 03:41 PM, wr...@apache.org 
> wrote:
> >>> Author: wrowe
> >>> Date: Mon Jul 18 13:41:26 2016
> >>> New Revision: 1753223
> >>>
> >>> URL: http://svn.apache.org/viewvc?rev=1753223=rev
> >>> Log:
> >>> Simplify; this code is executed one per request processed, saving
> >>> an immeasurably small quantum of CPU of a server under load.
> >>>
> >>> +int *methnum = apr_hash_get(methods_registry, method, len);
> >>
> >>How do we ensure that methods_registry is not NULL or better that
> >>ap_method_registry_init was called before?
> >>
> >>
> >> Is the ap_method_registry_init in mod_http register_hooks()
> insufficient?
> >>
> >>
> >>
> >
> > Doh. I missed that. Sorry for the noise.
> >
> > Regards
> >
> > Rüdiger
>
>


Re: svn commit: r1753223 - /httpd/httpd/trunk/modules/http/http_protocol.c

2016-07-18 Thread Rüdiger Plüm


On 07/18/2016 05:28 PM, William A Rowe Jr wrote:
> On Mon, Jul 18, 2016 at 10:22 AM, Ruediger Pluem  > wrote:
> 
> 
> On 07/18/2016 03:41 PM, wr...@apache.org  wrote:
> > Author: wrowe
> > Date: Mon Jul 18 13:41:26 2016
> > New Revision: 1753223
> >
> > URL: http://svn.apache.org/viewvc?rev=1753223=rev
> > Log:
> > Simplify; this code is executed one per request processed, saving
> > an immeasurably small quantum of CPU of a server under load.
> >
> > +int *methnum = apr_hash_get(methods_registry, method, len);
> 
> How do we ensure that methods_registry is not NULL or better that
> ap_method_registry_init was called before?
> 
>  
> Is the ap_method_registry_init in mod_http register_hooks() insufficient?
> 
> 
> 

Doh. I missed that. Sorry for the noise.

Regards

Rüdiger


Re: svn commit: r1753223 - /httpd/httpd/trunk/modules/http/http_protocol.c

2016-07-18 Thread William A Rowe Jr
On Mon, Jul 18, 2016 at 10:22 AM, Ruediger Pluem  wrote:

>
> On 07/18/2016 03:41 PM, wr...@apache.org wrote:
> > Author: wrowe
> > Date: Mon Jul 18 13:41:26 2016
> > New Revision: 1753223
> >
> > URL: http://svn.apache.org/viewvc?rev=1753223=rev
> > Log:
> > Simplify; this code is executed one per request processed, saving
> > an immeasurably small quantum of CPU of a server under load.
> >
> > +int *methnum = apr_hash_get(methods_registry, method, len);
>
> How do we ensure that methods_registry is not NULL or better that
> ap_method_registry_init was called before?
>

Is the ap_method_registry_init in mod_http register_hooks() insufficient?


Re: svn commit: r1753223 - /httpd/httpd/trunk/modules/http/http_protocol.c

2016-07-18 Thread Ruediger Pluem


On 07/18/2016 03:41 PM, wr...@apache.org wrote:
> Author: wrowe
> Date: Mon Jul 18 13:41:26 2016
> New Revision: 1753223
> 
> URL: http://svn.apache.org/viewvc?rev=1753223=rev
> Log:
> Simplify; this code is executed one per request processed, saving 
> an immeasurably small quantum of CPU of a server under load.
> 
> Modified:
> httpd/httpd/trunk/modules/http/http_protocol.c
> 
> Modified: httpd/httpd/trunk/modules/http/http_protocol.c
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_protocol.c?rev=1753223=1753222=1753223=diff
> ==
> --- httpd/httpd/trunk/modules/http/http_protocol.c (original)
> +++ httpd/httpd/trunk/modules/http/http_protocol.c Mon Jul 18 13:41:26 2016
> @@ -754,193 +754,6 @@ AP_DECLARE(int) ap_method_register(apr_p
>  return cur_method_number++;
>  }
>  
> -#define UNKNOWN_METHOD (-1)
> -
> -static int lookup_builtin_method(const char *method, apr_size_t len)
> -{
> -/* Note: the following code was generated by the "shilka" tool from
> -   the "cocom" parsing/compilation toolkit. It is an optimized lookup
> -   based on analysis of the input keywords. Postprocessing was done
> -   on the shilka output, but the basic structure and analysis is
> -   from there. Should new HTTP methods be added, then manual insertion
> -   into this code is fine, or simply re-running the shilka tool on
> -   the appropriate input. */
> -
> -/* Note: it is also quite reasonable to just use our method_registry,
> -   but I'm assuming (probably incorrectly) we want more speed here
> -   (based on the optimizations the previous code was doing). */
> -
> -switch (len)
> -{
> -case 3:
> -switch (method[0])
> -{
> -case 'P':
> -return (method[1] == 'U'
> -&& method[2] == 'T'
> -? M_PUT : UNKNOWN_METHOD);
> -case 'G':
> -return (method[1] == 'E'
> -&& method[2] == 'T'
> -? M_GET : UNKNOWN_METHOD);
> -default:
> -return UNKNOWN_METHOD;
> -}
> -
> -case 4:
> -switch (method[0])
> -{
> -case 'H':
> -return (method[1] == 'E'
> -&& method[2] == 'A'
> -&& method[3] == 'D'
> -? M_GET : UNKNOWN_METHOD);
> -case 'P':
> -return (method[1] == 'O'
> -&& method[2] == 'S'
> -&& method[3] == 'T'
> -? M_POST : UNKNOWN_METHOD);
> -case 'M':
> -return (method[1] == 'O'
> -&& method[2] == 'V'
> -&& method[3] == 'E'
> -? M_MOVE : UNKNOWN_METHOD);
> -case 'L':
> -return (method[1] == 'O'
> -&& method[2] == 'C'
> -&& method[3] == 'K'
> -? M_LOCK : UNKNOWN_METHOD);
> -case 'C':
> -return (method[1] == 'O'
> -&& method[2] == 'P'
> -&& method[3] == 'Y'
> -? M_COPY : UNKNOWN_METHOD);
> -case 'B':
> -return (method[1] == 'R'
> -&& method[2] == 'E'
> -&& method[3] == 'W'
> -? M_BREW : UNKNOWN_METHOD);
> -case 'W':
> -return (method[1] == 'H'
> -&& method[2] == 'E'
> -&& method[3] == 'N'
> -? M_WHEN : UNKNOWN_METHOD);
> -default:
> -return UNKNOWN_METHOD;
> -}
> -
> -case 5:
> -switch (method[2])
> -{
> -case 'T':
> -return (memcmp(method, "PATCH", 5) == 0
> -? M_PATCH : UNKNOWN_METHOD);
> -case 'R':
> -return (memcmp(method, "MERGE", 5) == 0
> -? M_MERGE : UNKNOWN_METHOD);
> -case 'C':
> -return (memcmp(method, "MKCOL", 5) == 0
> -? M_MKCOL : UNKNOWN_METHOD);
> -case 'B':
> -return (memcmp(method, "LABEL", 5) == 0
> -? M_LABEL : UNKNOWN_METHOD);
> -case 'A':
> -return (memcmp(method, "TRACE", 5) == 0
> -? M_TRACE : UNKNOWN_METHOD);
> -default:
> -return UNKNOWN_METHOD;
> -}
> -
> -case 6:
> -switch (method[0])
> -{
> -case 'U':
> -switch (method[5])
> -{
> -case 'K':
> -return (memcmp(method, "UNLOCK", 6) == 0
> -? M_UNLOCK : UNKNOWN_METHOD);
> -case 'E':
> -return (memcmp(method, "UPDATE", 6) == 0
> -? M_UPDATE : UNKNOWN_METHOD);
> -default:
> -return UNKNOWN_METHOD;
> -}
> -