Bug 48154

Summary: Requests through mod_isapi are not parsed by HTTP_INPUT filter
Product: Apache httpd-2 Reporter: Tom Hickey <thickey>
Component: mod_isapiAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED LATER    
Severity: normal Keywords: MassUpdate, PatchAvailable
Priority: P2    
Version: 2.2.14   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Patch against 2.2.x

Description Tom Hickey 2009-11-06 07:37:17 UTC
Changes made to ap_http_filter in version 2.2.9 (Bug ID 43711) are preventing requests through the mod_isapi, isapi_handler() function from being processed.  The changes for this bug are at line 327 of http_filters.c
...
        if ((ctx->state == BODY_CHUNK ||
            (ctx->state == BODY_LENGTH && ctx->remaining > 0)) &&
            f->r->expecting_100 && f->r->proto_num >= HTTP_VERSION(1,1) &&
            !(f->r->eos_sent || f->r->bytes_sent)) {
            if (!ap_is_HTTP_SUCCESS(f->r->status)) {
                ctx->state = BODY_NONE;
                ctx->eos_sent = 1;
            } else {
...

The specific problem is the call to "ap_is_HTTP_SUCCESS(f->r->status)"

I understand the reason behind the change it causes a problem due to the request_rec status being set to 0 at line 1483 of mod_isap.c

...
r->status = 0
...

This would happen wiht any message but for my situation it is a POST message and when initially handled by ap_read_request() the status is set to HTTP_OK (200)  I am not sure why the isapi_handler() function is setting the status to 0 other then perhaps to initialize the value as it is returned later.  But becuase this is done before the parse it prevents the message from being read by the http input filter into cid->ecb->lpbData and therefore no data is passed on to the external DLL.
Comment 1 William A. Rowe Jr. 2009-11-09 16:39:43 UTC
Do you have a proposed solution that satisfies both your use case and the issues
experienced prior to 2.2.9?
Comment 2 Tom Hickey 2009-11-10 04:40:03 UTC
My suggestion would be to make a change in isapi_handler() to remove the reset of  r->status to 0, this is what I have done as a workaround to be able to use 2.2.14.  I would think that if the applications is making decisions based on the status that it should not arbitrarily reset this value.
Comment 3 Matt Eaton 2009-11-24 18:40:26 UTC
Also note that a 100-continue is NEVER sent when using mod_isapi. 

The message body will always be empty in the case where a client was expecting to get a 100-continue before sending the request data.

In the case of my isapi dll that provides web services, we lose compatibility with any web service client that uses 100-continue (.NET by default).
Comment 4 Matt Eaton 2009-11-25 13:03:02 UTC
Created attachment 24617 [details]
Patch against 2.2.x

Proposed patch: removes status code reset from isapi handler
Comment 5 William A. Rowe Jr. 2018-11-07 21:09:15 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.