Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

removed timeouts on http_client when uploading. #85

Merged
merged 1 commit into from

2 participants

@rojotek

As per recommendations at https://github.com/nahi/httpclient, have set the send_timeout and receive_timeout to 0 when uploading large files:

LIMITATION:
          timeout occurs certainly when you send very large file and
          @send_timeout is default since HTTPClient::Session#query() assumes
          that all write are finished in @send_timeout sec not each write.
    
        WORKAROUND:
          increment @send_timeout and @receive_timeout or set @send_timeout and
          @receive_timeout to 0 not to be timeout.

@rojotek rojotek removed timeouts on http_client when uploading.
As per recommendations at https://github.com/nahi/httpclient, have set the send_timeout and receive_timeout to 0 when uploading large files:

LIMITATION:
          timeout occurs certainly when you send very large file and
          @send_timeout is default since HTTPClient::Session#query() assumes
          that *all* write are finished in @send_timeout sec not each write.
    
        WORKAROUND:
          increment @send_timeout and @receive_timeout or set @send_timeout and
          @receive_timeout to 0 not to be timeout.
4021e4a
@rojotek

Hey Tom,

Just wondering if you've had a chance to look at this? Any chance of getting it merged in with a release? :) Anything I can do to help?

@cwninja cwninja merged commit a2e51ce into geminabox:master
@cwninja
Owner

Sorry for the delay, I appear to be a caricature of a bad project maintainer.

@rojotek

:) no worries. Thanks for getting this pulled in. Very much appreciated.

@rojotek rojotek deleted the rojotek:patch-1 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 3, 2012
  1. @rojotek

    removed timeouts on http_client when uploading.

    rojotek authored
    As per recommendations at https://github.com/nahi/httpclient, have set the send_timeout and receive_timeout to 0 when uploading large files:
    
    LIMITATION:
              timeout occurs certainly when you send very large file and
              @send_timeout is default since HTTPClient::Session#query() assumes
              that *all* write are finished in @send_timeout sec not each write.
        
            WORKAROUND:
              increment @send_timeout and @receive_timeout or set @send_timeout and
              @receive_timeout to 0 not to be timeout.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/geminabox_client.rb
View
3  lib/geminabox_client.rb
@@ -10,7 +10,8 @@ def initialize(url)
@http_client.set_auth(url_for(:upload), @username, @password) if @username or @password
@http_client.www_auth.basic_auth.challenge(url_for(:upload)) # Workaround: https://github.com/nahi/httpclient/issues/63
@http_client.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
- @http_client.send_timeout = 600
+ @http_client.send_timeout = 0
+ @http_client.receive_timeout = 0
end
def extract_username_and_password_from_url!(url)
Something went wrong with that request. Please try again.