1 /* Reading/parsing the initialization file.
2 Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
4 This file is part of Wget.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
24 #include <sys/types.h>
39 # include <sys/socket.h>
40 # include <netinet/in.h>
41 # include <arpa/inet.h>
60 #define CMD_DECLARE(func) static int func \
61 PARAMS ((const char *, const char *, void *))
63 CMD_DECLARE (cmd_address);
64 CMD_DECLARE (cmd_boolean);
65 CMD_DECLARE (cmd_bytes);
66 CMD_DECLARE (cmd_directory_vector);
67 CMD_DECLARE (cmd_lockable_boolean);
68 CMD_DECLARE (cmd_number);
69 CMD_DECLARE (cmd_number_inf);
70 CMD_DECLARE (cmd_string);
71 CMD_DECLARE (cmd_time);
72 CMD_DECLARE (cmd_vector);
74 CMD_DECLARE (cmd_spec_dirstruct);
75 CMD_DECLARE (cmd_spec_dotstyle);
76 CMD_DECLARE (cmd_spec_header);
77 CMD_DECLARE (cmd_spec_htmlify);
78 CMD_DECLARE (cmd_spec_mirror);
79 CMD_DECLARE (cmd_spec_recursive);
80 CMD_DECLARE (cmd_spec_useragent);
82 /* List of recognized commands, each consisting of name, closure and function.
83 When adding a new command, simply add it to the list, but be sure to keep the
84 list sorted alphabetically, as comind() depends on it. Also, be sure to add
85 any entries that allocate memory (e.g. cmd_string and cmd_vector guys) to the
86 cleanup() function below. */
90 int (*action) PARAMS ((const char *, const char *, void *));
92 { "accept", &opt.accepts, cmd_vector },
93 { "addhostdir", &opt.add_hostdir, cmd_boolean },
94 { "alwaysrest", &opt.always_rest, cmd_boolean }, /* deprecated */
95 { "background", &opt.background, cmd_boolean },
96 { "backupconverted", &opt.backup_converted, cmd_boolean },
97 { "backups", &opt.backups, cmd_number },
98 { "base", &opt.base_href, cmd_string },
99 { "bindaddress", &opt.bind_address, cmd_address },
100 { "cache", &opt.proxy_cache, cmd_boolean },
101 { "continue", &opt.always_rest, cmd_boolean },
102 { "convertlinks", &opt.convert_links, cmd_boolean },
103 { "cutdirs", &opt.cut_dirs, cmd_number },
105 { "debug", &opt.debug, cmd_boolean },
107 { "deleteafter", &opt.delete_after, cmd_boolean },
108 { "dirprefix", &opt.dir_prefix, cmd_string },
109 { "dirstruct", NULL, cmd_spec_dirstruct },
110 { "domains", &opt.domains, cmd_vector },
111 { "dotbytes", &opt.dot_bytes, cmd_bytes },
112 { "dotsinline", &opt.dots_in_line, cmd_number },
113 { "dotspacing", &opt.dot_spacing, cmd_number },
114 { "dotstyle", NULL, cmd_spec_dotstyle },
115 { "excludedirectories", &opt.excludes, cmd_directory_vector },
116 { "excludedomains", &opt.exclude_domains, cmd_vector },
117 { "followftp", &opt.follow_ftp, cmd_boolean },
118 { "followtags", &opt.follow_tags, cmd_vector },
119 { "forcehtml", &opt.force_html, cmd_boolean },
120 { "ftpproxy", &opt.ftp_proxy, cmd_string },
121 { "glob", &opt.ftp_glob, cmd_boolean },
122 { "header", NULL, cmd_spec_header },
123 { "htmlextension", &opt.html_extension, cmd_boolean },
124 { "htmlify", NULL, cmd_spec_htmlify },
125 { "httpkeepalive", &opt.http_keep_alive, cmd_boolean },
126 { "httppasswd", &opt.http_passwd, cmd_string },
127 { "httpproxy", &opt.http_proxy, cmd_string },
128 { "httpuser", &opt.http_user, cmd_string },
129 { "httpsproxy", &opt.https_proxy, cmd_string },
130 { "ignorelength", &opt.ignore_length, cmd_boolean },
131 { "ignoretags", &opt.ignore_tags, cmd_vector },
132 { "includedirectories", &opt.includes, cmd_directory_vector },
133 { "input", &opt.input_filename, cmd_string },
134 { "killlonger", &opt.kill_longer, cmd_boolean },
135 { "logfile", &opt.lfilename, cmd_string },
136 { "login", &opt.ftp_acc, cmd_string },
137 { "mirror", NULL, cmd_spec_mirror },
138 { "netrc", &opt.netrc, cmd_boolean },
139 { "noclobber", &opt.noclobber, cmd_boolean },
140 { "noparent", &opt.no_parent, cmd_boolean },
141 { "noproxy", &opt.no_proxy, cmd_vector },
142 { "numtries", &opt.ntry, cmd_number_inf },/* deprecated*/
143 { "outputdocument", &opt.output_document, cmd_string },
144 { "pagerequisites", &opt.page_requisites, cmd_boolean },
145 { "passiveftp", &opt.ftp_pasv, cmd_lockable_boolean },
146 { "passwd", &opt.ftp_pass, cmd_string },
147 { "proxypasswd", &opt.proxy_passwd, cmd_string },
148 { "proxyuser", &opt.proxy_user, cmd_string },
149 { "quiet", &opt.quiet, cmd_boolean },
150 { "quota", &opt.quota, cmd_bytes },
151 { "reclevel", &opt.reclevel, cmd_number_inf },
152 { "recursive", NULL, cmd_spec_recursive },
153 { "referer", &opt.referer, cmd_string },
154 { "reject", &opt.rejects, cmd_vector },
155 { "relativeonly", &opt.relative_only, cmd_boolean },
156 { "removelisting", &opt.remove_listing, cmd_boolean },
157 { "retrsymlinks", &opt.retr_symlinks, cmd_boolean },
158 { "robots", &opt.use_robots, cmd_boolean },
159 { "saveheaders", &opt.save_headers, cmd_boolean },
160 { "serverresponse", &opt.server_response, cmd_boolean },
161 { "simplehostcheck", &opt.simple_check, cmd_boolean },
162 { "spanhosts", &opt.spanhost, cmd_boolean },
163 { "spider", &opt.spider, cmd_boolean },
164 { "timeout", &opt.timeout, cmd_time },
165 { "timestamping", &opt.timestamping, cmd_boolean },
166 { "tries", &opt.ntry, cmd_number_inf },
167 { "useproxy", &opt.use_proxy, cmd_boolean },
168 { "useragent", NULL, cmd_spec_useragent },
169 { "verbose", &opt.verbose, cmd_boolean },
170 { "wait", &opt.wait, cmd_time },
171 { "waitretry", &opt.waitretry, cmd_time }
174 /* Return index of COM if it is a valid command, or -1 otherwise. COM
175 is looked up in `commands' using binary search algorithm. */
177 comind (const char *com)
179 int min = 0, max = ARRAY_SIZE (commands) - 1;
183 int i = (min + max) / 2;
184 int cmp = strcasecmp (com, commands[i].name);
196 /* Reset the variables to default values. */
202 /* Most of the default values are 0. Just reset everything, and
203 fill in the non-zero values. Note that initializing pointers to
204 NULL this way is technically illegal, but porting Wget to a
205 machine where NULL is not all-zero bit pattern will be the least
206 of the implementors' worries. */
207 memset (&opt, 0, sizeof (opt));
210 opt.dir_prefix = xstrdup (".");
214 opt.ftp_acc = xstrdup ("anonymous");
215 /*opt.ftp_pass = xstrdup (ftp_getaddress ());*/
219 opt.http_keep_alive = 1;
221 tmp = getenv ("no_proxy");
223 opt.no_proxy = sepstring (tmp);
231 opt.remove_listing = 1;
233 opt.dot_bytes = 1024;
234 opt.dot_spacing = 10;
235 opt.dots_in_line = 50;
238 /* Return the user's home directory (strdup-ed), or NULL if none is
243 char *home = getenv ("HOME");
248 /* If HOME is not defined, try getting it from the password
250 struct passwd *pwd = getpwuid (getuid ());
251 if (!pwd || !pwd->pw_dir)
256 /* #### Maybe I should grab home_dir from registry, but the best
257 that I could get from there is user's Start menu. It sucks! */
261 return home ? xstrdup (home) : NULL;
264 /* Return the path to the user's .wgetrc. This is either the value of
265 `WGETRC' environment variable, or `$HOME/.wgetrc'.
267 If the `WGETRC' variable exists but the file does not exist, the
268 function will exit(). */
270 wgetrc_file_name (void)
275 /* Try the environment. */
276 env = getenv ("WGETRC");
279 if (!file_exists_p (env))
281 fprintf (stderr, "%s: %s: %s.\n", exec_name, file, strerror (errno));
284 return xstrdup (env);
288 /* If that failed, try $HOME/.wgetrc. */
292 file = (char *)xmalloc (strlen (home) + 1 + strlen (".wgetrc") + 1);
293 sprintf (file, "%s/.wgetrc", home);
297 /* Under Windows, "home" is (for the purposes of this function) the
298 directory where `wget.exe' resides, and `wget.ini' will be used
299 as file name. SYSTEM_WGETRC should not be defined under WINDOWS.
301 It is not as trivial as I assumed, because on 95 argv[0] is full
302 path, but on NT you get what you typed in command line. --dbudor */
306 file = (char *)xmalloc (strlen (home) + strlen ("wget.ini") + 1);
307 sprintf (file, "%swget.ini", home);
313 if (!file_exists_p (file))
321 /* Initialize variables from a wgetrc file */
323 run_wgetrc (const char *file)
329 fp = fopen (file, "rb");
332 fprintf (stderr, _("%s: Cannot read %s (%s).\n"), exec_name,
333 file, strerror (errno));
336 /* Reset line number. */
338 while ((line = read_whole_line (fp)))
343 /* Parse the line. */
344 status = parse_line (line, &com, &val);
346 /* If everything is OK, set the value. */
349 if (!setval (com, val))
350 fprintf (stderr, _("%s: Error in %s at line %d.\n"), exec_name,
355 else if (status == 0)
356 fprintf (stderr, _("%s: Error in %s at line %d.\n"), exec_name,
363 /* Initialize the defaults and run the system wgetrc and user's own
370 /* Load the hard-coded defaults. */
373 /* If SYSTEM_WGETRC is defined, use it. */
375 if (file_exists_p (SYSTEM_WGETRC))
376 run_wgetrc (SYSTEM_WGETRC);
378 /* Override it with your own, if one exists. */
379 file = wgetrc_file_name ();
382 /* #### We should somehow canonicalize `file' and SYSTEM_WGETRC,
385 if (!strcmp (file, SYSTEM_WGETRC))
387 fprintf (stderr, _("\
388 %s: Warning: Both system and user wgetrc point to `%s'.\n"),
398 /* Parse the line pointed by line, with the syntax:
399 <sp>* command <sp>* = <sp>* value <newline>
400 Uses malloc to allocate space for command and value.
401 If the line is invalid, data is freed and 0 is returned.
408 parse_line (const char *line, char **com, char **val)
410 const char *p = line;
411 const char *orig_comptr, *end;
414 /* Skip whitespace. */
415 while (*p && ISSPACE (*p))
418 /* Don't process empty lines. */
419 if (!*p || *p == '#')
422 for (orig_comptr = p; ISALPHA (*p) || *p == '_' || *p == '-'; p++)
424 /* The next char should be space or '='. */
425 if (!ISSPACE (*p) && (*p != '='))
427 /* Here we cannot use strdupdelim() as we normally would because we
428 want to skip the `-' and `_' characters in the input string. */
429 *com = (char *)xmalloc (p - orig_comptr + 1);
430 for (new_comptr = *com; orig_comptr < p; orig_comptr++)
432 if (*orig_comptr == '_' || *orig_comptr == '-')
434 *new_comptr++ = *orig_comptr;
437 /* If the command is invalid, exit now. */
438 if (comind (*com) == -1)
444 /* Skip spaces before '='. */
445 for (; ISSPACE (*p); p++);
446 /* If '=' not found, bail out. */
452 /* Skip spaces after '='. */
453 for (++p; ISSPACE (*p); p++);
454 /* Get the ending position for VAL by starting with the end of the
455 line and skipping whitespace. */
456 end = line + strlen (line) - 1;
457 while (end > p && ISSPACE (*end))
459 *val = strdupdelim (p, end + 1);
463 /* Set COM to VAL. This is the meat behind processing `.wgetrc'. No
464 fatals -- error signal prints a warning and resets to default
465 value. All error messages are printed to stderr, *not* to
466 opt.lfile, since opt.lfile wasn't even generated yet. */
468 setval (const char *com, const char *val)
477 /* #### Should I just abort()? */
479 fprintf (stderr, _("%s: BUG: unknown command `%s', value `%s'.\n"),
480 exec_name, com, val);
484 return ((*commands[ind].action) (com, val, commands[ind].closure));
487 /* Generic helper functions, for use with `commands'. */
489 static int myatoi PARAMS ((const char *s));
491 /* Store the address (specified as hostname or dotted-quad IP address) from VAL
492 to CLOSURE. COM is ignored, except for error messages. */
494 cmd_address (const char *com, const char *val, void *closure)
496 struct sockaddr_in sin;
498 if (!store_hostaddress ((unsigned char *)&sin.sin_addr, val))
500 fprintf (stderr, _("%s: %s: Cannot convert `%s' to an IP address.\n"),
501 exec_name, com, val);
505 sin.sin_family = AF_INET;
508 memcpy (closure, &sin, sizeof (sin));
513 /* Store the boolean value from VAL to CLOSURE. COM is ignored,
514 except for error messages. */
516 cmd_boolean (const char *com, const char *val, void *closure)
520 if (!strcasecmp (val, "on")
521 || (*val == '1' && !*(val + 1)))
523 else if (!strcasecmp (val, "off")
524 || (*val == '0' && !*(val + 1)))
528 fprintf (stderr, _("%s: %s: Please specify on or off.\n"),
533 *(int *)closure = bool_value;
537 /* Store the lockable_boolean {2, 1, 0, -1} value from VAL to CLOSURE. COM is
538 ignored, except for error messages. Values 2 and -1 indicate that once
539 defined, the value may not be changed by successive wgetrc files or
540 command-line arguments.
542 Values: 2 - Enable a particular option for good ("always")
543 1 - Enable an option ("on")
544 0 - Disable an option ("off")
545 -1 - Disable an option for good ("never") */
547 cmd_lockable_boolean (const char *com, const char *val, void *closure)
549 int lockable_boolean_value;
552 * If a config file said "always" or "never", don't allow command line
553 * arguments to override the config file.
555 if (*(int *)closure == -1 || *(int *)closure == 2)
558 if (!strcasecmp (val, "always")
559 || (*val == '2' && !*(val + 1)))
560 lockable_boolean_value = 2;
561 else if (!strcasecmp (val, "on")
562 || (*val == '1' && !*(val + 1)))
563 lockable_boolean_value = 1;
564 else if (!strcasecmp (val, "off")
565 || (*val == '0' && !*(val + 1)))
566 lockable_boolean_value = 0;
567 else if (!strcasecmp (val, "never")
568 || (*val == '-' && *(val + 1) == '1' && !*(val + 2)))
569 lockable_boolean_value = -1;
572 fprintf (stderr, _("%s: %s: Please specify always, on, off, "
578 *(int *)closure = lockable_boolean_value;
582 /* Set the non-negative integer value from VAL to CLOSURE. With
583 incorrect specification, the number remains unchanged. */
585 cmd_number (const char *com, const char *val, void *closure)
587 int num = myatoi (val);
591 fprintf (stderr, _("%s: %s: Invalid specification `%s'.\n"),
592 exec_name, com, val);
595 *(int *)closure = num;
599 /* Similar to cmd_number(), only accepts `inf' as a synonym for 0. */
601 cmd_number_inf (const char *com, const char *val, void *closure)
603 if (!strcasecmp (val, "inf"))
608 return cmd_number (com, val, closure);
611 /* Copy (strdup) the string at COM to a new location and place a
612 pointer to *CLOSURE. */
614 cmd_string (const char *com, const char *val, void *closure)
616 char **pstring = (char **)closure;
618 FREE_MAYBE (*pstring);
619 *pstring = xstrdup (val);
623 /* Merge the vector (array of strings separated with `,') in COM with
624 the vector (NULL-terminated array of strings) pointed to by
627 cmd_vector (const char *com, const char *val, void *closure)
629 char ***pvec = (char ***)closure;
632 *pvec = merge_vecs (*pvec, sepstring (val));
642 cmd_directory_vector (const char *com, const char *val, void *closure)
644 char ***pvec = (char ***)closure;
648 /* Strip the trailing slashes from directories. */
651 seps = sepstring (val);
652 for (t = seps; t && *t; t++)
654 int len = strlen (*t);
655 /* Skip degenerate case of root directory. */
658 if ((*t)[len - 1] == '/')
659 (*t)[len - 1] = '\0';
662 *pvec = merge_vecs (*pvec, seps);
672 /* Set the value stored in VAL to CLOSURE (which should point to a
673 long int), allowing several postfixes, with the following syntax
677 [0-9]+[kK] -> bytes * 1024
678 [0-9]+[mM] -> bytes * 1024 * 1024
681 Anything else is flagged as incorrect, and CLOSURE is unchanged. */
683 cmd_bytes (const char *com, const char *val, void *closure)
686 long *out = (long *)closure;
691 /* Check for "inf". */
692 if (p[0] == 'i' && p[1] == 'n' && p[2] == 'f' && p[3] == '\0')
697 /* Search for digits and construct result. */
698 for (; *p && ISDIGIT (*p); p++)
699 result = (10 * result) + (*p - '0');
700 /* If no digits were found, or more than one character is following
702 if (p == val || (*p != '\0' && *(p + 1) != '\0'))
704 printf (_("%s: Invalid specification `%s'\n"), com, val);
707 /* Search for a designator. */
708 switch (TOLOWER (*p))
719 result *= (long)1024 * 1024;
723 result *= (long)1024 * 1024 * 1024;
726 printf (_("%s: Invalid specification `%s'\n"), com, val);
733 /* Store the value of VAL to *OUT, allowing suffixes for minutes and
736 cmd_time (const char *com, const char *val, void *closure)
741 /* Search for digits and construct result. */
742 for (; *p && ISDIGIT (*p); p++)
743 result = (10 * result) + (*p - '0');
744 /* If no digits were found, or more than one character is following
746 if (p == val || (*p != '\0' && *(p + 1) != '\0'))
748 printf (_("%s: Invalid specification `%s'\n"), com, val);
751 /* Search for a suffix. */
752 switch (TOLOWER (*p))
766 /* Days (overflow on 16bit machines) */
774 printf (_("%s: Invalid specification `%s'\n"), com, val);
777 *(long *)closure = result;
781 /* Specialized helper functions, used by `commands' to handle some
782 options specially. */
784 static int check_user_specified_header PARAMS ((const char *));
787 cmd_spec_dirstruct (const char *com, const char *val, void *closure)
789 if (!cmd_boolean (com, val, &opt.dirstruct))
791 /* Since dirstruct behaviour is explicitly changed, no_dirstruct
792 must be affected inversely. */
794 opt.no_dirstruct = 0;
796 opt.no_dirstruct = 1;
801 cmd_spec_dotstyle (const char *com, const char *val, void *closure)
803 /* Retrieval styles. */
804 if (!strcasecmp (val, "default"))
806 /* Default style: 1K dots, 10 dots in a cluster, 50 dots in a
808 opt.dot_bytes = 1024;
809 opt.dot_spacing = 10;
810 opt.dots_in_line = 50;
812 else if (!strcasecmp (val, "binary"))
814 /* "Binary" retrieval: 8K dots, 16 dots in a cluster, 48 dots
816 opt.dot_bytes = 8192;
817 opt.dot_spacing = 16;
818 opt.dots_in_line = 48;
820 else if (!strcasecmp (val, "mega"))
822 /* "Mega" retrieval, for retrieving very long files; each dot is
823 64K, 8 dots in a cluster, 6 clusters (3M) in a line. */
824 opt.dot_bytes = 65536L;
826 opt.dots_in_line = 48;
828 else if (!strcasecmp (val, "giga"))
830 /* "Giga" retrieval, for retrieving very very *very* long files;
831 each dot is 1M, 8 dots in a cluster, 4 clusters (32M) in a
833 opt.dot_bytes = (1L << 20);
835 opt.dots_in_line = 32;
837 else if (!strcasecmp (val, "micro"))
839 /* "Micro" retrieval, for retrieving very small files (and/or
840 slow connections); each dot is 128 bytes, 8 dots in a
841 cluster, 6 clusters (6K) in a line. */
844 opt.dots_in_line = 48;
848 fprintf (stderr, _("%s: %s: Invalid specification `%s'.\n"),
849 exec_name, com, val);
856 cmd_spec_header (const char *com, const char *val, void *closure)
860 /* Empty header means reset headers. */
861 FREE_MAYBE (opt.user_header);
862 opt.user_header = NULL;
868 if (!check_user_specified_header (val))
870 fprintf (stderr, _("%s: %s: Invalid specification `%s'.\n"),
871 exec_name, com, val);
874 i = opt.user_header ? strlen (opt.user_header) : 0;
875 opt.user_header = (char *)xrealloc (opt.user_header, i + strlen (val)
877 strcpy (opt.user_header + i, val);
879 opt.user_header[i++] = '\r';
880 opt.user_header[i++] = '\n';
881 opt.user_header[i] = '\0';
887 cmd_spec_htmlify (const char *com, const char *val, void *closure)
889 int flag = cmd_boolean (com, val, &opt.htmlify);
890 if (flag && !opt.htmlify)
891 opt.remove_listing = 0;
896 cmd_spec_mirror (const char *com, const char *val, void *closure)
900 if (!cmd_boolean (com, val, &mirror))
905 if (!opt.no_dirstruct)
907 opt.timestamping = 1;
908 opt.reclevel = INFINITE_RECURSION;
909 opt.remove_listing = 0;
915 cmd_spec_recursive (const char *com, const char *val, void *closure)
917 if (!cmd_boolean (com, val, &opt.recursive))
921 if (opt.recursive && !opt.no_dirstruct)
928 cmd_spec_useragent (const char *com, const char *val, void *closure)
930 /* Just check for empty string and newline, so we don't throw total
931 junk to the server. */
932 if (!*val || strchr (val, '\n'))
934 fprintf (stderr, _("%s: %s: Invalid specification `%s'.\n"),
935 exec_name, com, val);
938 opt.useragent = xstrdup (val);
942 /* Miscellaneous useful routines. */
944 /* Return the integer value of a positive integer written in S, or -1
945 if an error was encountered. */
947 myatoi (const char *s)
950 const char *orig = s;
952 for (res = 0; *s && ISDIGIT (*s); s++)
953 res = 10 * res + (*s - '0');
960 #define ISODIGIT(x) ((x) >= '0' && (x) <= '7')
963 check_user_specified_header (const char *s)
967 for (p = s; *p && *p != ':' && !ISSPACE (*p); p++);
968 /* The header MUST contain `:' preceded by at least one
969 non-whitespace character. */
970 if (*p != ':' || p == s)
972 /* The header MUST NOT contain newlines. */
973 if (strchr (s, '\n'))
978 void cleanup_html_url PARAMS ((void));
979 void downloaded_files_free PARAMS ((void));
982 /* Free the memory allocated by global variables. */
986 extern acc_t *netrc_list;
988 recursive_cleanup ();
990 free_netrc (netrc_list);
994 downloaded_files_free ();
995 FREE_MAYBE (opt.lfilename);
996 xfree (opt.dir_prefix);
997 FREE_MAYBE (opt.input_filename);
998 FREE_MAYBE (opt.output_document);
999 free_vec (opt.accepts);
1000 free_vec (opt.rejects);
1001 free_vec (opt.excludes);
1002 free_vec (opt.includes);
1003 free_vec (opt.domains);
1004 free_vec (opt.follow_tags);
1005 free_vec (opt.ignore_tags);
1006 xfree (opt.ftp_acc);
1007 FREE_MAYBE (opt.ftp_pass);
1008 FREE_MAYBE (opt.ftp_proxy);
1009 FREE_MAYBE (opt.https_proxy);
1010 FREE_MAYBE (opt.http_proxy);
1011 free_vec (opt.no_proxy);
1012 FREE_MAYBE (opt.useragent);
1013 FREE_MAYBE (opt.referer);
1014 FREE_MAYBE (opt.http_user);
1015 FREE_MAYBE (opt.http_passwd);
1016 FREE_MAYBE (opt.user_header);