Do not set CURLOPT_TIMEOUT since this is used for all curl functions and not the connectivity

Compare 

> CURLOPT_TIMEOUT	The maximum number of seconds to allow cURL functions to execute.

and 

> CURLOPT_CONNECTTIMEOUT	The number of seconds to wait while trying to connect. Use 0 to wait indefinitely.

I think CURLOPT_CONNECTTIMEOUT is what you want since the first one will abort any running request even if its executing properly while the connection timeout is a useful thing to set.