tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 42573] New: - mod_jk 1.2.23 transfer data corrupted
Date Mon, 04 Jun 2007 06:52:04 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=42573>.
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=42573

           Summary: mod_jk 1.2.23 transfer data corrupted
           Product: Tomcat 5
           Version: 5.0.20
          Platform: PC
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: major
          Priority: P2
         Component: Native:JK
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: stevegy@gmail.com


I have to use a iis6 + jboss4.0.5(tomcat 5.5.20) to serve our web site(both with
jsp and asp). The mod_jk is 1.2.23(isapi_redirect.dll) and the normal html file
looks fine. 
I have some privilege restricted image files that i should send with the
servlet(response.write...) after the privilege check had be done. So, i use the
ServletOutputStream to write image file's byte array to the remote browser. But
i find the image file transfered by the jk oftentimes corrupted(error occurs
about 10%). I test this servlet file download on http connector 8080 and this
kind of data error has never been shown. When the file size is 100K-200K, this
error is more easy to re-produce on my windows machine and the server log
nothing exceptions or errors.

private void writeFileToResponse(FileInputStream fi, HttpServletResponse
response, Attachment af, int filelength)
    throws IOException {
        String ContentType = af.getMime();
        
        int C_BUFSIZE = 1024*32;
        byte[] buf = new byte[C_BUFSIZE];
        
       
response.setContentType((ContentType==null)?"application/octstream":ContentType);
        response.setContentLength(filelength);
        response.setHeader("Content-Disposition", "inline; filename=" + fname );
        ServletOutputStream bout = response.getOutputStream();
        try {
            int i = 0;
            while((i = fi.read(buf)) > 0) {
                // if the user leave, then break the loop
               bout.write(buf, 0, i);
            }
            bout.flush();
        } catch(IOException ioe) {
            //  write to the client error or read file error, but do not log
anything
        }
        finally {
            //bout.close();
        }
        
    }

-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message