orthecreedence / drakma-async

An asynchronous version of drakma that runs off of cl-async
38 stars 5 forks source link

Smarter read-timeout #14

Open orthecreedence opened 11 years ago

orthecreedence commented 11 years ago

When sending large chunks of data, (say, a 5MB file part to S3) the connection sometimes times out while uploading because the :read-timeout is hit.

It makes a lot of sense to disable the read timeout when sending data and re-enable it when data has been fully sent.

Investigate tcp-connect's :write-cb callback, determine if it gets called when ALL data is flushed to the socket from the bufferevent (good) or if it gets called in chunks (more difficult). This can be used to say "start upload, disable read timeout until :write-cb is triggered." Or if we're chunking, we can re-enable the read-timeout on the :write-cb of the last chunk.