X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fxmlrpc.inc;h=c3c89958c2d498108c1db7485c2fa6d171823e0b;hb=13381c346af5f3e86d9fdf6c04b1cb9ca4b54a56;hp=5b39a26753dae92a06ded03f3535f59868b26a81;hpb=69540b3e399387c69628c88c1f4e63fd1b2138e8;p=plcapi.git diff --git a/lib/xmlrpc.inc b/lib/xmlrpc.inc index 5b39a26..c3c8995 100644 --- a/lib/xmlrpc.inc +++ b/lib/xmlrpc.inc @@ -850,7 +850,7 @@ * http://curl.haxx.se/docs/faq.html#7.3) */ var $xmlrpc_curl_handle = null; - /// Wheter to use persistent connections for http 1.1 and https + /// Whether to use persistent connections for http 1.1 and https var $keepalive = false; /// Charset encodings that can be decoded without problems by the client var $accepted_charset_encodings = array(); @@ -1701,6 +1701,12 @@ curl_close($curl); } $resp =& $msg->parseResponse($result, true, $this->return_type); + // if we got back a 302, we can not reuse the curl handle for later calls + if($resp->faultCode() == $GLOBALS['xmlrpcerr']['http_error'] && $keepalive) + { + curl_close($curl); + $this->xmlrpc_curl_handle = null; + } } return $resp; }