softlayer / softlayer-object-storage-php

SoftLayer Object Storage PHP Client
Other
28 stars 18 forks source link

Support for arbitrary CURL options, or at least for connect timeout option #28

Open theage opened 9 years ago

theage commented 9 years ago

Please provide a way to set arbitrary CURL options, or at least all timeout settings.

When trying to load large objects, the request may time out. To work around this, you can set the timeout for the entire request to a few minutes maybe.

However this may cause your downloads to wait for a very long time if there are connection issues, because CURL defaults to very high timeout values e.g. for the connect phase (5 minutes), which you may not want.

Looking at the source of ObjectStorage_Http_Adapter_Curl, it seems that there are only a few hard-coded CURL options that can be set at all.

Rather than hard-code yet another option, I think it would be better to just provide a generic way to set any CURL option, e.g. via an array curloptions in the $options argument to the ObjectStorage constructor.

theage commented 9 years ago

PR https://github.com/softlayer/softlayer-object-storage-php/pull/29