Re: Usage of HTTP client and core

2013-03-15 Thread Jean-Marc Spaggiari
I think it's a mistake but it's not an issue. Please take a look here and look at the last message: http://httpcomponents.10934.n7.nabble.com/ANNOUNCEMENT-HttpComponents-HttpClient-4-2-3-GA-release-td18820.html 2013/3/15 Francois-Xavier Bonnet : > Hi, > > HttpComponents-client has been developed

Re: Suggested parameters for highly parallel async client

2013-02-08 Thread Jean-Marc Spaggiari
> From my personal experience a decent blocking HTTP client can be > expected to outperform a decent non-blocking HTTP client by 50 to 100%, > but such a massive difference does look very suspicious. My guess, > though, that the way pages are being processed can be a limiting factor > more more tha

Re: connect through proxy

2013-01-24 Thread Jean-Marc Spaggiari
This piece of code is working for me: HttpParams params = new BasicHttpParams(); params.setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(proxyhostname, 80)); client = new DefaultHttpClient(cm, params); You might want to look at something similar. JM 2013/1/24, Kevin Weslowski : > Hi, >

Re: [ANNOUNCEMENT] HttpComponents HttpClient 4.2.3 GA release

2013-01-15 Thread Jean-Marc Spaggiari
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 2013/1/15, 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 >

Re: Limit respons size?

2013-01-04 Thread Jean-Marc Spaggiari
I think I found... By replacing Void by HttpResponse and returning the response instead of null... Thanks! I will continue to dig that way. JM 2013/1/4, Jean-Marc Spaggiari : > Hi Sabastiano, > > Thanks for sharing. > > Previously I was doing: > HttpResponse respons = clie

Re: Limit respons size?

2013-01-04 Thread Jean-Marc Spaggiari
Hi Sabastiano, Thanks for sharing. Previously I was doing: HttpResponse respons = client.execute (method); With you code, it's not returning anything. How should I get the HttpResponse from this? Thanks, JM 2013/1/1, Sebastiano Vigna : > On 1 Jan 2013, at 11:32 AM, Jean-Marc S

Re: Limit respons size?

2013-01-01 Thread Jean-Marc Spaggiari
But the probleme is that I can't trust the server. I need to make sure that the client is robust so in case server is failing or not supporting the HTTP range request, client is still exiting after a certain quantity of bytes received... 2013/1/1, James Shaw : > On 1 January 2013 19:32, J

Limit respons size?

2013-01-01 Thread Jean-Marc Spaggiari
Hi, Is there a way to limit the respons size? Like, if I call http://my.domain.com/my/page and it's trying to return me a 5GB ISO file, I don't want to consume that. I want to abort the call as soon as it's over a certain amount of bytes. If I do response.getEntity() is it going to give the cont

Re: Right way to timeout

2012-12-17 Thread Jean-Marc Spaggiari
ll .abort() on the request (this method is > thread-safe). For example, I use this class and create a new instance of it > for every request I want to timeout. When I get a response, I interrupt my > timeout thread. > > http://pastebin.com/sRZdZuKx > > > On Sun, Dec 1

Right way to timeout

2012-12-16 Thread Jean-Marc Spaggiari
Hi, What's the "right" way to configure the timeout with HttpClient 4.2.1? Here is what I'm doing: HttpParams params = client.getParams(); HttpConnectionParams.setConnectionTimeout(params, 3); HttpConnectionParams.setSo

Re: ConnManagerParams.setTimeout

2012-11-09 Thread Jean-Marc Spaggiari
I figured also that timeout is not working very well and had to implement my own timeout (starting the get on a thread and killing it after the timeout if required). So I'm very interesting by what you found here. JM 2012/11/9, Mike Boyers : > I think there is an issue with the current javadoc fo

Re: HTTP Async Client and maximum connections per address

2012-11-09 Thread Jean-Marc Spaggiari
Hi, I don't think there is any limitation on HTTP async client side. Server side, only few of your requests will be replied at the same time based on the server configuration and all your other requests will just timed out. But client side, you can do almost what ever you want. JM 2012/11/8, Sac

Re: httpcore parses expires in Set-Cookie wrong

2012-11-07 Thread Jean-Marc Spaggiari
Oh! I see! This is working fine: response.addHeader("Set-Cookie", "c2=b; expires=\"Sun, 03-Nov-2013 10:54:41 GMT\"; path=\"/\", c3=c; domain=\"localhost\""); 2012/11/7, pvbem...@xs4all.nl : > > Hi JM, > > Look again: the ',' in > >"expires=Sun, 03-Nov-2013 10:54:41 GMT;" > > is parse

Re: httpcore parses expires date in Set-Cookie wrong

2012-11-06 Thread Jean-Marc Spaggiari
Hi Paul, I don't see anything wrong with the output. What will have you expected? JM 2012/11/6, pvbem...@xs4all.nl : > > I'm using httpcore-4.2.1 , and code below shows the problem. > The code is similar to that on page 2 of the httpcore tutorial pdf. > I only added a Set-Cookie with an expires

Re: Not able to fetch an OCSP Response

2012-09-13 Thread Jean-Marc Spaggiari
Can you past the complete exception here? Is there any causes in the exception? 2012/9/13, Oliver Zemann : > Hi, > > when i try to HttpGet the following URL http://ocsp.a-trust.at/ocsp > (which i can access in FF and get OK 200 with size -1 (no idea why) > its working as expexted) i get an > org.a

Re: infinite loop in ContentInputStream.close()

2012-08-18 Thread Jean-Marc Spaggiari
Hi Kireet, To avoid such issues (I faces many time issues where it's not responsing or timeout is not respected), I have implemented something like that and I'm doing all the calls that way. I might be possible to improve it. I did it very quickly. JM public HttpResponse executeSafe (fi

Re: Bandwidth usage

2012-08-08 Thread Jean-Marc Spaggiari
requestHeader.getName() != null) { > requestHeaderByteSize += requestHeader.getName().getBytes().length; > } > if (requestHeader.getValue() != null) { > requestHeaderByteSize += requestHeader.getValue().getBytes().length; > } > } > return requestHeaderByteSize; > } > > O

Bandwidth usage

2012-08-08 Thread Jean-Marc Spaggiari
Hi, Is there a good way to calculate the bandwidth used by a request? I'm doing a get and I try to track the upload and download bandwidth used. So for a get, there is some upload to the server. There is the URL, and the headers. But seems there is a bit more than that and I'm not able to figure

Re: NullPointerException in BestMatchSpec.formatCookies

2012-08-02 Thread Jean-Marc Spaggiari
g for few days. So it might take time before it happens again. 2012/8/2, sebb : > On 2 August 2012 19:36, Jean-Marc Spaggiari > wrote: >> I'm using 1.7.0_05 from Sun. >> >> I have enabled the RequestAddCookies debug logs and will see when I >> will get the next N

Re: NullPointerException in BestMatchSpec.formatCookies

2012-08-02 Thread Jean-Marc Spaggiari
an NPE at "if (!matchedCookies.isEmpty())" I will restart my tool with the debug mode enabled and keep you posted. 2012/8/2, sebb : > On 2 August 2012 19:03, Jean-Marc Spaggiari > wrote: >> I'm using version 4.2.1 binary distribution. > > In which ca

Re: NullPointerException in BestMatchSpec.formatCookies

2012-08-02 Thread Jean-Marc Spaggiari
I'm using version 4.2.1 binary distribution. 2012/8/2, sebb : > On 1 August 2012 12:08, Jean-Marc Spaggiari > wrote: >> Hi Oleg, >> >> My application is reading many other URLs before this one. So maybe >> it's a combination of multiple loads. >>

Re: NullPointerException in BestMatchSpec.formatCookies

2012-08-01 Thread Jean-Marc Spaggiari
able to reproduce that in a near futur. JM 2012/8/1, Oleg Kalnichevski : > On Tue, 2012-07-31 at 17:37 -0400, Jean-Marc Spaggiari wrote: >> Hi, >> >> I'm getting the exception below when I'm trying to load >> http://www.expedia.ca/Sunset-District-Hotels.d163

NullPointerException in BestMatchSpec.formatCookies

2012-07-31 Thread Jean-Marc Spaggiari
Hi, I'm getting the exception below when I'm trying to load http://www.expedia.ca/Sunset-District-Hotels.d163838.Travel-Guide-Hotels ... It's not critical since I'm catching everything, but I'm wondering if this is normal or if this is something which need to be fixed... java.lang.NullPointerExce

Re: Multithreads vs UnknownHostException

2012-07-24 Thread Jean-Marc Spaggiari
consider performing the lookups at the start, storing them in an > InMemoryDnsResolver > (http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/InMemoryDnsResolver.html) > and then never rely upon external DNS lookups after that. > > Hope this h

Multithreads vs UnknownHostException

2012-07-23 Thread Jean-Marc Spaggiari
Hi, I have an application where I'm trying to read about 30 URLs at a time from a 5000 URLs' list. I have implemented 30 threads to retrieve the content. I'm initialysing the HttpClient that way: SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme("http", 80