httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 40470] New: - isapi return wrong status when use ServerSupportFunction
Date Mon, 11 Sep 2006 18:13:26 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40470>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40470

           Summary: isapi return wrong status when use ServerSupportFunction
           Product: Apache httpd-2
           Version: 2.2.2
          Platform: Other
        OS/Version: Windows 2000
            Status: NEW
          Severity: major
          Priority: P2
         Component: All
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: tpirapokin@kencast.com


When use ServerSupportFunction function with HSE_REQ_SEND_RESPONSE_HEADER or
HSE_REQ_SEND_RESPONSE_HEADER_EX and supply valid headers, HTTP status become 0 (
access log recorded as - ) and the HTTP response status is 500 in Apache 2.2.3.
On Apache 2.0.54, the HTTP return status is 200 OK but the access log also
recorded - as return status code.

(I do the debug on 2.2.3 src)
This seems to be because of the return value of ap_scan_script_header_err_core
and ap_scan_script_header_err_strs functions (in server/util_script.c) or
incorrectly replace HTTP response status code in send_response_header
(arch/win32/mod_isapi.c).

server/util_script.c
ap_scan_script_header_err_core -> the function does look for Status in the
headers and set the r->status if it exist. The function then return OK (which is
define as 0). Shouldn't this function return HTTP_OK if status is not define in
the header or the status that is provided in the header?

ap_scan_script_header_err_strs -> return the result from
ap_scan_script_header_err_core

arch/win32/mod_isapi.c
send_response_header -> Call ap_scan_script_header_err_strs then assign the
return value to cid->r->status.

>From line 712
    if (stat) {
        cid->r->status = ap_scan_script_header_err_strs(cid->r, NULL,
                                        &termch, &termarg, stat, head, NULL);
        cid->ecb->dwHttpStatusCode = cid->r->status;
    }
    else {
        cid->r->status = ap_scan_script_header_err_strs(cid->r, NULL,
                                        &termch, &termarg, head, NULL);
  .....

In both case cid->r->status get set to 0 (with valid header) when it should be
200 (HTTP_OK) or other status which may be set from ap_scan_script_header_err_core.

I call ServerSupportFunction by:
1)
strTemp.Format("Content-Type: text/html\r\nContent-Length: %d\r\n\r\n",
strResult.GetLength());
dw = strTemp.GetLength();
pECB->ServerSupportFunction( pECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER,
				NULL, 
				&dw, 
				(DWORD *)(LPCTSTR) strTemp)
2)
strTemp.Format("Content-Type: text/html\r\nContent-Length: %d\r\n\r\n",
strResult.GetLength());
dw = strTemp.GetLength();
pECB->ServerSupportFunction( pECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER,
				"200 OK", 
				&dw, 
				(DWORD *)(LPCTSTR) strTemp)
3)
With HSE_REQ_SEND_RESPONSE_HEADER_EX putting the same info in HSE_URL_MAPEX_INFO 
for the second param.

Let me know if you need more info.
TP

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message