hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32607] - MultiThreadedHttpConnectionManager ingnores local address of HostConfiguration
Date Thu, 23 Dec 2004 19:53:50 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=32607>.
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=32607


olegk@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |WORKSFORME




------- Additional Comments From olegk@apache.org  2004-12-23 20:53 -------
I used the following code to test the latest CVS snapshot. I tweaked
SimpleHttpServer a little to make it print out the remote address of the
incoming connection. As far as I am concerned everything works as advertised

======================================
SimpleHttpServer httpserver = new SimpleHttpServer();
try {
    
    HttpClient httpclient = new HttpClient();

    HostConfiguration hostconfig = new HostConfiguration();
    hostconfig.setHost(
            httpserver.getLocalAddress(), httpserver.getLocalPort());
    hostconfig.setLocalAddress(
            InetAddress.getByAddress(new byte[] {127,0,0,2}));
    
    httpclient.getHttpConnectionManager().
            getParams().setConnectionTimeout(2000);
    
    httpserver.setHttpService(new FeedbackService());            
    
    GetMethod httpget = new GetMethod("/stuff");
    try {
        httpclient.executeMethod(hostconfig, httpget);
        System.out.println(httpget.getStatusLine());
        System.out.println(httpget.getResponseBodyAsString());
    } finally {
        httpget.releaseConnection();
    }
} finally {
    httpserver.destroy();
}
======================================

Output:
======================================
/127.0.0.2
[DEBUG] header - ->> "GET /stuff HTTP/1.1[\r][\n]"
[DEBUG] header - ->> "User-Agent: Jakarta Commons-HttpClient/3.0-beta1[\r][\n]"
[DEBUG] header - ->> "Host: localhost:33367[\r][\n]"
[DEBUG] header - ->> "[\r][\n]"
[DEBUG] header - -<< "HTTP/1.1 200 OK[\r][\n]"
[DEBUG] header - -<< "Content-Type: text/plain[\r][\n]"
[DEBUG] header - -<< "Content-Length: 74[\r][\n]"
HTTP/1.1 200 OK
Method type: GET
Requested resource: /stuff
Protocol version: HTTP/1.1
======================================

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


Mime
View raw message