3 #include "hphp/runtime/ext/extension.h"
5 #include "hphp/util/compact-vector.h"
6 #include "hphp/util/type-scan.h"
11 /////////////////////////////////////////////////////////////////////////////
16 struct CurlMultiResource
: SweepableResourceData
{
17 using EasyHandles
= CompactVector
<req::ptr
<CurlResource
>>;
19 DECLARE_RESOURCE_ALLOCATION(CurlMultiResource
)
20 CLASSNAME_IS("curl_multi")
21 const String
& o_getClassNameHook() const override
{ return classnameof(); }
22 bool isInvalid() const override
{ return !m_multi
; }
25 ~CurlMultiResource() { close(); }
28 bool setOption(int option
, const Variant
& value
);
29 const EasyHandles
& getEasyHandles() const { return m_easyh
; }
31 CURLMcode
add(CurlResource
* curle
);
32 CURLMcode
remove(CurlResource
* curle
, bool leak
= false);
33 Resource
find(CURL
*cp
);
36 void check_exceptions();
38 void setInExec(bool b
);
39 bool anyInExec() const;
42 void removeEasyHandles(bool leak
= false);
45 TYPE_SCAN_IGNORE_FIELD(m_multi
);
49 /////////////////////////////////////////////////////////////////////////////