tool_setopt.c
Go to the documentation of this file.
1 /***************************************************************************
2  * _ _ ____ _
3  * Project ___| | | | _ \| |
4  * / __| | | | |_) | |
5  * | (__| |_| | _ <| |___
6  * \___|\___/|_| \_\_____|
7  *
8  * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
9  *
10  * This software is licensed as described in the file COPYING, which
11  * you should have received as part of this distribution. The terms
12  * are also available at https://curl.haxx.se/docs/copyright.html.
13  *
14  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15  * copies of the Software, and permit persons to whom the Software is
16  * furnished to do so, under the terms of the COPYING file.
17  *
18  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19  * KIND, either express or implied.
20  *
21  ***************************************************************************/
22 #include "tool_setup.h"
23 
24 #ifndef CURL_DISABLE_LIBCURL_OPTION
25 
26 #define ENABLE_CURLX_PRINTF
27 /* use our own printf() functions */
28 #include "curlx.h"
29 
30 #include "tool_cfgable.h"
31 #include "tool_easysrc.h"
32 #include "tool_setopt.h"
33 #include "tool_convert.h"
34 
35 #include "mime.h"
36 #include "memdebug.h" /* keep this as LAST include */
37 
38 /* Lookup tables for converting setopt values back to symbols */
39 /* For enums, values may be in any order. */
40 /* For bit masks, put combinations first, then single bits, */
41 /* and finally any "NONE" value. */
42 
43 #define NV(e) {#e, e}
44 #define NV1(e, v) {#e, (v)}
45 #define NVEND {NULL, 0} /* sentinel to mark end of list */
46 
55  NVEND,
56 };
57 
63  NVEND,
64 };
65 
67  NV(CURLAUTH_ANY), /* combination */
68  NV(CURLAUTH_ANYSAFE), /* combination */
77  NVEND,
78 };
79 
86  NVEND,
87 };
88 
98  NVEND,
99 };
100 
106  NVEND,
107 };
108 
113  NVEND,
114 };
115 
121  NVEND,
122 };
123 
127  NVEND,
128 };
129 
134  NVEND,
135 };
136 
137 /* These mappings essentially triplicated - see
138  * tool_libinfo.c and tool_paramhlp.c */
140  NV(CURLPROTO_ALL), /* combination */
143  NV(CURLPROTO_FTP),
155  NV(CURLPROTO_SCP),
157  NV(CURLPROTO_SMB),
163  NVEND,
164 };
165 
166 /* These options have non-zero default values. */
168  NV1(CURLOPT_SSL_VERIFYPEER, 1),
169  NV1(CURLOPT_SSL_VERIFYHOST, 1),
170  NV1(CURLOPT_SSL_ENABLE_NPN, 1),
171  NV1(CURLOPT_SSL_ENABLE_ALPN, 1),
172  NV1(CURLOPT_TCP_NODELAY, 1),
173  NV1(CURLOPT_PROXY_SSL_VERIFYPEER, 1),
174  NV1(CURLOPT_PROXY_SSL_VERIFYHOST, 1),
175  NV1(CURLOPT_SOCKS5_AUTH, 1),
176  NVEND
177 };
178 
179 /* Format and add code; jump to nomem on malloc error */
180 #define ADD(args) do { \
181  ret = easysrc_add args; \
182  if(ret) \
183  goto nomem; \
184 } WHILE_FALSE
185 #define ADDF(args) do { \
186  ret = easysrc_addf args; \
187  if(ret) \
188  goto nomem; \
189 } WHILE_FALSE
190 
191 #define DECL0(s) ADD((&easysrc_decl, s))
192 #define DECL1(f,a) ADDF((&easysrc_decl, f,a))
193 
194 #define DATA0(s) ADD((&easysrc_data, s))
195 #define DATA1(f,a) ADDF((&easysrc_data, f,a))
196 #define DATA2(f,a,b) ADDF((&easysrc_data, f,a,b))
197 #define DATA3(f,a,b,c) ADDF((&easysrc_data, f,a,b,c))
198 
199 #define CODE0(s) ADD((&easysrc_code, s))
200 #define CODE1(f,a) ADDF((&easysrc_code, f,a))
201 #define CODE2(f,a,b) ADDF((&easysrc_code, f,a,b))
202 #define CODE3(f,a,b,c) ADDF((&easysrc_code, f,a,b,c))
203 
204 #define CLEAN0(s) ADD((&easysrc_clean, s))
205 #define CLEAN1(f,a) ADDF((&easysrc_clean, f,a))
206 
207 #define REM0(s) ADD((&easysrc_toohard, s))
208 #define REM1(f,a) ADDF((&easysrc_toohard, f,a))
209 #define REM2(f,a,b) ADDF((&easysrc_toohard, f,a,b))
210 
211 /* Escape string to C string syntax. Return NULL if out of memory.
212  * Is this correct for those wacky EBCDIC guys? */
213 static char *c_escape(const char *str, size_t len)
214 {
215  const char *s;
216  unsigned char c;
217  char *escaped, *e;
218 
219  if(len == CURL_ZERO_TERMINATED)
220  len = strlen(str);
221 
222  /* Check for possible overflow. */
223  if(len > (~(size_t) 0) / 4)
224  return NULL;
225 
226  /* Allocate space based on worst-case */
227  escaped = malloc(4 * len + 1);
228  if(!escaped)
229  return NULL;
230 
231  e = escaped;
232  for(s = str; (c = *s) != '\0'; s++) {
233  if(c == '\n') {
234  strcpy(e, "\\n");
235  e += 2;
236  }
237  else if(c == '\r') {
238  strcpy(e, "\\r");
239  e += 2;
240  }
241  else if(c == '\t') {
242  strcpy(e, "\\t");
243  e += 2;
244  }
245  else if(c == '\\') {
246  strcpy(e, "\\\\");
247  e += 2;
248  }
249  else if(c == '"') {
250  strcpy(e, "\\\"");
251  e += 2;
252  }
253  else if(! isprint(c)) {
254  snprintf(e, 5, "\\%03o", (unsigned)c);
255  e += 4;
256  }
257  else
258  *e++ = c;
259  }
260  *e = '\0';
261  return escaped;
262 }
263 
264 /* setopt wrapper for enum types */
266  const char *name, CURLoption tag,
267  const NameValue *nvlist, long lval)
268 {
269  CURLcode ret = CURLE_OK;
270  bool skip = FALSE;
271 
272  ret = curl_easy_setopt(curl, tag, lval);
273  if(!lval)
274  skip = TRUE;
275 
276  if(config->libcurl && !skip && !ret) {
277  /* we only use this for real if --libcurl was used */
278  const NameValue *nv = NULL;
279  for(nv = nvlist; nv->name; nv++) {
280  if(nv->value == lval) break; /* found it */
281  }
282  if(! nv->name) {
283  /* If no definition was found, output an explicit value.
284  * This could happen if new values are defined and used
285  * but the NameValue list is not updated. */
286  CODE2("curl_easy_setopt(hnd, %s, %ldL);", name, lval);
287  }
288  else {
289  CODE2("curl_easy_setopt(hnd, %s, (long)%s);", name, nv->name);
290  }
291  }
292 
293  nomem:
294  return ret;
295 }
296 
297 /* setopt wrapper for flags */
299  const char *name, CURLoption tag,
300  const NameValue *nvlist, long lval)
301 {
302  CURLcode ret = CURLE_OK;
303  bool skip = FALSE;
304 
305  ret = curl_easy_setopt(curl, tag, lval);
306  if(!lval)
307  skip = TRUE;
308 
309  if(config->libcurl && !skip && !ret) {
310  /* we only use this for real if --libcurl was used */
311  char preamble[80]; /* should accommodate any symbol name */
312  long rest = lval; /* bits not handled yet */
313  const NameValue *nv = NULL;
314  snprintf(preamble, sizeof(preamble),
315  "curl_easy_setopt(hnd, %s, ", name);
316  for(nv = nvlist; nv->name; nv++) {
317  if((nv->value & ~ rest) == 0) {
318  /* all value flags contained in rest */
319  rest &= ~ nv->value; /* remove bits handled here */
320  CODE3("%s(long)%s%s",
321  preamble, nv->name, rest ? " |" : ");");
322  if(!rest)
323  break; /* handled them all */
324  /* replace with all spaces for continuation line */
325  snprintf(preamble, sizeof(preamble), "%*s", strlen(preamble), "");
326  }
327  }
328  /* If any bits have no definition, output an explicit value.
329  * This could happen if new bits are defined and used
330  * but the NameValue list is not updated. */
331  if(rest)
332  CODE2("%s%ldL);", preamble, rest);
333  }
334 
335  nomem:
336  return ret;
337 }
338 
339 /* setopt wrapper for bitmasks */
341  const char *name, CURLoption tag,
342  const NameValueUnsigned *nvlist,
343  long lval)
344 {
345  CURLcode ret = CURLE_OK;
346  bool skip = FALSE;
347 
348  ret = curl_easy_setopt(curl, tag, lval);
349  if(!lval)
350  skip = TRUE;
351 
352  if(config->libcurl && !skip && !ret) {
353  /* we only use this for real if --libcurl was used */
354  char preamble[80];
355  unsigned long rest = (unsigned long)lval;
356  const NameValueUnsigned *nv = NULL;
357  snprintf(preamble, sizeof(preamble),
358  "curl_easy_setopt(hnd, %s, ", name);
359  for(nv = nvlist; nv->name; nv++) {
360  if((nv->value & ~ rest) == 0) {
361  /* all value flags contained in rest */
362  rest &= ~ nv->value; /* remove bits handled here */
363  CODE3("%s(long)%s%s",
364  preamble, nv->name, rest ? " |" : ");");
365  if(!rest)
366  break; /* handled them all */
367  /* replace with all spaces for continuation line */
368  snprintf(preamble, sizeof(preamble), "%*s", strlen(preamble), "");
369  }
370  }
371  /* If any bits have no definition, output an explicit value.
372  * This could happen if new bits are defined and used
373  * but the NameValue list is not updated. */
374  if(rest)
375  CODE2("%s%luUL);", preamble, rest);
376  }
377 
378  nomem:
379  return ret;
380 }
381 
382 /* Generate code for a struct curl_slist. */
383 static CURLcode libcurl_generate_slist(struct curl_slist *slist, int *slistno)
384 {
385  CURLcode ret = CURLE_OK;
386  char *escaped = NULL;
387 
388  /* May need several slist variables, so invent name */
389  *slistno = ++easysrc_slist_count;
390 
391  DECL1("struct curl_slist *slist%d;", *slistno);
392  DATA1("slist%d = NULL;", *slistno);
393  CLEAN1("curl_slist_free_all(slist%d);", *slistno);
394  CLEAN1("slist%d = NULL;", *slistno);
395  for(; slist; slist = slist->next) {
396  Curl_safefree(escaped);
397  escaped = c_escape(slist->data, CURL_ZERO_TERMINATED);
398  if(!escaped)
399  return CURLE_OUT_OF_MEMORY;
400  DATA3("slist%d = curl_slist_append(slist%d, \"%s\");",
401  *slistno, *slistno, escaped);
402  }
403 
404  nomem:
405  Curl_safefree(escaped);
406  return ret;
407 }
408 
409 /* Generate source code for a mime structure. */
410 static CURLcode libcurl_generate_mime(curl_mime *mime, int *mimeno)
411 {
412  CURLcode ret = CURLE_OK;
413  int i;
415  curl_mimepart *part;
416  char *filename;
417  char *escaped = NULL;
418  char *cp;
419  char *data;
420 
421  /* May need several mime variables, so invent name */
422  *mimeno = ++easysrc_mime_count;
423 
424  DECL1("curl_mime *mime%d;", *mimeno);
425  DATA1("mime%d = NULL;", *mimeno);
426  CODE1("mime%d = curl_mime_init(hnd);", *mimeno);
427  CLEAN1("curl_mime_free(mime%d);", *mimeno);
428  CLEAN1("mime%d = NULL;", *mimeno);
429  if(mime->firstpart) {
430  DECL1("curl_mimepart *part%d;", *mimeno);
431  for(part = mime->firstpart; part; part = part->nextpart) {
432  CODE2("part%d = curl_mime_addpart(mime%d);", *mimeno, *mimeno);
433  filename = part->filename;
434  switch(part->kind) {
435  case MIMEKIND_FILE:
436  Curl_safefree(escaped);
437  escaped = c_escape(part->data, CURL_ZERO_TERMINATED);
438  if(!escaped)
439  return CURLE_OUT_OF_MEMORY;
440  CODE2("curl_mime_filedata(part%d, \"%s\");", *mimeno, escaped);
441  if(!filename)
442  CODE1("curl_mime_filename(part%d, NULL);", *mimeno);
443  else {
444  /* Fast check to see if remote file name is base name. */
445  filename = part->data;
446  for(cp = filename; *cp; cp++)
447  if(*cp == '/' || *cp == '\\')
448  filename = cp + 1;
449  if(!part->filename || !strcmp(filename, part->filename))
450  filename = NULL;
451  else
452  filename = part->filename;
453  }
454  break;
455  case MIMEKIND_CALLBACK:
456  /* Can only be reading stdin in the current context. */
457  CODE1("curl_mime_data_cb(part%d, -1, (curl_read_callback) fread, \\",
458  *mimeno);
459  CODE0(" (curl_seek_callback) fseek, NULL, stdin);");
460  break;
461  case MIMEKIND_DATA:
462 #ifdef CURL_DOES_CONVERSIONS
463  /* Data is stored in ASCII and we want in in the host character
464  code. Convert it back for output. */
465  data = malloc(part->datasize + 1);
466  if(!data) {
467  ret = CURLE_OUT_OF_MEMORY;
468  goto nomem;
469  }
470  memcpy(data, part->data, part->datasize + 1);
471  ret = convert_from_network(data, strlen(data));
472  if(ret) {
473  Curl_safefree(data);
474  goto nomem;
475  }
476 #else
477  data = part->data;
478 #endif
479 
480  /* Are there any nul byte in data? */
481  for(cp = data; *cp; cp++)
482  ;
483  size = (cp == data + part->datasize)? (curl_off_t) -1: part->datasize;
484  Curl_safefree(escaped);
485  escaped = c_escape(data, (size_t) part->datasize);
486 #ifdef CURL_DOES_CONVERSIONS
487  Curl_safefree(data);
488 #endif
489  if(!escaped)
490  return CURLE_OUT_OF_MEMORY;
491  if(size >= 0)
492  CODE3("curl_mime_data(part%d, \"%s\", %" CURL_FORMAT_CURL_OFF_T ");",
493  *mimeno, escaped, size);
494  else
495  CODE2("curl_mime_data(part%d, \"%s\", CURL_ZERO_TERMINATED);",
496  *mimeno, escaped);
497  break;
498  case MIMEKIND_MULTIPART:
499  ret = libcurl_generate_mime(part->arg, &i);
500  if(ret)
501  goto nomem;
502  CODE2("curl_mime_subparts(part%d, mime%d);", *mimeno, i);
503  CODE1("mime%d = NULL;", i); /* Avoid freeing in CLEAN sequence. */
504  break;
505  default:
506  /* Other cases not possible in this context. */
507  break;
508  }
509 
510  if(part->encoder) {
511  Curl_safefree(escaped);
512  escaped = c_escape(part->encoder->name, CURL_ZERO_TERMINATED);
513  if(!escaped)
514  return CURLE_OUT_OF_MEMORY;
515  CODE2("curl_mime_encoder(part%d, \"%s\");", *mimeno, escaped);
516  }
517 
518  if(filename) {
519  Curl_safefree(escaped);
520  escaped = c_escape(filename, CURL_ZERO_TERMINATED);
521  if(!escaped)
522  return CURLE_OUT_OF_MEMORY;
523  CODE2("curl_mime_filename(part%d, \"%s\");", *mimeno, escaped);
524  }
525 
526  if(part->name) {
527  Curl_safefree(escaped);
528  escaped = c_escape(part->name, CURL_ZERO_TERMINATED);
529  if(!escaped)
530  return CURLE_OUT_OF_MEMORY;
531  CODE2("curl_mime_name(part%d, \"%s\");", *mimeno, escaped);
532  }
533 
534  if(part->mimetype) {
535  Curl_safefree(escaped);
536  escaped = c_escape(part->mimetype, CURL_ZERO_TERMINATED);
537  if(!escaped)
538  return CURLE_OUT_OF_MEMORY;
539  CODE2("curl_mime_type(part%d, \"%s\");", *mimeno, escaped);
540  }
541 
542  if(part->userheaders) {
543  int ownership = part->flags & MIME_USERHEADERS_OWNER? 1: 0;
544 
545  ret = libcurl_generate_slist(part->userheaders, &i);
546  if(ret)
547  goto nomem;
548  CODE3("curl_mime_headers(part%d, slist%d, %d);",
549  *mimeno, i, ownership);
550  if(ownership)
551  CODE1("slist%d = NULL;", i); /* Prevent freeing in CLEAN sequence. */
552  }
553  }
554  }
555 
556 nomem:
557  Curl_safefree(escaped);
558  return ret;
559 }
560 
561 /* setopt wrapper for CURLOPT_MIMEPOST */
563  const char *name, CURLoption tag,
564  curl_mime *mimepost)
565 {
566  CURLcode ret = CURLE_OK;
567 
568  ret = curl_easy_setopt(curl, tag, mimepost);
569 
570  if(config->libcurl && mimepost && !ret) {
571  int i;
572 
573  ret = libcurl_generate_mime(mimepost, &i);
574 
575  if(!ret)
576  CODE2("curl_easy_setopt(hnd, %s, mime%d);", name, i);
577  }
578 
579 nomem:
580  return ret;
581 }
582 
583 /* setopt wrapper for curl_slist options */
585  const char *name, CURLoption tag,
586  struct curl_slist *list)
587 {
588  CURLcode ret = CURLE_OK;
589 
590  ret = curl_easy_setopt(curl, tag, list);
591 
592  if(config->libcurl && list && !ret) {
593  int i;
594 
595  ret = libcurl_generate_slist(list, &i);
596  if(!ret)
597  CODE2("curl_easy_setopt(hnd, %s, slist%d);", name, i);
598  }
599 
600  nomem:
601  return ret;
602 }
603 
604 /* generic setopt wrapper for all other options.
605  * Some type information is encoded in the tag value. */
607  const char *name, CURLoption tag, ...)
608 {
609  va_list arg;
610  char buf[256];
611  const char *value = NULL;
612  bool remark = FALSE;
613  bool skip = FALSE;
614  bool escape = FALSE;
615  char *escaped = NULL;
616  CURLcode ret = CURLE_OK;
617 
618  va_start(arg, tag);
619 
620  if(tag < CURLOPTTYPE_OBJECTPOINT) {
621  /* Value is expected to be a long */
622  long lval = va_arg(arg, long);
623  long defval = 0L;
624  const NameValue *nv = NULL;
625  for(nv = setopt_nv_CURLNONZERODEFAULTS; nv->name; nv++) {
626  if(!strcmp(name, nv->name)) {
627  defval = nv->value;
628  break; /* found it */
629  }
630  }
631 
632  snprintf(buf, sizeof(buf), "%ldL", lval);
633  value = buf;
634  ret = curl_easy_setopt(curl, tag, lval);
635  if(lval == defval)
636  skip = TRUE;
637  }
638  else if(tag < CURLOPTTYPE_OFF_T) {
639  /* Value is some sort of object pointer */
640  void *pval = va_arg(arg, void *);
641 
642  /* function pointers are never printable */
643  if(tag >= CURLOPTTYPE_FUNCTIONPOINT) {
644  if(pval) {
645  value = "functionpointer";
646  remark = TRUE;
647  }
648  else
649  skip = TRUE;
650  }
651 
652  else if(pval && str) {
653  value = (char *)pval;
654  escape = TRUE;
655  }
656  else if(pval) {
657  value = "objectpointer";
658  remark = TRUE;
659  }
660  else
661  skip = TRUE;
662 
663  ret = curl_easy_setopt(curl, tag, pval);
664 
665  }
666  else {
667  /* Value is expected to be curl_off_t */
668  curl_off_t oval = va_arg(arg, curl_off_t);
669  snprintf(buf, sizeof(buf),
670  "(curl_off_t)%" CURL_FORMAT_CURL_OFF_T, oval);
671  value = buf;
672  ret = curl_easy_setopt(curl, tag, oval);
673 
674  if(!oval)
675  skip = TRUE;
676  }
677 
678  va_end(arg);
679 
680  if(config->libcurl && !skip && !ret) {
681  /* we only use this for real if --libcurl was used */
682 
683  if(remark)
684  REM2("%s set to a %s", name, value);
685  else {
686  if(escape) {
687  escaped = c_escape(value, CURL_ZERO_TERMINATED);
688  if(!escaped) {
689  ret = CURLE_OUT_OF_MEMORY;
690  goto nomem;
691  }
692  CODE2("curl_easy_setopt(hnd, %s, \"%s\");", name, escaped);
693  }
694  else
695  CODE2("curl_easy_setopt(hnd, %s, %s);", name, value);
696  }
697  }
698 
699  nomem:
700  Curl_safefree(escaped);
701  return ret;
702 }
703 
704 #endif /* CURL_DISABLE_LIBCURL_OPTION */
const char * name
Definition: tool_setopt.h:45
const NameValue setopt_nv_CURLFTPSSL_CCC[]
Definition: tool_setopt.c:109
#define CURLPROTO_FTPS
Definition: curl.h:847
#define CURLAUTH_DIGEST_IE
Definition: curl.h:705
#define CURLPROTO_HTTP
Definition: curl.h:844
#define CURLPROTO_FILE
Definition: curl.h:854
#define CURLPROTO_SCP
Definition: curl.h:848
filename
#define CURLPROTO_ALL
Definition: curl.h:872
#define CURLPROTO_SMB
Definition: curl.h:870
#define DATA3(f, a, b, c)
Definition: tool_setopt.c:197
const NameValue setopt_nv_CURLPROTO[]
Definition: tool_setopt.c:139
Definition: ws_ssl.c:25
#define CURLAUTH_BASIC
Definition: curl.h:697
#define CURLPROTO_DICT
Definition: curl.h:853
#define CURLPROTO_IMAP
Definition: curl.h:856
const NameValue setopt_nv_CURLPROXY[]
Definition: tool_setopt.c:47
char * filename
Definition: mime.h:112
char * data
Definition: curl.h:2336
#define CURLPROTO_SMBS
Definition: curl.h:871
#define CURLSSLOPT_NO_REVOKE
Definition: curl.h:787
XmlRpcServer s
#define CURLPROTO_SMTPS
Definition: curl.h:861
CURLcode
Definition: curl.h:454
static const NameValue setopt_nv_CURLNONZERODEFAULTS[]
Definition: tool_setopt.c:167
int easysrc_mime_count
Definition: tool_easysrc.c:45
unsigned int flags
Definition: mime.h:115
#define CURLAUTH_GSSNEGOTIATE
Definition: curl.h:701
char * name
Definition: mime.h:113
#define CURLPROTO_GOPHER
Definition: curl.h:869
enum mimekind kind
Definition: mime.h:102
static char * c_escape(const char *str, size_t len)
Definition: tool_setopt.c:213
char * data
Definition: mime.h:103
#define malloc(size)
Definition: curl_memory.h:124
#define CURLPROTO_FTP
Definition: curl.h:846
#define curl_easy_setopt(handle, option, value)
Definition: typecheck-gcc.h:41
const NameValue setopt_nv_CURL_SOCKS_PROXY[]
Definition: tool_setopt.c:58
unsigned int i
Definition: unit1303.c:79
const char * name
Definition: tool_setopt.h:40
#define CURLOPTTYPE_FUNCTIONPOINT
Definition: curl.h:879
const NameValue setopt_nv_CURL_SSLVERSION[]
Definition: tool_setopt.c:89
#define CURLPROTO_SFTP
Definition: curl.h:849
size_t len
Definition: curl_sasl.c:55
#define NV(e)
Definition: tool_setopt.c:43
memcpy(filename, filename1, strlen(filename1))
#define CURLAUTH_NONE
Definition: curl.h:696
#define CURLPROTO_HTTPS
Definition: curl.h:845
#define CURLPROTO_RTSP
Definition: curl.h:862
const char * str
Definition: unit1398.c:33
#define FALSE
#define CURLPROTO_LDAP
Definition: curl.h:851
#define CURLPROTO_LDAPS
Definition: curl.h:852
struct curl_slist * next
Definition: curl.h:2337
#define MIME_USERHEADERS_OWNER
Definition: mime.h:30
#define CURLOPTTYPE_OBJECTPOINT
Definition: curl.h:877
CURLcode tool_setopt_mimepost(CURL *curl, struct GlobalConfig *config, const char *name, CURLoption tag, curl_mime *mimepost)
Definition: tool_setopt.c:562
const NameValue setopt_nv_CURL_HTTP_VERSION[]
Definition: tool_setopt.c:80
unsigned long value
Definition: tool_setopt.h:46
#define CODE0(s)
Definition: tool_setopt.c:199
long value
Definition: tool_setopt.h:41
UNITTEST_START struct Curl_easy data
Definition: unit1399.c:82
#define CURLPROTO_POP3S
Definition: curl.h:859
#define CURLPROTO_IMAPS
Definition: curl.h:857
char * mimetype
Definition: mime.h:111
#define CURLOPTTYPE_OFF_T
Definition: curl.h:880
CURL_TYPEOF_CURL_OFF_T curl_off_t
Definition: system.h:420
char * libcurl
Definition: tool_cfgable.h:272
#define CODE3(f, a, b, c)
Definition: tool_setopt.c:202
#define CURLAUTH_NTLM
Definition: curl.h:704
#define DECL1(f, a)
Definition: tool_setopt.c:192
#define CURLPROTO_TFTP
Definition: curl.h:855
#define CODE1(f, a)
Definition: tool_setopt.c:200
Definition: curl.h:455
curl_mimepart * firstpart
Definition: mime.h:91
#define CURLPROTO_TELNET
Definition: curl.h:850
const NameValue setopt_nv_CURL_TIMECOND[]
Definition: tool_setopt.c:101
#define Curl_safefree(ptr)
Definition: memdebug.h:170
CURLoption
Definition: curl.h:910
#define CURLAUTH_ANYSAFE
Definition: curl.h:709
#define CODE2(f, a, b)
Definition: tool_setopt.c:201
static CURLcode libcurl_generate_mime(curl_mime *mime, int *mimeno)
Definition: tool_setopt.c:410
#define CURLPROTO_SMTP
Definition: curl.h:860
curl_mimepart * nextpart
Definition: mime.h:101
static CURLcode libcurl_generate_slist(struct curl_slist *slist, int *slistno)
Definition: tool_setopt.c:383
int easysrc_slist_count
Definition: tool_easysrc.c:46
const char * name
Definition: mime.h:66
const NameValueUnsigned setopt_nv_CURLSSLOPT[]
Definition: tool_setopt.c:124
CURLcode tool_setopt_bitmask(CURL *curl, struct GlobalConfig *config, const char *name, CURLoption tag, const NameValueUnsigned *nvlist, long lval)
Definition: tool_setopt.c:340
char buf[3]
Definition: unit1398.c:32
void CURL
Definition: curl.h:102
const NameValue setopt_nv_CURLUSESSL[]
Definition: tool_setopt.c:116
UNITTEST_START int * value
Definition: unit1602.c:51
CURLcode tool_setopt_enum(CURL *curl, struct GlobalConfig *config, const char *name, CURLoption tag, const NameValue *nvlist, long lval)
Definition: tool_setopt.c:265
const NameValue setopt_nv_CURL_NETRC[]
Definition: tool_setopt.c:130
curl_off_t datasize
Definition: mime.h:114
#define CURL_ZERO_TERMINATED
Definition: curl.h:1966
void * arg
Definition: mime.h:107
#define CURLAUTH_DIGEST
Definition: curl.h:698
size_t size
Definition: unit1302.c:52
struct curl_slist * userheaders
Definition: mime.h:110
static void skip(const char **date)
Definition: parsedate.c:260
#define snprintf
Definition: curl_printf.h:42
#define TRUE
const NameValueUnsigned setopt_nv_CURLAUTH[]
Definition: tool_setopt.c:66
#define CURLPROTO_POP3
Definition: curl.h:858
#define NV1(e, v)
Definition: tool_setopt.c:44
#define CURLAUTH_ANY
Definition: curl.h:708
const char * name
Definition: curl_sasl.c:54
static CURL * curl
Definition: sessioninfo.c:35
#define CURLAUTH_NTLM_WB
Definition: curl.h:706
const mime_encoder * encoder
Definition: mime.h:117
#define DATA1(f, a)
Definition: tool_setopt.c:195
#define CURLSSLOPT_ALLOW_BEAST
Definition: curl.h:783
CURLcode tool_setopt(CURL *curl, bool str, struct GlobalConfig *config, const char *name, CURLoption tag,...)
Definition: tool_setopt.c:606
CURLcode tool_setopt_slist(CURL *curl, struct GlobalConfig *config, const char *name, CURLoption tag, struct curl_slist *list)
Definition: tool_setopt.c:584
#define REM2(f, a, b)
Definition: tool_setopt.c:209
#define CURLAUTH_ONLY
Definition: curl.h:707
#define CLEAN1(f, a)
Definition: tool_setopt.c:205
CURLcode tool_setopt_flags(CURL *curl, struct GlobalConfig *config, const char *name, CURLoption tag, const NameValue *nvlist, long lval)
Definition: tool_setopt.c:298
#define NVEND
Definition: tool_setopt.c:45
#define CURL_FORMAT_CURL_OFF_T
Definition: system.h:373


rc_tagdetect_client
Author(s): Monika Florek-Jasinska , Raphael Schaller
autogenerated on Sat Feb 13 2021 03:42:16