hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pill, Juergen" <Juergen.P...@softwareag.com>
Subject RE: [PATCH] Re: Bug in Head Method (with authenticated server)
Date Wed, 18 Dec 2002 14:41:01 GMT
Hello Ortwin,

Unfortunately your patch did not really solved the performance problem, I
have added some printlns:

NEW HEAD METHOD START rsp = 401
NEW HEAD METHOD END, time used = 0
INFO  [main] org.apache.commons.httpclient.HttpMethod - Recoverable
exception caught when writing request: 18 Dec 2002 15:35:59,381
NEW HEAD METHOD START rsp = 200
NEW HEAD METHOD END, time used = 15003 ms





If I change the HeadMethod.readresponseBody to something like:


    protected void readResponseBody(HttpState state, HttpConnection conn)
    throws IOException, HttpException {
        log.trace(
            "enter HeadMethod.readResponseBody(HttpState, HttpConnection)");

        // despite the possible presence of a content-length header,
        // HEAD returns no response body
        long start = System.currentTimeMillis();
        System.out.println("NEW HEAD METHOD START rsp = " +
getStatusCode());
        if (getStatusCode() != 200) {
            super.readResponseBody(state, conn);
            InputStream in = this.getResponseBodyAsStream();
            if ((in != null) && responseHasBody()) {
              exhaust(in);
            }
        } else {
            responseBodyConsumed();
        }
        System.out.println("NEW HEAD METHOD END, time used = " +
(System.currentTimeMillis()-start));
        return;
    }



The performance and output looks very promising:




NEW HEAD METHOD START rsp = 401
NEW HEAD METHOD END, time used = 0
INFO  [main] org.apache.commons.httpclient.HttpMethod - Recoverable
exception caught when writing request: 18 Dec 2002 15:39:00,835
NEW HEAD METHOD START rsp = 200
NEW HEAD METHOD END, time used = 0



 -----Original Message-----
From: 	Ortwin Gl├╝ck [mailto:ortwin.glueck@nose.ch] 
Sent:	Tuesday, December 17, 2002 13.55 PM
To:	Commons HttpClient Project
Subject:	[PATCH] Re: Bug in Head Method (with authenticated server)

 << File: httpheadbug.patch >> << File: ATT370603.txt >> This has
been
addressed now.

Happy?

Pill, Juergen wrote:
> 2) performance is very slow, I believe the second call (rsp=200) does not
> deliever a body, but a content length, now the client waits until the
Stream
> is closed.

Mime
View raw message