2008-06-29 Micah Cowan * version.c: Bumped version to 1.11.4. 2008-06-24 Micah Cowan * ftp-ls.c (ftp_index): Don't assume time_t* is compatible with long*. Fixes crash on Windows, and probably other systems. 2008-06-16 Micah Cowan * http.c (http_loop): When hstat.len is higher than the successfully completed content's length, but it's because we _set_ it that way, don't abort. 2008-05-28 Micah Cowan * version.c: Bumped version to 1.11.3. 2008-05-14 Joao Ferreira * main.c, http.c, ftp.c: -nc is now working in conjunction with '-O file'. 2008-05-12 Micah Cowan * main.c (main): Downgrade "-N with -O" to a warning, and switch it off to avoid confusing messages. 2008-04-30 Micah Cowan * version.c: Bumped version to 1.11.2. * progress.c (create_image): Fix glitch where too many spaces are printed on lines that don't display the ETA, in multibyte locales. 2008-04-27 Rabin Vincent * ftp.c (ftp_retrieve_glob): Prevent attempted retrieval of an empty filename when --recursive hits an empty directory. Fixes bug #22968. [Thanks also to Steven M. Schweda, who also submitted this fix. -mjc] 2008-04-27 Rabin Vincent * http.c (http_loop): Fix return for the case where we don't download a file because of -nc. 2008-04-27 Micah Cowan * url.c (path_simplify): Go back to allowing leading ".." in paths, but only for FTP URLs. (test_path_simplify): Add scheme-specificness to tests, adapt for mu_run_test. * test.c (all_tests): Add test_path_simplify. * main.c (main): Downgrade -r, -p with -O to a warning rather than an error; elaborate just a bit more for other -O combination cases. 2008-04-26 Micah Cowan * http.c (gethttp): Move proxy CONNECT handling to below the retry_with_auth label, to deal with properly reconnecting to proxies when we need to authenticate. * version.c: Forgot to move version to a "-devel" one again. 2008-04-11 Micah Cowan * ftp.c (getftp, ftp_loop_internal): Don't append to an existing .listing when --continue is used. Fixes bug #22825. Thanks to Rabin Vincent for pointing the way with a suggested fix! 2008-03-19 Micah Cowan * utils.c (test_dir_matches_p): More tests related for dir_matches_p. 2008-03-17 Micah Cowan * connect.c: Include sys/time.h to support use of the select function on older systems. 2008-02-11 Benno Schulenberg * http.c: More accurate and descriptive messages for when a file won't be retrieved during spider-mode. 2008-02-10 Micah Cowan * http.c: Added existence_checked member to the http_stat struct. (gethttp): Mark hs->existence_checked when we've checked whether a file-to-download exists; so we don't check it again if the connection gets lost (and potentially pick a new "unique" name). This fixes bug 22251. * progress.c (create_image): Add space for an extra column in the "eta" portion of the progress bar image; to deal with too-long Czech translation. * main.c, http.c, init.c: Added --auth-no-challenge option, to bring back 1.10.2 unsafe auth behavior when needed. This fixes bug #22242. 2007-02-10 Hrvoje Niksic * ftp.c (ftp_retrieve_glob): Print both arguments of fnmatch in fnmatch error message. (ftp_retrieve_glob): Don't match with fnmatch if we're only supposed to get one file. 2008-02-07 Micah Cowan * progress.c (create_image): Remove assertion on exceeding screen width, which given the less-than-robust code there, can be broken by a number of factors (such as large file downloads). 2008-02-06 Micah Cowan * progress.c (countcols): Use strlen() when mbtowc or wcwidth not available (or not using NLS). * utils.c: Ensure we use single-byte separators when not doing NLS progress-bars. * wget.h: Determine whether to use NLS for progress-bars, based on whether wcwidth and mbtowc are available. 2008-02-03 Micah Cowan * progress.c (create_image): Use number of characters/columns consumed, rather than number of bytes, to determine how much of a line we've used. Fixes assertion errors and field alignment bugs (#22161, #20481) (get_eta, count_cols): Added to support the changes for create_image. * http.c (http_loop): Put no-clobber logic back into http_loop, before starting to fetch, for when we're not doing content-disposition. 2008-01-31 Micah Cowan * http.c (gethttp): Don't derive hs->contlen from possibly invalid/missing Content-Length; instead, get the appropriate value from the Content-Range header values. (parse_content_range): Handle '*' instance-length field. 2008-01-30 Micah Cowan * version.c: Bumped version number to 1.11.1-devel. 2008-01-25 Micah Cowan * Makefile.in, cmpt.c, connect.c, connect.h, convert.c, cookies.c, cookies.h, ftp-basic.c, ftp-ls.c, ftp-opie.c, ftp.c, ftp.h, gen-md5.c, gen-md5.h, gnu-md5.c, gnu-md5.h, gnutls.c, hash.c, hash.h, host.c, host.h, html-parse.c, html-parse.h, html-url.c, http-ntlm.c, http-ntlm.h, http.c, http.h, init.c, init.h, log.c, log.h, main.c, mswindows.c, mswindows.h, netrc.c, netrc.h, openssl.c, options.h, progress.c, progress.h, ptimer.c, ptimer.h, recur.c, recur.h, res.c, res.h, retr.c, retr.h, spider.c, spider.h, ssl.h, sysdep.h, test.c, test.h, url.c, url.h, utils.c, utils.h, wget.h, xmalloc.c, xmalloc.h: Updated copyright year. * version.c: Bumped version number to 1.11. 2007-12-10 Micah Cowan * main.c: The option is --content-disposition, not --no-content-disposition (at the moment). 2007-12-05 Micah Cowan * utils.c (subdir_p): Handle the case where d1 is "". * convert.c (convert_all_links): Don't return without deallocating timer. 2007-11-28 Micah Cowan * Makefile.in, cmpt.c, connect.c, connect.h, convert.c, convert.h, cookies.c, cookies.h, ftp-basic.c, ftp-ls.c, ftp-opie.c, ftp.c, ftp.h, gen-md5.c, gen-md5.h, gnutls.c, hash.c, hash.h, host.c, host.h, html-parse.c, html-parse.h, html-url.c, http-ntlm.c, http-ntlm.h, http.c, http.h, init.c, init.h, log.c, log.h, main.c, mswindows.c, mswindows.h, netrc.c, netrc.h, openssl.c, options.h, progress.c, progress.h, ptimer.c, ptimer.h, recur.c, recur.h, res.c, res.h, retr.c, retr.h, safe-ctype.c, safe-ctype.h, spider.c, spider.h, ssl.h, sysdep.h, test.c, test.h, url.c, url.h, utils.c, utils.h, wget.h, xmalloc.c, xmalloc.h: Updated license exception for OpenSSL, per the SFLC. 2007-10-10 Micah Cowan * http-ntlm.c: Include openssl/opensslv.h explicitly, instead of hoping it'll be included by accident in openssl/des.h. 2007-10-09 Gisle Vanem * mswindows.c: 'argc' and 'argv' in 'windows_main()' are no longer needed. Hence simply the prototype. Free 'exec_name' at exit. 2007-10-08 Micah Cowan * http.c (http_loop): Add send_head_first conditional back around code that needs it, but not around the last-modified header-parsing stuff this time. Removed no-longer-useful (was it ever?) restart_loop boolean, continuing unconditionally at end of send_head_first conditional block (if we haven't jumped out). 2007-10-04 Micah Cowan * http.c (http_loop): We've got_name if content_disposition support isn't on; make sure we continue properly in that case, even though we're not sending HEAD. 2007-10-02 Gisle Vanem * ftp.c: Use "_listing" for MSDOS (".listing" is illegal). * url.c: Update comment for 'filechr_not_windows'. * utils.c: Include for 'getpid()' on Watcom. 2007-10-02 Micah Cowan * ftp.c (getftp, ftp_loop_internal), http.c (http_loop), main (main): Use datetime_str instead of time_str, for those who have potentially long-running sessions. Based on suggestions by Saso Tomat and Steven M. Schweda . * http.c (gethttp): Warn about host lookup failures. Adjusted from Stephen Gildea's patch. 2007-10-02 Stephen Gildea * connect.c (connect_to_host): Warn about host lookup failures. 2007-09-25 Micah Cowan * Makefile.in: Use EXEEXT instead of exeext. 2007-09-24 Gisle Vanem * connect.c, init.c, main.c, openssl.c, options.h, sysdep.h, url.c, utils.c: Added support for building on MS-DOS. 2007-09-24 Jochen Roderburg * http.c (http_zero): Remove no-longer-used local_size variable. Fixes bug #21057. 2007-09-12 Micah Cowan * http.c (http_loop): Remove send_head_first from condition for parsing timestamp. 2007-08-29 Micah Cowan * openssl.c (ssl_init): Re un-const-ified the meth local variable, to match current versions of openssl. * spider.c: Removed visited_url function, as it may be very inefficient. (print_broken_links): Removed traversal of referrers, until such time as a more efficient implementation can be written. * spider.h: Replaced declaration of visited_url with an empty-bodied, function-like macro. 2007-08-27 Gisle Vanem * mswindows.c (run_with_timeout): Ensure that the correct conversion specification is used for the return result of the GetLastError function. * getopt.c: Fix missing (but, accidentally, legal) comment delimiter after licensing text. * recur.c (retrieve_tree): Inserted missing cast for strip_auth. Includes adjustment by Ralf Wildenhues. * openssl.c (ssl_init): const-ified the meth local variable. * main.c: Include all the static function definitions in the "#ifndef TESTING" clause, leaving just the definitions for exec_name (not set), and opt. * utils.c (run_with_timeout): Now returns bool, to align with declaration in utils.h. 2007-08-27 Micah Cowan * wget.h: Added macro replacement for ngettext, for environs that lack NLS. 2007-08-26 Micah Cowan * spider.c (print_broken_links): Fixed incorrect plurals msgid usage, switched to use ngettext function. 2007-08-24 Micah Cowan * http.c (http_loop): Introduced time_came_from_head boolean flag, to help avoid parsing the same Last-Modified header twice. Replaced spidering returns of RETRUNNEEDED for some situations, to RETROK, as otherwise it will be interpreted as an error. RETRUNNEEDED appears never to be referenced outside of http.c (and wget.h), and, when returned by gethttp, is translated by http_loop to RETROK. * url.c (are_urls_equal): Don't call getchar_from_escaped_string if u2 is shorter than u1. (getchar_from_escaped_string): Don't decode reserved characters. Handle illegally appearing '%'s as literal '%'s. Ensure hex digits before attempting to decode. (test_are_urls_equal): Added tests to handle u2 shorter than u1, and %2f not treated the same as /. * spider.c (in_url_list_p): Don't call are_urls_equal if one of them is NULL. 2007-08-23 Joshua David Williams * spider.c (in_url_list_p): Removed the bool verbose argument 2007-08-22 Mauro Tortonesi * http.c (http_loop): Fall back to GET if HEAD fails with a 500 or 501 error code. 2007-08-21 Mauro Tortonesi * http.c (http_loop): Send preliminary HEAD request if -N is given and the destination file exists already. 2007-08-10 Mauro Tortonesi * http.c (http_loop): Fixed HTTP HEAD requests logic when --spider is given. 2007-08-10 Ralf Wildenhues * url.c (append_uri_pathel): Do not assume dest string to be zero-terminated. (test_append_uri_pathel): Terminate string to fix test failure. 2007-08-09 Ralf Wildenhues * url.c (url_string): Use comparison, not assignment, in check for auth_mode == URL_AUTH_HIDE_PASSWD. 2007-08-09 Micah Cowan * http.c (http_loop): If we got a HEAD and then a GET, and the GET had a timestamp, use that one, not any we may have gotten from the HEAD. 2007-08-08 Micah Cowan * init.c (defaults): Content disposition will not be default, since it currently results in extra round-trips. 2007-07-31 Micah Cowan * http.c (gethttp): Set contlen = -1 when we encounter a negative-valued Content-Length header, so we don't consider it an internal error later on and call abort(). 2007-07-29 Micah Cowan * url.h, url.c (url_string): Replaced bool arg of the url_string function with enum url_auth_mode, with added option to completely remove user/pass auth information. * http.c, ftp.c, url.c, recur.c: Adapted call to url_string function to fit new usage. * recur.c (retrieve_tree): Remove auth info from Referer header. 2007-07-28 Micah Cowan * options.h, init.c, retr.c, main.c: renamed opt maxredirect field to max_redirect, for improved consistency. * init.c: changed max_redirect parser from cmd_number_inf to cmd_number, as infinite redirects may not be appropriate. Alternatively, if cmd_number_inf should be used, then opt.max_redirect's value should be checked a bit differently in retr.c, to allow for the "infinite" meaning of zero. 2007-07-25 Micah Cowan * http.c (create_authorization_line) (basic_authentication_encode, known_authentication_scheme_p) (load_cookies): Moved declarations up. (basic_authed_hosts): Added. Tracks what hosts have issued Basic challenge and been given the global username, password. (maybe_send_basic_creds): Added. Sends Basic creds for hosts that have issued Basic challenges. (register_basic_auth_host): Added. Instantiates basic_authed_hosts if necessary, then registers the host that has issued a challenge. (gethttp) : Only send authentication credentials after we've received a challenge from that host. This is a stop-gap fix until a proper fix can be implemented; still isn't quite right, as we should only be sending credentials automatically for authenticated paths and below, and not for the entire host. 2007-07-16 Joshua David Williams * options.h: added maxredirect to options struct * init.c: added maxredirect to list of variables * retr.c (retrieve_url): replaced MAX_REDIRECTIONS with opt.maxredirect * main.c: added option --max-redirect 2007-07-16 Joshua David Williams * test.h: tests made more verbose; now displays the name of each test run. 2007-07-10 Mauro Tortonesi * http.c (http_loop): Fixed the HTTP requests logic. Now it skips the preliminary HEAD request if either -O or --no-content-disposition are given, and neither --spider and -N are given. 2007-07-05 Micah Cowan * cmpt.c, connect.c, connect.h, convert.c, convert.h: * cookies.c, cookies.h, ftp-basic.c, ftp.c, ftp.h, ftp-ls.c: * ftp-opie.c, gen-md5.c, gen-md5.h, getopt.c, getopt.h, gnu-md5.c: * gnu-md5.h, gnutls.c, hash.c, hash.h, host.c, host.h: * html-parse.c, html-parse.h, html-url.c, http.c, http.h: * http-ntlm.c, http-ntlm.h, init.c, init.h, log.c, log.h, main.c: * Makefile.in, mswindows.c, mswindows.h, netrc.c, netrc.h: * openssl.c, options.h, progress.c, progress.h, ptimer.c: * ptimer.h, recur.c, recur.h, res.c, res.h, retr.c, retr.h: * safe-ctype.c, safe-ctype.h, spider.c, spider.h, ssl.h, sysdep.h: * test.c, test.h, url.c, url.h, utils.c, utils.h, wget.h: * xmalloc.c, xmalloc.h: Updated GPL reference to version 3 or later, removed FSF address. 2007-07-04 Mauro Tortonesi * http.c (http_loop): Skip HEAD request and start immediately with GET if -O is given. 2007-02-02 Hrvoje Niksic * http.c (print_server_response): Escape non-printable characters in server respone. 2007-02-02 Hrvoje Niksic * netrc.c: Don't make netrc_list static, as it prevents compilation with DEBUG_MALLOC. * utils.c (aprintf): Don't use vasprintf when DEBUG_MALLOC is requested because, in that case, we want the calls to malloc to be coming from us. 2007-01-23 Hrvoje Niksic * cookies.c (parse_set_cookie): Would erroneously discard cookies with unparsable expiry time. 2007-01-23 Hrvoje Niksic * progress.c (create_image): Check for ETA overflow. (print_row_stats): Ditto. 2007-01-09 Mauro Tortonesi * init.c (cmd_spec_prefer_family): Small fix to get rid of a gcc warning about strict-aliasing violation. 2007-01-09 Steven M. Schweda * ftp-basic.c (ftp_syst): Fixed segfault if response text is missing. 2006-12-29 Gisle Vanem * mswindows.c: Avoid a warning if 'ws_hangup()' is unused. 2006-12-27 Mauro Tortonesi * http.c (parse_content_disposition): Consider directory prefix, if specified. 2006-11-21 Hrvoje Niksic * retr.c (retrieve_from_file): Ditto. (url_uses_proxy): New function. * main.c (main): Don't check for opt.use_proxy when deciding whether to call retrieve_url or retrieve_tree; check whether the proxy would be used for *this* URL. 2006-10-17 Mike Grant * ftp.c (ftp_loop_internal): Would incorrectly skip changing working directory when retrying after a failed FTP attempt. Originally reported by Nate Eldredge. 2006-10-12 Mauro Tortonesi * convert.c (downloaded_file): Fixed bug which used to break -E -k -K mode. 2006-08-28 Mauro Tortonesi * http.c: #include'd spider.h to get rid of compiler warnings. * main.c: Ditto. * recur.c: Ditto. 2006-08-24 Mauro Tortonesi * Makefile.in: Added spider.c to the list of files to compile and spider.h to the list of header files. Updated copyright information. * http.c: Major changes to recursive spider mode. Now for every resource we are supposed to check, we send a HEAD request to find out if it exists. If the resource is a HTML file, we retrieve it and parse it to discover links to other resources. * recur.c: Ditto. * res.c (res_retrieve_file): Disable opt.timestamping and opt.spider when retrieving robots.txt. Updated copyright information. * convert.c: Moved code tracking broken links to spider.c. * convert.h: Ditto. * spider.c: Created new file to keep track of visited URLs in spider mode. * spider.h: Ditto. 2006-08-21 Mauro Tortonesi * http.c: Fixed timestamping-related bug. 2006-08-16 Mauro Tortonesi * http.c: Fixed bug which broke --continue feature. Now if -c is given, http_loop sends a HEAD request to find out the destination filename before resuming download. 2006-08-08 Hrvoje Niksic * utils.c (datetime_str): Avoid code repetition with time_str. 2006-07-21 Hrvoje Niksic * init.c (commands): Correctly place "contentdisposition". 2006-07-14 Mauro Tortonesi * sysdep.h: If intptr_t isn't defined, simply typedef it to long. * http.c: Added explicit cast to int in logprintf call to remove compiler warnings on 64-bit platforms. * connect.c: Added a few casts to intptr_t to remove compiler warnings on 64-bit platforms. * main.c: Disable -r, -p and -N when -O is used. Disable -k when -O is used and multiple URLs are given. Update maintainer information. * all: Update copyright information. 2006-07-10 KJKHyperion * url.c (filechr_table): Mark DEL (0x7f) as a control character and | as a character Windows can't handle. 2006-06-28 Mauro Tortonesi * res.c: Implemented is_robots_txt_url function for detection of robots.txt URLs and related test routine. * res.h: Ditto. * url.c: Implemented are_urls_equal function for URL comparison and related testing routine. * url.h: Ditto. * convert.c: Fixes for recursive spider mode: don't consider non-existing robots.txt as a broken link, and use are_urls_equal instead of strcasecmp for referrer URLs comparison. * test.c: Call tests routines for are_urls_equal and is_robots_txt_url. 2006-06-26 Hrvoje Niksic * wget.h (wgint): Typedef to any 64-bit (or larger) type we can find, not necessarily off_t or long. 2006-06-26 Hrvoje Niksic * cmpt.c (strtoll): Check for overflow and underflow without relying on (technically) undefined behavior. Don't assume that strtoll_type is 64 bits wide. 2006-06-21 Hrvoje Niksic * utils.c (base64_encode): Cast void pointer to char * before doing arithmetic. 2006-06-20 Hrvoje Niksic * utils.c (base64_encode): Made TBL const. (base64_decode): Made the base64_char_to_value table const. 2006-06-19 Hrvoje Niksic * utils.c (base64_encode): Made the DATA pointer void * so the callers can pass it any kind of pointer (including both signed and unsigned char pointers). (base64_decode): Ditto for DEST. 2006-06-19 Hrvoje Niksic * utils.c (base64_encode): Would read past end of STR. Reported by rick@eckle.org. 2006-06-13 Mauro Tortonesi * options.h (struct options): Introduced member restrict_files_case to keep track of preferences on character case restrictions for filenames. * init.c: Modified defaults and cmd_spec_restrict_file_names to support character case restrictions for filenames. Added test_cmd_spec_restrict_file_names unit test. * url.c: Modified append_uri_pathel to support character case restrictions for filenames. Added test_append_uri_pathel unit test. * test.c: Added test_cmd_spec_restrict_file_names and test_append_uri_pathel to the list of unit tests to run. 2006-06-12 Mauro Tortonesi * retr.c (retrieve_from_file): Use retrieve_tree and automatically turn on opt.follow_ftp in case of recursive FTP retrieval through HTTP proxy. * main.c: Automatically turn on opt.follow_ftp in case of recursive FTP retrieval through HTTP proxy. 2006-06-12 Tony Lewis * main.c: Improved CHEN Peng's patch by proposing a simpler logic. 2006-06-12 CHEN Peng * main.c: Use retrieve_tree in case of recursive FTP retrieval through HTTP proxy. 2006-05-25 Mauro Tortonesi * convert.c: Added mechanisms to keep track broken links. * convert.h: Ditto. * wget.h: Reordered and enumerated uerr_t constants. * recur.c: Fixes to support recursive spider mode. * http.c: Ditto. * main.c: Print broken links in case of recursive spider mode. * retr.c: Changed interface of retrieve_url. * retr.h: Ditto. * ftp.c: Changed interface of ftp_loop. * ftp.h: Ditto. * res.c: Minor change to reflect changes in interface of retrieve_url. 2006-05-18 Lawrence Jones * ftp-ls.c (ftp_parse_unix_ls): Correct size parsing, add size and filename debugging output. 2006-04-28 Mauro Tortonesi * http.c: If Content-Disposition header is present, allow unique filename generation unless -nc is given. Permit to disable parsing of Content-Disposition header. * options.h: Added option --no-content-disposition to disable parsing of HTTP Content-Disposition header. * init.c: Ditto. * main.c: Ditto. 2006-04-11 Hrvoje Niksic * hash.c (TOLOWER): Wrap macro arg in parentheses. 2006-04-08 Hrvoje Niksic * http.c (parse_content_disposition): Doc fix. 2006-03-15 Mauro Tortonesi * utils.c: Restricted operational semantics of frontcmp and proclist from generic strings to directory names and them to subdir_p and dir_matches_p respectively. Applied George Ogata's one line patch to restrict algorithm of subdir_p to full directory name matching. Added testcases for subdir_p and dir_matches_p. * utils.h: Changed all frontcmp occurrences to subdir_p. * recur.c: Ditto. * test.c: Changed type returned by test functions from char * to const char *. Added test_subdir_p and test_dir_matches_p to the list of tests to run. * http.c (test_parse_content_disposition): Changed return type from char * to const char *. 2006-03-14 Mauro Tortonesi * recur.c (struct queue_element): Changed type of html_allowed member to bool. 2006-03-09 Mauro Tortonesi * ftp.c (ftp_list): Try `LIST -a' command first and revert to `LIST' in case of failure. 2006-03-06 Hrvoje Niksic * hash.c (TOLOWER): Fix definition when STANDALONE. Reported by Beni Serfaty. 2006-03-02 Mauro Tortonesi * http.c (http_loop): Fixed recursive HTTP retrieval. 2006-02-28 Hrvoje Niksic * http.c (extract_param): Declare extern so it can be used from other files. (extract_param): Return error for empty name. 2006-02-28 Hrvoje Niksic * url.c (find_last_char): Define in terms of memrchr. * cmpt.c (memrchr): Define it on systems that don't have it. * http.c (extract_param): New function for parsing header values with parameters. (parse_content_disposition): Use it. Don't allow slashes and backslashes in the file name. 2006-02-27 Hrvoje Niksic * url.c (path_simplify): Don't preserve ".." at beginning of path. Suggested by Frank McCown. 2006-02-25 Hrvoje Niksic * http.c (gethttp): Only use FILE.N.html if FILE.html exists. 2006-02-09 Hrvoje Niksic * mswindows.c (run_with_timeout): Made thread_hnd non-static. 2006-02-05 Hrvoje Niksic * retr.c (sleep_between_retrievals): Sleep at a minimum of 1/2 of the specified wait period. 2006-02-03 Hrvoje Niksic * utils.c (number_to_string): Don't use sprintf for printing WGINT_MIN; simply divide n by 10 and defer printing the last digit. (number_to_string): Removed the SPRINTF_WGINT macro. 2006-02-03 Mauro Tortonesi * http.c: Fixed support for Content-Disposition header. * test.c: Added test_parse_content_disposition to the list of unit tests to run. 2006-02-02 Hrvoje Niksic * hash.c: Don't define countof if it's already defined. * hash.c: Obtain the definition of uintptr_t when standalone. 2006-01-30 Mauro Tortonesi * http.c: Changed output format. Removed excessively verbose debugging output. 2005-12-07 Mauro Tortonesi * http.c: Fixed pre-download verbose output which was broken by HTTP code refactoring. 2005-11-23 Mauro Tortonesi * http.c: Refactored HTTP code. If -O is not used, the new code delays the choice of the file name where the downloaded resource will be saved until the HTTP headers have been retrieved. Added support for Content-Disposition header. 2005-11-19 Hrvoje Niksic * hash.c (INVALID_PTR): Use uintptr_t instead of unsigned long. (hash_pointer): Don't assume a pointer fits in `unsigned long'. 2005-11-02 Mauro Tortonesi * Makefile.in: Removed support for unit testing (now it is in tests/Makefile.in). 2005-10-27 Mauro Tortonesi * Makefile.in: Added basic support for unit testing. * test.c: Ditto. * test.h: Ditto. 2005-10-13 Daniel Stenberg * http-ntlm.c (ntlm_output): Fixed buffer overflow vulnerability. 2005-10-09 Russ Allbery * snprintf.c: Remove round to round_int and pow10 to pow10_int, to avoid warnings from GCC 4.0. 2005-10-05 Mauro Tortonesi * retr.c: Changed semantics of no_proxy_match. 2005-09-17 Hrvoje Niksic * main.c (main): Don't print the summary if nothing has been downloaded. 2005-09-17 Hrvoje Niksic * retr.c (retr_rate): Rename parameter from MSECS to SECS since it no longer holds milliseconds. 2005-09-01 Hrvoje Niksic * progress.c: Introduce symbolic constants for "magic" values of 0.2 and 0.9, REFRESH_INTERVAL and ETA_REFRESH_INTERVAL. 2005-08-27 Hrvoje Niksic * cmpt.c (strtoll): Correctly handle strtoll("0x", ptr, 0) and strtoll("0x", ptr, 0) -- in both cases *ptr must be set to the position of 'x', not after it. 2005-08-27 Hrvoje Niksic * hash.c (hash_table_map): Rename to hash_table_for_each and update callers. Document the meaning of the callback's return value. (hash_table_iterate): New function. (hash_table_iter_next): Likewise. Update most places that used hash_table_for_each to use the iteration, which doesn't require a temporary function with explicit state management. 2005-08-26 Albert Chin * Makefile.in: Use @datadir@. Define localedir as $(datadir)/locale. 2005-08-26 Jeremy Shapiro * openssl.c (ssl_init): Set SSL_MODE_AUTO_RETRY. 2005-08-23 Hrvoje Niksic * host.c (address_list_from_ipv4_addresses): Use IP_INADDR_DATA. 2005-08-12 Hrvoje Niksic * wget.h: Renamed strtoll_return to strtoll_type. 2005-08-11 Hrvoje Niksic * progress.c (eta_to_human_short): Switch to days when printing more than 48h rather than 100h. (It's not immediately apparent how many days there are in 83h.) 2005-08-11 Hrvoje Niksic * cmpt.c (strtoll): Define it if missing on the system and if Wget needs it. * mswindows.c (str_to_int64): Move to cmpt.c and rename to strtoll. 2005-08-10 Hrvoje Niksic * host.c (print_address): Always use inet_ntop when IPv6 is enabled. * host.h (ip_address): Simplify the data union. 2005-08-09 Hrvoje Niksic * mswindows.c (inet_ntop): Also handle IPv4 addresses for completeness. 2005-08-09 Hrvoje Niksic * http.c (gethttp): Don't read more than the amount of data specified by the content-length header. 2005-08-09 Vasil Dimov * ftp.c (getftp): Don't free RESPLINE if ftp_response returns a status other than FTPOK. 2005-08-04 Giuseppe Bonacci * ftp-ls.c (ftp_parse_unix_ls): Remember the position of the previous token instead of backtracking back to it. 2005-07-08 Gisle Vanem * mswindows.h: Include process.h to get getpid() declaration. 2005-07-08 Hrvoje Niksic * utils.c (aprintf): Use vasprintf where available. 2005-07-08 Hrvoje Niksic * url.c (rewrite_shorthand_url): Simplify code using aprintf and strspn. 2005-07-07 Hrvoje Niksic * gnutls.c (ssl_check_certificate): Check for the validity of the presented X509 certificate. 2005-07-07 Hrvoje Niksic * openssl.c (ssl_check_certificate): Print custom error messages for frequent X509 certificate problems. 2005-07-07 Hrvoje Niksic * mswindows.h: Define an alias for stat and fstat, as requested by config-compiler.h. (gai_strerror): Define to windows_strerror if NEED_GAI_STRERROR is defined. 2005-07-06 Hrvoje Niksic * mswindows.h: Use strtoll where available. 2005-07-06 Hrvoje Niksic * sysdep.h: Add a full declaration of fnmatch.h. 2005-07-06 Hrvoje Niksic * utils.c: Unconditionally include . 2005-07-06 Hrvoje Niksic * utils.c (fnmatch_nocase): New function. (proclist): Use it instead of fnmatch when opt.ignore_case is requested. (in_acclist): Respect opt.ignore_case. (frontcmp): Respect opt.ignore_case. * options.h (struct options): New flag opt.ignore_case. 2005-07-06 Hrvoje Niksic * ptimer.c: Measure time in seconds rather than milliseconds. Adjusted all callers. 2005-07-06 Hrvoje Niksic * http.c (gethttp): When freeing MESSAGE, take into account that it can be NULL. 2005-07-05 Hrvoje Niksic * cmpt.c (timegm): Handle years after 2099. 2005-07-05 Hrvoje Niksic * cmpt.c (timegm): Remove unused variable. 2005-07-05 Hrvoje Niksic * cmpt.c (timegm): Don't call mktime; simply count the seconds between 1970-01-01 and the specified date. 2005-07-05 Hrvoje Niksic * wget.h (or): Define HAVE_SSL when either HAVE_OPENSSL or HAVE_GNUTLS are defined. * gnutls.c: New file. 2005-07-05 Hrvoje Niksic * http.c (gethttp): Don't print the request write error message twice. 2005-07-04 Hrvoje Niksic * openssl.c (openssl_errstr): Instead of always using a large static buffer, only allocate the error string when there is an actual error. 2005-07-04 Hrvoje Niksic * xmalloc.c (debugging_free): Prefix hex pointer value with "0x" when printing. 2005-07-04 Hrvoje Niksic * utils.c (NEXT_BASE64_CHAR): Rename to NEXT_CHAR and simplify to get the next non-whitespace character. 2005-07-04 Hrvoje Niksic * utils.c (base64_decode): Don't silently tolerate non-base64 non-white-space characters in the base64 stream. 2005-07-04 Hrvoje Niksic * connect.c (LAZY_RETRIEVE_INFO): Make last_tick unsigned to match transport_map_modified_tick. 2005-07-04 Hrvoje Niksic * config-post.h (alloca): Updated declaration to not enumerate all Windows compilers. 2005-07-04 Hrvoje Niksic * openssl.c (openssl_errstr): Separate error messages with "; ". 2005-07-03 Hrvoje Niksic * ftp.c (getftp): Ditto. * http.c (gethttp): Use fd_errstr. * connect.c (fd_register_transport): Restructure parameters to include only a single structure that describes transport implementation. * openssl.c (openssl_errstr): New function: dump SSL error strings into a static buffer and return a pointer to the buffer. * connect.c (fd_errstr): New function; returns transport-specific error message, or strerror(errno) if transport doesn't supply one. 2005-07-03 Hrvoje Niksic * mswindows.h: Also wrap accept() and listen(). 2005-07-03 Hrvoje Niksic * url.c (path_end): Skip separators appropriate for the scheme. (strpbrk_or_eos): Remove gcc-specific version, as the optimization it tried to perform no longer applies. 2005-07-02 Hrvoje Niksic * host.c: Don't include "connect.h" now that we no longer have socket_has_inet6. 2005-07-02 Hrvoje Niksic * host.c: Remove extraneous definition of netdb.h. 2005-07-02 Hrvoje Niksic * http.c (gethttp): Skip error message body in the keep-alive case. 2005-07-02 Hrvoje Niksic * url.c (url_parse): Would crash when parsing fragments. Support fragments for FTP URLs too. 2005-07-02 Hrvoje Niksic * version.c: Don't use "cvs" in version name, since we're not using CVS anymore. 2005-07-02 Hrvoje Niksic * progress.c (create_image): Ditto. * retr.c (retr_rate): Display smaller rate numbers with greater precision. 2005-07-02 Hrvoje Niksic * http.c (response_head_terminator): Minor optimization. * retr.c (fd_read_hunk): Call terminator with pointer to the start of the data and the pointer to the current data. Changed all callers. 2005-07-01 Hrvoje Niksic * url.c (url_parse): Make sure u->params is not initialized for http/https URLs. (url_parse): Don't crash on garbage following []-delimited IPv6 addresses. 2005-07-01 Hrvoje Niksic * main.c (print_help): Don't refer to the non-existent -nr in description of --mirror. 2005-06-30 Hrvoje Niksic * host.c (pretty_print_address): Renamed to just print_address. Clarify documentation. 2005-06-30 Hrvoje Niksic * http.c (gethttp): Explicitly document the different cases when generating the Host header. 2005-06-30 Hrvoje Niksic * host.c (pretty_print_address): Handle error result from inet_ntop. 2005-06-30 Gisle Vanem * mswindows.c (inet_ntop): New function. Print IPv6 addresses using WSAAddressToString. 2005-06-27 Hrvoje Niksic * progress.c (dot_update): Remove unused variable row_qty. 2005-06-29 Hrvoje Niksic * main.c: Check for both SIGHUP and SIGUSR1 before using them. 2005-06-29 Hrvoje Niksic * utils.c: Unconditionally include locale.h. 2005-06-29 Hrvoje Niksic * ptimer.c: Include sys/time.h to get struct timeval. 2005-06-29 Hrvoje Niksic * wget.h: Remove obsolete definition of with_thousand_seps_sum. 2005-06-29 Hrvoje Niksic * gnu-md5.h: Unconditionally include limits.h. 2005-06-29 Hrvoje Niksic * utils.c (random_number): Use lrand48 if available. (random_float): Use drand48 if available. 2005-06-29 Hrvoje Niksic * main.c (secs_to_human_time): Use print_decimal when printing total download time in seconds. * progress.c (print_row_stats): Use it to print total download time at the end of the download. (create_image): Ditto. * utils.c (print_decimal): New function; print small decimal numbers with more precision than large ones. * progress.c (print_row_stats): New function. Print ETA after the download rate at the end of each row. 2005-06-28 Hrvoje Niksic * init.c (parse_line): Check for alphanumerics. 2005-06-28 Hrvoje Niksic * (dot_create): Remove unnecessary casts. 2005-06-28 Hrvoje Niksic * ftp.c (getftp): Delete trailing newlines from LIST output so lines don't come out with trailing \015\012 with -S. 2005-06-27 Hrvoje Niksic * mswindows.h: Remove superfluous includes. 2005-06-27 Hrvoje Niksic * config-post.h (alloca): Amend alloca declaration to take care of all Win32 compilers, not just MSVC and MinGW. 2005-06-27 Hrvoje Niksic * utils.c (get_grouping_data): Force separator to "." rather than " " when "," is taken. 2005-06-27 Hrvoje Niksic * wget.h (PTR_FORMAT): Cast the result of sizeof to int before passing it to printf's %*. * retr.h: Declare output_stream and output_stream_regular. * ftp.h: Declare ftp_last_respline. * convert.h: Declare dl_url_file_map. * http.h: New file. 2005-06-27 Hrvoje Niksic * cookies.c: Make cookies_now static. 2005-06-27 Hrvoje Niksic * utils.c (human_readable): Remove intermediary cast to long; MSVC has problems casting *unsigned* __int64 to double. 2005-06-27 Hrvoje Niksic * sysdep.h: Use the system-provided fnmatch by default. 2005-06-27 Hrvoje Niksic * http.c (mktime_from_utc): Renamed to timegm and moved to cmpt.c. Don't compile it if GNU timegm is available. (http_atotm): Use timegm. 2005-06-27 Hrvoje Niksic * http.c (http_atotm): Correctly query the old locale value. 2005-06-27 Hrvoje Niksic * config-post.h (alloca): Don't #define alloca under MinGW32, which defines it in malloc.h, included from mswindows.h. 2005-06-27 Hrvoje Niksic * utils.c (get_grouping_data): Force the use of separators in C locale. 2005-06-27 Hrvoje Niksic * main.c (i18n_initialize): Set all locale categories. * http.c (http_atotm): Temporarily set locale to "C". 2005-06-27 Hrvoje Niksic * http.c (gethttp): Improve "POST data file missing" error message. 2005-06-27 Hrvoje Niksic * progress.c (set_progress_implementation): Type COLON as const char *. 2005-06-27 Hrvoje Niksic * utils.c (with_thousand_seps): Handle negative numbers. 2005-06-26 Hrvoje Niksic * progress.c (create_image): Mark the "eta" string for translation. 2005-06-26 Hrvoje Niksic * html-url.c (get_urls_file): Don't explicitly set entry->next to NULL since entry is already zeroed out. 2005-06-26 Gisle Vanem * mswindows.h: Define gai_strerror under MinGW. 2005-06-26 Hrvoje Niksic * utils.c (with_thousand_seps): Correctly implement thousand seps consisting of more than one character. 2005-06-26 Hrvoje Niksic * main.c (secs_to_human_time): Ditto. * progress.c (create_image): Print more exact duration of very short downloads. * main.c (secs_to_human_time): Don't translate time suffixes "h", "m", and "s", which are not strictly SI, but are "accepted for use with SI". (secs_to_human_time): Print really small intervals as 0s, not 0.00s. 2005-06-26 Hrvoje Niksic * config-post.h: Replace the alloca declaration with the one from the latest Autoconf manual. This should remove a warning with GCC on AIX. 2005-06-26 Hrvoje Niksic * ftp.c (getftp): Always invoke SIZE, not only when continuing a download. * main.c (main): Ditto here. * progress.c (create_image): When the download is finished, print how long it took. 2005-06-26 Hrvoje Niksic * main.c (main): Print the downloaded and quota amounts with the "human_readable" function. * ftp.c (print_length): Ditto. * http.c (gethttp): Don't display thousand separators. * utils.c (with_thousand_seps): Rewritten to respect locale settings and to be type size agnostic. 2005-06-25 Hrvoje Niksic * utils.c (human_readable): Divide with 1024 instead of shifting so the operation can work with non-integer N. 2005-06-25 Hrvoje Niksic * progress.c (eta_to_human): New logic for more human-readable ETA. 2005-06-25 Hrvoje Niksic * utils.c (with_thousand_seps_sum): Decrease buffer size so it cannot overrun add_thousand_seps's buffer. 2005-06-25 Hrvoje Niksic * utils.c (SPRINTF_WGINT): The correct format is %I64d, not just %I64. 2005-06-25 Hrvoje Niksic * http.c (http_loop): Don't warn about wildcards in HTTP URLs if globbing isn't requested in the first place. * retr.c (retrieve_url): Temporarily turn off globbing when processing HTTP->FTP redirects. 2005-06-25 Hrvoje Niksic * utils.c (with_thousand_seps_sum): Now defined only if SUM_SIZE_INT is double. * wget.h (SUM_SIZE_INT): Instead of bothering with long, long long, __int64, and friends, simply either use wgint or double, end of story. Since we know how to print either, we no longer need LARGE_INT_FMT. * sysdeps.h (LARGE_INT): Renamed to SUM_SIZE_INT to better reflect its intent, and moved to wget.h. 2005-06-25 Hrvoje Niksic * Makefile.in: No need to clean .libs. 2005-06-25 Hrvoje Niksic * cookies.c (parse_set_cookies): Cast pointer subtraction to int before using it with %d; AIX compiler warns on this. Reported by Jens Schleusener. 2005-06-24 Hrvoje Niksic * http.c (gethttp): Don't prepend / here. * cookies.c (cookie_handle_set_cookie): Prepend / to PATH. (cookie_header): Ditto. 2005-06-24 Hrvoje Niksic * init.c: opt.verbose must be declared as int. 2005-06-23 Hrvoje Niksic * cmpt.c (strpbrk): Removed. (mktime): Removed. Include . 2005-06-23 Hrvoje Niksic * utils.c (read_file): Ditto. * main.c (main): Use struct_fstat. * mswindows.h (struct_fstat): Define a struct_fstat to deal with the fact that Borland 5.5 has 64-bit stat, but not 64-bit fstat! 2005-06-23 Hrvoje Niksic * sysdep.h: Remove code that deals with Watcom. 2005-06-22 Hrvoje Niksic * all: Use bool instead of int and false/true instead of 0/non-0 for boolean variables and values. 2005-06-22 Hrvoje Niksic * sysdep.h: Include the stdbool.h/_Bool/bool blurb from Autoconf. 2005-06-22 Hrvoje Niksic * init.c (cmd_lockable_boolean): Removed. 2005-06-22 Hrvoje Niksic * cookies.c (struct cookie): Use 1-bit bitfields for booleans which makes the structure takes less space at no cost in complexity. 2005-06-22 Hrvoje Niksic * Makefile.in ($(OBJ)): Add the config.h dependency. 2005-06-22 Hrvoje Niksic * openssl.c, connect.c, host.c: Replace instances of #ifdef ENABLE_DEBUG if (opt.debug) {...} #endif with IF_DEBUG {...}. * main.c: Rename the IF_DEBUG defined here to WHEN_DEBUG. * wget.h (IF_DEBUG): New macro. (DEBUGP): Define in terms of IF_DEBUG. 2005-06-22 Hrvoje Niksic * http.c (gethttp): Only handle --set-cookies (and assert that cookie jar exists) if opt.cookies is true. Failure to do so triggered the assert when --no-cookies was used and the server sent a Set-Cookie header. Ouch! 2005-06-22 Hrvoje Niksic * connect.c (select_fd): Expect select() to exist. * utils.c (xsleep): Always use select() as sleep fallback on non-Windows platforms. * ptimer.c: Delete the implementation of PTIMER_TIME. * main.c: Assume existence of signal(), test for different signal names instead. * cmpt.c: Better document reasons why certain functions are included. 2005-06-22 Hrvoje Niksic * Makefile.in: Remove the manually maintained dependency list; make all object files depend on every header. 2005-06-20 Hrvoje Niksic * hash.c: Rename "mapping" to "cell" to avoid confusion with the term "mapping" (or "map") sometimes being used for the entire hash table. Also rename "non-empty" to "occupied" for easier reading of if (!NON_EMPTY (...)) ... . 2005-06-20 Hrvoje Niksic * main.c, ptimer.c, sysdep.h, utils.c: Use #elif to simplify reading of chained if-else-else-else-... statements. 2005-06-20 Hrvoje Niksic * all: Return type of signal handlers is `void'. Include signal.h unconditionally. * all: Don't explicitly cast values returned by malloc. We no longer support ancient compilers that don't declare malloc, and we never supported C++ builds. 2005-06-19 Hrvoje Niksic * all: Don't declare errno. Include both time.h and sys/time.h, as long as sys/time.h exists. Don't dereference function pointers when invoking the functions they point to. * cmpt.c (memmove): Remove function mandated by C89. (strerror): Ditto. (strstr): Ditto. * all: Undo the K&R-ization changes from 2005-05-03. * all: Remove support for K&R compilers: use C89 function declarations, remove definition of PARAMS, remove support for varargs, and remove ansi2knr. Assume the presence of time.h, string.h, and other headers mandated by C89. 2005-06-19 Hrvoje Niksic * init.c (cmd_lockable_boolean): Don't recognize literal "2" and "-1" values; unlike 0 and 1, those should never be exposed to the user. Update the error message to be more self-consistent, as proposed by Benno Schulenberg. 2005-06-18 Hrvoje Niksic * http.c (gethttp): Don't free "head" before using it to save headers. 2005-06-18 Hrvoje Niksic * http.c (gethttp): When -E is in use, check for file existence after appending ".html" to the name and modify the file name if necessary. 2005-06-17 Hrvoje Niksic * connect.c (socket_has_inet6): Removed. * host.c (lookup_host): Don't use the AI_ADDRCONFIG getaddrinfo hint. 2005-06-16 Hrvoje Niksic * init.c (cmd_lockable_boolean): Improve the error message so it lists the more useful values first. 2005-06-15 Hrvoje Niksic * http.c (gethttp): Also report the system error when the POST data file is missing. 2005-06-15 Benno Schulenberg * ftp.c, http.c, connect.c, cookies.c, html-url.c, init.c, res.c: Gettext-ize messages that were previously missed. 2005-06-15 Hrvoje Niksic * host.h (ip_address): Remove the trailing comma from the type enum in the no-IPv6 case. * main.c (struct cmdline_option): Remove the trailing comma from the enum. Reported by Jens Schleusener. 2005-05-30 Hrvoje Niksic * url.c (strpbrk_or_eos): Check for a recent GCC version before using the statement-as-expression extension. 2005-05-30 Hrvoje Niksic * http.c (gethttp): Don't attempt to "skip short body" if we're issuing a HEAD request (in which case the response head is not followed by a body). 2005-05-30 Hrvoje Niksic * init.c (cmd_spec_header): Don't split the string along the commas using cmd_vector; just append the new value using vec_append instead. * utils.c (vec_append): New function. 2005-05-27 Andreas Beckmann * html-url.c (tag_handle_link): Mark the content from the tag as expecting HTML. 2005-05-24 Hrvoje Niksic * http.c (http_atotm): Document the origin of the "cookie date" format. 2005-05-21 Hrvoje Niksic * init.c (setval_internal): Report exact command name alongside the "display name". 2005-05-18 Hrvoje Niksic * cookies.c (update_cookie_field): Explicitly cast -1 to time_t to cope with systems where time_t is unsigned. * cookies.c: Remove unnecessary casts to time_t from values already of that type. 2005-05-17 Hrvoje Niksic * ftp.c (ftp_loop_internal): Same here. * http.c (http_loop): Don't clobber the file when -c is specified and the first attempt to retrieve the file fails. 2005-05-16 Hrvoje Niksic * openssl.c (ssl_check_certificate): Print all issues with a certificate. 2005-05-16 Hrvoje Niksic * ftp-basic.c: Don't xfree() the line returned by ftp_response if the returned code is not FTPOK. 2005-05-16 Hrvoje Niksic * init.c (cleanup): Don't free the non-existent opt.ftp_acc. Free the SSL-related stuff. 2005-05-16 Hrvoje Niksic * ftp.c (print_length): Consistently print \n at end of the "Length" line. 2005-05-14 Hrvoje Niksic * openssl.c (ssl_connect): Announce the beginning and the end of the SSL handshake when in debug mode. * wget.h (PTR_FORMAT): New macro for easier printing of pointer values. Use %0*lx along with PTR_FORMAT instead of %p. 2005-05-14 Hrvoje Niksic * http.c (gethttp): Would forget to close the connection when keep_alive was not used. 2005-05-13 Hrvoje Niksic * openssl.c (pattern_match): Document the code that decides whether "*" matches ".". 2005-05-12 Hrvoje Niksic * ftp-ls.c (ftp_index): Use %d to print the port number, which is now int. From Steven M. Schweda's VMS patches. 2005-05-12 Hrvoje Niksic * url.c (rewrite_shorthand_url): Don't rewrite "https://host" to "ftp://https//host" when SSL is not used. 2005-05-11 Hrvoje Niksic * openssl.c (ssl_check_server_identity): Renamed to ssl_check_certificate because it does more than just checking the server's identity. (ssl_check_certificate): Tell the user about --no-check-certificate. 2005-05-11 Hrvoje Niksic * openssl.c (ssl_init): Always use SSL_VERIFY_NONE, so that the handshake finishes even if the certificate is invalid. That way ssl_check_server_identity can provide better diagnostics on why the verification failed. 2005-05-11 Hrvoje Niksic * openssl.c (pattern_match): New function. (ssl_check_server_identity): Treat peer certificate common name as wildcard. 2005-05-10 Hrvoje Niksic * openssl.c (ssl_check_server_identity): Print certificate subject and issuer. 2005-05-10 Hrvoje Niksic * res.c (res_register_specs): Correctly pass pointers to hash_table_get_pair. 2005-05-10 Hrvoje Niksic * http.c (gethttp): Call ssl_check_server_identity. * openssl.c (ssl_check_server_identity): New function, verifies that the host name in the certificate matches the actual host name. (verify_cert_callback): Removed, since it didn't do anything except returning the preverify_ok argument. * connect.c (fd_transport_context): Allow retrieval of the context pointer registered with fd_register_transport. 2005-05-09 Hrvoje Niksic * openssl.c (verify_cert_callback): Renamed from verify_callback. Always return the received "ok" value. Print the X509 name in debug mode. (ssl_init): Enable partial writes in SSL context. 2005-05-08 Hrvoje Niksic * http.c (http_loop): Check for wildcards in the URL path component, not in the whole URL. * ftp.c (ftp_loop): Check for wildcards in URL path before unescaping, so the users can escape globbing metacharacters with % escapes. 2005-05-08 Hrvoje Niksic * init.c (run_command): Correctly interpret the return value of parse_line. (commands): Re-alphabetize. 2005-05-08 Hrvoje Niksic * netrc.c (parse_netrc): Explicitly check for assignment != NULL to silence warning from Borland C. * url.c (sync_path): Don't unnecessarily increment p. (url_parse): Don't unnecessarily set url_encode to NULL just prior to return from the function. 2005-05-08 Hrvoje Niksic * log.c (escnonprint_internal): Place variable declarations before other statements. 2005-05-08 Hrvoje Niksic * html-url.c: Include recur.h. * http.c (request_new): Define as accepting no args. 2005-05-07 Hrvoje Niksic * url.c (strpbrk_or_eos): Made inline. Use strchr(s, '\0') for finding the NUL char position. 2005-05-07 Hrvoje Niksic * url.c (decide_copy_method): Renamed to char_needs_escaping. Since it now returns only two possible values, change it to return boolean (int). 2005-05-07 Hrvoje Niksic * ftp-basic.c (ftp_request): Prevent newlines in VALUE causing inadvertent sending of multiple FTP commands. 2005-05-07 Hrvoje Niksic * url.c (decide_copy_method): Never cause reencode_escapes to decode % escapes; it is too intrusive and breaks some servers. 2005-05-07 Hrvoje Niksic * http.c (gethttp): When tunnelling SSL traffic over proxy with CONNECT, we're really talking to the remote server directly. Because of this, the request-line argument must be the URL path rather than the whole URL, as it would be when using regular proxies. Reported by Charles Lane. 2005-05-06 Hrvoje Niksic * init.c (cmd_spec_useragent): Allow empty User-Agent. * http.c (gethttp): Don't print "unknown authentication scheme" for failed Basic authentication. (SET_USER_AGENT): Don't set user-agent if opt.useragent is empty. (gethttp): Use alloca for allocation of www_authenticate. 2005-05-06 Hrvoje Niksic * main.c (print_help): Fix wording of --secure-protocol help text. 2005-05-06 Hrvoje Niksic * cmpt.c (strstr): Updated from glibc 2.3.5. 2005-05-05 Hrvoje Niksic * http.c (http_atotm): Zero out the whole struct tm being passed to strptime. 2005-05-05 Hrvoje Niksic * main.c (main): Propagate option name to setoptval. * init.c (setoptval): Accept another argument, OPTNAME. Propagate that argument as the option name independently of the actual command, determined by command_by_name(com). 2005-05-05 Hrvoje Niksic * init.c (parse_line): Make the return value indicate whether there was a syntax error or a setter failed. (run_wgetrc): Return an indication on whether an error has been encountered. (initialize): Abort if there have been errors running either .wgetrc file. 2005-05-05 Hrvoje Niksic * log.c (copy_and_escape): Slightly reduce code repetition between the two loops. 2005-05-05 Charles C.Fu * utils.c (proclist): Strip leading slash when calling fnmatch too, otherwise wildcard comparisons always fail. 2005-05-05 Hrvoje Niksic * utils.c (touch): Set access time to current time. 2005-05-05 Hrvoje Niksic * url.c (url_unescape): Don't unescape %00, it effectively truncates the string. 2005-05-05 Hrvoje Niksic * log.c (copy_and_escape): Replace the FOR_URI argument with a slightly more general mechanism for specifying different kinds of escape. 2005-05-05 Hrvoje Niksic * ftp-basic.c (ftp_response): Fix printing FTP server response. 2005-05-05 Hrvoje Niksic * retr.c (limit_bandwidth_reset): Reset sleep_adjust. (limit_bandwidth): Don't allow huge "adjustment" values that result from being suspended for a while. 2005-05-04 Hrvoje Niksic * wget.h: If gettext was found but libtintl.h wasn't, declare gettext's return type to avoid type mismatches. 2005-05-03 Hrvoje Niksic * url.c (url_parse): Rename label `error' to avoid conflict with identifier. * retr.c (fd_read_body): Rename label `out' to avoid conflict with identifier. (fd_read_hunk): Use explicit double constant. (retrieve_from_file): Don't use string concatenation. (sleep_between_retrievals): Make sure xsleep is called with a `double' argument. (no_proxy_match): Define as static, like it is declared. * progress.c (bar_create): Use 0.0 instead of 0 because K&R compilers can't automatically promote it. * http-ntlm.c (ntlm_output): Replace \xHH sequences with \OOO for the sake of old compilers. * ftp.c (ftp_loop_internal): Don't use string concatenation. * http.c (request_send): Use explicit double constants when calling fd_read and fd_write. (post_file): Ditto. (gethttp): Ditto. (skip_short_body): Ditto. * ftp-basic.c: When calling fd_write, specify the last argument as a `double' constant for the sake of K&R compilers which don't see the prototype and therefore can't promote it to double automatically. * cookies.c (cookie_jar_load): Rename abort label to abort_cookie to avoid name conflict in K&R compilers. 2005-04-29 Hrvoje Niksic * ptimer.c (posix_init): Since we allow _POSIX_MONOTONIC_CLOCK==0, it is not enough to check for _POSIX_MONOTONIC_CLOCK-0, we must also check for defined(_POSIX_MONOTONIC_CLOCK). 2005-04-28 Hrvoje Niksic * ftp.c, hash.c, connect.c, host.c, http.c: Remove unreached code, such as "break" following return or abort. 2005-04-28 Hrvoje Niksic * init.c (commands): Wrap the use of opt.random_file in #ifdef HAVE_SSL. 2005-04-28 Hrvoje Niksic * http.c (gethttp): Correctly set the user agent. 2005-04-27 Hrvoje Niksic * init.c (cmd_spec_useragent): Free the old value of opt.useragent before setting the new one. 2005-04-27 Mauro Tortonesi * main.c: Map --ftp-password, --http-password and --proxy-password to the new ftppassword, httppassword and proxypassword commands respectively. Document the --user and --password options in the help string. 2005-04-27 Mauro Tortonesi * ftp.c: Add support for --user and --password. * http.c: Add support for --user and --password. * init.c: Deprecated ftppasswd, httppasswd, login, passwd and proxypasswd commands. Added ftppassword, ftpuser, httppassword, password, proxypassword and user commands. * main.c: Renamed --ftp-passwd to --ftp-password. Added --ftp-user, --http-password, --password, --proxy-password and --user. Deprecated --http-passwd and --proxy-passwd. Added documentation for new options and removed documentation for deprecated options in the help string. * options.h (struct options): Added user and passwd members to handle --user and --password respectively. Renamed ftp_acc and ftp_pass members to ftp_user and ftp_passwd for consistency. 2005-04-27 Hrvoje Niksic * main.c (print_help): Advertise "DER", not "ASN1". 2005-04-27 Hrvoje Niksic * openssl.c (init_prng): Disable the weak random seed by default. * http.c (gethttp): Simplify SSL initialization; disable SSL when anything goes wrong with the initialization. * options.h (struct options): New option opt.random_file. 2005-04-27 Hrvoje Niksic * init.c: Wrap private key commands in IF_SSL. 2005-04-27 Hrvoje Niksic * openssl.c (ssl_init): Ditto. * options.h (struct options): Allow separate specification of key type and certificate type. * init.c (cmd_spec_cert_type): Provide a "der" synonym for "asn1" certificate encoding. 2005-04-26 Hrvoje Niksic * openssl.c: Renamed "gen_sslfunc.c" to "openssl.c" and "gen_sslfunc.h" to "openssl.h". This reflects the intent of openssl.c encapsulating the OpenSSL-specific code. 2005-04-26 Hrvoje Niksic * init.c: Renamed "closure" (a synonym for context in some cultures) to "place", which more accurately reflects the usage. 2005-04-26 Hrvoje Niksic * gen_sslfunc.c (ssl_init): Use default locations for loading the certificate bundles. (ssl_init_prng): Disable the cryptographically weak PRNG initialization fallback. * init.c: Renamed SSL command-line arguments and wgetrc commands. (defaults): Check the server certificate by default. 2005-04-26 Hrvoje Niksic * cookies.c (cookie_handle_set_cookie): Delete the part of the path after the trailing slash. * http.c (gethttp): Call cookie_handle_set_cookie with path that begins with '/'. 2005-04-26 Hrvoje Niksic * http.c (gethttp): Call skip_short_body only if keep_alive is in use. (gethttp): Send the User-Agent header with the CONNECT request as well. 2005-04-25 Hrvoje Niksic * main.c (option_data): Removed support for the undocumented flag --use-proxy. 2005-04-25 Hrvoje Niksic * main.c (option_data): Don't treat -Y as a boolean switch; treat it as a value switch instead, so "-Y off" continues to work. 2005-04-24 Hrvoje Niksic * utils.c (aprintf): Delete unreachable statement. 2005-04-24 Hrvoje Niksic * host.c (cmp_prefer_ipv4): New function. (cmp_prefer_ipv6): New function. (lookup_host): Use the appropriate comparator according to opt.prefer_family. * init.c: New option prefer_family. * host.c (is_valid_ipv6_address): Spell NS_* constants in lower case to avoid clash with system headers. (lookup_host): Reorder the addresses so that IPv4 ones come first. * utils.c (stable_sort): New function. 2005-04-24 Hrvoje Niksic * connect.c (retryable_socket_connect_error): Return 0 for ENETUNREACH and EHOSTUNREACH. 2005-04-23 Hrvoje Niksic * cmpt.c: Reenable the memmove implementation for systems that lack it. * http.c (gethttp): Store the "authorized" state of the persistent connection. (request_remove_header): New function. (gethttp): Don't send the "Basic" authentication if the connection is already authorized. 2005-04-23 Hrvoje Niksic * utils.c (base64_encode): Treat input as unsigned chars. Required for correct encoding of binary stuff. 2005-04-23 Hrvoje Niksic * http-ntlm.c: Format the function definitions in an ansi2knr-friendly fashion. 2005-04-22 Hrvoje Niksic * http.c (gethttp): Handle multiple WWW-Authentication headers, only one of which is recognized. Those are sent by IIS with NTLM authorization. (create_authorization_line): Propagate information whether authorization is finished. (gethttp): Only stop authorization when it's really finished, not after fixed two steps. 2005-04-21 Hrvoje Niksic * gen_sslfunc.c (ssl_init): Fix warning message text; mark the message as translatable. 2005-04-21 Hrvoje Niksic * main.c (print_help): Print the EGD option outside the cluster of SSL options. 2005-04-21 Hrvoje Niksic * http-ntlm.c (ntlm_output): Fix setting the domain. Suggested by Sami Krank. 2005-04-20 Mauro Tortonesi * connect.c: Set IPV6_V6ONLY socket option when -6 switch is used. 2005-04-20 FUJISHIMA Satsuki * http.c (request_set_header): Fix the check whether a new header needs to be allocated. 2005-04-18 Hrvoje Niksic * utils.c (base64_encode): Use the parameter order that makes more sense. Return the length of the base64 written. Updated all callers. 2005-04-17 Hrvoje Niksic * http.c (request_set_header): Free NAME when VALUE is NULL and freeing the header name is requested. 2005-04-17 Hrvoje Niksic * snprintf.c (fmtstr): Declare VALUE as const char *. Based on patch by Russ Allbery. 2005-04-17 Hrvoje Niksic * snprintf.c (fmtfp): More correct handling of significant digit count with %g -- 0.002 has one significant digit, not three. 2005-04-16 Hrvoje Niksic * retr.c (fd_read_body): Respect read timeout with non-interactive or no progress gauge -- treat ETIMEDOUT specially only when progress_interactive. Reported by FUJISHIMA Satsuki. 2005-04-16 FUJISHIMA Satsuki * http.c (gethttp): Don't use HTTP/1.0 persistent connections over proxy. 2005-04-16 Hrvoje Niksic * snprintf.c: Use the PARAMS macro to handle prototypes. Write function definitions in the ansi2knr-friendly way. (fmtstr): If string precision is specified, don't read VALUE past it. (dopr): Actually print %g and %e formats. (fmtfp): Fix a bug that caused 0.01 to be printed as 0.1. (fmtfp): Use LLONG in floating point conversions to be able to convert more digits. (fmtfp): Interpret precision as number of significant digits with %g. (fmtfp): Omit trailing decimal zeros with %g. * snprintf.c: Don't include because none of it is used. Include strings.h/string.h, as per Autoconf. 2005-04-15 Hrvoje Niksic * ptimer.c: Use _POSIX_TIMERS - 0 > 0, which handles the case when _POSIX_TIMERS is defined but empty, as well as the case when it is undefined. Do the same with the check for _POSIX_MONOTONIC_CLOCK. Suggested by Larry Jones. 2005-04-15 Hrvoje Niksic * ptimer.c: Check that _POSIX_TIMERS is defined as well as > 0. Problem reported by Steven M. Schweda. 2005-04-14 Hrvoje Niksic * http.c (skip_short_body): Print the skipped body data in debug mode. (skip_short_body): Don't skip more than 4k of body data. (skip_short_body): Return whether the skipping was successful. (gethttp): If skip_short_body failed, invalidate the connection. 2005-04-12 Gisle Vanem * ftp.c (getftp): Ditto. * http.c (gethttp): Open the output file in binary mode. 2005-04-11 Hrvoje Niksic * hash.c: Conditionalize including config.h on HAVE_CONFIG_H instead of on STANDALONE. 2005-04-11 Hrvoje Niksic * gen_sslfunc.c (ssl_print_errors): Made static. (ssl_print_errors): Eliminate potentially dangerous fixed-size error buffer. Passing NULL to ERR_error_string causes it to use its own static buffer, which is fine for our purposes. * gen_sslfunc.c: Include gen_sslfunc.h. Make the declarations of ssl_init and ssl_conect match the actual definitions. (ssl_connect): Simply return a boolean, the SSL context is no longer useful as a return value. * retr.c: Don't include SSL headers; we don't need them. 2005-04-11 Hrvoje Niksic * config-post.h: Don't define _VA_LIST under Solaris; it breaks compilation with GCC 3.4 under Solaris 10. (It was defined to avoid a warning with previous versions of GCC.) 2005-04-11 Hrvoje Niksic * xmalloc.c (register_ptr): Warn the user to increase SZ prior to aborting. 2005-04-11 Hrvoje Niksic * convert.c (convert_cleanup): Free converted_files. 2005-04-10 Hrvoje Niksic * wget.h (DEBUGP): Use __builtin_expect to give a hint to GCC that opt.debug is false in the vast majority of cases. 2005-04-10 Hrvoje Niksic * config-post.h: Declare alloca as void *, not char *. 2005-04-09 Hrvoje Niksic * recur.c (download_child_p): When -p is used, (temporarily) ignore accept/reject rules for HTMLs, even when they are at the maximum recursion depth. That is because with -p we are, if necessary, overstepping the max. depth to get the requisites. 2004-06-12 Larry Jones * recur.c (download_child_p): Correct the logic in check number 6: test opt.reclevel (not DEPTH) against INFINITE_RECURSION. 2005-04-09 Hrvoje Niksic * url.c: Use "static const" in preference to "const static". Sun's cc warns that "storage class after type is obsolescent". * url.c (urlchr_table): Don't mark ~ as unsafe, too many broken web sites are confused when ~ is changed to %7E. Their servers redirect /%7Efoo/ to /~foo/, which Wget again accesses using %7E, causing further redirections, therefore looping infinitely. See Debian bug #301624 for an example. 2005-04-09 Hrvoje Niksic * alloca.c: Include wget.h to be able to use xmalloc. In addition to defining malloc to xmalloc, also define free to xfree. 2005-04-09 Hrvoje Niksic * http-ntlm.c (ntlm_output): Use "char", not "unsigned char" for ntlmbuf. Our base64 functions accept char anyway. (ntlm_output): Join up the format string, since we nominally support K&R compilers. (ntlm_output): Ditto. 2005-04-08 Hrvoje Niksic * ptimer.c: Use Windows timers under Cygwin, whose POSIX timer implementation is incomplete. 2005-04-08 Hrvoje Niksic * ptimer.c (struct ptimer): Remove the unused initialized field. * ptimer.c: Renamed function parameters from WT (which used to stand for wget_timer or wtimer) to PT. 2005-04-08 Hrvoje Niksic * ptimer.c (posix_init): Be smarter about choosing clocks. In decreasing order of preference, use CLOCK_MONOTONIC, CLOCK_HIGHRES, and CLOCK_REALTIME. (ptimer_allocate): Removed. * ptimer.c: Refactor the code by cleanly separating the architecture-dependent code from the architecture-independent code. 2005-04-08 Hrvoje Niksic * ptimer.c (ptimer_init): Explicitly check that _POSIX_MONOTONIC_CLOCK is *both* defined and >=0. (Undefined symbols are >=0.) 2005-04-08 Hrvoje Niksic * ptimer.c (ptimer_diff): Fix typo affecting Windows build. 2005-04-08 Hrvoje Niksic * ptimer.c (ptimer_init): In fact, _POSIX_MONOTONIC_CLOCK needs to be >= 0. * ptimer.c (ptimer_init): Check whether _POSIX_MONOTONIC_CLOCK is defined instead of whether it's greater than 0. glibc defines it to 0, but still makes it available via sysconf. 2005-04-08 Hrvoje Niksic * mswindows.c (str_to_int64): Rename OVERFLOW and UNDERFLOW to INT64_OVERFLOW and INT64_UNDERFLOW, since those names are used. 2005-04-07 Hrvoje Niksic * ptimer.c: New file. Move the "wtimer" functions from utils.c to this file and rename them to ptimer_. 2005-04-07 Hrvoje Niksic * host.c (NO_ADDRESS): Define NO_ADDRESS only after the system headers have been included. 2005-04-06 Hrvoje Niksic * http.c (pconn): Include NTLM data, which is per-connection. (known_authentication_scheme_p): Recognize NTLM authorization. (create_authorization_line): Call ntlm_input and ntlm_output. * http-ntlm.c: New file, donated by Daniel Stenberg and originally written for curl, heavily modified for Wget. * utils.c (base64_encode): Relocated from http.c, since it is now used by http-ntlm.c, and will possibly be used elsewhere. (base64_decode): New function, originally based on code from GNU recode. 2005-04-02 Hrvoje Niksic * ftp.c (ftp_loop): Ditto. * ftp-basic.c (ftp_pasv): Use the xzero shorthand for memset(0). (ftp_lpsv): Ditto. 2005-04-05 Mauro Tortonesi * Makefile.in: removed string_t.c from list of source files. 2005-04-04 Mauro Tortonesi * string_t.c: Removed. * string_t.h: Removed. 2005-04-02 Hrvoje Niksic * url.c (rewrite_shorthand_url): Only accept recognized schemes. That way "foo:80" will correctly be rewritten to "http://foo:80" instead of left unchanged and ultimately rejected because of "unsupported scheme foo". 2005-03-31 Hrvoje Niksic * utils.c (number_to_string): Avoid explicit 64-bit constants; construct them by multiplication at compile-time. * utils.c, elsewhere: Don't append "L" to 32-bit integer constants; we aren't really compilable on 16-bit systems anyway. * hash.c (prime_size): Remove primes larger than 2^31, but include 2^31-1, which is prime. 2005-03-30 Hrvoje Niksic * utils.c (string_set_to_array): New function. * convert.c: Replace the use of "slists" with sets/hash-tables, which in fact suit the intended purpose much better. downloaded_html_list is removed altogether. 2005-03-29 Hrvoje Niksic * ftp.h (enum): Rename GLOBALL, GETALL, and GETONE to GLOB_GLOBALL, GLOB_GETALL, and GLOB_GETONE to avoid conflict with Linux headers. 2005-03-29 Hrvoje Niksic * utils.c (numdigit): More correct handling of negative numbers. 2005-03-21 Hrvoje Niksic * http.c (gethttp): Print the human-readable size. * ftp.c (getftp): Print the human-readable size of the file to be downloaded. * utils.c (human_readable): New function. * utils.c: Renamed "legible" to "with_thousand_seps", "legible_large_int" to "with_thousand_seps_large", and "legible_1" to "add_thousand_seps". 2005-03-21 Hrvoje Niksic * http.c (gethttp): Inhibit persistent connections when talking to proxies, as mandated by RFC 2068. 2005-03-20 Hrvoje Niksic * url.c (unescape_single_char): New function. (url_escape_dir): Use it to unescape slashes in directory components. (url_string): Escape unsafe chars in host name, except for the ':' charaters, which can appear in IPv6 addresses. * main.c (main): Don't access the cookie jar directly. * log.c (escnonprint_internal): Correctly calculate the needed string size. Don't forget the buffer's new size after having reallocated it. (log_cleanup): New function. Free the escnonprint ring data. * init.c (cleanup): Don't free the cookie jar explicitly, it is now done by http_cleanup. (cleanup): opt.user_headers is now a vector, free it with free_vec. * http.c (gethttp): Make sure to free the request data, the status message, and the response data before returning from the function. (save_cookies): New function. (http_cleanup): Free the cookie jar here. * hash.c: Renamed string_hash to hash_string and ptrhash to hash_pointer. Exported hash_pointer. * xmalloc.c: Organized malloc_table (previously malloc_debug) as a simple EQ hash table. register_ptr and unregister_ptr are now of O(1) complexity. * xmalloc.c: Renamed "*_debug" to debugging_* and "*_real" to checking_*. 2005-03-12 Hrvoje Niksic * utils.c (debug_test_md5): Moved to gen-md5.c. * mswindows.h: Don't declare inet_ntop, since we don't use it. * mswindows.h: For consistency, also wrap closesocket, it being a Winsock call. * mswindows.h: Don't declare sleep and usleep; we're defining xsleep now. * mswindows.h (mkdir): Don't special-case Borland C, _mkdir works there as well. * host.c: Don't include winsock header files; the correct ones are already included by mswindows.h. * mswindows.c (xsleep): Round toward the nearest millisecond in an attempt to avoid average short sleeps. * utils.c (wtimer_granularity): Report correct values for Windows timers and for high-resolution timers. * utils.c (wtimer_initialize_once): New function, called to initialize the timer frequency. * utils.c: Replace the use of GetSystemTime with high-resolution counters under Windows. When high-resolution counters are unavailable, use GetTickCount(). 2005-03-15 Hrvoje Niksic * retr.c (fd_read_body): Undo the 2004-11-18 change. Instead, always be "exact". 2005-03-17 Hrvoje Niksic * ftp-basic.c (ftp_login): Don't free the string if ftp_response returned an error status because the line didn't get allocated in the first place. 2005-03-15 Hrvoje Niksic * http.c (read_http_response_head): Limit the response size to 64k bytes. * retr.c (fd_read_hunk): Accept a MAXSIZE argument that limits the number of bytes the function is allowed to allocate. (fd_read_line): Limit the line to 4096 bytes. 2005-03-12 Hrvoje Niksic * wget.h: Include options.h after wgint has been defined. * options.h (struct options): Declare options processed with cmd_bytes as wgint, not long. 2005-03-18 Hrvoje Niksic * init.c (cmd_file): Use concat_strings. * http.c (basic_authentication_encode): Use concat_strings. * ftp-ls.c (ftp_index): Use concat_strings. * ftp-basic.c (ftp_request): Use concat_strings. * utils.c (concat_strings): New function. 2005-03-12 Hrvoje Niksic * init.c (simple_atof): Handle negative numbers; skip whitespace before the number. (simple_atoi): Ditto. Also, check for overflow and underflow. (cmd_number): Bail out on negative numbers. (parse_bytes_helper): Ditto. 2005-03-06 Hrvoje Niksic * http.c (gethttp): Handle multiple Set-Cookie headers sent by remote server. 2005-03-06 Hrvoje Niksic * init.c (defaults): Use passive FTP by default. 2005-03-06 Hrvoje Niksic * mswindows.c: Provide wrappers to Winsock functions that set errno to WSAGetLastError() in case of failure. Also provide a Windows-specific version of strerror. * mswindows.h: Wrap calls to socket, bind, connect, recv, send, select, getsockname, getpeername, and setsockopt. 2005-03-06 Hrvoje Niksic * url.c (url_parse): Reject port numbers larger than 65535. We also check for overflow while parsing port numbers. 2005-03-06 Hrvoje Niksic * utils.c (read_file): Don't use wgint for file size; LFS won't work since the file is mmap'ed as a whole. * options.h: Don't include stdio.h. * log.c: Ditto. * init.c: Disambiguate assignment from non-zero test to avoid Borland C warning. * http.c (response_new): Don't needlessly post-increment count. * hash.c: Include stdio.h. * gnu-md5.h: Don't include stdio.h. * getopt.h (struct option): Always use const. * ftp.c (getftp): Avoid unnecessary assignment to RES to avoid Borland C warning. * ftp-ls.c: Disambiguate assignment from non-zero test to avoid Borland C warning. * cmpt.c (strptime_internal): Don't initialize rp_backup when !_NL_CURRENT to avoid Borland C warning. 2005-03-06 Hrvoje Niksic * utils.c (fopen_excl): Fix parse error when O_BINARY is available. 2005-03-05 Hrvoje Niksic * url.c (url_file_name): Don't allow hosts named ".." to be appended as path elements. 2005-03-03 Hrvoje Niksic * retr.c (retrieve_url): Escape location header. * http.c (print_server_response_1): Escape server response when printing it. (gethttp): Escape host name, status message, location header, and content type. (http_loop): Escape error message from server. * host.c (lookup_host): Escape host name when printing it. * ftp.c (getftp): Escape user name when printing it. (getftp): Escape remote file and directory for printing. (getftp): Escape server listing when printing it. (ftp_retrieve_list): Escape link name and file name. (ftp_retrieve_glob): Escape file name. * ftp-basic.c (ftp_response): Escape server response when printing it. * cookies.c (parse_set_cookies): Escape the cookie field when printing it. (parse_set_cookies): Escape contents of remote header. (cookie_handle_set_cookie): Escape host name and cookie domain. * connect.c (connect_to_ip): Escape the host name. * log.c (escnonprint): New function, used for printing strings coming from the server that possibly contain non-ASCII characters. (escnonprint_uri): Ditto. 2005-02-24 Hrvoje Niksic * ftp.c (getftp): Ditto. * http.c (gethttp): When we're not supposed to overwrite files, use fopen_excl to open the file and recompute the file name. * log.c (redirect_output): Use unique_create to avoid a race condition. * mswindows.c (fake_fork_child): Use unique_create. * utils.c (fopen_excl): New function that opens a stdio stream with the O_EXCL flag (where available). (unique_create): New function, like unique_name, but also creating the file and returning a file pointer. (fork_to_background): Use unique_create to create the file immediately to avoid race condition with multiple instances of wget -b. 2005-02-24 Hrvoje Niksic * host.c (lookup_host): Test for AI_ADDRCONFIG directly, instead of checking for HAVE_GETADDRINFO_AI_ADDRCONFIG. 2005-02-23 Hrvoje Niksic * host.c (is_valid_ipv6_address): Move here from url.c. (lookup_host): If the address is numeric, don't print the "resolving..." line, don't set up DNS timeouts, and set the AI_NUMERICHOST hint, where available. 2005-02-26 Gisle Vanem * utils.c: Use the nnnLL syntax under GCC. Define struct_stat to struct _stati64 under __MINGW32__ as well as under MS VC. 2005-02-26 Hrvoje Niksic * utils.c: Use the nnnI64 syntax for __int64 constants under all Windows compilers. (SPRINTF_WGINT): Use "%I64" under all Windows compilers. * mswindows.h (WGINT_MAX): Use the nnnI64 syntax for __int64 constants under all Windows compilers. (struct_stat): Use `struct stati64' under Borland C. (fstat): Don't redefine to _fstati64 under Borland. * mswindows.c: Define str_to_int64 under Borland C as well as under (older) Visual C. 2005-02-25 Hrvoje Niksic * ftp.c (getftp): Initialize err to suppress compiler warning. 2005-02-24 Hrvoje Niksic * ftp.c (ftp_expected_bytes): Fix bug that caused infloop because of not correctly skipping the '(' character. 2005-02-24 Hrvoje Niksic * mswindows.c (wget_ftello): Removed. * mswindows.h: Remove bogus definition of stat. (wget_ftello): Remove the leftover ftello replacement. 2005-02-20 Hrvoje Niksic * mswindows.c (wget_ftello): Wget's replacement for ftello. * utils.c (file_size): Use ftello where available. * ftp-ls.c (ftp_parse_unix_ls): Use str_to_wgint to parse the file size. (ftp_parse_winnt_ls): Ditto. * ftp-basic.c (ftp_size): Use str_to_wgint to convert number to wgint; pass 10 instead of 0 as the BASE argument. * ftp.c (ftp_expected_bytes): Use str_to_wgint to parse the file size. * sysdep.h (LARGE_INT_FMT): Use __int64 as LARGE_INT on MSVC/Windows; print it with "%I64". * wget.h: Define a `wgint' type, normally aliased to (the possibly 64-bit variant of) off_t. * all: Use `wgint' instead of `long' for numeric variables that can hold file sizes. * utils.c (number_to_string): Support printing of `wgint' argument. (number_to_static_string): New function. * all: Replace printf("%ld", long_value) with printf("%s", number_to_static_string(wgint_value)). 2005-02-18 Mauro Tortonesi * main.c: Added the --ftp-passwd command line option. * init.c: Renamed command passwd to ftppasswd. 2005-02-11 Mauro Tortonesi * string_t.c: Fixed a bug in do_escape and triggered escape of backslashes in string_escape to avoid ambiguities in the result string. 2005-02-10 Mauro Tortonesi * string.h: Renamed to string_t.h to fix a compilation conflict with the string.h header in the standard C library. * string.c: Renamed to string_t.c for consistency with string.h. * string_t.c: Ditto. * string_t.h: Ditto. 2004-12-31 Mauro Tortonesi * string.c: New file. * string.h: New file. * Makefile.in: Added string.c to the list of modules to compile. * main.c: Updated copyright. 2004-11-18 Ulf Harnhammar * ftp-ls.c: Fixed a problem in ftp_parse_winnt_ls that could allow a malicious remote FTP server to crash wget. 2004-11-18 Hans-Andreas Engel * http.c: Enable --convert-links (-k) when a single page is downloaded via --output-document (-O). 2004-11-18 Mauro Tortonesi * connect.c: Minor correction to the comment in front of fd_peek. 2004-11-18 Leonid Petrov * retr.c: Fix a timeout problem in fd_read_body when using http_proxy. 2004-11-15 YAMAZAKI Makoto * netrc.c: Fix termination by assertion bug in netrc parsing. 2004-05-09 David Fritz * mswindows.c (fake_fork): Pass entire command line to the child process. 2004-03-31 Hrvoje Niksic * http.c (gethttp): Fix typo: SCHEME_SSL -> SCHEME_HTTPS. 2004-03-30 Hrvoje Niksic * http.c (gethttp): Send the Proxy-Authorization header over non-SSL connections too. 2004-03-25 David Fritz * mswindows.c (fake_fork_child): Ignore error code when OpenFileMapping() fails; assume it failed because the object does not exist. 2004-03-24 David Fritz * mswindows.c (fake_fork): New function. * mswindows.c (fork_to_background): Use it. 2004-03-19 David Fritz * mswindows.c (ws_hangup): Incorporate old fork_to_background() code. Add event name argument. (fork_to_backgorund): Now a simple wrapper around ws_hangup(). (ws_handler): Correctly handle the case when neither CTRLC_BACKGND nor CTRLBREAK_BACKGND are defined. Don't bother handling close, logoff, or shutdown events. Call ws_hangup() with the correct event name; don't assume it was CTRL+Break. 2004-03-19 Hrvoje Niksic * url.c (url_parse): Decode %HH sequences in host name. 2004-03-04 Hrvoje Niksic * convert.c (local_quote_string): Quote "#" as "%23" and "%" as "%25" when creating links to local files. 2004-03-02 David Fritz * mswindows.c (ws_percenttitle): Guard against future changes by doing nothing if the proper variables have not been initialized. Clamp percentage value. 2004-03-04 Gisle Vanem * retr.c (fd_read_body): Don't change console title if quiet. 2004-02-25 David Fritz * mswindows.c (set_sleep_mode): Remove argument and return value. Call GetModuleHandle() instead of LoadLibrary()/FreeLibrary() for kernel32.dll. Use typedef for function-pointer. Don't cast l-value. Don't use dereference operator when calling through function-pointer. (ws_startup): Update call to set_sleep_mode(). (ws_cleanup): Remove call to set_sleep_mode(). 2004-02-23 David Fritz * http.c (http_loop): Ditto. * ftp.c (ftp_loop_internal): Update call to ws_changetitle(). * main.c (main): Don't bother calling ws_changetitle(). * mswindows.h (ws_changetitle): Update prototype. * mswindows.c (ws_changetitle): Remove second argument. Use xfree_null(). (ws_percenttitle): Only update title when percentage has changed. 2004-02-23 David Fritz * mswindows.h: Ditto. * mswindows.c: Misc. formatting/comment tweaks throughout. 2004-02-20 David Fritz * main.c (print_help): Remove call to ws_help(). * mswindows.c (ws_help): Remove. * mswindows.h (ws_help): Remove. 2004-02-16 David Fritz * init.c (home_dir): Use aprintf() instead of xmalloc()/sprintf(). Under Windows, if $HOME is not defined, use the directory that contains the Wget binary instead of hard-coded `C:\'. (wgetrc_file_name): Under Windows, look for $HOME/.wgetrc then, if not found, look for wget.ini in the directory of the Wget binary. * mswindows.c (ws_mypath): Employ slightly more robust methodology. Strip trailing path separator. 2004-02-06 Hrvoje Niksic * http.c (gethttp): Respect --ignore-length. (gethttp): Inhibit keep-alive if --ignore-length is specified. 2004-02-06 Hrvoje Niksic * connect.c (sockaddr_set_data): Zero out sockaddr_in/sockaddr_in6. Apparently BSD-derived stacks need this when binding a socket to local address. 2004-02-04 Hrvoje Niksic * hash.c: Make the file compilable outside Wget source tree when -DSTANDALONE is used. 2004-01-29 Hrvoje Niksic * utils.c (determine_screen_width): Return 0 if not running on Windows or on a TIOCGWINSZ-capable system. 2004-01-28 David Fritz * utils.c (determine_screen_width): Correctly determine console width under Windows. 2004-01-28 Christian Biere * progress.c (bar_set_params): Fixed syntax error when HAVE_ISATTY was undefined. * ftp.c (ftp_loop_internal): Allocate a larger buffer in case "try" gets translated to something large. Ditto in http_loop in http.c. * http.c (response_header_copy): Don't write to buf[BUFSIZE]. * ftp-opie.c (skey_response): Eliminate unnecessary string concatenation; just call gen_md5_update twice. 2004-01-25 Hrvoje Niksic * utils.c (xsleep): Don't call usleep with values larger than 1,000,000. 2003-12-16 Hrvoje Niksic * http.c (gethttp): Fix generation of `Content-Length'. 2003-12-15 Gisle Vanem * url.c (url_skip_credentials): Fixed return value; 'url' if no credentials. 2003-12-14 Hrvoje Niksic * url.c (url_skip_credentials): Return a pointer directly. 2003-12-14 Hrvoje Niksic * url.c (url_file_name): Ditto. (parse_errors): Ditto. * retr.c (retr_rate): Ditto. * progress.c (create_image): Ditto. * netrc.c (parse_netrc): Ditto. * main.c (struct cmdline_option): Ditto. (redirect_output_signal): Ditto. * init.c (commands): Ditto. * ftp-ls.c (ftp_index): Ditto. * cookies.c (check_domain_match): Declare the pointer to a literal string as `const'. 2003-12-12 Hrvoje Niksic * retr.c (fd_read_body): Pass total size to progress_create, not the remaining amount. 2003-12-12 Hrvoje Niksic * retr.c (fd_read_body): Don't fiddle with "interactive timeout" if read timeout is unset. 2003-12-12 Hrvoje Niksic * connect.c (bind_local): Don't set the IPV6_V6ONLY option on the socket. 2003-12-06 Hrvoje Niksic * url.c (url_file_name): Respect the setting of opt.protocol_directories. * main.c (main): Only check for ret=='?' when longindex is unset. (option_data): New option --protocol-directories. 2003-12-06 Hrvoje Niksic * ftp.c (getftp): Ditto. * http.c (gethttp): Correctly calculate bandwidth as total data read divided with download time. * retr.c (fd_read_body): Separate the return values for data written and read. 2003-12-05 Hrvoje Niksic * http.c (H_REDIRECTED): Respect the HTTP/1.1 "303 See Other" response code. Suggested by Dan Razzell. 2003-11-30 Hrvoje Niksic * retr.c (fd_read_body): Report the amount of data *written* as amount_read. This is not entirely logical, but that's what the callers expect, and it's not easy to change. * ftp.c (ftp_loop_internal): Ditto. * http.c (http_loop): Be smarter about assigning restval; if we're in the nth pass of a download, simply use the information we have about how much data has been retrieved as restval. * ftp.c (getftp): Ditto for FTP "REST" command. * http.c (gethttp): When the server doesn't respect range, skip the first RESTVAL bytes of the read body. Never truncate the output file. * retr.c (fd_read_body): Support skipping initial STARTPOS octets. 2003-11-30 Hrvoje Niksic * http.c (skip_short_body): Renamed skip_body to skip_short_body; don't bother calling fd_read_body. 2003-11-30 Hrvoje Niksic * retr.c (fd_read_body): Sanitize arguments and document them better. Make sure the timer is created and updated only if necessary. Updated callers. 2003-11-30 Hrvoje Niksic * http.c (skip_body): New function. (gethttp): Use it to skip the body of the responses we don't care to download. That allows us to reuse the connection. (gethttp): Trust that the HEAD requests will not generate body data. * retr.c (fd_read_body): Don't write to OUT if it's NULL. 2003-11-29 Hrvoje Niksic * http.c (gethttp): Initialize SSL only the first time when SSL URL is downloaded. 2003-11-29 Hrvoje Niksic * cookies.c (cookie_header): Only generate the contents of the header, not the leading "Cookie: " or the trailing "\r\n". * http.c (gethttp): When adding headers specified with `--header', allow them to override the headers generated by Wget. * init.c (cmd_spec_header): Made opt.user_headers a vector. * http.c (request_new): New function. Returns a request structure which can be modified in various ways, most notably by adding HTTP headers to the request. (request_set_header): New function for adding the header to the request. If the header is already available, it gets replaced. (request_send): Construct and send the request. (gethttp): Use the request_* functions to generate the request. 2003-11-28 Hrvoje Niksic * http.c (gethttp): Don't include the Proxy-Authorization header in the request tunneled through proxy. 2003-11-28 Hrvoje Niksic * http.c (gethttp): Use the CONNECT handle to establish SSL passthrough through non-SSL proxies. 2003-11-28 Hrvoje Niksic * init.c: Don't #include netinet/Winsock stuff. 2003-11-28 Hrvoje Niksic * http.c: Deleted the old functions header_process, header_extract_number, header_exists, header_strdup, http_process_range, http_process_none, http_process_type, and http_process_connection. * http.c (response_new): New function. (response_header_bounds): Ditto. (response_header_copy): Ditto. (response_header_strdup): Ditto. (response_status): Ditto. (gethttp): Use the new response_* functions to parse the response. Support HTTP/0.9 responses. 2003-11-27 Hrvoje Niksic * progress.c (create_image): Don't calculate ETA if nothing has been downloaded yet, because it causes division by zero. 2003-11-27 Hrvoje Niksic * connect.c (bind_local): Rename sa_len to addrlen because IRIX headers define sa_len as a macro. 2003-11-26 Hrvoje Niksic * html-parse.c (convert_and_copy): Remove embedded newlines when AP_TRIM_BLANKS is specified. 2003-11-26 Hrvoje Niksic * ftp.c: Set con->csock to -1 where rbuf_uninitialize was previously used. 2003-11-26 Hrvoje Niksic * Makefile.in (http$o): Added the trailing backslash that was missing. 2003-11-21 Hrvoje Niksic * headers.c: Removed. The file is no longer relevant, now that no special handling of headers is done by the rbuf code. Moved portions to http.c. 2003-11-21 Hrvoje Niksic * rbuf.c: Removed. * ftp-basic.c (ftp_response): Use fd_read_line. No longer use struct rbuf. Updated all callers. * http.c (gethttp): Use fd_read_head to read all the headers in one go. (next_header): New function. * retr.c (fd_read_line): New function: reads a line from FD, leaving the rest of the data unread. (fd_read_head): New function. * connect.c (fd_peek): New function, implements peeking. (poll_internal): New function. (fd_read): Use it. (fd_write): Ditto. (fd_peek): Ditto. (fd_register_transport): Allow registering a "peeker" callback. 2003-11-20 Hrvoje Niksic * connect.c: Renamed xread/xwrite/xclose to fd_read/fd_write/fd_close. The "x" prefix is not appropriate because the semantics have diverged from read/write/close too significantly. Updated all callers. 2003-11-20 Hrvoje Niksic * connect.c (sock_write): It's not necessary to initialize RES. 2003-11-19 Hrvoje Niksic * main.c (main): Don't reference opt.ipv4_only and opt.ipv6_only if IPv6 is disabled. 2003-11-19 Hrvoje Niksic * connect.c (socket_has_inet6): Only compile it if IPv6 is enabled and AI_ADDRCONFIG is missing. 2003-11-18 Hrvoje Niksic * gen_sslfunc.c (ssl_init_prng): Warn the user when using a weak random seed. 2003-11-18 Hrvoje Niksic * host.c (address_list_contains): Renamed address_list_find to address_list_contains because its result is boolean. 2003-11-18 Hrvoje Niksic * connect.c (select_fd): Return 1 if select is not available. 2003-11-17 Hrvoje Niksic * connect.c (connect_to_host): Don't reference address list after releasing it. 2003-11-17 Hrvoje Niksic * main.c (print_help): Fix alignment of FTP options output. 2003-11-17 Hrvoje Niksic * host.c (lookup_host): Check for the ability to create IPv6 sockets here. * init.c (defaults): Don't auto-set --inet4-only on IPv6-less systems. 2003-11-16 Hrvoje Niksic * main.c (print_help): Fix typo in `-O' help message. Fix docs of -Y/--proxy. Fix docs of `--cookies' and `--glob'. Improve docs of --convert-links. Fix docs of SSL options. 2003-11-16 Hrvoje Niksic * ftp-basic.c: Don't include and others because they're no longer needed. 2003-11-16 Hrvoje Niksic * main.c (main): Don't allow setting of both opt.ipv4_only and opt.ipv6_only. * init.c (defaults): Mark opt.ipv4_only specially when set automatically. 2003-11-15 Hrvoje Niksic * host.c (lookup_host): Use AI_ADDRCONFIG only if the family is unspecified. This ensures that specifying `--no-inet4' on systems where IPv6 resolves, but doesn't work behaves the same regardless of the availability of AI_ADDRCONFIG. 2003-11-15 Hrvoje Niksic * host.c: Don't refer to the now-removed function forget_host_lookup in the documentation of lookup_host. 2003-11-15 Hrvoje Niksic * http.c (persistent_available_p): Correctly specify the endpoint argument to socket_ip_address. (gethttp): When printing the "reusing connection to..." message, specify the host name of the reused connection, not the current host name. That makes more sense because it provides a useful piece of information -- we know to which host we're supposed to connect anyway! 2003-11-15 Hrvoje Niksic * init.c: Make sure the options are in alphabetic order! * host.c (lookup_host): Merge lookup_host_passive and lookup_host after all -- having both would result in some code duplication. (lookup_host): Set hints.ai_family to AF_INET if ipv4_only is requested. Likewise, set it to AF_INET6 for ipv6_only. Specify AI_ADDRCONFIG where available. (lookup_host): New flag LH_REFRESH that specifies that a cached entry for HOST should be refreshed. (cache_query): New function. (cache_store): Ditto. (cache_remove): Ditto. (forget_host_lookup): No longer necessary, replaced with static function cache_remove. 2003-11-14 Hrvoje Niksic * main.c: Enable -4 and -6 only if IPv6 is enabled. 2003-11-14 Hrvoje Niksic * connect.c (register_transport): Renamed from register_extended. Explain the intended usage. 2003-11-14 Hrvoje Niksic * url.c (uri_merge): Merging "foo" and "bar" should result in "bar", not in "foo/bar". (path_simplify): Don't remove empty path elements; don't special-case leading slash. (path_simplify): Don't swallow ".."'s at the beginning of string. E.g. simplify "foo/../../bar" as "../bar", not as "bar". (append_uri_pathel): Defang ".." path element upon encountering it. 2003-11-13 Hrvoje Niksic * http.c (persistent_available_p): Don't attempt to talk to two different SSL sites over the same secure connection. 2003-11-13 Hrvoje Niksic * http.c (gethttp): Ditto. * ftp.c (getftp): Use retryable_socket_connect_error instead of CONNECT_ERROR. * wget.h (CONNECT_ERROR): Removed. * connect.c (retryable_socket_connect_error): New function instead of unsupported_socket_family_error. 2003-11-13 Hrvoje Niksic * wget.h (CONNECT_ERROR): Use it. * connect.c (unsupported_socket_family_error): New function. 2003-11-13 Hrvoje Niksic * connect.c (bind_local): Renamed bindport to bind_local; return the socket directly. Updated callers. (accept_connection): Renamed acceptport to accept_connection; return the created socket directly. Updated callers. 2003-11-13 Hrvoje Niksic * init.c (defaults): Turn on opt.ipv4_only if we're compiling with IPv6, and AI_ADDRINFO is not available, and AF_INET6 sockets can't be created. 2003-11-13 Hrvoje Niksic * host.c (lookup_host): Document the fact that the addresses are returned in order. 2003-11-12 Hrvoje Niksic * utils.c: Use limits.h only where available. * hash.c: Use INVALID_PTR and INVALID_PTR_BYTE. Include limits.h. 2003-11-11 Hrvoje Niksic * main.c: Added options --inet4-only and --inet6-only. 2003-11-11 Hrvoje Niksic * host.c (host_errstr): Use the more standard message "Unknown host". 2003-11-10 Hrvoje Niksic * connect.c (connect_to_host): Use that flag to decide whether to re-resolve the host name. * host.c (struct address_list): Added a flag that maintains whether the connection worked at some point. 2003-11-10 Hrvoje Niksic * host.c (lookup_host): Special-case the numeric addresses only in the non-IPv6 case. 2003-11-10 Hrvoje Niksic * connect.c (resolve_bind_address): Call lookup_host_passive. Make sure that opt.bind_address is resolved only once. * host.c (lookup_host_passive): New function, handles "passive" lookups. (lookup_host): Remove the passive flags. Remove the family-related flags -- use ip_default_family instead. 2003-11-09 Hrvoje Niksic * html-url.c: Get URLs from . 2003-11-09 Hrvoje Niksic * main.c (option_data): Specify the command to use for --mirror. 2003-11-08 Hrvoje Niksic * cookies.c (cookie_handle_set_cookie): Specify exact match for unspecified domains. 2003-11-08 Hrvoje Niksic * main.c (main): Removed one-letter options `-C', `-g', `-G', and `-s'. 2003-11-08 Hrvoje Niksic * main.c (main): Add --dont-remove-listing for backward compatibility with previous versions. (print_help): Fix typo, spotted by Dennis Smit. 2003-11-08 Gisle Vanem * ftp-basic.c: Support Windows-2000 ftp servers. Win-2000 *is* Win-NT 5.0 so calling it ST_WINNT is okay I guess. 2003-11-08 Hrvoje Niksic * progress.c (update_speed_ring): Clear the speed ring when the download stalls. * retr.c (get_contents): Specify 0.95s read timeout, so that the progress gauge can be updated even when data arrives very slowly or stalls. 2003-11-08 Hrvoje Niksic * utils.c (wtimer_allocate): Bless the use of wtimer_read on a timer that has merely been allocated because get_contents() does that. (wtimer_update): Abort if the timer is not initialized. 2003-11-08 Hrvoje Niksic * retr.c (get_contents): Pass the timer to limit_bandwidth(). * utils.c (wtimer_update): New function instead of wget_elapsed; just update the timer, but don't return anything. (wtimer_read): Read and return the last known value of the timer. 2003-11-08 Hrvoje Niksic * http.c (persistent_available_p): Instead of matching all the addresses of HOST and last host, determine the peer's IP address with socket_ip_address and see if that address is one of those HOST resolves to. * host.c (address_list_match_all): Removed. (address_list_find): New function, finds an IP address in the address list. * ftp.c (ftp_do_pasv): Get the peer's address here, and pass it to ftp_epsv so it doesn't need to call getpeername. * ftp-basic.c (ftp_port): Use socket_ip_address instead of getpeername. (ftp_lprt): Ditto. * connect.c (socket_ip_address): Replaces conaddr, generalized to either get peer's or local address. (sockaddr_get_data): Made local to this file. 2003-11-08 Hrvoje Niksic * hash.c (HASH_POSITION): Explicitly accept the hash function. (grow_hash_table): Extract ht->hash_function outside the loop. (hash_table_remove): Ditto. (hash_table_clear): Fill entries with 0xff to clear them. (hash_table_remove): Mark entries as deleted with the correct marker. 2003-11-08 Hrvoje Niksic * http.c (persistent_available_p): No reason for the host lookup to be silent -- it's a lookup like any other. 2003-11-08 Hrvoje Niksic * connect.c (register_extended): Check that fd >= 0. 2003-11-07 Hrvoje Niksic * connect.c (LAZY_RETRIEVE_INFO): Set LAST_INFO. 2003-11-07 Hrvoje Niksic * hash.c (NON_EMPTY): Use the all-bit-set value as the marker that the field is empty. This allows NULL pointer and 0 value to be used as keys, which is necessary for the connect.c code to work when fd==0. (hash_table_new): Fill mappings with 0xff. (grow_hash_table): Ditto. 2003-11-07 Hrvoje Niksic * url.c (url_parse): Allow empty ports. 2003-11-07 Hrvoje Niksic * main.c (print_help): Break the help string into multiple chunks. (cmdline_option): New option handler OPT_FUNCALL. Generalized HANDLE_CMD to generic DATA. (option_data): Use the new OPT_FUNCALL feature. 2003-11-06 Hrvoje Niksic * log.h: Declare log_init, log_close, and log_request_redirect_output here. 2003-11-05 Dennis Smit * main.c: (main): added --preserve-permissions option. * ftp.c (ftp_retrieve_list): added support for --preserve-permissions option. * init.c: added support for --preserve-permission option. * option.h: added support for --preserve-permission option. 2003-11-06 Hrvoje Niksic * main.c (init_switches): New function. Convert option_data to long_options and short_options, which can be fed to getopt_long. (main): Execute command-line options by consulting option_data. 2003-11-06 Hrvoje Niksic * gen_sslfunc.c (ssl_read): Implement a more correct check for EINTR. (ssl_write): Ditto. (init_ssl): Use a global SSL context. 2003-11-06 Hrvoje Niksic * connect.c (xclose): Free INFO even if it doesn't provide a closer. 2003-11-06 Hrvoje Niksic * connect.c: Updated all callers of iread/ssl_iread/iwrite/ssl_iwrite to use xread and xwrite instead. * rbuf.h (struct rbuf): Removed the SSL member because SSL is handled automatically by xread. * hash.c (ptrhash): Made private. (ptrcmp): Ditto. (inthash): Removed. * connect.c (select_fd): Don't set errno, leave it to the caller. * gen_sslfunc.c (connect_ssl): Use register_extended to register SSL callbacks for communication with SSL-enabled endpoints. (ssl_read): New function. (ssl_write): Ditto. (ssl_poll): Ditto. (ssl_close): Ditto. * connect.c (register_extended): New function -- register callbacks for basic socket operations. (xread): Ditto. (xwrite): Ditto. (xclose): Ditto. (sock_read): New function, default implementation for reading. (sock_write): Ditto for writing. (sock_poll): Ditto for polling. (sock_close): Ditto for closing. 2003-11-05 Hrvoje Niksic * connect.c (bindport): Fix compilation under pre-C99 compilers. 2003-11-05 Hrvoje Niksic * connect.c (connect_to_ip): More compact error checking. (bindport): Don't treat failed setsockopt as a fatal error. 2003-11-05 Hrvoje Niksic * connect.c (resolve_bind_address): Use a more accurate error message -- we're not binding to ANY, we're disabling bind altogether. 2003-11-05 Hrvoje Niksic * cookies.c (save_cookies_mapper): Respect the setting of keep-session-cookies. (cookie_jar_load): Import session cookies. Based on code submitted by Nicolas Schodet. * utils.c (datetime_str): Use information in TM when it's non-NULL. * main.c (main): New option `--keep-session-cookies'. 2003-11-04 Hrvoje Niksic * Makefile.in (realclean): Delete config.h.in. 2003-11-04 Hrvoje Niksic * config-post.h: New file, included from now autogenerated config.h.in. 2003-11-04 Hrvoje Niksic * progress.c (progress_handle_sigwinch): Don't call determine_screen_width() from the signal handler. Instead, just set a volatile variable. (bar_create): Check whether SIGWINCH was received. (bar_update): Ditto. * sysdep.h: Define SYSTEM_FNMATCH only if HAVE_FNMATCH_H is true. 2003-11-03 Hrvoje Niksic * utils.c (xsleep): New function. Uses nanosleep where available, resuming sleeps interrupted by signals. Updated callers of sleep and usleep to use xsleep. 2003-11-03 Hrvoje Niksic * ftp-basic.c (ftp_login): Remove shadowing (and bogus) declaration of SEED. 2003-11-03 Hrvoje Niksic * log.c (logvprintf): Documented better. Renamed to log_vprintf_internal to avoid confusion with the public API functions logprintf and logputs. 2003-11-03 Hrvoje Niksic * wget.h (N_): Don't parenthesize argument. 2003-11-03 Hrvoje Niksic * host.h (ADDRESS_IPV4_DATA): Don't take the address of in.s_addr because that doesn't work on machines that define it as bitfield. 2003-11-03 Hrvoje Niksic * connect.c (select_fd): Generalize the third argument into WAIT, so that the caller can request waiting for both read and write. Updated callers. 2003-11-02 Hrvoje Niksic * html-url.c (cleanup_html_url): Destroy the hash tables, don't just call free on them. (init_interesting): Use hash_table_put instead of string_set_add because we don't need the strdup that the latter function performs. * init.c (cleanup): Don't pass NULL to cookie_jar_delete. * xmalloc.c (xfree_real): Abort when passed a NULL pointer. (xfree_debug): Print at the file and line of the offending call to free. 2003-11-02 Hrvoje Niksic * wget.h: Retired the `boolean' type. Moved the DEFAULT_LOGFILE define to log.h. Moved the INFINITE_RECURSION define to recur.h. * xmalloc.h: Renamed FREE_MAYBE to xfree_null and moved the definition from wget.h to xmalloc.h. 2003-11-02 Hrvoje Niksic * html-parse.c (decode_entity): New function; split the decoding of entities here. (convert_and_copy): Use it to decode entities. (decode_entity): Handle the &apos entity. (decode_entity): Don't decode Latin 1 numeric entities. Don't decode �. 2003-11-01 Hrvoje Niksic * ftp-opie.c (calculate_skey_response): Use uint32_t instead of `unsigned long' for the cheksum array. Document the function. 2003-11-01 Hrvoje Niksic * connect.c (acceptport): Don't call select_fd when timeout is not requested. 2003-11-01 Hrvoje Niksic * host.c: Removed the ip_default_family global variable. * host.c (lookup_host): Document the function. Fixed declaration of VEC. 2003-10-31 Hrvoje Niksic * various: Use new macros xnew, xnew0, xnew_array, and xnew0_array in various places. 2003-10-31 Hrvoje Niksic * wget.h: Move declarations of malloc and logging code to xmalloc.h and log.h respectively to unclutter this file. (STRDUP_ALLOCA): Made it side-effect free. * xmalloc.h: New files. Define macros xnew, xnew0, xnew_array, and xnew0_array. * xmalloc.c: New file. Move the xmalloc routines here. 2003-10-31 Hrvoje Niksic * connect.c (sockaddr_set_data): Remove the broken code that checked for NULL address. 2003-10-31 Hrvoje Niksic * host.c (address_list_from_single): Removed. (address_list_from_ipv4_addresses): Renamed from address_list_from_vector. 2003-10-31 Hrvoje Niksic * sysdep.h (CLOSE): Don't call close on file descriptors less than 0, i.e. on uncreated sockets. * connect.c (resolve_bind_address): Work on struct sockaddr directly. (connect_to_host): Replacement for connect_to_many. Resolve HOST and connect to any of its addresses. If we can't connect and the host name lookup was cached, try to resolve it again. This should fix problems with hosts behind dynamic DNS. Updated all callers. (connect_to_ip): Replacement for connect_to_one. Removed SILENT; added the argument PRINT instead. Updated all callers. (set_connection_host_name): Removed. * host.c (address_list_address_at): New function instead of address_list_copy_one. It returns a pointer to ip_address *, so it's not necessary to copy the data. (address_list_cached_p): New function. (forget_host_lookup): Ditto. * connect.c: Got rid of the MSOCK global variable. Made bindport return the local socket it creates. Added a new argument to acceptport, the socket to call accept on. Updated callers. (closeport): Removed. * connect.c: Moved the sockaddr code from host.c to this file, because most of that stuff is used for connecting, and has nothing to do with host names anyway. (sockaddr_set_data, sockaddr_get_data): New functions, replace the old sockaddr_set_address, sockaddr_set_port, sockaddr_get_address, and sockaddr_get_port. 2003-10-30 Hrvoje Niksic * sysdep.h: Use `S >= 8' rather than `S == 8' when looking for large integers. 2003-10-30 Hrvoje Niksic * url.c (append_uri_pathel): New argument ESCAPED_P that says whether [B, E) is to be treated as URL-escaped or not. If ESCAPED_P is false, don't unescape the region. (url_file_name): u->file is not URL-escaped. 2003-10-30 Hrvoje Niksic * retr.c (retrieve_from_file): Use retrieve_tree for page-requisites. * main.c (main): Don't define opt.recursive when -p is used. Instead, make sure that recursion is used for HTTP in that case. 2003-10-29 Hrvoje Niksic * host.h: Defined accessors for elements of ip_address. Updated all callers. (address_list_match_all): Use memcmp in the non-IPv6 case. * wget.h (CONNECT_ERROR): Don't retry connecting if connect() returned EAFNOSUPPORT. 2003-10-27 Mauro Tortonesi * connect.h: changed bindport prototype and added the related BIND_ON_IPV4_ONLY and BIND_ON_IPV6_ONLY flags. * connect.c: changed bindport and resolve_bind_address to allow protocol-version specific DNS resolution. modified conaddr, acceptport and connect_to_one to make use of struct sockaddr_storage and of the new ip_address structure. * ftp-basic.c: added LPRT/LPSV (RFC1639) support, refactored PORT/PASV (RFC959) and EPRT/EPSV (RFC2428) support code. * ftp.c: added the ftp_do_port and ftp_do_pasv functions to handle FTP over IPv6. * ftp.h: changed prototype of ftp_epsv and added prototypes for ftp_lpsv, ftp_lprt and ftp_eprt. * host.c: renamed the wget_sockaddr_set_address and wget_sockaddr_get_addr, and wget_sockaddr_{s,g}et_port couples to sockaddr_{s,g}et_address and sockaddr_{g,s}et_port respectively. changed address_list_match_all, address_list_from_addrinfo sockaddr_len, pretty_print_address, lookup_host, sockaddr_{s,g}et_address and sockaddr_{g,s}et_port to make use of struct sockaddr_storage and of the new ip_address structure. removed map_ipv4_to_ip and map_ip_to_ipv4. * host.h: redefined structure ip_address and removed structure wget_sockaddr. 2003-10-26 Hrvoje Niksic * sysdep.h: Include inttypes.h where available. * host.c: Switch from u_int32_t to uint32_t. 2003-10-26 Hrvoje Niksic * netrc.c (parse_netrc): Reset the QUOTE flag after the closing quote. 2003-10-25 Hrvoje Niksic * url.c (is_valid_ipv6_address): Reformat to GNU coding style. Use enums for NS_IN* constants. Use ISXDIGIT. * convert.c (construct_relative): Document better how the function works. 2003-10-23 Hrvoje Niksic * config.h.in: Deploy preprocessor magic to avoid Ultrix's include which defines its own u_int32_t. Reported by Bernhard Simon. 2003-10-23 Hrvoje Niksic * version.c: Bump version. 2003-10-23 Hrvoje Niksic * url.c: Ditto. * html-parse.c (advance_declaration): Don't use trailing comma in enum because older compilers don't support it. * utils.c: Don't redefine HAVE_SIGSETJMP. 2003-10-16 Hrvoje Niksic * convert.c (construct_relative): Don't handle absolute files specially -- for example, -P/tmp/foo shouldn't imply that converted files must refer to "/tmp/foo/..."! 2003-10-15 Hrvoje Niksic * http.c: Consider status 307 a valid redirect. 2003-10-15 Philip Stadermann * ftp.c (ftp_retrieve_glob): Correctly loop through the list whose elements might have been deleted. 2003-10-13 Hrvoje Niksic * html-url.c (tag_handle_meta): Set the Refresh link to expect HTML. (append_one_url): Renamed to append_url. 2003-10-13 Hrvoje Niksic * sysdep.h: Only define u_int32_t. 2003-10-11 Hrvoje Niksic * utils.c (large_int_to_string): Use snprintf() to print the number. This will work even on systems where libc doesn't understand %lld, but the compiler does, because it will use our snprintf replacement. * init.c (parse_bytes_helper): New function. (cmd_bytes): Use it to parse bytes, but cast the result to long. (cmd_bytes_large): Ditto, but store the result to LARGE_INT. Used for --quota so that --quota=10G works even on machines without long long. * options.h (struct options): Declare quota as LARGE_INT. * retr.c (downloaded_exceeds_quota): Removed. (downloaded_increase): Ditto. (total_downloaded_bytes): New variable, replaces opt.downloaded, which was the wrong place for it anyway. Updated callers of downloaded_exceeds_quota and downloaded_increase to check this variable directly. * sysdep.h: Get rid of VERY_LONG_TYPE. Use LARGE_INT for the same purpose, defined as `long', `long long' or `double', depending on size of long and whether long long is available. 2003-10-11 Hrvoje Niksic * sysdep.h: Also check size of short for int32_t. 2003-10-11 Hrvoje Niksic * host.c (lookup_host): Use u_int32_t to store the result of inet_addr(). That removes the need for offset fiddling, caring about endian-ness, etc. * sysdep.h: Define int32_t and u_int32_t if not available. 2003-10-11 Hrvoje Niksic * ftp-basic.c (ftp_epsv): Use socklen_t * as the third argument to getpeername. * config.h.in: Define socklen_t stub. * host.c (sockaddr_len): Return socklen_t. * connect.c (conaddr): Use socklen_t as the third argument to accept, getsockname, and connect. 2003-10-10 Hrvoje Niksic * recur.c (retrieve_tree): Don't descend into documents that are not expected to contain HTML, regardless of their content-type. * html-url.c (tag_url_attributes): Record which attributes are supposed to yield HTML links that can be followed. (tag_find_urls): Propagate that information to the caller through struct urlpos. 2003-10-10 Hrvoje Niksic * hash.c (find_mapping): Return the next available mapping when the key is not found, not NULL. (hash_table_put): Use find_mapping to find the storage for the new data. (hash_table_put): Grow the table before exceeding maximum fullness, not afterwards. 2003-10-10 Hrvoje Niksic * hash.c (hash_table_new): Slightly change the meaning of the first parameter. Instead of being the minimum initial size, it is now the minimum number of items that the hash table can take without needing to resize. 2003-10-09 Hrvoje Niksic * html-url.c (init_interesting): Initialize interesting_tags and interesting_attributes as hash tables. This simplifies the code immensely because hash tables handle allocation and remove duplicates automatically. (find_tag): Removed. (collect_tags_mapper): Instead of calling find_tag, simply get the entry from interesting_tags hash table, which is both simpler and faster. 2003-10-09 Hrvoje Niksic * hash.c (hash_table_get): Declare hash-table argument as const. (find_mapping): Ditto. (hash_table_get_pair): Ditto. (hash_table_contains): Ditto. (hash_table_count): Ditto. 2003-10-08 Hrvoje Niksic * html-url.c (get_urls_html): Parse the appropriate flags to html-parse.c. * html-parse.c (map_html_tags): Accept FLAGS from the caller instead of examining OPT. 2003-10-08 Hrvoje Niksic * html-url.c (find_tag): Switch to binary search. 2003-10-08 Hrvoje Niksic * main.c (print_help): Fix typo; stured -> stored. 2003-10-08 Hrvoje Niksic * getopt.c: Add definitions of getopt_long and getopt_long_only. 2003-10-08 Hrvoje Niksic * config.h.in: Renamed DEBUG to ENABLE_DEBUG. ENABLE_DEBUG is, I think, a better name, because it implies that debugging output is merely possible, not "on by default", as might be construed from just DEBUG. 2003-10-08 Hrvoje Niksic * ftp.c (has_insecure_name_p): Define it here. * utils.c (has_wildcards_p): Define it here. * sysdep.h: Declare fnmatch-related macros here, if not using system fnmatch(). Update .c files to not declare fnmatch.h directly. * cmpt.c (fnmatch): Moved here. Use it only under non-GNU libc. 2003-10-08 Hrvoje Niksic * getopt.c: Newer version, imported from Free libit. 2003-10-07 Hrvoje Niksic * cookies.c (struct cookie): Remove unused backpointer to cookie jar. 2003-10-07 Hrvoje Niksic * cmpt.c (memmove): Comment out, since it's no longer used. * cookies.c (cookie_jar_generate_cookie_header): Allocate room for chains in one pass. (find_chains_of_host): Assume that the caller has allocated DEST to be sufficiently large to take all the data. (eliminate_dups): Run through the array and eliminate dups on the fly instead of using memmove. (cookie_jar_process_set_cookie): Free cookie->domain before re-setting it. 2003-10-05 Gisle Vanem * mswindows.c (set_sleep_mode): Fix type of _SetThreadExecutionState. 2003-10-05 Hrvoje Niksic * utils.c (file_size): Return -1 if fopen() returns NULL. Prior to this patch, wget --post-file=nosuchfile dumped core. 2003-10-04 Gisle Vanem * mswindows.c (run_with_timeout): Use WaitForSingleObject to wait for thread termination. 2003-10-04 Hrvoje Niksic * log.c: Use `...' in function definitions; ansi2knr will convert them to va_dcl. This allowed removal of the ugly VA_START_1 and VA_START_2 macros. 2003-10-03 Gisle Vanem * connect.c: And don't include them here. * mswindows.h: Include winsock headers here. 2003-10-03 Hrvoje Niksic * html-parse.c (convert_and_copy): Move variable declarations before statements. 2003-10-02 Gisle Vanem * mswindows.c (run_with_timeout): For Windows: Run the 'fun' in a thread via a helper function. Continually query the thread's exit-code until finished or timed out. 2003-10-02 Hrvoje Niksic * wget.h (XMALLOC_ARRAY): Removed. (ALLOCA_ARRAY): Ditto. * html-parse.c: Renamed alloca_p to resized. (GROW_ARRAY): Renamed DO_REALLOC_FROM_ALLOCA to GROW_ARRAY and returned it to html-parse.c, since nothing else was using it. 2003-10-02 Hrvoje Niksic * retr.c (retrieve_url): Initialize DUMMY storage for DT. Caught by valgrind. 2003-10-02 Hrvoje Niksic * html-parse.c (convert_and_copy): Handle numeric entities in hexadecimal, &#xHH. (convert_and_copy): Copy the contents directly to the pool without a stack-allocated intermediary. 2003-10-02 Hrvoje Niksic * utils.c (alarm_set): New function; use either setitimer or alarm to set up the alarm. (alarm_cancel): New function; cancel the alarm set up by alarm_set. (run_with_timeout): Use them. 2003-10-01 Hrvoje Niksic * url.c (url_parse): Don't leak memory when a reencoded URL turns out to be invalid. * url.c (parse_errors): Mark error messages for translation. (url_error): Translate error messages returned to the caller. 2003-10-01 Hrvoje Niksic * ftp.c (ftp_loop_internal): Initialize TMRATE to NULL to shut up the compiler. 2003-09-26 Gisle Vanem * src/mswindows.c: Added ws_percenttitle() showing progress in the window titlebar. Called from retr.c. Secured ws_mypath(). * windows/config.h.ms: alloca() prototype not needed. Removed "#undef ENABLE_NLS"; should be in Makefile IMHO. Moved WGET_USE_STDARG from mswindows.h to config.ms.h because of #ifdef in log.c. (MSVC's vararg.h and stdarg.h are incompatible). 2003-09-29 Aaron Hawley * ftp.c (getftp): --spider option should now work with FTP downloads. (ftp_loop_internal): quiet reports and calculations of downloads when --spider option set, nor try deleting when --delete-after also set. (ftp_loop): --spider will skip HTML-ification of .listing file. 2003-09-26 Gisle Vanem * mswindows.c (read_registry): Removed. (set_sleep_mode): New function. (windows_main_junk): Call it. 2003-09-26 Gisle Vanem * mswindows.c (read_registry): Fix invocation of registry functions. * mswindows.c (read_registry): Condition definitions of sleep and usleep with not HAVE_SLEEP and HAVE_USLEEP respectively. Define HAVE_SLEEP and HAVE_USLEEP under __DMC__. 2003-09-24 Hrvoje Niksic * url.c (url_escape_1): Revert unintentional change to lowercase xdigit escapes. (url_escape_dir): Document that this function depends on the output of url_escape_1. 2003-09-23 Hrvoje Niksic * progress.c (create_image): Print the current ETA if we're done with the download. (create_image): Change '-' display char to '+' in the progress bar. * Makefile.in (clean): Remove .libs. 2003-09-23 Hrvoje Niksic * cookies.c (struct cookie): New flag domain_exact. (update_cookie_field): Skip leading dot in domain. (find_matching_chains): Match numeric addresses exactly; don't needlessly copy HOST to the stack