You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by bu...@apache.org on 2006/05/30 23:19:37 UTC

DO NOT REPLY [Bug 39220] - Missing body in a PROPFIND request

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=39220>.
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=39220





------- Additional Comments From gillesGaillard@compuserve.com  2006-05-30 21:19 -------
The issue lies in method HttpRequestBodyMethodBase#writeRequestBody where
the bytes are not properly written to the underlying ChunkedOutputStream stream 
when using chunked contents. The corrected method is shown below.

Additionally, please also note the wrong comment in the method comment and in 
the class header.

    protected boolean writeRequestBody(HttpState state, HttpConnection conn)
        throws IOException, HttpException {
        OutputStream out = conn.getRequestOutputStream();
        if (isHttp11() && (null == getRequestHeader("Content-Length"))) {
            out = new ChunkedOutputStream(out);
        }

        InputStream inputStream = null;
        if (file != null && file.exists()) {
            inputStream = new FileInputStream(file);
        } else if (url != null) {
            inputStream = url.openConnection().getInputStream();
        } else if(data != null){
            inputStream = new ByteArrayInputStream(data);
        } else {
            return true;
        }

        byte[] buffer = new byte[4096];
        int nb = 0;
        while (true) {
            nb = inputStream.read(buffer);
            if (nb == -1) {
                break;
            }
            out.write(buffer, 0, nb);
        }
        if (out instanceof ChunkedOutputStream){
          ((ChunkedOutputStream)out).finish();
        }
        out.flush();
        return true;
    }


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