Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

PUT image/png : operation timed out after 5000 milliseconds #12

Closed
jmettraux opened this Issue Feb 24, 2010 · 4 comments

Comments

Projects
None yet
3 participants

details at :

http://gist.github.com/313391

(the gist uses a simple sinatra server, but the issue was initially observed with CouchDB)

symptom :

$ ruby client.rb
/Users/jmettraux/.rvm/gems/ruby-1.9.1-p378/gems/patron-0.4.5/lib/patron/session.rb:179:in `handle_request': Operation timed out after 5000 milliseconds with 0 bytes received (Patron::TimeoutError)
from /Users/jmettraux/.rvm/gems/ruby-1.9.1-p378/gems/patron-0.4.5/lib/patron/session.rb:179:in `request'
from /Users/jmettraux/.rvm/gems/ruby-1.9.1-p378/gems/patron-0.4.5/lib/patron/session.rb:127:in `put'
from client.rb:10:in `<main>'

Many thanks for Patron !

Owner

toland commented Mar 1, 2010

I think I have traced this problem to an issue uploading binary files. I don't have a solution yet, but I think I am close.

@ghost ghost assigned toland Jun 22, 2011

@bombazook bombazook referenced this issue in lostisland/faraday Jun 19, 2015

Closed

Patron file upload #281

Collaborator

julik commented Apr 27, 2016

Reproduced, I will look into this.

@julik julik assigned julik and unassigned toland Apr 27, 2016

Collaborator

julik commented Apr 27, 2016

This problem occurs with any request body that is 32 bytes long or more. @toland is there any buffering thing at the C level that would cause something like this to happen that you remember?

Owner

toland commented Apr 28, 2016

@julik Not that I remember. It has been a looong time since I worked with that code, and some other contributors have made changes in that area. I just looked at the C code again and it was like looking at something someone else wrote :)

julik added a commit to julik/patron that referenced this issue Apr 28, 2016

Fix the bug that would occur with a literal PUT body
The problem is the read callback function used for
reading the data. Somehow it hangs curl midflight
if there is too much data given. Also, it is really
meant for files - and it turns out you can just pass
the string pointer curl explicitly, as described
in this SO answer:

http://stackoverflow.com/a/7570281/153886

Also, switch to POSTFIELDSIZE_LARGE if it is
supported.

Closes #12

@toland toland closed this in #115 Apr 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment