Re: How to interrupt connexion ?
This may be an ignorant question, but here it goes: Couldn't you have an interrupt method that calls close() on the underlying streams, then calls close() on the socket itself? If I recall correctly, calling close() on a socket causes any thread that is blocked on that socket to throw a SocketException. But it should work if you shut down the associated streams first, right? --Nathan McMinn - Original Message - From: "Laura Werner" <[EMAIL PROTECTED]> To: "Commons HttpClient Project" <[EMAIL PROTECTED]> Sent: Thursday, July 03, 2003 3:12 PM Subject: Re: How to interrupt connexion ? > Oleg Kalnichevski wrote: > > >Sadly enough, there's (there will be) no reliable way to interrupt a > >request in the release 2.0. It is an unfortunate oversight on our part. > >This feature is planned for the 2.1 release: > > > > > This is a hard problem, because almost all of the calls in the old > java.io library are non-interruptible. There's no good way to, for > example, have a background thread whose job is to interrupt requests > that have taken too long. In our current code, we fake interruptible > threads by using (pooled) background threads to execute the requests. > When the timeout interval expires, we give up on waiting for the > background thread to finish the fetch and just throw a timeout > exception. But I haven't found a way to make the background thread > actually stop the fetch, so it just sits there until the socket timeout > (if any) triggers an IOException. At that point we can recycle the > thread back into the pool. This is very error-prone, though; I'm > currently trying to track down a nasty synchronization bug in the threading. > > To make this feature work, we'd probably have to do something like this: > > - Add a timeout property to HttpMethod or HttpMethodBase > - Just before executing a method, set an internal "endTime" property > - Every time we're about to do a socket operation, e.g. in > AutoCloseInputStream.read(), compare the current time and endTime. If > we're past endTime, though an exception. If not, adjust the socket > timeout so that the read operation can't go past endTime. > - Do similar things while waiting on the connection pool, opening > sockets, etc. > > Yuck. I keep thinking there *must* be a simpler way, but I haven't > found it yet. > > -- Laura > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where to post
Perfect. Thanks. - Original Message - From: "Laura Werner" <[EMAIL PROTECTED]> To: "Commons HttpClient Project" <[EMAIL PROTECTED]> Sent: Thursday, June 26, 2003 2:47 PM Subject: Re: Where to post > Hi Nate, > > >Jun 26, 2003 1:48:21 PM org.apache.commons.httpclient.HttpMethodBase > >processRedirectResponse > >INFO: Redirect requested but followRedirects is disabled > >... > >I can just create a GetMethod and give it the url that would be redirected > >to, but how to get rid of that error message. Any suggestions? > > > > > That's not really an error message, just a trace log that HttpClient > writes to make it easier to figure out what's going on when a problem > happens. You can control the logging level, send the logs to a separate > file (or to the bit bucket), and so on. See > http://jakarta.apache.org/commons/httpclient/logging.html for some info > on how to do it. In your case, you might want to set the logging level > to "error" so you only see messages for serious problems. > > -- Laura > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where to post
Thank you. It's kind of an http newbie question, but here it is. I create a PostMethod object, and use it to post data to a site's login page. The login page redirects to another page within the site. When that redirect is sent, I get the following message: Jun 26, 2003 1:48:21 PM org.apache.commons.httpclient.HttpMethodBase processRedirectResponse INFO: Redirect requested but followRedirects is disabled I have set allowRedirects to true within the PostMethod object. However, I noticed that PostMethod inherits from EntityEnclosingMethod, overriding getAllowRedirects with a method that always returns false (per rfc2616). This is obviously not a bug, but how would you recommend handling this situation. The data I am after is on the page that will be redirected to. I can just create a GetMethod and give it the url that would be redirected to, but how to get rid of that error message. Any suggestions? Thanks a bunch --Nathan McMinn - Original Message - From: "Kalnichevski, Oleg" <[EMAIL PROTECTED]> To: "Commons HttpClient Project" <[EMAIL PROTECTED]> Sent: Thursday, June 26, 2003 10:03 AM Subject: RE: Where to post Nathan, Please go ahead and post your questions here, as there's no separate HttpClient user mailing list. Oleg -Original Message- From: Nate [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 16:59 To: [EMAIL PROTECTED] Subject: Where to post Sorry if this is the wrong place to ask this question, but where is the proper place to post user questions about HttpClient? Couldn't find a user mailing list. --Nathan McMinn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Where to post
Sorry if this is the wrong place to ask this question, but where is the proper place to post user questions about HttpClient? Couldn't find a user mailing list. --Nathan McMinn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]