Changeset 579 for trunk/zoo-project/zoo-kernel/ulinet.h
- Timestamp:
- Feb 12, 2015, 5:01:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/ulinet.h
r554 r579 1 /* *1 /* 2 2 * Author : Gérald FENOY 3 3 * … … 56 56 static char CCookie[MAX_REQ][1024]; 57 57 #else 58 extern char HEADER[MAX_REQ][3072]; 58 /** 59 * The cookies found 60 */ 59 61 extern char CCookie[MAX_REQ][1024]; 60 62 #endif … … 64 66 #endif 65 67 66 //static pthread_mutex_t hMutexConnect = PTHREAD_MUTEX_INITIALIZER;67 68 static char* waitingRequests[MAX_REQ];69 70 68 struct MemoryStruct { 71 char *memory; 72 size_t size; 69 char *memory; //!< the memory space to store data 70 size_t size; //!< side of the memory space 73 71 }; 74 72 73 /** 74 * Individual CURL handler 75 */ 75 76 typedef struct { 76 CURL *handle; 77 struct curl_slist *header; 78 char* filename; 79 FILE* file; 80 size_t size; 81 unsigned char *pabyData; 82 char *mimeType; 83 int hasCacheFile; 84 int nDataLen; 85 int nDataAlloc; 86 int id; 77 CURL *handle; //!< the CURL handler 78 struct curl_slist *header; //!< the headers to send 79 char* filename; //!< the cached file name 80 FILE* file; //!< the file pointer 81 unsigned char *pabyData; //!< the downloaded content 82 char *mimeType; //!< the mimeType returned by the server 83 int hasCacheFile; //!< 1 if we used a cache file 84 int nDataLen; //!< the length of the downloaded content 85 int nDataAlloc; //!< 86 int id; //!< The position of the element in the queue 87 87 } _HINTERNET; 88 88 89 /** 90 * Multiple CURL handlers 91 */ 89 92 typedef struct { 90 CURLM *handle; 91 _HINTERNET ihandle[MAX_REQ]; 92 char *waitingRequests[MAX_REQ]; 93 char *agent; 94 int nb; 93 CURLM *handle; //!< the CURLM handler 94 _HINTERNET ihandle[MAX_REQ]; //!< individual handlers in the queue 95 char *waitingRequests[MAX_REQ]; //!< request in the queue 96 char *agent; //!< The User-Agent to use for HTTP request 97 int nb; //!< number of element in the queue 95 98 } HINTERNET; 96 99 97 100 size_t write_data_into(void *buffer, size_t size, size_t nmemb, void *data); 98 101 99 size_t content_write_data(void *buffer, size_t size, size_t nmemb, void *data);100 101 102 size_t header_write_data(void *buffer, size_t size, size_t nmemb, void *data); 102 103 103 104 104 void setProxy(CURL* handle,char* host,long port); 105 106 105 107 106 #if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
Note: See TracChangeset
for help on using the changeset viewer.