Re: Possible Bug With HttpCore-NIO 4.1

2010-11-20 Thread Oleg Kalnichevski
On Fri, 2010-11-19 at 19:48 -0800, Michael Poindexter wrote: > I'm seeing a problem with AsyncNHttpClientHandler in v4.1 of HttpCore. When > I submit a number of requests simultaneously (anything > 12 seems to trigger > it for me), I get this exception: > > Caused by: java.lang.NullPointerExcep

[ANNOUNCEMENT] HttpComponents HttpClient 4.1-beta1 Released

2010-11-21 Thread Oleg Kalnichevski
HttpClient 4.1-beta1 finalizes the 4.1 API and brings a number of major improvements to the HTTP caching module. This release also adds full support for NTLMv1, NTLMv2, and NTLM2 Session authentication. The NTLM protocol code was kindly contributed by the Lucene Connector Framework project. I

Re: How many bytes did I get?

2010-11-24 Thread Oleg Kalnichevski
On Wed, 2010-11-24 at 14:59 +0200, John Smith wrote: > Hello everyone! > I describe my situation. > > I download some content from some sites by HttpClient. > I send GET request and get HttpEntity to byte array: > > bEntity = EntityUtils.toByteArray(entity); > then I save bEntity in file. > > I

Re: Close/interrupt HTTP connections

2010-11-24 Thread Oleg Kalnichevski
On Wed, 2010-11-24 at 19:55 +0100, Roman Kennke wrote: > Hello, > > I need to be able to close/interrupt an active connection. The only ways to > achieve this, as far as I understand it, is to: > - Close the socket from a 2nd thread. This would throw a SocketConnection on > the blocked thread. I

Re: How many bytes did I get?

2010-11-25 Thread Oleg Kalnichevski
On Thu, 2010-11-25 at 06:37 +0200, John Smith wrote: > On 24 of November 2010 23:09:30 Oleg Kalnichevski wrote: > > On Wed, 2010-11-24 at 14:59 +0200, John Smith wrote: > > > > Do you want just the final total or you intermediate data for a process > > indicator

Re: Multithreaded http downloads

2010-11-30 Thread Oleg Kalnichevski
On Tue, 2010-11-30 at 11:22 +0100, Håkon Sagehaug wrote: > Hi all, > > I've got a service that users can use to download files from a http. I want > to add functionality so that a user can supply many urls and the service > starts to download the files. So I wondered if the way described here[1] i

Re: WebServis authentication problem, Android

2010-12-01 Thread Oleg Kalnichevski
On Wed, 2010-12-01 at 10:49 +0200, Filiz Gökçe wrote: > Hi, > I have a service that gives xml data. But it didn't connect, I reseach all > of documents on internet and you site, I develop my code on you site exampl= > e > > I give the example of my code : > > protected InputStream getInputStream(

RE: Multithreaded http downloads

2010-12-01 Thread Oleg Kalnichevski
On Wed, 2010-12-01 at 12:55 +0100, Roman Kennke wrote: > Hi, > > >> I've got a service that users can use to download files from a http. I want > >> to add functionality so that a user can supply many urls and the service > >> starts to download the files. So I wondered if the way described here[1

Re: entity.consumeContent() deprecated in 4.0.3

2010-12-01 Thread Oleg Kalnichevski
On Wed, 2010-12-01 at 17:49 +0100, Joan Balaguero wrote: > Hello, > > > > The entity.consumeContent() method is deprecated in 4.0.3. What must we use > instead of it? > > > > Currently we’re using this method to be sure that the content is consumed > and connection is released. And it’s wor

Re: How to prevent HttpClient from downloading large files?

2010-12-02 Thread Oleg Kalnichevski
On Wed, 2010-12-01 at 10:50 -0800, yoosh wrote: > Hi, > > I've searched the forum: > > http://old.nabble.com/Opening-streaming-URL-td11290919.html#a11344350 > http://old.nabble.com/Opening-streaming-URL-td11290919.html#a11344350 > > based on the above, I still don't understand fully that: > >

RE: Close/interrupt HTTP connections

2010-12-03 Thread Oleg Kalnichevski
On Fri, 2010-12-03 at 12:29 +0100, Roman Kennke wrote: > Hi Oleg, > > HttpConnection.shutdown() seem to be perfect for this. Thanks. > > However, one question remains. Is there a way to distinguish between the > IOException thrown be shutdown and other (i.e. protocol/network related) > IOExcept

RE: Close/interrupt HTTP connections

2010-12-03 Thread Oleg Kalnichevski
On Fri, 2010-12-03 at 13:08 +0100, Roman Kennke wrote: > >> However, one question remains. Is there a way to distinguish between the > >> IOException thrown be >shutdown and other (i.e. protocol/network related) > >> IOException? As far as I can see, there is no >special subclass for > >> shutdo

Re: HttpClient 3.1 & Too Many Open Files

2010-12-06 Thread Oleg Kalnichevski
On Mon, 2010-12-06 at 12:41 -0600, Douglas Ferguson wrote: > This just seems like a hack.. Is there no way to make HttpClient clean up its > connections. > > D/ > You need to evict connections from the pool that have been idle for too long. http://hc.apache.org/httpcomponents-client-ga/tutoria

Re: HttpComponents 4.0.1 - POST + File Transfer + Form

2010-12-10 Thread Oleg Kalnichevski
On Thu, 2010-12-09 at 23:57 -0800, Karl Heinz Marbaise wrote: > Hi to all, > > I have the following http://imagebin.ca/view/vt_QBTQ6.html form which i > like to post data to...and i have the following code: > > DefaultHttpClient httpClient = new DefaultHttpClient(); > String tr

Re: Trouble with TrustManager and TrustStrategy for self-signed-certificates

2010-12-13 Thread Oleg Kalnichevski
On Mon, 2010-12-13 at 09:23 +0100, Gerhard Sinne wrote: > Hi all, > I've asked something similar before, so apologies if you feel its doubled. > > I have a https- Server that I need to connect to using HTTPS and digest > authentication. This works perfect with plain HTTP. > > Now for SSL, I impl

Re: Trouble with TrustManager and TrustStrategy for self-signed-certificates

2010-12-14 Thread Oleg Kalnichevski
On Tue, 2010-12-14 at 09:19 +0100, Gerhard Sinne wrote: > > > > Gerd > > > > I find it somewhat difficult to believe that the trust manager never > > gets called. You might want to turn on the SSL debugging to find out > > what certificates are trusted. > > > > > http://download.oracle.com/java

Re: Trouble with TrustManager and TrustStrategy for self-signed-certificates

2010-12-14 Thread Oleg Kalnichevski
On Tue, 2010-12-14 at 11:51 +0100, Gerhard Sinne wrote: > > > main, WRITE: TLSv1 Alert, length = 2 > > > > Gerd > > > > This looks like a SSL protocol compatibility issue. Try using a > > different version of the protocol (SSLv1 or TLSv1) and see if that makes > > any difference. > > I inspected

Re: Trying to get a safe multi-threaded implementation, getting I/O exception (java.net.SocketException) caught when processing request: Connection reset

2010-12-14 Thread Oleg Kalnichevski
On Tue, 2010-12-14 at 12:32 +0100, H. Brunsting wrote: > Hi, > > I'm trying to get a multi-threaded implementation of HttpClient. > Basically i have a number of threads that call getHttpData() > concurrently. It seems to work, but upon starting my threads I get a > bunch of exceptions: > > Dec 14

Re: HttpCore/HttpClient services integration in a J2EE Servlet container

2010-12-15 Thread Oleg Kalnichevski
On Wed, 2010-12-15 at 17:44 +0100, Javier Ramos wrote: > Thanks, Oleg > > I understand that reusing an HttpClient instance is a recommended practice, > ¿right? > > If we push this reuse strategy to the limit then it should be best to have > just one HttpClient with a ThreadSafeClientConnManager i

Re: AW: No IOException when reading from ResponseBodyStream

2010-12-15 Thread Oleg Kalnichevski
On Wed, 2010-12-15 at 18:44 +0100, daniel.stu...@attensity.com wrote: > Hi again, > > I just donwloaded HttpCore 4.1 and created a small test sample to > reproduce the problem described in my former mail. > When using the InputStream provided by HttpResponse > getEntity().getContent() I get, as ex

Re: Trouble with TrustManager and TrustStrategy for self-signed-certificates

2010-12-20 Thread Oleg Kalnichevski
On Fri, 2010-12-17 at 14:45 +0100, Gerhard Sinne wrote: > Hi Oleg, > may I raise this issue again ? > > > > > Gerd > > > > > > > > This looks like a SSL protocol compatibility issue. Try using a > > > > different version of the protocol (SSLv1 or TLSv1) and see if that > makes > > > > any diffe

Re: HttpClient4.0.3 performance problem, much slower than HttpClient3.1?

2010-12-28 Thread Oleg Kalnichevski
On Tue, 2010-12-28 at 16:33 +0800, 世涛 wrote: > Hi all: > > I'm considering to update HttpClient3.1 to HttpClient4.0.3 in my new project, > and I must be sure that system speed will not be slower. > So I did some tests, but I found that Httpclient4's performance is not as > good as HttpClient3.1.

Re: HttpClient4.0.3 performance problem, much slower than HttpClient3.1?

2010-12-28 Thread Oleg Kalnichevski
... > Thanks very much for your quick reply! > > I just did the benchmark test from your email, in the benchmark, the > number of requests was 1, but the result seems not satisfying. > The result data is below: > > [zhangshi...@inc-130-120 http-benchmark]$ ./httpclient4.sh > http://10.20.130

Re: getting NoHttpResponseException("The target server failed to respond")

2011-01-04 Thread Oleg Kalnichevski
On Tue, 2011-01-04 at 17:30 +0200, Ittay Dror wrote: > It turns out this is because my warmupInput file was empty. The server > responded with 100 (continue), but because the file was empty nothing > was written to the output stream, so after a while there was a timeout. > > IMHO, this is a bug.

Re: getting NoHttpResponseException("The target server failed to respond")

2011-01-04 Thread Oleg Kalnichevski
"Ittay Dror" wrote: > > >Oleg Kalnichevski wrote: >> On Tue, 2011-01-04 at 17:30 +0200, Ittay Dror wrote: >>> It turns out this is because my warmupInput file was empty. The >server >>> responded with 100 (continue), but because the file was empty

Re: getting NoHttpResponseException("The target server failed to respond")

2011-01-04 Thread Oleg Kalnichevski
"Ittay Dror" wrote: > > >Oleg Kalnichevski wrote: >> "Ittay Dror" wrote: >> >>> >>> Oleg Kalnichevski wrote: >>>> On Tue, 2011-01-04 at 17:30 +0200, Ittay Dror wrote: >>>>> It turns out this is because

Re: getting NoHttpResponseException("The target server failed to respond")

2011-01-04 Thread Oleg Kalnichevski
> >>> > > In which case HttpClent would use chunk coding to signal the end of the > > message body. That means there would be at least a closing tag. > > I don't know HttpClient like you, but once I put some content in the > file everything works. > > Please produce wire log of the HTTP sessio

Re: getting NoHttpResponseException("The target server failed to respond")

2011-01-04 Thread Oleg Kalnichevski
On Tue, 2011-01-04 at 19:32 +0100, Oleg Kalnichevski wrote: > > >>> > > > In which case HttpClent would use chunk coding to signal the end of the > > > message body. That means there would be at least a closing tag. > > > > I don't know HttpC

Re: Correct usage (instantiation of httpClient, proxy, resource releasing)

2011-01-05 Thread Oleg Kalnichevski
On Wed, 2011-01-05 at 13:33 +0100, Stelios Togias wrote: > Hi, > > Not sure how to phrase this... > > 1) Is creating a new instance of HttpClient a costly operation? No, it is not, but creating a new instance of a connection manager is. > Meaning is > it ok to create a new instance > each time

Re: httpclient 3.1 failing DIGEST authentication

2011-01-05 Thread Oleg Kalnichevski
On Wed, 2011-01-05 at 15:54 +0100, Claudio Martella wrote: > Done. > > It basically does a simple Basic authentication putting user and > password in the request: > > http://user:passw...@ip/ > > This doesn't happen with httpclient which tries a basic authentication > through the Authenticate he

Re: Correct usage (instantiation of httpClient, proxy, resource releasing)

2011-01-05 Thread Oleg Kalnichevski
On Wed, 2011-01-05 at 16:54 +0100, Stelios Togias wrote: > Hi Oleg thanks for the answers there are helpful :) > > how can I set the proxy per request? > ConnRoutePName#DEFAULT_PROXY parameter is your friend. Oleg - To unsub

Re: Correct usage (instantiation of httpClient, proxy, resource releasing)

2011-01-07 Thread Oleg Kalnichevski
On Fri, 2011-01-07 at 11:51 +0100, Stelios Togias wrote: > so I would do: > httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); > > and when I don't want to use it > httpClient.getParams().removeParameter(ConnRoutePNames.DEFAULT_PROXY); > > thanks > stelios > HttpUriReque

Re: Correct usage (instantiation of httpClient, proxy, resource releasing)

2011-01-07 Thread Oleg Kalnichevski
On Fri, 2011-01-07 at 14:02 +0100, Stelios Togias wrote: > ok that sets the proxy, now when I want to remove it I do > httpClient.getParams().removeParameter(ConnRoutePNames.DEFAULT_PROXY); > or I set the ConnRoutePNames some other value... > > You do not _need_ to remove anything as this parame

HttpClient 4.1 GA and HttpAsyncHttpClient 4.0-alpha1 releases expected next week

2011-01-07 Thread Oleg Kalnichevski
Folks HttpClient 4.1 GA and HttpAsyncHttpClient 4.0-alpha1 releases are expected next week provided no release blockers are reported in the next few days. Please do try to find time to test the latest build of HttpClient for compatibility with your applications and report issues if found. You ma

Re: Need help with ProxySelectorRoutePlanner

2011-01-11 Thread Oleg Kalnichevski
On Mon, 2011-01-10 at 18:00 -0500, David Motes wrote: > I seem to be missing something. I am trying to use this sample code > from the doc to access a proxy without > configuring the proxy parms. > > One can also instruct HttpClient to use standard JRE proxy selector to > obtain proxy information:

Re: HttpDelete and similar could exhaust your http connection pool if not handled properly

2011-01-11 Thread Oleg Kalnichevski
On Tue, 2011-01-11 at 06:11 +0100, Stevo Slavić wrote: > Hello httpclient-users, > > Beginner httpclient user here and this is more note to self and > httpclient users alike. Been hit by http connection pool getting > exhausted, randomly, on production... For few days I've been BMHATW, > suspected

Re: HttpDelete and similar could exhaust your http connection pool if not handled properly

2011-01-11 Thread Oleg Kalnichevski
On Tue, 2011-01-11 at 19:17 +0100, Stevo Slavić wrote: > It seems they were. > > On client side of communication I now have: > > > HttpDelete httpDelete = new HttpDelete(deleteUrl); > > try { > HttpResponse response = client.execute(delete); >

Re: HttpDelete and similar could exhaust your http connection pool if not handled properly

2011-01-11 Thread Oleg Kalnichevski
On Tue, 2011-01-11 at 22:21 +0100, Stevo Slavić wrote: > @Oleg > > 4) So it's better / more recommended to consumeContent of response > entity than to abort request? Is connection considered reusable when > contentConsumed compared to abort where it gets discarded and new > connection needs to be

Re: Need help with ProxySelectorRoutePlanner

2011-01-13 Thread Oleg Kalnichevski
On Wed, 2011-01-12 at 14:07 -0500, David Motes wrote: > After spending too much time on ProxySelectorRoutePlanner, here is > what I have discovered. > > Note this is for a Java application not an applet. > > If you do not use System.setProperty("java.net.useSystemProxies", > "true"); in your pro

Re: Httpclient duplicate cookies issue

2011-01-13 Thread Oleg Kalnichevski
On Thu, 2011-01-13 at 05:34 -0800, motital74 wrote: > I am connecting to a web site which send in the response the same cookies > twice. > The first one with value and second one empty. > The httpclient take the last one (with the empty value) to the cookie store > and dismiss the one with the valu

Re: Need help with ProxySelectorRoutePlanner

2011-01-14 Thread Oleg Kalnichevski
On Thu, 2011-01-13 at 16:57 -0500, David Motes wrote: > I probably was not clear about the ProxySelectorRoutePlanner, I took > that code out. > > With ProxySelectorRoutePlanner and > System.setProperty("java.net.useSystemProxies", > "true") the routing code looks right based on the trace: > 2011/

Re: Multiple post with Httpclient 4.0.3 hanging randomly

2011-01-17 Thread Oleg Kalnichevski
On Fri, 2011-01-14 at 10:24 -0800, sherkal wrote: > Hello friends, let me explain the situation. > > I have a servlet redirecting outgoing GET/POST to another project on another > domain (some kind of proxy) whose job is to handle it and return some stuff > (params and a gif). Im using HttpClient

Re: peer review for RFE ...

2011-01-17 Thread Oleg Kalnichevski
On Sun, 2011-01-16 at 16:19 +, Albretch Mueller wrote: > ~ > As we well know, (RFC 616: 5.3, 6.2; RFC 822: 3.1, RFC: 4229), > servers do not send response headers metadata ordered in any > particular way. They are just a bag of {property:value} text strings > of ISO-8859-1 characters. Response

[ANNOUNCEMENT] HttpComponents HttpAsyncClient 4.0-alpha1 Released

2011-01-18 Thread Oleg Kalnichevski
This is the first public release of Apache HttpAsyncClient. HttpAsyncClient is a library for asynchronous client-side HTTP communication built on top of HttpCore NIO and HttpClient components. HttpAsyncClient is NOT meant to replace or supersede Apache HttpClient. It is a complementary library to

Re: Multiple post with Httpclient 4.0.3 hanging randomly

2011-01-18 Thread Oleg Kalnichevski
> > > > Hmm I set connPerRoute.setDefaultMaxPerRoute(50); still doesnt work :|. > It seems to hang when I have 2 POST called exactly at the same time, async > ajax. Please follow the instructions of the HttpClient logging guide, enable context logging for connection management / request executi

Re: Changing connection manager params

2011-01-18 Thread Oleg Kalnichevski
On Tue, 2011-01-18 at 21:23 +0100, Stevo Slavić wrote: > Hello httpclient users, > > Can someone please just validate if following is true or not. It seems > to me that it was possible in 3.x to change connection manager > parameters even after it's construction. It doesn't seem possible now > in

Re: Changing connection manager params

2011-01-19 Thread Oleg Kalnichevski
On Wed, 2011-01-19 at 09:57 +0100, Stevo Slavić wrote: > Besides 4.1-beta2-snapshot [1], I don't see 4.1 (GA) at maven central > [2]. Switched to that snapshot. > The release vote is ongoing. I expect it to be closed tomorrow. > Found means to change configuration - most I couldn't initially fin

Re: Threads hang in ThreadSafeClientConnManager.getConnection:216

2011-01-19 Thread Oleg Kalnichevski
On Wed, 2011-01-19 at 02:32 -0800, olze wrote: > I wrote a multithreaded Tool which creates some DefaultHttpClient instances > and HttpGets which then download a site (like a crawler). My Problem is > that, after a couple of minutes (~20) the application goes slower and > slower. In the beginning 1

Re: new HttpPost(post_url); fails inside an web applet

2011-01-20 Thread Oleg Kalnichevski
On Thu, 2011-01-20 at 14:54 +, Giuseppe De Marco wrote: > who can tell me why if I use HttpPost and HttpGet inside a webapplet theese > works only if the post/get_url is different from the server that has given me > the applet? > > If in a java webapplet I launch a procedure to connect to si

Re: TLS close handshake

2011-01-21 Thread Oleg Kalnichevski
On Fri, 2011-01-21 at 14:17 +, Matthew Churcher wrote: > Hi All, > > HttpClient appears to be closing https connections without completing the > TLS close handshake. This is reported by our server but also the JCCE > debugging on the client. I'm using 4.1-beta1, does this occur in other > peop

[ANNOUNCEMENT] HttpComponents HttpClient 4.1 (GA) release

2011-01-24 Thread Oleg Kalnichevski
The HttpComponents project is pleased to announce 4.1 (GA) release of Apache HttpClient. HttpClient 4.1 builds upon the stable foundation laid by HttpClient 4.0 and adds several functional improvements and popular features: * Response caching conditionally compliant with HTTP/1.1 specification (fu

RE: Problem with Proxy Basic Authentication

2011-01-25 Thread Oleg Kalnichevski
On Mon, 2011-01-24 at 21:50 -0200, Rodrigo B. Campacci wrote: > Hi, > > I'm trying to make a GET request through a HTTP proxy (squid) with basic > authentication (user and password). > > I found a sample of how to do that using version 3.0, but for version 4.x I > can't found this. > Please pos

RE: Problem with Proxy Basic Authentication

2011-01-26 Thread Oleg Kalnichevski
> 2011/01/25 23:50:14:464 GMT [DEBUG] DefaultClientConnection - Receiving > response: HTTP/1.0 407 Proxy Authentication Required > 2011/01/25 23:50:14:464 GMT [DEBUG] headers - << HTTP/1.0 407 Proxy > Authentication Required > 2011/01/25 23:50:14:464 GMT [DEBUG] headers - << Server: squid/2.6.ST

Re: Resolving bad formatted hrefs.

2011-01-26 Thread Oleg Kalnichevski
On Wed, 2011-01-26 at 16:02 +0100, Karl Wettin wrote: > Hi gang, > > I've implemented a piece of code that resolved bad formatted URIs (as in > hrefs, etc) and what not similar to the way browsers does it. It doesn't > really belong in hc but it's the best project fit I can find and since I find

Re: RE How to prevent retry on time out while waiting for response

2011-01-26 Thread Oleg Kalnichevski
On Wed, 2011-01-26 at 11:14 -0500, laurent.duper...@videotron.com wrote: > Let me just add that I tried a much shorter timeout (20 seconds) and that > makes the process fail much more rapidly. > > I'm also investigating whether the fact that the httpclient call is > executed within a thread has

Re: Resolving bad formatted hrefs.

2011-01-27 Thread Oleg Kalnichevski
On Wed, 2011-01-26 at 19:31 +0100, Karl Wettin wrote: > On Jan 26, 2011, at 5:25 PM, Oleg Kalnichevski wrote: > > > On Wed, 2011-01-26 at 16:02 +0100, Karl Wettin wrote: > >> I've implemented a piece of code that resolved bad formatted URIs (as in > >> hrefs, e

Re: set encodings for http post in httpclient v4.1

2011-01-27 Thread Oleg Kalnichevski
On Thu, 2011-01-27 at 01:03 +0100, Yanchuan Li wrote: > Hello, > I've been using httpclient v4.1 in my application. But so far I've searched > for the whole week and couldn't find how to set encoding to UTF8 for all my > post requests. I mean, we have got really a few documents there. > Following

RE: Problem with Proxy Basic Authentication

2011-01-27 Thread Oleg Kalnichevski
On Thu, 2011-01-27 at 01:28 -0200, Rodrigo B. Campacci wrote: > Hi Oleg! ... > > And I don't get anything printed in console. > But jUnit in eclipse captured an exception stacktrace: > (sorry to don´t mention that before, I´m a little bit new at jUnit in Eclipse) > > java.lang.NoClassDefFoundE

RE: Problem with Proxy Basic Authentication

2011-01-27 Thread Oleg Kalnichevski
On Thu, 2011-01-27 at 17:54 -0200, Rodrigo B. Campacci wrote: > Thanks, Oleg! > > Just included Apache Commons Codec in my pom.xml and it works! > > > org.apache.commons > commons-codec > 1.3 > > > But remains one ques

Re: multi-user/settings with httpclient

2011-01-28 Thread Oleg Kalnichevski
On Fri, 2011-01-28 at 00:05 +0100, khiem nguyen wrote: > hi, > i want to use http-client to implement a kind of proxy-server, since it'll > be used by several users & each user can have different settings > (cookie-handling, headers-handling...), is there a better way than to give > each user 1 or

Re: multi-user/settings with httpclient

2011-01-28 Thread Oleg Kalnichevski
On Fri, 2011-01-28 at 14:43 +0100, khiem nguyen wrote: > what about Interceptors (request & response) ? > from my understanding, these are "properties" of HttpClient. > No, they are not. Protocol interceptors are strategies that implement a particular aspect of the HTTP protocol. They are meant t

RE: Problem with Proxy Basic Authentication

2011-02-01 Thread Oleg Kalnichevski
On Mon, 2011-01-31 at 07:17 -0800, Pifagor wrote: > Oleg > > Your advice needed: > > When I import browser proxy settings into HttpClient in applet using: > > DefaultHttpClient hc = new DefaultHttpClient(); > ProxySelectorRoutePlanner routePlanner = new > ProxySelectorRoutePlanne

RE: Problem with Proxy Basic Authentication

2011-02-01 Thread Oleg Kalnichevski
On Tue, 2011-02-01 at 05:19 -0800, Pifagor wrote: > > olegk wrote: > > > > > > it turns out that the ProxySelectorRoutePlanner did not pick up proxy > > settings correctly. > > > > Oleg > > > > > > > It correctly picks host and port but not username and password. Also JRE > does not provi

Re: HTTP request using another method such as PATCH

2011-02-01 Thread Oleg Kalnichevski
On Tue, 2011-02-01 at 15:30 +0100, Grzegorz Szpetkowski wrote: > Hi, > > According to HttpClient Tutorial (1.1.1. HTTP request) there is > support for methods: GET, HEAD, POST, PUT, DELETE, TRACE and OPTIONS. > How I can make request using PATCH (RFC 5789) method or CONNECT ? You ought not execu

Re: Forcing a chunk boundary

2011-02-02 Thread Oleg Kalnichevski
On Wed, 2011-02-02 at 12:16 -0500, John Kiffmeyer wrote: > Hi all, > I'm working with an application that requires requests to be chunked a > certain way. More or less, the body contains an application request and > some data associated with it. If chunked normally, the first chunk > contains

Re: Forcing a chunk boundary

2011-02-03 Thread Oleg Kalnichevski
> Hi Oleg, > > Thanks for your reply! > > I started writing a custom ChunkedOutputStream and it appears that in the > current implementation calling flush() causes it to write out whatever it > has in its buffer as the next chunk. Which means, the next call to > write() will start the chunk

Re: Upgrade from Commons HttpClient to HttpClient 4.1

2011-02-06 Thread Oleg Kalnichevski
On Fri, 2011-02-04 at 11:30 +, Ewan Slater wrote: > Hi, > > I have downloaded (and wish to run) a piece of example code for > accessing an application that was written for Commons HttpClient. > > I have downloaded HttpClient 4.1 as this is recommended and I would > like to upgrade the example

Re: Streaming content & header-parsing

2011-02-07 Thread Oleg Kalnichevski
On Mon, 2011-02-07 at 10:28 +0100, khiem nguyen wrote: > Hi, > i'm trying to use httpclient 4.1 to get some stream-content from this site > http://oe1.orf.at/konsole/?show=live > > this doesnt work, log message: > > DefaultResponseParser [DEBUG] Garbage in response: > > from browser, debug with

Re: Upgrade from Commons HttpClient to HttpClient 4.1

2011-02-07 Thread Oleg Kalnichevski
On Mon, 2011-02-07 at 10:01 +, ewan.sla...@googlemail.com wrote: > Hi Guys, > > Thanks for the suggestions. > > It seems that upgrade in this case uses what one of my friends (who works in > product management for a software vendor) describes as a "bumpy upgrade path > with limited appeal t

Re: Streaming content & header-parsing

2011-02-07 Thread Oleg Kalnichevski
On Mon, 2011-02-07 at 13:58 +0100, khiem nguyen wrote: > here's logging-console: > ... > DEBUG [org.apache.http.wire] << "ICY 200 OK[\r][\n]" > DEBUG [org.apache.http.impl.conn.DefaultResponseParser] Garbage in response: > ICY 200 OK 'ICY 200 OK' is not a valid HTTP status line. Oleg ---

Re: Streaming content & header-parsing

2011-02-07 Thread Oleg Kalnichevski
On Mon, 2011-02-07 at 14:39 +0100, khiem nguyen wrote: > ok, i see > > so the server gives junk status-header back to the client. > > is there a way to overcome this ?, i mean how can i replace > the DefaultResponseParser without touching the client's code too much ( just > like a responseInterce

Re: Problem with URIs

2011-02-08 Thread Oleg Kalnichevski
On Tue, 2011-02-08 at 09:36 +0100, Ismael Marín Carrión wrote: > Dear all, > > Caused by: org.apache.commons.httpclient.NoHttpResponseException: The > server localhost failed to respond > at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(Unknown > Source) > at org.apache.commons.http

Re: HC 4.1

2011-02-09 Thread Oleg Kalnichevski
On Wed, 2011-02-09 at 14:40 +0100, Joan Balaguero wrote: > Hello Oleg, > > > > I’m using HttpClient4.0.3. In terms of performance, is there any gain using > HttpClient 4.1. vs 4.0.3? > > > > Thanks, > > Joan. > Joan HttpCore 4.1 used by HttpClient 4.1 should be approximately 5% faster t

Re: Header and Content parsing and saving as html page

2011-02-10 Thread Oleg Kalnichevski
On Thu, 2011-02-10 at 23:30 -0800, CodingForever wrote: > I am still need help , I could not find the solution. > CodingForever wrote: > > Have a look at the test cases for EntityDeserializer http://hc.apache.org/httpcomponents-core-ga/httpcore/xref-test/org/apache/http/impl/entity/TestEntityDes

Re: Header and Content parsing and saving as html page

2011-02-11 Thread Oleg Kalnichevski
On Fri, 2011-02-11 at 00:39 -0800, CodingForever wrote: > Thanks olegk for the answer,Now I am looking that. But I will ask something > I wrote the code that below. How can I get the decoded content using header > parameters ? String s = "HTTP/1.1 200 OK\r\n" + "Server: whatever\r\n" +

Re: Unvalid httpcore-nio-4.0-beta1.jar

2011-02-11 Thread Oleg Kalnichevski
On Fri, 2011-02-11 at 10:15 +0100, Håkon Sagehaug wrote: > Hi, > > I've got http-core 4.1 as a dependency in a maven project. So when I compile > the project I get error that the httpcore-nio-4.0-beta1.jar is invalid. The > jar file is a http page with "301 Moved Permanently". > > Do you know how

Re: Header and Content parsing and saving as html page

2011-02-11 Thread Oleg Kalnichevski
On Fri, 2011-02-11 at 01:30 -0800, CodingForever wrote: > I appreciated. > That is working like I want. > You see that, i am trying to decoding html page using header and > content(offline). And I am not a perfect about httpclient. So I could not > find the best solution for my problem. > > Think

Re: SO_LINGER option

2011-02-11 Thread Oleg Kalnichevski
On Fri, 2011-02-11 at 11:48 +0100, Kennke, Roman wrote: > Hello, > > I see it is possible to set the SO_LINGER option by calling > > HttpConnectionParams.setLinger(params, so_linger); > > However, from looking at the docs and specification I find that it is not > possible to enable SO_LINGE

Re: SocketException in HttpClient GET

2011-02-14 Thread Oleg Kalnichevski
On Mon, 2011-02-14 at 11:00 +, Mahesh Mattepu wrote: > Hi, > > We are trying to solve a very simple problem for *HttpClient4* -- > SocketException for HTTP GET. HttpClient4 gets the first "chunk" of data from > server (Tomcat-6.0.18) and then the server unexpectedly closes the connection. >

Re: java.io.IOException: Request already aborted - Why ThreadSafeClientConnManager does not renew connection?

2011-02-15 Thread Oleg Kalnichevski
On Tue, 2011-02-15 at 11:38 +0200, Maxim Veksler wrote: > Hello everyone, > > I'm doing a small stress run from my Workstation to my Laptop. > The code is attached below. > > This code emulates a situation where the connection pool runs out of > connections. I'm seeking to catch this situation an

Re: java.io.IOException: Request already aborted - Why ThreadSafeClientConnManager does not renew connection?

2011-02-15 Thread Oleg Kalnichevski
> Thanks for your response. > > The test runs for ~25seconds and only then starts to fail. > Once it fails I eclipse trace it, by going step by step over the code > and the failure reproduces on each attempt. > > > Should the ThreadSafeClientConnManager attempt the reconnect or do I > need to do

Re: java.io.IOException: Request already aborted - Why ThreadSafeClientConnManager does not renew connection?

2011-02-15 Thread Oleg Kalnichevski
On Tue, 2011-02-15 at 14:53 +0200, Maxim Veksler wrote: > On Tue, Feb 15, 2011 at 2:44 PM, Ryan Smith > wrote: > > ms = 0.2 seconds. If youre making calls over the internet, you might > > want to try a timeout of 15000ms (15 seconds). > > I sometimes set it to 6ms b/c the internet can lag at

Re: Gzip problem ?

2011-02-15 Thread Oleg Kalnichevski
On Tue, 2011-02-15 at 07:38 -0800, CodingForever wrote: > Hi, there > > I am using a piece of code(thanks to oleg) for decoding html data. (chunked > or gzipped vs. ) > when I try to decode the gzipped data it does not work. That gives me > gzipped data. > - I looked the header it contains Conte

Re: Non-blocking file upload

2011-02-16 Thread Oleg Kalnichevski
On Wed, 2011-02-16 at 11:05 +, Frazer Irving wrote: > Hi, > ... > It seems that the call to executeMethod is blocking until the entire > body of the RequestEntity has been written to the server before > processing the response. Yes, this is indeed the case due to the limitations of the bl

Re: java.io.IOException: Request already aborted - Why ThreadSafeClientConnManager does not renew connection?

2011-02-16 Thread Oleg Kalnichevski
On Wed, 2011-02-16 at 14:47 +0200, Maxim Veksler wrote: ... > I've implemented the suggested changes. Please find them at the > revision > https://gist.github.com/829061/8a173df84ce47b288f6b34f675fc708fcf649535 > > This has improved the execution, now calling httpGet.abort(); does not > affect

Re: java.io.IOException: Request already aborted - Why ThreadSafeClientConnManager does not renew connection?

2011-02-16 Thread Oleg Kalnichevski
On Wed, 2011-02-16 at 16:31 +0200, Maxim Veksler wrote: > On Wed, Feb 16, 2011 at 3:14 PM, Oleg Kalnichevski wrote: > > > > Once aborted a request cannot be executed again. Create a new HttpGet > > instance for each request execution. They are cheap. > > > > Th

Re: Webstart problems with SSL and the DEFAULT SSLSocketFactory

2011-02-17 Thread Oleg Kalnichevski
A. On Thu, 2011-02-17 at 14:48 -0500, Mark Claassen wrote: > I have been using HttpClient for a while now with success. However, I have > recently encountering some problems which I think have > an easy solution, although it is not accessible to me through the current API. > > Situation (my

Re: HttpCore - getting POST parameters

2011-02-19 Thread Oleg Kalnichevski
On Fri, 2011-02-18 at 22:46 +0200, Mario Pavlov wrote: > Hi, > I'm trying to create a simple HTTP server with HttpCore 4.1 but I can't > figure out how to get parameters from HTTP POST requests. For instance I want > to handle the POST request generated by this HTML code: > > > > >

Re: Http Server with error Connection Reset

2011-02-19 Thread Oleg Kalnichevski
On Sat, 2011-02-19 at 12:59 +0800, LongkerDandy wrote: > Hi > > I'm using latest version of HTTP Core. > And I'm following the sample "Basic HTTP Server" ( > http://hc.apache.org/httpcomponents-core-ga/examples.html). > But I keep getting the error: Connection Reset. > > Every time I finished han

Re: Proxy-Authorization header received on server side

2011-02-24 Thread Oleg Kalnichevski
On Thu, 2011-02-24 at 10:15 +0100, Onofer Dusan wrote: > Hi, > > I'm following example > http://hc.apache.org/httpcomponents-client-ga/examples.html > Proxy authentication > > but it seems that not only proxy is receiving credentials for proxy. > In log, which is generated at target.host I can s

Re: Getting MalformedChunkCodingException while downloading attachments

2011-02-28 Thread Oleg Kalnichevski
On Mon, 2011-02-28 at 04:27 -0800, httpClientUser wrote: > Hi All, > > I am using HttpClient4.1 and jdk1.6.0_16, I am trying to download more than > 1000 attachments using HttpClient in a program. > > I used ThreadSafeClientConnManager for creating the connectionManager. When > i try downloading

Re: Slowness of 4.1

2011-03-03 Thread Oleg Kalnichevski
On Thu, 2011-03-03 at 01:38 -0800, Tony Anecito wrote: > Hi All, > > I downloaded httpclient 4.1 and noticed it is significantly slower than 3.1. > I > even used the threadsafe connection manager hoping for better performance. I > used to get below 3msec and now it is above 150msec. > Is keepal

Re: Slowness of 4.1

2011-03-03 Thread Oleg Kalnichevski
se I will see what if I can find again the client side code > soemwhere and compare it to what I have unless you have a link to it. > > Thanks, > -Tony > > > > - Original Message > From: Oleg Kalnichevski > To: HttpClient User Discussion > Sent: Thu, March 3,

Re: How to handle Range header in Http Core

2011-03-05 Thread Oleg Kalnichevski
On Fri, 2011-03-04 at 15:42 +0800, LongkerDandy wrote: > Hi > > I'm developing a UPnP/DLNA media server, and using Http Core for file > transfer. > Client may ask for part of the file, using IF Range and Range Http headers. > Is there a easy way to deal with that? LongkerDandy HttpCore does not

Re: How to determine the authentication method used by HttpClient?

2011-03-07 Thread Oleg Kalnichevski
On Sun, 2011-03-06 at 06:49 -0800, Utopius wrote: > I'm using HttpClient for basic and NTLM authentication. Therefore I configure > a HttpClient with both types of credentials and based on the authentication > challenge from the server it chooses the correct one. Now, after the > authentication, I

Re: httpclient configuration over ssl-truststores question

2011-03-08 Thread Oleg Kalnichevski
On Mon, 2011-03-07 at 09:02 -0800, am am wrote: > I have a question relating httpclient and ssl connections. > I have no problem connecting to tomcat for server authentication using apache > httpclient (tomcat is sending back a self-signed certificate i.e. not trusted > by > java by default). >

Re: SSL Mutual Authentication Code worked in 4.0.1 but fails in 4.1

2011-03-08 Thread Oleg Kalnichevski
On Mon, 2011-03-07 at 15:24 -0800, Travis T wrote: > I have a server with a self signed certificate. I've created a java key > store (trustStore) which includes that server in the trust store. I have a > keystore which includes my certificate and private key. My certificate was > signed by the s

Re: SSL Mutual Authentication Code worked in 4.0.1 but fails in 4.1

2011-03-09 Thread Oleg Kalnichevski
On Tue, 2011-03-08 at 09:22 -0800, Travis T wrote: > > olegk wrote: > > > > Try running you code with the SSL debug enabled to get more details > > about the trust material sent by the server during the SSL handshake. > > > > Oleg > > > > Below is the debug output of the handshake from the 4.

Re: 400 Bad request is returned (Target Authentication)

2011-03-09 Thread Oleg Kalnichevski
On Wed, 2011-03-09 at 17:09 +0530, manasa k wrote: > Hi all, > > I am trying to connect a URL * > http://renderv3.mappoint.net/render-30/RenderService.asmx *which needs > WWW-Authenticate(uses Digest Authentication). Also this should go via a > Proxy(uses Basic Authentication). Following is my cod

Re: HttpPost is being retried

2011-03-09 Thread Oleg Kalnichevski
On Wed, 2011-03-09 at 15:14 +0100, Martin Ždila wrote: > On Wed, Mar 9, 2011 at 3:02 PM, Razvan Mihailescu < > razvan.mihaile...@computaris.com> wrote: > > > You may need to implement your own HttpRequestRetryHandler, as the one > > provided by default by http-client does a number of retries by de

<    8   9   10   11   12   13   14   15   16   17   >