Re: PoolingClientConnectionManager and createConnectionOperator

2013-02-01 Thread Oleg Kalnichevski
On Thu, 2013-01-31 at 16:53 -0800, John Sheehy wrote: > Hi, > > I'm trying to override the entity serializer for a http POST like so > > PoolingClientConnectionManager cm = new > PoolingClientConnectionManager(schemeRegistry) { > @Override > protected ClientConnectionOperator createConnec

Re: Socket timeout

2013-02-01 Thread Oleg Kalnichevski
On Thu, 2013-01-31 at 17:33 +0100, joan.balagu...@grupoventus.com wrote: > Hello, > > Just one problem about socket timeout. > > My app uses the PoolingConnectionManager intensively (hundreds of > threads getting connections from it simultaneously). The response > (socket) timeout is set t

Re: How to configure basic authentication for SOCKs Proxy

2013-01-31 Thread Oleg Kalnichevski
On Wed, 2013-01-30 at 22:23 -0800, Sachin Survase wrote: > Hi Oleg, > > Got it working with Authentication as well. > I used java.net.Authenticator which provides credentials. > I have placed this Custom Authenticator in my extended > ClientConnectionOperator. > > Please have a look at my ClientC

Re: recovery of ther HTTPClient after connection disruption - retrying of the HttpRequest

2013-01-30 Thread Oleg Kalnichevski
On Wed, 2013-01-30 at 13:43 +0100, Bronislav Gabrhelik wrote: > The original problem I am trying to solve is connection disruption after > resume from the sleep mode (on Windows). When the machine is resumed the > TCP/IP stack is not ready yet, so all requests queued and processed at the > time of

Re: Interrupt flag getting cleared

2013-01-30 Thread Oleg Kalnichevski
On Wed, 2013-01-30 at 12:28 +, James Shaw wrote: > On 30 January 2013 12:26, Oleg Kalnichevski wrote: > > On Wed, 2013-01-30 at 12:07 +, James Shaw wrote: > >> On 30 January 2013 11:54, Oleg Kalnichevski wrote: > >> > On Wed, 2013-01-30 at 11:22 +,

Re: Interrupt flag getting cleared

2013-01-30 Thread Oleg Kalnichevski
On Wed, 2013-01-30 at 12:07 +, James Shaw wrote: > On 30 January 2013 11:54, Oleg Kalnichevski wrote: > > On Wed, 2013-01-30 at 11:22 +, James Shaw wrote: > >> I'm having some trouble tracking this down, but I believe that > >> httpclient 4.2.3 is clearing

Re: Interrupt flag getting cleared

2013-01-30 Thread Oleg Kalnichevski
On Wed, 2013-01-30 at 11:22 +, James Shaw wrote: > I'm having some trouble tracking this down, but I believe that > httpclient 4.2.3 is clearing the interrupt flag. > > My code looks like this: > > executorService.submit(new Runnable() { > @Override public void run() { > while (!T

Re: Connection Reset errors

2013-01-29 Thread Oleg Kalnichevski
sion' > Subject: RE: Connection Reset errors > > Thanks! I will check it out! > > -Original Message- > From: Oleg Kalnichevski [mailto:ol...@apache.org] > Sent: Tuesday, January 29, 2013 3:09 PM > To: HttpClient User Discussion > Subject: Re: Connection Reset e

Re: Connection Reset errors

2013-01-29 Thread Oleg Kalnichevski
:32 PM org.apache.http.impl.conn.PoolingClientConnectionManager > releaseConnection > > -Original Message- > From: Mark Claassen [mailto:ma...@donnell.com] > Sent: Tuesday, January 29, 2013 12:39 PM > To: 'HttpClient User Discussion' > Subject: RE: Connection R

Re: Connection Reset errors

2013-01-29 Thread Oleg Kalnichevski
a Result: 1 > BUILD SUCCESSFUL (total time: 26 seconds) -Original Message- > From: Mark Claassen [mailto:ma...@donnell.com] > Sent: Friday, January 25, 2013 11:25 AM > To: 'HttpClient User Discussion' > Subject: RE: Connection Reset errors > > I am running the tes

Re: Http Get retrieve data larger than Integer.MAX_VALUE

2013-01-28 Thread Oleg Kalnichevski
On Mon, 2013-01-28 at 23:42 +0100, Olivier Lamy wrote: > Hi, > Is there any way to retrieve a file which is larger than Integer.MAX_VALUE ? > ContentLengthInputStream has a cast which can be bigger than Integer.MAX_VALUE > > if (pos + len > contentLength) { > len = (int) (contentLength - pos); >

Re: how to change content length strategy

2013-01-28 Thread Oleg Kalnichevski
On Mon, 2013-01-28 at 16:24 +0100, Zanelli Franco wrote: > Il 28/01/2013 16:07, Oleg Kalnichevski ha scritto: > > > On Mon, 2013-01-28 at 12:34 +0100, Zanelli Franco wrote: > > hi to all, > > my device for each http request, returns a response that pro

Re: When is canceled called on a request callback?

2013-01-28 Thread Oleg Kalnichevski
On Mon, 2013-01-28 at 20:58 +0700, Ho Duc Ha wrote: > We're making 10 concurrent HTTP requests via the HttpAsyncClient (with a 0.2 > sec minimum delay between requests). > > > > We are seeing sometimes that the cancel() method on the > FutureCallback object is being called. But I don't see any

Re: How to configure basic authentication for SOCKs Proxy

2013-01-28 Thread Oleg Kalnichevski
On Mon, 2013-01-28 at 05:27 -0800, Sachin Survase wrote: > Thanks Oleg. > > Is there any custom way to achieve this functionality ? > > Regards, > Sachin > Sachin Honestly I have no idea. I have never worked with the SOCKs protocol. Supposedly the damn thing should be well supported by modern

Re: how to change content length strategy

2013-01-28 Thread Oleg Kalnichevski
On Mon, 2013-01-28 at 12:34 +0100, Zanelli Franco wrote: > hi to all, > my device for each http request, returns a response that provides more bytes > than specified with Content-Length header. I can know the amount of > additional bytes, but I don't know how to tell to httpclient. > Can you ple

Re: How to configure basic authentication for SOCKs Proxy

2013-01-28 Thread Oleg Kalnichevski
On Fri, Jan 25, 2013 at 11:27:44PM -0800, Sachin Survase wrote: > Hi,I am using Apache HttpClient 4.2.3 library for for accessing resources via > HTTP/HTTPS.Requests are sent through SOCKs proxy which requires 'basic > authentication'.I looked at the API doc and found that there is class > /ProxyAu

Re: Connection Reset errors

2013-01-25 Thread Oleg Kalnichevski
er unable to read > exception, but a Connection Reset. The stale connection check passed, so > HttpClient thinks this is a good connection, right? Or are there limits to > how reliable a stale connection check can be? > > public boolean isStale() { > if (!isOpen()) { >

Re: Using HttpAsyncClient completely asynchronously, and shutdown client/request appropriately.

2013-01-23 Thread Oleg Kalnichevski
On Wed, 2013-01-23 at 09:16 -0500, Arian wrote: > Hey Oleg, > I figured that out as well yesterday (that the client and/or request is > shutdown/closed before the callback/thread has a chance to do anything with > it). > > That was a very quick example of what I was trying to do ... In reality, >

Re: Write multiple files to outputstream without closing the stream

2013-01-23 Thread Oleg Kalnichevski
On Mon, 2013-01-21 at 21:00 -0600, Stephen J. Butler wrote: > MIME multipart response? Googling suggests browser support for such a thing > is hit or miss: > > https://www.google.com/search?q=http+multipart+response > Indeed, MIME multipart messages would probably the most natural choice. Have a

Re: Using HttpAsyncClient completely asynchronously, and shutdown client/request appropriately.

2013-01-23 Thread Oleg Kalnichevski
On Mon, 2013-01-21 at 16:00 -0500, Arian wrote: > Hello all, > So I'm using the DefaultHttpAsyncClient to send a POST http request to a > 3rd party that records some information. > Almost like a 'tracking' request, (but they dont want it done on the > client-side if JS is disabled, or using a GET v

[ANNOUNCEMENT] HttpComponents HttpClient 4.3-alpha1 release

2013-01-21 Thread Oleg Kalnichevski
The HttpComponents project is pleased to announce the first ALPHA release of HttpClient 4.3. The 4.3 branch enhances HttpClient in several key areas and includes several notable features and improvements: * Support for Java 7 try-with-resources for resource management (connection release.) * Adde

Re: NTLMv2 connection

2013-01-18 Thread Oleg Kalnichevski
On Fri, 2013-01-18 at 13:43 -0600, Godbey, David J. (HQ-LM020)[DIGITAL MANAGEMENT INC.] wrote: > When I login to my Exchange server via http-client for the first time, I get > the following string out of the http-client to the server log. Subsequent > connections does not get the below warning. A

Re: Connection Reset errors

2013-01-18 Thread Oleg Kalnichevski
this.inbuffer.isDataAvailable(1); > return isEof(); > } catch (SocketTimeoutException ex) { > return false; > } catch (IOException ex) { > return true; > } > } > > > -Original Message- > From: Oleg Kaln

Re: Connection Reset errors

2013-01-18 Thread Oleg Kalnichevski
ed with: fact = new > SSLSocketFactory(HttpsURLConnection.getDefaultSSLSocketFactory(),verifier); > I do not thing any of these should matter. Oleg > -Original Message- > From: Oleg Kalnichevski [mailto:ol...@apache.org] > Sent: Friday, January 18, 2013 6:17 AM > To: HttpClient User Discussion

Re: Connection Reset errors

2013-01-18 Thread Oleg Kalnichevski
register > an HTTP scheme for the proxy. > schemeRegistry.register(new > Scheme(SCHEME_HTTP,address.getPort(),PlainSocketFactory.getSocketFactory())); > } > } > > } > > -Original Message- > From: Oleg Kalnic

Re: Connection Reset errors

2013-01-17 Thread Oleg Kalnichevski
On Wed, 2013-01-16 at 15:22 -0500, Mark Claassen wrote: Basically 'connection reset' errors are a direct result of a general limitation of the blocking I/O model: when not blocked in an I/O operation there is no way for the socket to get notified of the opposite endpoint terminating the connection

Re: Unit test failure

2013-01-15 Thread Oleg Kalnichevski
On Tue, 2013-01-15 at 15:39 -0500, Mark Claassen wrote: > Thanks! My test laptops are not too fast, so I am guessing that this might > be the issue. > > I am not too familiar with the ins and outs of maven. Is there a way I can > remove this test from my local lists of tests and run the build

Re: Unit test failure

2013-01-15 Thread Oleg Kalnichevski
On Tue, 2013-01-15 at 14:39 -0500, Mark Claassen wrote: > I tried it on a different machine, this one running the same version of Java, > but on a Windows 7 machine (64 bit OS, 32 bit VM). > > I get the same result. Only this time is has "Connect to localhost:56701 > timed out" > > -Origin

Re: [ANNOUNCEMENT] HttpComponents HttpClient 4.2.3 GA release

2013-01-15 Thread Oleg Kalnichevski
On Tue, 2013-01-15 at 10:13 -0500, Jean-Marc Spaggiari wrote: > Hi Oleg, > > Into httpcomponents-client-4.2.3 zip file there is httpcore-4.2.2 > file. Should it not be httpcore-4.2.3? > > JM > Damn, I overlooked that. While unfortunate, it is not a major issue. All fixes in HttpCore 4.2.3 but o

[ANNOUNCEMENT] HttpComponents HttpClient 4.2.3 GA release

2013-01-15 Thread Oleg Kalnichevski
The HttpComponents project is pleased to announce 4.2.3 GA release of Apache HttpClient. This is a bug fix release that addresses a number of issues reported since release 4.2.2. This release also includes a thoroughly reworked NTLM authentication engine which should result in a better compatibili

Re: Re:

2013-01-15 Thread Oleg Kalnichevski
On Tue, 2013-01-15 at 17:05 +0530, Deepak Mishra wrote: > Thank you very much Dilip, Oleg. > > We need to get latest release of HttpClient 4.2.3 with this bug fix very > urgently. > > Can you please also tell me how to get the latest jar files > (httpclient-4.2.3.jar etc...) for the latest code >

Re: httpcore + ssl... is NIO the only way?

2013-01-14 Thread Oleg Kalnichevski
On Mon, 2013-01-14 at 13:50 -0500, Cyrus Adkisson wrote: > I'm currently using httpcore to access the Twitter api. It's been a > life-saver since Twitter needs RFC 3986 encoding and HttpClient defaults to > (and seems difficult to un-default from) a lower URL encoding (17xx, can't > remember exactl

Re: http client and SSLContext.getDefault

2013-01-10 Thread Oleg Kalnichevski
On Thu, 2013-01-10 at 07:55 -0500, Gary Gregory wrote: > On Thu, Jan 10, 2013 at 7:55 AM, Gary Gregory wrote: > > > My preference would be to make Java 6 the minimum requirement. > > > > Start with 4.3 I should have added. > > Gary > Gary My understanding is that even the latest versions of A

Re: java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.

2013-01-08 Thread Oleg Kalnichevski
On Tue, 2013-01-08 at 01:02 -0800, ErwinZwart wrote: > First of all my environment: > > Android application using Eclipse > httpclient-4.2.2.jar > > This is my piece of intelligent code: > > public class TestPCCManagerActivity extends Activity { > /** Called when the activity is first create

Re: SPNEGO authentication not working with IBM JRE 1.6

2013-01-08 Thread Oleg Kalnichevski
On Mon, 2013-01-07 at 17:10 -0500, Heather Sterling wrote: > > Hi, > > I am unable to get the HttpClient to work with SPNEGO authentication using > the IBM JRE. I have successfully gotten it to work with the Oracle JRE and > the login.conf file that is recommended for Oracle, so I know that my >

Re: The digest authentication doesn't work when using proxy

2013-01-07 Thread Oleg Kalnichevski
tolerant, but the use of API would be more consistent. > > Thanks for your help, > Bronislav > Yes, the ending slash should be enforced. If it is not the case, this is definitely a bug. Please raise a JIRA for this defect. Oleg > > > 2013/1/7 Oleg Kalnichevski > >

Re: When less is more; Re: AbstractNIOConnPool memory leak?

2013-01-07 Thread Oleg Kalnichevski
On Sun, 2013-01-06 at 23:14 -0800, vigna wrote: > > Try reducing the number of concurrent connections from 20k to, say, 2k > > and you may be surprised to find out that a smaller number of > > connections can actually chew through the same workload faster. If the > > Well... no. :) We have an e

Re: HttpClient performance with multiple threads; Re: AbstractNIOConnPool memory leak?

2013-01-07 Thread Oleg Kalnichevski
On Sun, 2013-01-06 at 15:48 -0800, Ken Krugler wrote: > Hi Oleg, > > [snip] > > > Ken, > > > > You might want to have a look at the lest code in SVN trunk (to be > > released as 4.3). Several classes such as the scheme registry that > > previously had to be synchronized in order to ensure thread

Re: The digest authentication doesn't work when using proxy

2013-01-07 Thread Oleg Kalnichevski
On Sun, 2013-01-06 at 23:17 +0100, Bronislav Gabrhelik wrote: > Hello, > > > I came across the following issue. If I configure the HttpClient with > proxy(no-auth) then the digest authentication is failed by the server > with 400 Bad request. After short analysis I have found out that the > diges

When less is more; Re: AbstractNIOConnPool memory leak?

2013-01-06 Thread Oleg Kalnichevski
On Sat, 2013-01-05 at 15:58 -0800, vigna wrote: > Oh, well, I'm sorry, I'm not really a network person :). I meant that we want > to keep 20K connections busy and transferring data while respecting > politeness, not to keep them open in the TCP sense. My fault. > > Try reducing the number of con

HttpClient performance with multiple threads; Re: AbstractNIOConnPool memory leak?

2013-01-06 Thread Oleg Kalnichevski
On Sat, 2013-01-05 at 15:56 -0800, Ken Krugler wrote: > On Jan 5, 2013, at 3:31pm, vigna wrote: > > > On 5 Jan 2013, at 3:10 PM, Ken Krugler wrote: > > > >> So on a large box (e.g. 24 more powerful cores) I could see using upward > >> of 10K threads being the > >> optimal number. > > > > We ar

Re: AbstractNIOConnPool memory leak?

2013-01-05 Thread Oleg Kalnichevski
On Sat, 2013-01-05 at 15:40 -0800, vigna wrote: > It seems like we are talking about different things. The thousands of open > connections move beween *hundreds of thousands* of servers. You do not keep > connections open—and anyway people often sets Apache's httpd timeout for > reusing connections

Re: Suggested parameters for highly parallel async client

2013-01-05 Thread Oleg Kalnichevski
On Sat, 2013-01-05 at 14:38 -0800, vigna wrote: > Is there any suggestion for parameters of the asynchronous client in case of > several thousands parallel requests (e.g., for the IOReactor)? We are > experimenting both with DefaulHttpClient and DefaultHttpAsyncClient, and > with the same configura

Re: AbstractNIOConnPool memory leak?

2013-01-05 Thread Oleg Kalnichevski
On Sat, 2013-01-05 at 22:11 +, sebb wrote: > On 5 January 2013 21:33, vigna wrote: > >> But why would you want a web crawler to have 10-20K simultaneously > >> opened connections in the first place? > > > > (I thought I answered this, but it's not on the archive. Boh.) > > > > Having a few tho

Re: Set host name verifier for SystemDefaultHttpClient

2013-01-03 Thread Oleg Kalnichevski
On Thu, 2013-01-03 at 07:57 -0700, Billy Newman wrote: > Looking through the code I am have a hard time trying to understand > the easiest way to get a SystemDefaultHttpClient with the host name > verifier set to ALLOW_ALL_HOSTNAME_VERIFIER. > > I have the following code: > > SystemDefaultHttpCli

Re: AbstractNIOConnPool memory leak?

2012-12-27 Thread Oleg Kalnichevski
On Thu, 2012-12-27 at 12:30 -0800, Sebastiano Vigna wrote: > On 26 December 2012 13:10, Oleg Kalnichevski wrote: > > > > > Just out of curiosity, why are using an asynchronous HTTP client for a > > web crawler? I personally would consider a blocking HTTP client a much

Re: AbstractNIOConnPool memory leak?

2012-12-26 Thread Oleg Kalnichevski
On Tue, 2012-12-25 at 08:53 -0800, vigna wrote: > Well, if you do a world-wide crawl with order of pages in the billions it > happens. This particular problem arose with a proxy simulating 100,000,000 > sites during a crawl. > > I agree that it is an event that can happen only with very specific >

Re: AbstractNIOConnPool memory leak?

2012-12-25 Thread Oleg Kalnichevski
On Mon, 2012-12-24 at 21:01 -0800, vigna wrote: > Well, actually not. I did a careful port-mortem analysis using the Eclipse > Memory Analyzer, and, simply, the map is very huge. There are more than one > million entry, and each entry uses approximately 256 bytes for connections > and routes. > M

Re: Injecting DNS resolver in HttpAsyncClient

2012-12-24 Thread Oleg Kalnichevski
On Sun, 2012-12-23 at 23:03 -0800, vigna wrote: > I'm trying to convince DefaultHttpAsyncClient to use DNSJava instead of the > standard Java DNS. With DefaultHttpClient it is not difficult by using a > specialized DefaultConnectionOperator: > > DefaultHttpClient httpClient = new Def

Re: The correct way to abort a connection from an AsyncByteConsumer

2012-12-24 Thread Oleg Kalnichevski
On Sun, 2012-12-23 at 18:35 -0800, vigna wrote: > We need to abort a connection during a callback to > AsyncByteConsumer.onByteReceived() (essentially, when the number of > processed bytes goes beyond a certain threshold). > > Which is the correct method of IOControl that must be invoked to obtai

Re: AbstractNIOConnPool memory leak?

2012-12-24 Thread Oleg Kalnichevski
On Sun, 2012-12-23 at 18:33 -0800, vigna wrote: > I'm following up on myself. > > Apparently there was a mistake from our part: we were allocating an > asynchronous client for each of our 64 worker threads, instead of having a > single one. In this way the memory allocation per client of the route

Re: HttpAsyncClient and cookies

2012-12-19 Thread Oleg Kalnichevski
On Tue, 2012-12-18 at 15:36 -0800, vigna wrote: > We are trying to use DefaultHttpAsyncClient in our new crawler. We need to > handle a few hundred connections per thread asynchronously, and it seems the > right candidate. > > In the last weeks we experimented with many DefaultHttpClient on a few

Re: ConnectionPoolTimeoutException with multi-threaded HttpClient usage

2012-12-18 Thread Oleg Kalnichevski
On Tue, 2012-12-18 at 21:49 +0200, Marko Asplund wrote: > On 2012-12-16 15:04:25 GMT Oleg Kalnichevski wrote: > > > This can happen if you have a pool with the number of concurrent > > connections much smaller than the number of work threads (which causes a > > high resou

Re: "Proxy Authentication Required" error in using kerberos authentication with Proxy Server

2012-12-18 Thread Oleg Kalnichevski
On Tue, 2012-12-18 at 17:22 +0530, Deepak Mishra wrote: > Hi, > We need to communicate to an internet URL through a Proxy Server, the Proxy > Server has kerberos authentication integrated with an active directory. > I am using HttpClient-4.2 with JRE 1.6.0_37. When I try to connect to an > internet

Re: PoolingClientConnectionManager how to close a selected connection

2012-12-18 Thread Oleg Kalnichevski
On Tue, 2012-12-18 at 09:24 +, Alex wrote: > Hi, > I'm using PoolingClientConnectionManager to obtain a HttpClient and after > execute a HttpPost where I set 1 to max for the pool. > > Looking at connection state with netstat I see the connection status in > ESTABLISHED (and this is the righ

Re: PoolingClientConnectionManager set max number of requests

2012-12-18 Thread Oleg Kalnichevski
On Mon, 2012-12-17 at 07:08 +, Alex wrote: > Hi, > > I thinking to use PoolingClientConnectionManager to connect to EPP server. > The costrains for this server are : > 1) number of max parallel connections > 2) number of max requests in single connection and after use new connect > > For thi

Re: Problems with NTLM proxy authentication and SystemDefaultHttpClient

2012-12-17 Thread Oleg Kalnichevski
... > > > > Hi Daz > > > > I may have found the culprit. Could you please see if the > > 'http.keepAlive' system property on your system is set to anything other > > than 'true'? > > > > The user has confirmed that NTLM authentication works correctly with > "http.keepAlive='true'". When we upgrad

Re: Socket leak of Async HTTP server

2012-12-16 Thread Oleg Kalnichevski
On Sun, 2012-12-16 at 13:03 +0200, Nir Dweck wrote: > Hi, > I am new to HTTP Components. I wrote a short server which is based on the > Asynchronous HTTP Server example. I am using httpcore-4.2.2 and > httpcore-nio-4.2.2. I wrote a short test program that loads my server. I > see that after ~500,00

Re: ConnectionPoolTimeoutException with multi-threaded HttpClient usage

2012-12-16 Thread Oleg Kalnichevski
On Thu, 2012-12-13 at 22:18 +0200, Marko Asplund wrote: > Hi, > > I'm having problems using HttpClient in a multi-threaded environment. > When HttpClient.execute is called I occasionally get the following > error, even when there > probably should be connections available in the pool. > This can

Re: Problems with NTLM proxy authentication and SystemDefaultHttpClient

2012-12-13 Thread Oleg Kalnichevski
On Wed, 2012-12-12 at 09:28 -0700, Daz DeBoer wrote: > Hi > First of all thanks for the great library. As a core Gradle developer, > I really appreciate the power and flexibility that comes with > HttpClient. (Gradle made the switch from java.net.URL based > downloading to using HttpClient over a y

Re: RE: Re: Multiple http clients at one runtime

2012-12-13 Thread Oleg Kalnichevski
On Thu, 2012-12-13 at 13:15 +0400, Eugen Kondrashev wrote: > Another question here is it possible to have both HC3.x and HC4.x in one > runtime. > Is there a space for a conflict? > No, there is not. > Well, ok, but the question then, > > Is it possible to define socket factory instance f

Re: Problems with NTLM proxy authentication and SystemDefaultHttpClient

2012-12-12 Thread Oleg Kalnichevski
On Wed, 2012-12-12 at 09:28 -0700, Daz DeBoer wrote: > Hi > First of all thanks for the great library. As a core Gradle developer, > I really appreciate the power and flexibility that comes with > HttpClient. (Gradle made the switch from java.net.URL based > downloading to using HttpClient over a y

Re: Multiple http clients at one runtime

2012-12-12 Thread Oleg Kalnichevski
On Wed, 2012-12-12 at 20:27 +0400, Eugen Kondrashev wrote: > Hi experts, > > I'm using commons-httpclient-3.1 for my project purposes. > > There are infrastructure and client layers in the project. > Infrastructure uses http client to talk to the server(over ssl), while client > layer performing

Re: PoolingClientconnectionManager release connection

2012-12-04 Thread Oleg Kalnichevski
On Mon, 2012-12-03 at 15:42 -0800, Jaikit Savla wrote: > Hi Folks, > > I am using PoolingClientConnectionManager and wanted to make sure I am not > leaking connections. I read Oleg's comment here ( > http://www.mail-archive.com/httpclient-users@hc.apache.org/msg06061.html) > > My question is: >

Re: HTTP Async client and SO_SNDBUF

2012-12-03 Thread Oleg Kalnichevski
tween non-blocking channels. Oleg > On Mon, Dec 3, 2012 at 8:55 AM, Oleg Kalnichevski wrote: > > > On Sun, 2012-12-02 at 00:12 -0500, Sachin Nikumbh wrote: > > > Hi, > > > > > > Is there a way to set the SO_SNDBUF while working with the async HTTP

Re: HTTP Async client and SO_SNDBUF

2012-12-03 Thread Oleg Kalnichevski
On Sun, 2012-12-02 at 00:12 -0500, Sachin Nikumbh wrote: > Hi, > > Is there a way to set the SO_SNDBUF while working with the async HTTP > client? CoreConnectionPNames class does not expose this property. When I > google'ed on this topic, I found that > org.apache.commons.httpclient.params.HttpCon

[ANNOUNCEMENT] HttpComponents HttpCore 4.3-alpha1 Released

2012-12-02 Thread Oleg Kalnichevski
The Apache HttpComponents project is pleased to announce release 4.3-alpha1 of HttpComponents HttpCore. This is the first release from the 4.3.x release branch. The main theme of the 4.3 release series is streamlining of component configuration and deprecation of the old configuration API based on

[ANNOUNCEMENT] HttpComponents HttpCore 4.2.3 GA Released

2012-12-02 Thread Oleg Kalnichevski
The Apache HttpComponents project is pleased to announce release 4.2.3 (GA) of HttpComponents HttpCore. This is a maintenance release that fixes a number of bugs found since 4.2.2 including a major bug in the NIO module that can cause an infinite loop in SSL sessions under special circumstances whe

Re: releaseConnection() vs getConnectionManager().shutdown()

2012-11-29 Thread Oleg Kalnichevski
On Thu, 2012-11-29 at 13:56 +, Flavio Oliveira wrote: > Oleg, > > Definitely, thank you for clarifying. > > By the way, I am going to do http get in different services (at same host or > not). > So as I only have one instance of the HTTP Client, can I have different > threads with differen

Re: releaseConnection() vs getConnectionManager().shutdown()

2012-11-29 Thread Oleg Kalnichevski
On Wed, 2012-11-28 at 15:16 +, Flavio Oliveira wrote: > Hi, > > I use an instance of HttpClient to execute multiple methods from multiple > threads. > > cm = new PoolingClientConnectionManager(); > cm.setMaxTotal(20); > httpclient = new DefaultHttpClient(cm); > > I r

Re: Should DefaultHttpRequestRetryHandler test for ClosedByInterruptException?

2012-11-22 Thread Oleg Kalnichevski
On Thu, 2012-11-22 at 15:41 +, James Shaw wrote: > On 22 November 2012 15:35, Oleg Kalnichevski wrote: > > > On Thu, 2012-11-22 at 15:02 +, James Shaw wrote: > > > I've been looking at making my HttpClient interruptible. To do this, I'm > >

Re: Should DefaultHttpRequestRetryHandler test for ClosedByInterruptException?

2012-11-22 Thread Oleg Kalnichevski
On Thu, 2012-11-22 at 15:02 +, James Shaw wrote: > I've been looking at making my HttpClient interruptible. To do this, I'm > creating my own SocketFactory and registering it in a SchemeRegistry. But > I'm now having an issue where the request is being retried three times, > each time catchin

Re: HttpAnsyncClient: is there a way to know the uri?

2012-11-20 Thread Oleg Kalnichevski
is where I can find the protocol scheme, > whether it is http or https. I can get to the ProtocolVersion which tells > me that it's HTTP 1.0 or 1.1, but not if it's HTTPS or not. Is there a way > to get this information? > Again, HttpContext is your friend. One can obtain the

Re: HttpAnsyncClient: is there a way to know the uri?

2012-11-18 Thread Oleg Kalnichevski
On Sun, 2012-11-18 at 15:39 -0500, Mark Greene wrote: > Peter, > > One approach I use is when I construct my callback object, I pass in a > reference to the HttpRequest. From there, you can extra the URI. This > approach can also be achieved if you write your own Future wrapper as well. > > Hope

Re: Multiple HTTP async client instances and java.nio.channels.AsynchronousCloseException

2012-11-16 Thread Oleg Kalnichevski
On Fri, 2012-11-16 at 11:44 -0500, Sachin Nikumbh wrote: > Hi Oleg, > > Thanks for your response. > > On Fri, Nov 16, 2012 at 10:59 AM, Oleg Kalnichevski wrote: > > > On Thu, 2012-11-15 at 16:42 -0500, Sachin Nikumbh wrote: > > > Hi, > > > > >

Re: Multiple HTTP async client instances and java.nio.channels.AsynchronousCloseException

2012-11-16 Thread Oleg Kalnichevski
On Thu, 2012-11-15 at 16:42 -0500, Sachin Nikumbh wrote: > Hi, > > I have successfully used the HTTP Async client. It's working great for the > most part. In my application I am creating multiple instances > of DefaultHttpAsyncClient. However, I > get java.nio.channels.AsynchronousCloseException o

Re: how to release leased connection in httpclient PoolingClientConnectionManager

2012-11-16 Thread Oleg Kalnichevski
On Fri, 2012-11-16 at 00:05 +0800, Zhan Zhifeng wrote: > hi, Oleg > > How can I "_always_ response content "? > > I have do these below: > HttpEntity entity = response.getEntity(); > if (entity != null && header_[0].getValue(). > contains("text/html")) { > String html_ = EntityUtils.toString(

Re: how to release leased connection in httpclient PoolingClientConnectionManager

2012-11-15 Thread Oleg Kalnichevski
On Wed, 2012-11-14 at 19:38 +0800, Zhan Zhifeng wrote: > Hi, > > I run a crawler with httpclient. PoolingClientConnectionManager used in the > process of crawling. > I monitor the PoolStats with one monitor thread. And when my crawling > website list is zero, > and the ps_.getLeased() is always no

Re: HTTP Async client and HTTP response 413

2012-11-12 Thread Oleg Kalnichevski
On Mon, 2012-11-12 at 12:10 -0500, Sachin Nikumbh wrote: > Hi, > > I am trying out the HTTP async client and have some sporadic behavior when > it comes to HTTP response 413. The server I am communicating with has a > request size limit. When my request content exceeds this limit, the server > sen

Re: Http Async Client: Connection already open

2012-11-12 Thread Oleg Kalnichevski
On Mon, 2012-11-12 at 11:08 -0500, Mark Greene wrote: > Hi, > > Occasionally I'll get this error when executing a call but would like to > understand the actual source of the problem and if there is some > configuration I can change to prevent it from happening again. > > java.lang.IllegalStateE

Re: Question about IOReactorConfig.soTimeout and IOReactorConfig.ioThreadCount

2012-11-09 Thread Oleg Kalnichevski
On Fri, 2012-11-09 at 16:17 -0500, Sachin Nikumbh wrote: > Hi Oleg, > > Thanks a lot for your response. > > > Hi, > > > > > > I am evaluating HTTP Async client and have following questions. > > > > > > How's IOReactorConfig.soTimeout different > > > from CoreConnectionPNames.SO_TIMEOUT? I am look

Re: Question about IOReactorConfig.soTimeout and IOReactorConfig.ioThreadCount

2012-11-09 Thread Oleg Kalnichevski
On Fri, 2012-11-09 at 11:59 -0500, Sachin Nikumbh wrote: > Hi, > > I am evaluating HTTP Async client and have following questions. > > How's IOReactorConfig.soTimeout different > from CoreConnectionPNames.SO_TIMEOUT? I am looking into the code but it's > not very obvious to me yet. IOReactorConf

Re: httpcore parses expires in Set-Cookie wrong

2012-11-09 Thread Oleg Kalnichevski
On Fri, 2012-11-09 at 16:18 +0100, pvbem...@xs4all.nl wrote: > Hi Jean-Marc, Oleg, > > Thanks for your replies. > > I think I found the relevant part of the spec: > > rfc2616.pdf: page 17: > Many HTTP/1.1 header field values consist of words separated by LWS > or special characters. These sp

Re: ConnManagerParams.setTimeout

2012-11-09 Thread Oleg Kalnichevski
On Fri, 2012-11-09 at 04:55 -0800, Mike Boyers wrote: > I think there is an issue with the current javadoc for ConnManagerParams. > > When I first began using HttpComponents/Client v4.0, I would use > > ConnManagerParams.setTimeout(timeout) > > to > configure the timeout on the connection manag

Re: HTTP Async Client and maximum connections per address

2012-11-09 Thread Oleg Kalnichevski
On Thu, 2012-11-08 at 22:54 -0500, Sachin Nikumbh wrote: > Hi, > > I am trying the HTTP async client and trying to figure out how to get/set > the maximum number of connections per address. What is the default that's > being used? The HTTP specification recommends 2 number of connections per > add

Re: httpcore parses expires in Set-Cookie wrong

2012-11-07 Thread Oleg Kalnichevski
On Wed, 2012-11-07 at 19:43 +0100, pvbem...@xs4all.nl wrote: > Hi JM, > > Look again: the ',' in > >"expires=Sun, 03-Nov-2013 10:54:41 GMT;" > > is parsed as if it were a ';' . > > That leads to > expires=Sun > and > 03-Nov-2013 10:54:41 GMT=null > > I can't believe I'm the fir

Re: PoolStats question

2012-11-06 Thread Oleg Kalnichevski
gt; > > > > > > > > - Original Message - > > From: Oleg Kalnichevski > > To: HttpClient User Discussion > > Cc: > > Sent: Monday, November 5, 2012 3:22 PM > > Subject: Re: PoolStats question > > > > On Sun, 2012-11

Re: Does hc4.2.2 support jdk 7 AIO Feature?

2012-11-06 Thread Oleg Kalnichevski
On Tue, 2012-11-06 at 09:58 +0800, Wei Gao wrote: > thanks a lot, but if anyone has suggestion to the IO model for a high > concurrency and high performance httpclient tool? > Blocking I/O model. Oleg > > On Tue, Nov 6, 2012 at 5:01 AM, Oleg Kalnichevski wrote: > > On

Re: Servlet getInputStream getting truncated

2012-11-06 Thread Oleg Kalnichevski
On Mon, 2012-11-05 at 15:06 -0600, Godbey, David J. (HQ-LM020)[DIGITAL MANAGEMENT INC.] wrote: > This is probably a good place to pose this question. I'm guessing someone > will know what is going on, and perhaps http-client has a solution. > > You will recall that recently I created a "proxy" se

Re: Does hc4.2.2 support jdk 7 AIO Feature?

2012-11-05 Thread Oleg Kalnichevski
On Mon, 2012-11-05 at 20:51 +0800, Wei Gao wrote: > hi, dears > I'd like to use jdk'7 new feature aio together with httpclient or > httpcore api, but do not know if new httpcore api support it > or if anyone has the experience, could you give me some examples? > > man

Re: PoolStats question

2012-11-05 Thread Oleg Kalnichevski
On Sun, 2012-11-04 at 04:44 -0800, Mike Boyers wrote: > I'm upgrading to 4.2 from 4.1 and am wondering what the various definitions > are for these methods in PoolStats: > > getLeased() persistent connections tracked by the connection manager currently being used to execute requests. > getPendi

Re: Unable to get HttpStatus.SC_REQUEST_TOO_LONG status successfully

2012-11-01 Thread Oleg Kalnichevski
sing HttpAsyncClient and it's working as > > expected. Is the async client still in beta version? Are there any known > > issues that I should be aware of? > > > > Thanks > > Sachin > > Yes, it is still considered BETA because its APIs are not finalized. It is reaso

Re: SSL Session caching and connection pooling

2012-11-01 Thread Oleg Kalnichevski
On Wed, Oct 31, 2012 at 05:02:39PM -0700, John Sheehy wrote: > Hi all, > > if there are any Android users out there, does anyone know if there is > a need to explicitly provide an SSL session cache with HttpClient 4.2 > in order to avoid TLS negotiation with every new TCP connection ? > > I've go

Re: Detecting when SSL socket connects

2012-11-01 Thread Oleg Kalnichevski
gt;> > >> https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/proxy/http/TrustingSSLSocketFactory.java > >> > >> the custom ssl socket that sets the listener Oleg mentioned: > >> > >> https://github.com/webmetrics/b

Re: Unable to get HttpStatus.SC_REQUEST_TOO_LONG status successfully

2012-11-01 Thread Oleg Kalnichevski
On Wed, Oct 31, 2012 at 09:19:19AM -0400, Sachin Nikumbh wrote: > Hi, > > I am using HttpClient (version 4.2.2) to communicate with a server using > POST requests. The server can be configured to set request size limit. Once > the request content exceeds this limit, it sends HTTP 413 response stat

Re: Detecting when SSL socket connects

2012-10-31 Thread Oleg Kalnichevski
On Tue, Oct 30, 2012 at 02:42:47PM -0700, John Sheehy wrote: > Hi all, > > using HttpComponents client 4.2.2, is there a way I can be notified when an > SSL connection is ready for writing? I'm using a > PoolingClientConnectionManager and I think I need to somehow override > DefaultClientConnectio

Re: SSLv3 support

2012-10-26 Thread Oleg Kalnichevski
On Fri, 2012-10-26 at 11:06 +0200, Olivier Lamy wrote: > Hi, > Is there any way to handle SSLv3 (see related maven issue > https://jira.codehaus.org/browse/MNG-5363 ) ? > Or what is the best way to achieve that ? > > Thanks for any advice Hi Olivier One can exert full control over the connectio

[ANNOUNCEMENT] HttpComponents HttpClient 4.2.2 GA release

2012-10-25 Thread Oleg Kalnichevski
The HttpComponents project is pleased to announce 4.2.2 GA release of Apache HttpClient. This is a bug fix release that addresses number of issues reported since release 4.2.1. Users of HttpClient 4.2 are advised to upgrade. --- Download - R

Re: HttpClient with PoolingClientConnectionManager throws read time out

2012-10-17 Thread Oleg Kalnichevski
ration(response, context); returning > MAX_INT and it is not getting inside the if(keepAlive==-1) ?? > > I just double-checked. -1 is default. Oleg > I'm using httpclient 4.2 > > 2012/10/17 Oleg Kalnichevski : > > On Wed, 2012-10-17 at 10:07 -0400, Mark Claassen w

RE: HttpClient with PoolingClientConnectionManager throws read time out

2012-10-17 Thread Oleg Kalnichevski
super.getKeepAliveDuration(response, > context); > if (keepAlive == -1) { > keepAlive = 15000; > } > return keepAlive; > } > > }); &

<    10   11   12   13   14   15   16   17   18   19   >