X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fcurl-de-sac.phh;h=c66c58bad4baef9851bd1b41f2a6dbde39e4ff14;hb=2338f1bebd53050610b91d6940d8d20760df02b7;hp=01ba78b81dee6322e46c438d91c82712abc7a65c;hpb=7b5e4084f27b054398e9da0250c166c16d4e8b6c;p=curl-de-sac.git diff --git a/web/Obj/curl-de-sac.phh b/web/Obj/curl-de-sac.phh index 01ba78b..c66c58b 100644 --- a/web/Obj/curl-de-sac.phh +++ b/web/Obj/curl-de-sac.phh @@ -67,16 +67,23 @@ class CDS_cmd_cls { $this->cds = $cds; } - static function pre_create($cds, $url) + static function pre_create($cds, $url, $opts=NULL) { if ($cds->dbg_get() > 2) { printf("CURL: curl_init\n"); } if (($ch = curl_init()) == FALSE) return FALSE; curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_FORBID_REUSE, true); - curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close')); + if ($opts == NULL) { + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_FORBID_REUSE, true); + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close')); + } + else { + foreach($opts as $opt => $value) { + curl_setopt($ch, $opt, $value); + } + } return ($ch); }