7
7
* | (__| |_| | _ <| |___
8
8
* \___|\___/|_| \_\_____|
9
9
*
10
- * Copyright (C) 1998 - 2007 , Daniel Stenberg, <[email protected] >, et al.
10
+ * Copyright (C) 1998 - 2015 , Daniel Stenberg, <[email protected] >, et al.
11
11
*
12
12
* This software is licensed as described in the file COPYING, which
13
13
* you should have received as part of this distribution. The terms
14
- * are also available at http ://curl.haxx.se/docs/copyright.html.
14
+ * are also available at https ://curl.haxx.se/docs/copyright.html.
15
15
*
16
16
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
17
17
* copies of the Software, and permit persons to whom the Software is
@@ -64,6 +64,8 @@ typedef enum {
64
64
CURLM_INTERNAL_ERROR , /* this is a libcurl bug */
65
65
CURLM_BAD_SOCKET , /* the passed in socket argument did not match */
66
66
CURLM_UNKNOWN_OPTION , /* curl_multi_setopt() with unsupported option */
67
+ CURLM_ADDED_ALREADY , /* an easy handle already added to a multi handle was
68
+ attempted to get added - again */
67
69
CURLM_LAST
68
70
} CURLMcode ;
69
71
@@ -72,6 +74,11 @@ typedef enum {
72
74
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
73
75
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
74
76
77
+ /* bitmask bits for CURLMOPT_PIPELINING */
78
+ #define CURLPIPE_NOTHING 0L
79
+ #define CURLPIPE_HTTP1 1L
80
+ #define CURLPIPE_MULTIPLEX 2L
81
+
75
82
typedef enum {
76
83
CURLMSG_NONE , /* first, not used */
77
84
CURLMSG_DONE , /* This easy handle has completed. 'result' contains
@@ -89,6 +96,19 @@ struct CURLMsg {
89
96
};
90
97
typedef struct CURLMsg CURLMsg ;
91
98
99
+ /* Based on poll(2) structure and values.
100
+ * We don't use pollfd and POLL* constants explicitly
101
+ * to cover platforms without poll(). */
102
+ #define CURL_WAIT_POLLIN 0x0001
103
+ #define CURL_WAIT_POLLPRI 0x0002
104
+ #define CURL_WAIT_POLLOUT 0x0004
105
+
106
+ struct curl_waitfd {
107
+ curl_socket_t fd ;
108
+ short events ;
109
+ short revents ; /* not supported yet */
110
+ };
111
+
92
112
/*
93
113
* Name: curl_multi_init()
94
114
*
@@ -133,6 +153,20 @@ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
133
153
fd_set * exc_fd_set ,
134
154
int * max_fd );
135
155
156
+ /*
157
+ * Name: curl_multi_wait()
158
+ *
159
+ * Desc: Poll on all fds within a CURLM set as well as any
160
+ * additional fds passed to the function.
161
+ *
162
+ * Returns: CURLMcode type, general multi error code.
163
+ */
164
+ CURL_EXTERN CURLMcode curl_multi_wait (CURLM * multi_handle ,
165
+ struct curl_waitfd extra_fds [],
166
+ unsigned int extra_nfds ,
167
+ int timeout_ms ,
168
+ int * ret );
169
+
136
170
/*
137
171
* Name: curl_multi_perform()
138
172
*
@@ -311,6 +345,37 @@ typedef enum {
311
345
/* maximum number of entries in the connection cache */
312
346
CINIT (MAXCONNECTS , LONG , 6 ),
313
347
348
+ /* maximum number of (pipelining) connections to one host */
349
+ CINIT (MAX_HOST_CONNECTIONS , LONG , 7 ),
350
+
351
+ /* maximum number of requests in a pipeline */
352
+ CINIT (MAX_PIPELINE_LENGTH , LONG , 8 ),
353
+
354
+ /* a connection with a content-length longer than this
355
+ will not be considered for pipelining */
356
+ CINIT (CONTENT_LENGTH_PENALTY_SIZE , OFF_T , 9 ),
357
+
358
+ /* a connection with a chunk length longer than this
359
+ will not be considered for pipelining */
360
+ CINIT (CHUNK_LENGTH_PENALTY_SIZE , OFF_T , 10 ),
361
+
362
+ /* a list of site names(+port) that are blacklisted from
363
+ pipelining */
364
+ CINIT (PIPELINING_SITE_BL , OBJECTPOINT , 11 ),
365
+
366
+ /* a list of server types that are blacklisted from
367
+ pipelining */
368
+ CINIT (PIPELINING_SERVER_BL , OBJECTPOINT , 12 ),
369
+
370
+ /* maximum number of open connections in total */
371
+ CINIT (MAX_TOTAL_CONNECTIONS , LONG , 13 ),
372
+
373
+ /* This is the server push callback function pointer */
374
+ CINIT (PUSHFUNCTION , FUNCTIONPOINT , 14 ),
375
+
376
+ /* This is the argument passed to the server push callback */
377
+ CINIT (PUSHDATA , OBJECTPOINT , 15 ),
378
+
314
379
CURLMOPT_LASTENTRY /* the last unused */
315
380
} CURLMoption ;
316
381
@@ -338,6 +403,31 @@ CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
338
403
CURL_EXTERN CURLMcode curl_multi_assign (CURLM * multi_handle ,
339
404
curl_socket_t sockfd , void * sockp );
340
405
406
+
407
+ /*
408
+ * Name: curl_push_callback
409
+ *
410
+ * Desc: This callback gets called when a new stream is being pushed by the
411
+ * server. It approves or denies the new stream.
412
+ *
413
+ * Returns: CURL_PUSH_OK or CURL_PUSH_DENY.
414
+ */
415
+ #define CURL_PUSH_OK 0
416
+ #define CURL_PUSH_DENY 1
417
+
418
+ struct curl_pushheaders ; /* forward declaration only */
419
+
420
+ CURL_EXTERN char * curl_pushheader_bynum (struct curl_pushheaders * h ,
421
+ size_t num );
422
+ CURL_EXTERN char * curl_pushheader_byname (struct curl_pushheaders * h ,
423
+ const char * name );
424
+
425
+ typedef int (* curl_push_callback )(CURL * parent ,
426
+ CURL * easy ,
427
+ size_t num_headers ,
428
+ struct curl_pushheaders * headers ,
429
+ void * userp );
430
+
341
431
#ifdef __cplusplus
342
432
} /* end of extern "C" */
343
433
#endif
0 commit comments