File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ public function setOptions($options)
9999 */
100100 public function setTimeout ($ timeout )
101101 {
102+ // Since this timeout is really for putting a bound on the time
103+ // we'll set them both to the same. If you need to specify a longer
104+ // CURLOPT_TIMEOUT, or a tigher CONNECTTIMEOUT, the best thing to
105+ // do is use the setOptions method for the values individually.
106+ $ this ->options [CURLOPT_CONNECTTIMEOUT ] = $ timeout ;
102107 $ this ->options [CURLOPT_TIMEOUT ] = $ timeout ;
103108 }
104109}
Original file line number Diff line number Diff line change @@ -101,6 +101,10 @@ public function executeRequest(Google_Http_Request $request)
101101 // time situation.
102102 @$ fh = fopen ($ url , 'r ' , false , $ context );
103103
104+ if (isset ($ this ->options [self ::TIMEOUT ])) {
105+ stream_set_timeout ($ fh , $ this ->options [self ::TIMEOUT ]);
106+ }
107+
104108 $ response_data = false ;
105109 $ respHttpCode = self ::UNKNOWN_CODE ;
106110 if ($ fh ) {
You can’t perform that action at this time.
0 commit comments