Re: Server Stall

From: Date: Tue, 06 Feb 2007 00:15:11 +0000
Subject: Re: Server Stall
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-248401@lists.php.net to get a copy of this message
Hi, Matt Thanks for answer, I try your solution and use it. And interestingly I found this, If my request coming from second tab of firefox it will wait util first request done. I think php does not open second thread for same session... Anyway thanks for answer. It was very useful.. Regards On Monday 05 February 2007 20:32, Matt Carlson wrote: > function doRequest($method, $url, $vars = '', $headers = '0') { >     $ch = curl_init(); >     curl_setopt($ch, CURLOPT_URL, $url); >     curl_setopt($ch, CURLOPT_HEADER, $headers); >     curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); >     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); >     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); >     curl_setopt($ch, CURLOPT_TIMEOUT, 30); >     curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); >     curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); >     if ($method == 'POST') { >         curl_setopt($ch, CURLOPT_POST, 1); >         curl_setopt($ch, CURLOPT_POSTFIELDS, $vars); >     } >     $data = curl_exec($ch); >     curl_close($ch); >     if ($data) { >         return $data; >     } >     else { >         return curl_error($ch); >     } > }

« previous php.general (#248401) next »