mirror of
https://github.com/curl/curl.git
synced 2026-07-28 16:13:05 +03:00
config2setopt.c: refactor config2setopts
Introduce sub functions Closes #22215
This commit is contained in:
parent
7791b1629b
commit
8aeef462e3
9 changed files with 172 additions and 109 deletions
|
|
@ -13,9 +13,9 @@ int main(int argc, char *argv[])
|
|||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "foo=bar&baz=quux");
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)16);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
|
||||
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
|
||||
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ int main(int argc, char *argv[])
|
|||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
|
||||
mime1 = curl_mime_init(curl);
|
||||
part1 = curl_mime_addpart(mime1);
|
||||
curl_mime_data(part1, "value", CURL_ZERO_TERMINATED);
|
||||
|
|
@ -44,7 +45,6 @@ int main(int argc, char *argv[])
|
|||
mime2 = NULL;
|
||||
curl_mime_name(part1, "file");
|
||||
curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime1);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
|
||||
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
|
||||
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ int main(int argc, char *argv[])
|
|||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "ftp://%HOSTIP:%FTPPORT/%TESTNUMBER");
|
||||
curl_easy_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_QUOTE, slist1);
|
||||
curl_easy_setopt(curl, CURLOPT_POSTQUOTE, slist2);
|
||||
curl_easy_setopt(curl, CURLOPT_PREQUOTE, slist3);
|
||||
curl_easy_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
|
||||
|
||||
/* Here is a list of options the curl code used that cannot get generated
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ int main(int argc, char *argv[])
|
|||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER");
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_MAIL_FROM, "sender@example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, slist1);
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ int main(int argc, char *argv[])
|
|||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "pop3://%HOSTIP:%POP3PORT/%TESTNUMBER");
|
||||
curl_easy_setopt(curl, CURLOPT_DIRLISTONLY, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_USERPWD, "user:secret");
|
||||
curl_easy_setopt(curl, CURLOPT_DIRLISTONLY, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
|
||||
|
||||
/* Here is a list of options the curl code used that cannot get generated
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ int main(int argc, char *argv[])
|
|||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "ab\201cd\000e\\\"\?\r\n\t\001fghi\x1ajklm\xfd");
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)24);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
|
||||
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
|
||||
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue