Skip to content

Commit fb07bb7

Browse files
authored
Merge pull request #162 from Superior404/fix/deprecated-warnings
include/curl_easy.h: Adapted to 7.86.0
2 parents 0f88f9b + fcee7c6 commit fb07bb7

2 files changed

Lines changed: 13 additions & 51 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cmake .. -DBUILD_SHARED_LIBS=SHARED
3535
make
3636
```
3737

38-
**Note:** cURL >= 7.34.0 is required.
38+
**Note:** cURL >= 7.86.0 is required.
3939

4040
When linking curlcpp to your application don't forget to also link `curl`. Example:
4141

include/curl_easy.h

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ namespace curl {
8080
// URL a redirect would take you to, had you enabled redirects.
8181
CURLCPP_DEFINE_INFO(CURLINFO_REDIRECT_URL,char *);
8282
// Number of bytes uploaded.
83-
CURLCPP_DEFINE_INFO(CURLINFO_SIZE_UPLOAD,double);
83+
CURLCPP_DEFINE_INFO(CURLINFO_SIZE_UPLOAD_T,double);
8484
// Number of bytes downloaded.
85-
CURLCPP_DEFINE_INFO(CURLINFO_SIZE_DOWNLOAD,double);
85+
CURLCPP_DEFINE_INFO(CURLINFO_SIZE_DOWNLOAD_T,double);
8686
// Average download speed.
87-
CURLCPP_DEFINE_INFO(CURLINFO_SPEED_DOWNLOAD,double);
87+
CURLCPP_DEFINE_INFO(CURLINFO_SPEED_DOWNLOAD_T,double);
8888
// Average upload speed.
89-
CURLCPP_DEFINE_INFO(CURLINFO_SPEED_UPLOAD,double);
89+
CURLCPP_DEFINE_INFO(CURLINFO_SPEED_UPLOAD_T,double);
9090
// Number of bytes of all headers received.
9191
CURLCPP_DEFINE_INFO(CURLINFO_HEADER_SIZE,long);
9292
// Number of bytes sent in the issued HTTP requests.
@@ -96,9 +96,9 @@ namespace curl {
9696
// A list of OpenSSL crypto engines.
9797
CURLCPP_DEFINE_INFO(CURLINFO_SSL_ENGINES,struct curl_slist *);
9898
// Content length from the Content-Length header.
99-
CURLCPP_DEFINE_INFO(CURLINFO_CONTENT_LENGTH_DOWNLOAD,long);
99+
CURLCPP_DEFINE_INFO(CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,long);
100100
// Upload size.
101-
CURLCPP_DEFINE_INFO(CURLINFO_CONTENT_LENGTH_UPLOAD,long);
101+
CURLCPP_DEFINE_INFO(CURLINFO_CONTENT_LENGTH_UPLOAD_T,long);
102102
// Content type from the Content-Type header.
103103
CURLCPP_DEFINE_INFO(CURLINFO_CONTENT_TYPE,char *);
104104
// User's private data pointer.
@@ -121,13 +121,8 @@ namespace curl {
121121
CURLCPP_DEFINE_INFO(CURLINFO_LOCAL_PORT,long);
122122
// List of all known cookies.
123123
CURLCPP_DEFINE_INFO(CURLINFO_COOKIELIST,struct curl_slist *);
124-
// Last socket used.
125-
CURLCPP_DEFINE_INFO(CURLINFO_LASTSOCKET,long);
126-
// This option is avaiable in libcurl 7.45 or greater.
127-
#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM >= 0x072D00
128124
// The session's active socket.
129-
CURLCPP_DEFINE_INFO(CURLINFO_ACTIVESOCKET,curl_socket_t *);
130-
#endif
125+
CURLCPP_DEFINE_INFO(CURLINFO_ACTIVESOCKET,long);
131126
// The entry path after logging in to an FTP server.
132127
CURLCPP_DEFINE_INFO(CURLINFO_FTP_ENTRY_PATH,char *);
133128
// Certificate chain
@@ -231,7 +226,7 @@ namespace curl {
231226
CURLCPP_DEFINE_OPTION(CURLOPT_HTTPHEADER, const struct curl_slist*);
232227

233228
/* This points to a linked list of post-entries, struct curl_httppost */
234-
CURLCPP_DEFINE_OPTION(CURLOPT_HTTPPOST, const struct curl_httppost*);
229+
CURLCPP_DEFINE_OPTION(CURLOPT_MIMEPOST, const struct curl_httppost*);
235230

236231
/* name of the file keeping your private SSL-certificate */
237232
CURLCPP_DEFINE_OPTION(CURLOPT_SSLCERT, const char*);
@@ -298,15 +293,14 @@ namespace curl {
298293
CURLCPP_DEFINE_OPTION(CURLOPT_FOLLOWLOCATION, long); /* use Location: Luke! */
299294

300295
CURLCPP_DEFINE_OPTION(CURLOPT_TRANSFERTEXT, long); /* transfer data in text/ASCII format */
301-
CURLCPP_DEFINE_OPTION(CURLOPT_PUT, long); /* HTTP PUT */
302296

303297
/* 55 = OBSOLETE */
304298

305299
/* DEPRECATED
306300
* Function that will be called instead of the internal progress display
307301
* function. This function should be defined as the curl_progress_callback
308302
* prototype defines. */
309-
CURLCPP_DEFINE_OPTION(CURLOPT_PROGRESSFUNCTION, curl_progress_callback);
303+
CURLCPP_DEFINE_OPTION(CURLOPT_XFERINFOFUNCTION, curl_progress_callback);
310304

311305
/* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION
312306
callbacks */
@@ -368,13 +362,6 @@ namespace curl {
368362
makes the operation slower and is less friendly for the network. */
369363
CURLCPP_DEFINE_OPTION(CURLOPT_FORBID_REUSE, long);
370364

371-
/* Set to a file name that contains random data for libcurl to use to
372-
seed the random engine when doing SSL connects. */
373-
CURLCPP_DEFINE_OPTION(CURLOPT_RANDOM_FILE, const char*);
374-
375-
/* Set to the Entropy Gathering Daemon socket pathname */
376-
CURLCPP_DEFINE_OPTION(CURLOPT_EGDSOCKET, const char*);
377-
378365
/* Time-out connect operations after this amount of seconds, if connects are
379366
OK within this time, then fine... This only aborts the connect phase. */
380367
CURLCPP_DEFINE_OPTION(CURLOPT_CONNECTTIMEOUT, long);
@@ -576,9 +563,6 @@ namespace curl {
576563
*/
577564
CURLCPP_DEFINE_OPTION(CURLOPT_FTPSSLAUTH, long);
578565

579-
CURLCPP_DEFINE_OPTION(CURLOPT_IOCTLFUNCTION, curlioerr(*)(CURL *handle, int cmd, void *clientp));
580-
CURLCPP_DEFINE_OPTION(CURLOPT_IOCTLDATA, void*);
581-
582566
/* zero terminated string for pass on to the FTP server when asked for
583567
"account" info */
584568
CURLCPP_DEFINE_OPTION(CURLOPT_FTP_ACCOUNT, const char*);
@@ -611,19 +595,6 @@ namespace curl {
611595
extracting it with CURLINFO_LASTSOCKET */
612596
CURLCPP_DEFINE_OPTION(CURLOPT_CONNECT_ONLY, long);
613597

614-
/* Function that will be called to convert from the
615-
network encoding (instead of using the iconv calls in libcurl) */
616-
CURLCPP_DEFINE_OPTION(CURLOPT_CONV_FROM_NETWORK_FUNCTION, CURLcode(*)(char *ptr, size_t length));
617-
618-
/* Function that will be called to convert to the
619-
network encoding (instead of using the iconv calls in libcurl) */
620-
CURLCPP_DEFINE_OPTION(CURLOPT_CONV_TO_NETWORK_FUNCTION, CURLcode(*)(char *ptr, size_t length));
621-
622-
/* Function that will be called to convert from UTF8
623-
(instead of using the iconv calls in libcurl)
624-
Note that this is used only for SSL certificate processing */
625-
CURLCPP_DEFINE_OPTION(CURLOPT_CONV_FROM_UTF8_FUNCTION, CURLcode(*)(char *ptr, size_t length));
626-
627598
/* if the connection proceeds too quickly then need to slow it down */
628599
/* limit-rate: maximum number of bytes per second to send or receive */
629600
CURLCPP_DEFINE_OPTION(CURLOPT_MAX_SEND_SPEED_LARGE, curl_off_t);
@@ -726,7 +697,7 @@ namespace curl {
726697
CURLCPP_DEFINE_OPTION(CURLOPT_TFTP_BLKSIZE, long);
727698

728699
/* Socks Service */
729-
CURLCPP_DEFINE_OPTION(CURLOPT_SOCKS5_GSSAPI_SERVICE, const char*);
700+
CURLCPP_DEFINE_OPTION(CURLOPT_PROXY_SERVICE_NAME, const char*);
730701

731702
/* Socks Service */
732703
CURLCPP_DEFINE_OPTION(CURLOPT_SOCKS5_GSSAPI_NEC, long);
@@ -735,13 +706,13 @@ namespace curl {
735706
transfer, which thus helps the app which takes URLs from users or other
736707
external inputs and want to restrict what protocol(s) to deal
737708
with. Defaults to CURLPROTO_ALL. */
738-
CURLCPP_DEFINE_OPTION(CURLOPT_PROTOCOLS, long);
709+
CURLCPP_DEFINE_OPTION(CURLOPT_PROTOCOLS_STR, long);
739710

740711
/* set the bitmask for the protocols that libcurl is allowed to follow to,
741712
as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
742713
to be set in both bitmasks to be allowed to get redirected to. Defaults
743714
to all protocols except FILE and SCP. */
744-
CURLCPP_DEFINE_OPTION(CURLOPT_REDIR_PROTOCOLS, long);
715+
CURLCPP_DEFINE_OPTION(CURLOPT_REDIR_PROTOCOLS_STR, long);
745716

746717
/* set the SSH knownhost file name to use */
747718
CURLCPP_DEFINE_OPTION(CURLOPT_SSH_KNOWNHOSTS, const char*);
@@ -879,13 +850,6 @@ namespace curl {
879850
CURLCPP_DEFINE_OPTION(CURLOPT_SASL_IR, long);
880851
#endif
881852

882-
/* Options added in 7.32 */
883-
#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM >= 0x072000
884-
/* Function that will be called instead of the internal progress display
885-
* function. This function should be defined as the curl_xferinfo_callback
886-
* prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */
887-
CURLCPP_DEFINE_OPTION(CURLOPT_XFERINFOFUNCTION, curl_xferinfo_callback);
888-
#endif
889853

890854
/* Options added in 7.33 */
891855
#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM >= 0x072100
@@ -914,8 +878,6 @@ namespace curl {
914878

915879
/* Options added in 7.36 */
916880
#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM >= 0x072400
917-
/* Enable/disable TLS NPN extension (http2 over ssl might fail without) */
918-
CURLCPP_DEFINE_OPTION(CURLOPT_SSL_ENABLE_NPN, long);
919881

920882
/* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */
921883
CURLCPP_DEFINE_OPTION(CURLOPT_SSL_ENABLE_ALPN, long);

0 commit comments

Comments
 (0)