32 #ifndef HAVE_CURLSOCK_H
33 #define HAVE_CURLSOCK_H
36 #include <curl/curl.h>
38 #ifndef _NO_CSOCKET_NS
67 virtual bool CheckFDs(
const std::map< int, int16_t > & miiReadyFds ) {
return( m_bEnabled ); }
85 virtual size_t OnHeader( CURL * pCURL,
const char * pData,
size_t uBytes ) {
return( uBytes ); }
87 virtual size_t OnBody( CURL * pCURL,
const char * pData,
size_t uBytes ) {
return( uBytes ); }
90 static size_t WriteData(
void * pData,
size_t uSize,
size_t uNemb,
void * pStream );
91 static size_t WriteHeader(
void * pData,
size_t uSize,
size_t uNemb,
void * pStream );
92 static int SetupSock( CURL * pCurlHandle, curl_socket_t iFD,
int iWhat,
void * pcbPtr,
void * pSockPtr );
93 static int SetupTimer( CURLM * pMulti,
long iTimeout_ms,
void * pcdPtr );
95 void SetTimeoutMS(
long iTimeoutMS )
97 m_iTimeout_ms = iTimeoutMS;
101 CURLM * m_pMultiHandle;
102 std::map< CURL *, bool > m_pcbCurlHandles;
105 #ifndef _NO_CSOCKET_NS
#define CS_EXPORT
Definition: Csocket.h:136
Csocket style wrapper around libcurl-multi.
Definition: CurlSock.h:59
CURL * Retr(const CS_STRING &sURL, const CS_STRING &sReferrer="")
initiates a GET style transfer, but the process doesn't get started until the next GatherFDsForSelect...
virtual bool CheckFDs(const std::map< int, int16_t > &miiReadyFds)
reimplement this to do nothing as its not needed
Definition: CurlSock.h:67
virtual bool GatherFDsForSelect(std::map< int, int16_t > &miiReadyFds, long &iTimeoutMS)
the hook we tie into to get events from csocket
virtual size_t OnHeader(CURL *pCURL, const char *pData, size_t uBytes)
called as header information for the document is returned
Definition: CurlSock.h:85
virtual void OnCURLComplete(CURL *pCURL)=0
called when the transfer associate with this CURL object is completed
virtual size_t OnBody(CURL *pCURL, const char *pData, size_t uBytes)
called as the document is returned
Definition: CurlSock.h:87
Class to tie sockets to for monitoring by Csocket at either the Csock or TSockManager.
Definition: Csocket.h:458
#define CS_STRING
Definition: include/znc/defines.h:27