]> sjero.net Git - wget/blob - src/ChangeLog
[svn] Made [0.5*wait, 1.5*wait) the range of --random-wait.
[wget] / src / ChangeLog
1 2006-02-05  Hrvoje Niksic  <hniksic@xemacs.org>
2
3         * retr.c (sleep_between_retrievals): Sleep at a minimum of 1/2 of
4         the specified wait period.
5
6 2006-02-03  Hrvoje Niksic  <hniksic@xemacs.org>
7
8         * utils.c (number_to_string): Don't use sprintf for printing
9         WGINT_MIN; simply divide n by 10 and defer printing the last
10         digit.
11         (number_to_string): Removed the SPRINTF_WGINT macro.
12
13 2006-02-03  Mauro Tortonesi  <mauro@ferrara.linux.it>
14
15         * http.c: Fixed support for Content-Disposition header.
16
17         * test.c: Added test_parse_content_disposition to the list of unit
18         tests to run.
19
20 2006-02-02  Hrvoje Niksic  <hniksic@xemacs.org>
21
22         * hash.c: Don't define countof if it's already defined.
23
24         * hash.c: Obtain the definition of uintptr_t when standalone.
25
26 2006-01-30  Mauro Tortonesi  <mauro@ferrara.linux.it>
27
28         * http.c: Changed output format. Removed excessively verbose debugging
29         output.
30
31 2005-12-07  Mauro Tortonesi  <mauro@ferrara.linux.it>
32
33         * http.c: Fixed pre-download verbose output which was broken by 
34         HTTP code refactoring.
35
36 2005-11-23  Mauro Tortonesi  <mauro@ferrara.linux.it>
37
38         * http.c: Refactored HTTP code.  If -O is not used, the new code
39         delays the choice of the file name where the downloaded resource
40         will be saved until the HTTP headers have been retrieved.
41         Added support for Content-Disposition header. 
42
43 2005-11-19  Hrvoje Niksic  <hniksic@xemacs.org>
44
45         * hash.c (INVALID_PTR): Use uintptr_t instead of unsigned long.
46         (hash_pointer): Don't assume a pointer fits in `unsigned long'.
47
48 2005-11-02  Mauro Tortonesi  <mauro@ferrara.linux.it>
49
50         * Makefile.in: Removed support for unit testing (now it is in
51         tests/Makefile.in).
52
53 2005-10-27  Mauro Tortonesi  <mauro@ferrara.linux.it>
54
55         * Makefile.in: Added basic support for unit testing.
56
57         * test.c: Ditto.
58         
59         * test.h: Ditto.
60         
61 2005-10-13  Daniel Stenberg  <daniel@haxx.se>
62
63         * http-ntlm.c (ntlm_output): Fixed buffer overflow vulnerability.
64
65 2005-10-09  Russ Allbery  <rra@stanford.edu>
66
67         * snprintf.c: Remove round to round_int and pow10 to pow10_int, to
68         avoid warnings from GCC 4.0.
69
70 2005-10-05  Mauro Tortonesi  <mauro@ferrara.linux.it>
71
72         * retr.c: Changed semantics of no_proxy_match.
73
74 2005-09-17  Hrvoje Niksic  <hniksic@xemacs.org>
75
76         * main.c (main): Don't print the summary if nothing has been downloaded.
77
78 2005-09-17  Hrvoje Niksic  <hniksic@xemacs.org>
79
80         * retr.c (retr_rate): Rename parameter from MSECS to SECS since it
81         no longer holds milliseconds.
82
83 2005-09-01  Hrvoje Niksic  <hniksic@xemacs.org>
84
85         * progress.c: Introduce symbolic constants for "magic" values of
86         0.2 and 0.9, REFRESH_INTERVAL and ETA_REFRESH_INTERVAL.
87
88 2005-08-27  Hrvoje Niksic  <hniksic@xemacs.org>
89
90         * cmpt.c (strtoll): Correctly handle strtoll("0x", ptr, 0) and
91         strtoll("0x<nonhexchar>", ptr, 0) -- in both cases *ptr must be
92         set to the position of 'x', not after it.
93
94 2005-08-27  Hrvoje Niksic  <hniksic@xemacs.org>
95
96         * hash.c (hash_table_map): Rename to hash_table_for_each and
97         update callers.
98         Document the meaning of the callback's return value.
99         (hash_table_iterate): New function.
100         (hash_table_iter_next): Likewise.
101         Update most places that used hash_table_for_each to use the
102         iteration, which doesn't require a temporary function with
103         explicit state management.
104
105 2005-08-26  Albert Chin  <wget@mlists.thewrittenword.com>
106
107         * Makefile.in: Use @datadir@.  Define localedir as $(datadir)/locale.
108
109 2005-08-26  Jeremy Shapiro  <jnshapiro@gmail.com>
110
111         * openssl.c (ssl_init): Set SSL_MODE_AUTO_RETRY.
112
113 2005-08-23  Hrvoje Niksic  <hniksic@xemacs.org>
114
115         * host.c (address_list_from_ipv4_addresses): Use IP_INADDR_DATA.
116
117 2005-08-12  Hrvoje Niksic  <hniksic@xemacs.org>
118
119         * wget.h: Renamed strtoll_return to strtoll_type.
120
121 2005-08-11  Hrvoje Niksic  <hniksic@xemacs.org>
122
123         * progress.c (eta_to_human_short): Switch to days when printing
124         more than 48h rather than 100h.  (It's not immediately apparent
125         how many days there are in 83h.)
126
127 2005-08-11  Hrvoje Niksic  <hniksic@xemacs.org>
128
129         * cmpt.c (strtoll): Define it if missing on the system and if Wget
130         needs it.
131
132         * mswindows.c (str_to_int64): Move to cmpt.c and rename to strtoll.
133
134 2005-08-10  Hrvoje Niksic  <hniksic@xemacs.org>
135
136         * host.c (print_address): Always use inet_ntop when IPv6 is
137         enabled.
138
139         * host.h (ip_address): Simplify the data union.
140
141 2005-08-09  Hrvoje Niksic  <hniksic@xemacs.org>
142
143         * mswindows.c (inet_ntop): Also handle IPv4 addresses for
144         completeness.
145
146 2005-08-09  Hrvoje Niksic  <hniksic@xemacs.org>
147
148         * http.c (gethttp): Don't read more than the amount of data
149         specified by the content-length header.
150
151 2005-08-09  Vasil Dimov  <vd@datamax.bg>
152
153         * ftp.c (getftp): Don't free RESPLINE if ftp_response returns a
154         status other than FTPOK.
155
156 2005-08-04  Giuseppe Bonacci  <g.bonacci@libero.it>
157
158         * ftp-ls.c (ftp_parse_unix_ls): Remember the position of the
159         previous token instead of backtracking back to it.
160
161 2005-07-08  Gisle Vanem  <giva@bgnett.no>
162
163         * mswindows.h: Include process.h to get getpid() declaration.
164
165 2005-07-08  Hrvoje Niksic  <hniksic@xemacs.org>
166
167         * utils.c (aprintf): Use vasprintf where available.
168
169 2005-07-08  Hrvoje Niksic  <hniksic@xemacs.org>
170
171         * url.c (rewrite_shorthand_url): Simplify code using aprintf and
172         strspn.
173
174 2005-07-07  Hrvoje Niksic  <hniksic@xemacs.org>
175
176         * gnutls.c (ssl_check_certificate): Check for the validity of the
177         presented X509 certificate.
178
179 2005-07-07  Hrvoje Niksic  <hniksic@xemacs.org>
180
181         * openssl.c (ssl_check_certificate): Print custom error messages
182         for frequent X509 certificate problems.
183
184 2005-07-07  Hrvoje Niksic  <hniksic@xemacs.org>
185
186         * mswindows.h: Define an alias for stat and fstat, as requested by
187         config-compiler.h.
188         (gai_strerror): Define to windows_strerror if NEED_GAI_STRERROR is
189         defined.
190
191 2005-07-06  Hrvoje Niksic  <hniksic@xemacs.org>
192
193         * mswindows.h: Use strtoll where available.
194
195 2005-07-06  Hrvoje Niksic  <hniksic@xemacs.org>
196
197         * sysdep.h: Add a full declaration of fnmatch.h.
198
199 2005-07-06  Hrvoje Niksic  <hniksic@xemacs.org>
200
201         * utils.c: Unconditionally include <setjmp.h>.
202
203 2005-07-06  Hrvoje Niksic  <hniksic@xemacs.org>
204
205         * utils.c (fnmatch_nocase): New function.
206         (proclist): Use it instead of fnmatch when opt.ignore_case is
207         requested.
208         (in_acclist): Respect opt.ignore_case.
209         (frontcmp): Respect opt.ignore_case.
210
211         * options.h (struct options): New flag opt.ignore_case.
212
213 2005-07-06  Hrvoje Niksic  <hniksic@xemacs.org>
214
215         * ptimer.c: Measure time in seconds rather than milliseconds.
216         Adjusted all callers.
217
218 2005-07-06  Hrvoje Niksic  <hniksic@xemacs.org>
219
220         * http.c (gethttp): When freeing MESSAGE, take into account that
221         it can be NULL.
222
223 2005-07-05  Hrvoje Niksic  <hniksic@xemacs.org>
224
225         * cmpt.c (timegm): Handle years after 2099.
226
227 2005-07-05  Hrvoje Niksic  <hniksic@xemacs.org>
228
229         * cmpt.c (timegm): Remove unused variable.
230
231 2005-07-05  Hrvoje Niksic  <hniksic@xemacs.org>
232
233         * cmpt.c (timegm): Don't call mktime; simply count the seconds
234         between 1970-01-01 and the specified date.
235
236 2005-07-05  Hrvoje Niksic  <hniksic@xemacs.org>
237
238         * wget.h (or): Define HAVE_SSL when either HAVE_OPENSSL or
239         HAVE_GNUTLS are defined.
240
241         * gnutls.c: New file.
242
243 2005-07-05  Hrvoje Niksic  <hniksic@xemacs.org>
244
245         * http.c (gethttp): Don't print the request write error message
246         twice.
247
248 2005-07-04  Hrvoje Niksic  <hniksic@xemacs.org>
249
250         * openssl.c (openssl_errstr): Instead of always using a large
251         static buffer, only allocate the error string when there is an
252         actual error.
253
254 2005-07-04  Hrvoje Niksic  <hniksic@xemacs.org>
255
256         * xmalloc.c (debugging_free): Prefix hex pointer value with "0x"
257         when printing.
258
259 2005-07-04  Hrvoje Niksic  <hniksic@xemacs.org>
260
261         * utils.c (NEXT_BASE64_CHAR): Rename to NEXT_CHAR and simplify to
262         get the next non-whitespace character.
263
264 2005-07-04  Hrvoje Niksic  <hniksic@xemacs.org>
265
266         * utils.c (base64_decode): Don't silently tolerate non-base64
267         non-white-space characters in the base64 stream.
268
269 2005-07-04  Hrvoje Niksic  <hniksic@xemacs.org>
270
271         * connect.c (LAZY_RETRIEVE_INFO): Make last_tick unsigned to match
272         transport_map_modified_tick.
273
274 2005-07-04  Hrvoje Niksic  <hniksic@xemacs.org>
275
276         * config-post.h (alloca): Updated declaration to not enumerate all
277         Windows compilers.
278
279 2005-07-04  Hrvoje Niksic  <hniksic@xemacs.org>
280
281         * openssl.c (openssl_errstr): Separate error messages with "; ".
282
283 2005-07-03  Hrvoje Niksic  <hniksic@xemacs.org>
284
285         * ftp.c (getftp): Ditto.
286
287         * http.c (gethttp): Use fd_errstr.
288
289         * connect.c (fd_register_transport): Restructure parameters to
290         include only a single structure that describes transport
291         implementation.
292
293         * openssl.c (openssl_errstr): New function: dump SSL error strings
294         into a static buffer and return a pointer to the buffer.
295
296         * connect.c (fd_errstr): New function; returns transport-specific
297         error message, or strerror(errno) if transport doesn't supply one.
298
299 2005-07-03  Hrvoje Niksic  <hniksic@xemacs.org>
300
301         * mswindows.h: Also wrap accept() and listen().
302
303 2005-07-03  Hrvoje Niksic  <hniksic@xemacs.org>
304
305         * url.c (path_end): Skip separators appropriate for the scheme.
306         (strpbrk_or_eos): Remove gcc-specific version, as the optimization
307         it tried to perform no longer applies.
308
309 2005-07-02  Hrvoje Niksic  <hniksic@xemacs.org>
310
311         * host.c: Don't include "connect.h" now that we no longer have
312         socket_has_inet6.
313
314 2005-07-02  Hrvoje Niksic  <hniksic@xemacs.org>
315
316         * host.c: Remove extraneous definition of netdb.h.
317
318 2005-07-02  Hrvoje Niksic  <hniksic@xemacs.org>
319
320         * http.c (gethttp): Skip error message body in the keep-alive
321         case.
322
323 2005-07-02  Hrvoje Niksic  <hniksic@xemacs.org>
324
325         * url.c (url_parse): Would crash when parsing fragments.  Support
326         fragments for FTP URLs too.
327
328 2005-07-02  Hrvoje Niksic  <hniksic@xemacs.org>
329
330         * version.c: Don't use "cvs" in version name, since we're not
331         using CVS anymore.
332
333 2005-07-02  Hrvoje Niksic  <hniksic@xemacs.org>
334
335         * progress.c (create_image): Ditto.
336
337         * retr.c (retr_rate): Display smaller rate numbers with greater
338         precision.
339
340 2005-07-02  Hrvoje Niksic  <hniksic@xemacs.org>
341
342         * http.c (response_head_terminator): Minor optimization.
343
344         * retr.c (fd_read_hunk): Call terminator with pointer to the start
345         of the data and the pointer to the current data.  Changed all
346         callers.
347
348 2005-07-01  Hrvoje Niksic  <hniksic@xemacs.org>
349
350         * url.c (url_parse): Make sure u->params is not initialized for
351         http/https URLs.
352         (url_parse): Don't crash on garbage following []-delimited IPv6
353         addresses.
354
355 2005-07-01  Hrvoje Niksic  <hniksic@xemacs.org>
356
357         * main.c (print_help): Don't refer to the non-existent -nr in
358         description of --mirror.
359
360 2005-06-30  Hrvoje Niksic  <hniksic@xemacs.org>
361
362         * host.c (pretty_print_address): Renamed to just print_address.
363         Clarify documentation.
364
365 2005-06-30  Hrvoje Niksic  <hniksic@xemacs.org>
366
367         * http.c (gethttp): Explicitly document the different cases when
368         generating the Host header.
369
370 2005-06-30  Hrvoje Niksic  <hniksic@xemacs.org>
371
372         * host.c (pretty_print_address): Handle error result from
373         inet_ntop.
374
375 2005-06-30  Gisle Vanem  <giva@bgnett.no>
376
377         * mswindows.c (inet_ntop): New function.  Print IPv6 addresses
378         using WSAAddressToString.
379
380 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
381
382         * progress.c (dot_update): Remove unused variable row_qty.
383
384 2005-06-29  Hrvoje Niksic  <hniksic@xemacs.org>
385
386         * main.c: Check for both SIGHUP and SIGUSR1 before using them.
387
388 2005-06-29  Hrvoje Niksic  <hniksic@xemacs.org>
389
390         * utils.c: Unconditionally include locale.h.
391
392 2005-06-29  Hrvoje Niksic  <hniksic@xemacs.org>
393
394         * ptimer.c: Include sys/time.h to get struct timeval.
395
396 2005-06-29  Hrvoje Niksic  <hniksic@xemacs.org>
397
398         * wget.h: Remove obsolete definition of with_thousand_seps_sum.
399
400 2005-06-29  Hrvoje Niksic  <hniksic@xemacs.org>
401
402         * gnu-md5.h: Unconditionally include limits.h.
403
404 2005-06-29  Hrvoje Niksic  <hniksic@xemacs.org>
405
406         * utils.c (random_number): Use lrand48 if available.
407         (random_float): Use drand48 if available.
408
409 2005-06-29  Hrvoje Niksic  <hniksic@xemacs.org>
410
411         * main.c (secs_to_human_time): Use print_decimal when printing
412         total download time in seconds.
413
414         * progress.c (print_row_stats): Use it to print total download
415         time at the end of the download.
416         (create_image): Ditto.
417
418         * utils.c (print_decimal): New function; print small decimal
419         numbers with more precision than large ones.
420
421         * progress.c (print_row_stats): New function.  Print ETA after the
422         download rate at the end of each row.
423
424 2005-06-28  Hrvoje Niksic  <hniksic@xemacs.org>
425
426         * init.c (parse_line): Check for alphanumerics.
427
428 2005-06-28  Hrvoje Niksic  <hniksic@xemacs.org>
429
430         * (dot_create): Remove unnecessary casts.
431
432 2005-06-28  Hrvoje Niksic  <hniksic@xemacs.org>
433
434         * ftp.c (getftp): Delete trailing newlines from LIST output so
435         lines don't come out with trailing \015\012 with -S.
436
437 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
438
439         * mswindows.h: Remove superfluous includes.
440
441 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
442
443         * config-post.h (alloca): Amend alloca declaration to take care of
444         all Win32 compilers, not just MSVC and MinGW.
445
446 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
447
448         * utils.c (get_grouping_data): Force separator to "." rather than
449         " " when "," is taken.
450
451 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
452
453         * wget.h (PTR_FORMAT): Cast the result of sizeof to int before
454         passing it to printf's %*.
455
456         * retr.h: Declare output_stream and output_stream_regular.
457
458         * ftp.h: Declare ftp_last_respline.
459
460         * convert.h: Declare dl_url_file_map.
461
462         * http.h: New file.
463
464 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
465
466         * cookies.c: Make cookies_now static.
467
468 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
469
470         * utils.c (human_readable): Remove intermediary cast to long; MSVC
471         has problems casting *unsigned* __int64 to double.
472
473 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
474
475         * sysdep.h: Use the system-provided fnmatch by default.
476
477 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
478
479         * http.c (mktime_from_utc): Renamed to timegm and moved to cmpt.c.
480         Don't compile it if GNU timegm is available.
481         (http_atotm): Use timegm.
482
483 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
484
485         * http.c (http_atotm): Correctly query the old locale value.
486
487 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
488
489         * config-post.h (alloca): Don't #define alloca under MinGW32,
490         which defines it in malloc.h, included from mswindows.h.
491
492 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
493
494         * utils.c (get_grouping_data): Force the use of separators in C
495         locale.
496
497 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
498
499         * main.c (i18n_initialize): Set all locale categories.
500
501         * http.c (http_atotm): Temporarily set locale to "C".
502
503 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
504
505         * http.c (gethttp): Improve "POST data file missing" error
506         message.
507
508 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
509
510         * progress.c (set_progress_implementation): Type COLON as const
511         char *.
512
513 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
514
515         * utils.c (with_thousand_seps): Handle negative numbers.
516
517 2005-06-26  Hrvoje Niksic  <hniksic@xemacs.org>
518
519         * progress.c (create_image): Mark the "eta" string for translation.
520
521 2005-06-26  Hrvoje Niksic  <hniksic@xemacs.org>
522
523         * html-url.c (get_urls_file): Don't explicitly set entry->next to
524         NULL since entry is already zeroed out.
525
526 2005-06-26  Gisle Vanem  <giva@bgnett.no>
527
528         * mswindows.h: Define gai_strerror under MinGW.
529
530 2005-06-26  Hrvoje Niksic  <hniksic@xemacs.org>
531
532         * utils.c (with_thousand_seps): Correctly implement thousand seps
533         consisting of more than one character.
534
535 2005-06-26  Hrvoje Niksic  <hniksic@xemacs.org>
536
537         * main.c (secs_to_human_time): Ditto.
538
539         * progress.c (create_image): Print more exact duration of very
540         short downloads.
541
542         * main.c (secs_to_human_time): Don't translate time suffixes "h",
543         "m", and "s", which are not strictly SI, but are "accepted for use
544         with SI".
545         (secs_to_human_time): Print really small intervals as 0s, not
546         0.00s.
547
548 2005-06-26  Hrvoje Niksic  <hniksic@xemacs.org>
549
550         * config-post.h: Replace the alloca declaration with the one from
551         the latest Autoconf manual.  This should remove a warning with GCC
552         on AIX.
553
554 2005-06-26  Hrvoje Niksic  <hniksic@xemacs.org>
555
556         * ftp.c (getftp): Always invoke SIZE, not only when continuing a
557         download.
558
559         * main.c (main): Ditto here.
560
561         * progress.c (create_image): When the download is finished, print
562         how long it took.
563
564 2005-06-26  Hrvoje Niksic  <hniksic@xemacs.org>
565
566         * main.c (main): Print the downloaded and quota amounts with the
567         "human_readable" function.
568
569         * ftp.c (print_length): Ditto.
570
571         * http.c (gethttp): Don't display thousand separators.
572
573         * utils.c (with_thousand_seps): Rewritten to respect locale
574         settings and to be type size agnostic.
575
576 2005-06-25  Hrvoje Niksic  <hniksic@xemacs.org>
577
578         * utils.c (human_readable): Divide with 1024 instead of shifting
579         so the operation can work with non-integer N.
580
581 2005-06-25  Hrvoje Niksic  <hniksic@xemacs.org>
582
583         * progress.c (eta_to_human): New logic for more human-readable
584         ETA.
585
586 2005-06-25  Hrvoje Niksic  <hniksic@xemacs.org>
587
588         * utils.c (with_thousand_seps_sum): Decrease buffer size so it
589         cannot overrun add_thousand_seps's buffer.
590
591 2005-06-25  Hrvoje Niksic  <hniksic@xemacs.org>
592
593         * utils.c (SPRINTF_WGINT): The correct format is %I64d, not just
594         %I64.
595
596 2005-06-25  Hrvoje Niksic  <hniksic@xemacs.org>
597
598         * http.c (http_loop): Don't warn about wildcards in HTTP URLs if
599         globbing isn't requested in the first place.
600
601         * retr.c (retrieve_url): Temporarily turn off globbing when
602         processing HTTP->FTP redirects.
603
604 2005-06-25  Hrvoje Niksic  <hniksic@xemacs.org>
605
606         * utils.c (with_thousand_seps_sum): Now defined only if
607         SUM_SIZE_INT is double.
608
609         * wget.h (SUM_SIZE_INT): Instead of bothering with long, long
610         long, __int64, and friends, simply either use wgint or double, end
611         of story.  Since we know how to print either, we no longer need
612         LARGE_INT_FMT.
613
614         * sysdeps.h (LARGE_INT): Renamed to SUM_SIZE_INT to better reflect
615         its intent, and moved to wget.h.
616
617 2005-06-25  Hrvoje Niksic  <hniksic@xemacs.org>
618
619         * Makefile.in: No need to clean .libs.
620
621 2005-06-25  Hrvoje Niksic  <hniksic@xemacs.org>
622
623         * cookies.c (parse_set_cookies): Cast pointer subtraction to int
624         before using it with %d; AIX compiler warns on this.
625         Reported by Jens Schleusener.
626
627 2005-06-24  Hrvoje Niksic  <hniksic@xemacs.org>
628
629         * http.c (gethttp): Don't prepend / here.
630
631         * cookies.c (cookie_handle_set_cookie): Prepend / to PATH.
632         (cookie_header): Ditto.
633
634 2005-06-24  Hrvoje Niksic  <hniksic@xemacs.org>
635
636         * init.c: opt.verbose must be declared as int.
637
638 2005-06-23  Hrvoje Niksic  <hniksic@xemacs.org>
639
640         * cmpt.c (strpbrk): Removed.
641         (mktime): Removed.
642         Include <time.h>.
643
644 2005-06-23  Hrvoje Niksic  <hniksic@xemacs.org>
645
646         * utils.c (read_file): Ditto.
647
648         * main.c (main): Use struct_fstat.
649
650         * mswindows.h (struct_fstat): Define a struct_fstat to deal with
651         the fact that Borland 5.5 has 64-bit stat, but not 64-bit fstat!
652
653 2005-06-23  Hrvoje Niksic  <hniksic@xemacs.org>
654
655         * sysdep.h: Remove code that deals with Watcom.
656
657 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
658
659         * all: Use bool instead of int and false/true instead of 0/non-0
660         for boolean variables and values.
661
662 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
663
664         * sysdep.h: Include the stdbool.h/_Bool/bool blurb from Autoconf.
665
666 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
667
668         * init.c (cmd_lockable_boolean): Removed.
669
670 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
671
672         * cookies.c (struct cookie): Use 1-bit bitfields for booleans
673         which makes the structure takes less space at no cost in
674         complexity.
675
676 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
677
678         * Makefile.in ($(OBJ)): Add the config.h dependency.
679
680 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
681
682         * openssl.c, connect.c, host.c: Replace instances of #ifdef
683         ENABLE_DEBUG if (opt.debug) {...} #endif with IF_DEBUG {...}.
684
685         * main.c: Rename the IF_DEBUG defined here to WHEN_DEBUG.
686
687         * wget.h (IF_DEBUG): New macro.
688         (DEBUGP): Define in terms of IF_DEBUG.
689
690 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
691
692         * http.c (gethttp): Only handle --set-cookies (and assert that
693         cookie jar exists) if opt.cookies is true.  Failure to do so
694         triggered the assert when --no-cookies was used and the server
695         sent a Set-Cookie header.  Ouch!
696
697 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
698
699         * connect.c (select_fd): Expect select() to exist.
700
701         * utils.c (xsleep): Always use select() as sleep fallback on
702         non-Windows platforms.
703
704         * ptimer.c: Delete the implementation of PTIMER_TIME.
705
706         * main.c: Assume existence of signal(), test for different signal
707         names instead.
708
709         * cmpt.c: Better document reasons why certain functions are
710         included.
711
712 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
713
714         * Makefile.in: Remove the manually maintained dependency list;
715         make all object files depend on every header.
716
717 2005-06-20  Hrvoje Niksic  <hniksic@xemacs.org>
718
719         * hash.c: Rename "mapping" to "cell" to avoid confusion with the
720         term "mapping" (or "map") sometimes being used for the entire hash
721         table.  Also rename "non-empty" to "occupied" for easier reading
722         of if (!NON_EMPTY (...)) ... .
723
724 2005-06-20  Hrvoje Niksic  <hniksic@xemacs.org>
725
726         * main.c, ptimer.c, sysdep.h, utils.c: Use #elif to simplify reading of
727         chained if-else-else-else-... statements.
728
729 2005-06-20  Hrvoje Niksic  <hniksic@xemacs.org>
730
731         * all: Return type of signal handlers is `void'.  Include signal.h
732         unconditionally.
733
734         * all: Don't explicitly cast values returned by malloc.  We no
735         longer support ancient compilers that don't declare malloc, and we
736         never supported C++ builds.
737
738 2005-06-19  Hrvoje Niksic  <hniksic@xemacs.org>
739
740         * all: Don't declare errno.  Include both time.h and sys/time.h,
741         as long as sys/time.h exists.  Don't dereference function pointers
742         when invoking the functions they point to.
743
744         * cmpt.c (memmove): Remove function mandated by C89.
745         (strerror): Ditto.
746         (strstr): Ditto.
747
748         * all: Undo the K&R-ization changes from 2005-05-03.
749
750         * all: Remove support for K&R compilers: use C89 function
751         declarations, remove definition of PARAMS, remove support for
752         varargs, and remove ansi2knr.  Assume the presence of time.h,
753         string.h, and other headers mandated by C89.
754
755 2005-06-19  Hrvoje Niksic  <hniksic@xemacs.org>
756
757         * init.c (cmd_lockable_boolean): Don't recognize literal "2" and
758         "-1" values; unlike 0 and 1, those should never be exposed to the
759         user.  Update the error message to be more self-consistent, as
760         proposed by Benno Schulenberg.
761
762 2005-06-18  Hrvoje Niksic  <hniksic@xemacs.org>
763
764         * http.c (gethttp): Don't free "head" before using it to save
765         headers.
766
767 2005-06-18  Hrvoje Niksic  <hniksic@xemacs.org>
768
769         * http.c (gethttp): When -E is in use, check for file existence
770         after appending ".html" to the name and modify the file name if
771         necessary.
772
773 2005-06-17  Hrvoje Niksic  <hniksic@xemacs.org>
774
775         * connect.c (socket_has_inet6): Removed.
776
777         * host.c (lookup_host): Don't use the AI_ADDRCONFIG getaddrinfo
778         hint.
779
780 2005-06-16  Hrvoje Niksic  <hniksic@xemacs.org>
781
782         * init.c (cmd_lockable_boolean): Improve the error message so it
783         lists the more useful values first.
784
785 2005-06-15  Hrvoje Niksic  <hniksic@xemacs.org>
786
787         * http.c (gethttp): Also report the system error when the POST
788         data file is missing.
789
790 2005-06-15  Benno Schulenberg  <benno@nietvergeten.nl>
791
792         * ftp.c, http.c, connect.c, cookies.c, html-url.c, init.c, res.c:
793         Gettext-ize messages that were previously missed.
794
795 2005-06-15  Hrvoje Niksic  <hniksic@xemacs.org>
796
797         * host.h (ip_address): Remove the trailing comma from the type
798         enum in the no-IPv6 case.
799
800         * main.c (struct cmdline_option): Remove the trailing comma from
801         the enum.
802
803         Reported by Jens Schleusener.
804
805 2005-05-30  Hrvoje Niksic  <hniksic@xemacs.org>
806
807         * url.c (strpbrk_or_eos): Check for a recent GCC version before
808         using the statement-as-expression extension.
809
810 2005-05-30  Hrvoje Niksic  <hniksic@xemacs.org>
811
812         * http.c (gethttp): Don't attempt to "skip short body" if we're
813         issuing a HEAD request (in which case the response head is not
814         followed by a body).
815
816 2005-05-30  Hrvoje Niksic  <hniksic@xemacs.org>
817
818         * init.c (cmd_spec_header): Don't split the string along the
819         commas using cmd_vector; just append the new value using
820         vec_append instead.
821
822         * utils.c (vec_append): New function.
823
824 2005-05-27  Andreas Beckmann  <debian@abeckmann.de>
825
826         * html-url.c (tag_handle_link): Mark the content from the <link
827         src="..."> tag as expecting HTML.
828
829 2005-05-24  Hrvoje Niksic  <hniksic@xemacs.org>
830
831         * http.c (http_atotm): Document the origin of the "cookie date"
832         format.
833
834 2005-05-21  Hrvoje Niksic  <hniksic@xemacs.org>
835
836         * init.c (setval_internal): Report exact command name alongside
837         the "display name".
838
839 2005-05-18  Hrvoje Niksic  <hniksic@xemacs.org>
840
841         * cookies.c (update_cookie_field): Explicitly cast -1 to time_t to
842         cope with systems where time_t is unsigned.
843
844         * cookies.c: Remove unnecessary casts to time_t from values
845         already of that type.
846
847 2005-05-17  Hrvoje Niksic  <hniksic@xemacs.org>
848
849         * ftp.c (ftp_loop_internal): Same here.
850
851         * http.c (http_loop): Don't clobber the file when -c is specified
852         and the first attempt to retrieve the file fails.
853
854 2005-05-16  Hrvoje Niksic  <hniksic@xemacs.org>
855
856         * openssl.c (ssl_check_certificate): Print all issues with a
857         certificate.
858
859 2005-05-16  Hrvoje Niksic  <hniksic@xemacs.org>
860
861         * ftp-basic.c: Don't xfree() the line returned by ftp_response if
862         the returned code is not FTPOK.
863
864 2005-05-16  Hrvoje Niksic  <hniksic@xemacs.org>
865
866         * init.c (cleanup): Don't free the non-existent opt.ftp_acc.  Free
867         the SSL-related stuff.
868
869 2005-05-16  Hrvoje Niksic  <hniksic@xemacs.org>
870
871         * ftp.c (print_length): Consistently print \n at end of the
872         "Length" line.
873
874 2005-05-14  Hrvoje Niksic  <hniksic@xemacs.org>
875
876         * openssl.c (ssl_connect): Announce the beginning and the end of
877         the SSL handshake when in debug mode.
878
879         * wget.h (PTR_FORMAT): New macro for easier printing of pointer
880         values.  Use %0*lx along with PTR_FORMAT instead of %p.
881
882 2005-05-14  Hrvoje Niksic  <hniksic@xemacs.org>
883
884         * http.c (gethttp): Would forget to close the connection when
885         keep_alive was not used.
886
887 2005-05-13  Hrvoje Niksic  <hniksic@xemacs.org>
888
889         * openssl.c (pattern_match): Document the code that decides
890         whether "*" matches ".".
891
892 2005-05-12  Hrvoje Niksic  <hniksic@xemacs.org>
893
894         * ftp-ls.c (ftp_index): Use %d to print the port number, which is
895         now int.
896         From Steven M. Schweda's VMS patches.
897
898 2005-05-12  Hrvoje Niksic  <hniksic@xemacs.org>
899
900         * url.c (rewrite_shorthand_url): Don't rewrite "https://host" to
901         "ftp://https//host" when SSL is not used.
902
903 2005-05-11  Hrvoje Niksic  <hniksic@xemacs.org>
904
905         * openssl.c (ssl_check_server_identity): Renamed to
906         ssl_check_certificate because it does more than just checking the
907         server's identity.
908         (ssl_check_certificate): Tell the user about
909         --no-check-certificate.
910
911 2005-05-11  Hrvoje Niksic  <hniksic@xemacs.org>
912
913         * openssl.c (ssl_init): Always use SSL_VERIFY_NONE, so that the
914         handshake finishes even if the certificate is invalid.  That way
915         ssl_check_server_identity can provide better diagnostics on why
916         the verification failed.
917
918 2005-05-11  Hrvoje Niksic  <hniksic@xemacs.org>
919
920         * openssl.c (pattern_match): New function.
921         (ssl_check_server_identity): Treat peer certificate common name as
922         wildcard.
923
924 2005-05-10  Hrvoje Niksic  <hniksic@xemacs.org>
925
926         * openssl.c (ssl_check_server_identity): Print certificate subject
927         and issuer.
928
929 2005-05-10  Hrvoje Niksic  <hniksic@xemacs.org>
930
931         * res.c (res_register_specs): Correctly pass pointers to
932         hash_table_get_pair.
933
934 2005-05-10  Hrvoje Niksic  <hniksic@xemacs.org>
935
936         * http.c (gethttp): Call ssl_check_server_identity.
937
938         * openssl.c (ssl_check_server_identity): New function, verifies
939         that the host name in the certificate matches the actual host
940         name.
941         (verify_cert_callback): Removed, since it didn't do anything
942         except returning the preverify_ok argument.
943
944         * connect.c (fd_transport_context): Allow retrieval of the context
945         pointer registered with fd_register_transport.
946
947 2005-05-09  Hrvoje Niksic  <hniksic@xemacs.org>
948
949         * openssl.c (verify_cert_callback): Renamed from verify_callback.
950         Always return the received "ok" value.  Print the X509 name in
951         debug mode.
952         (ssl_init): Enable partial writes in SSL context.
953
954 2005-05-08  Hrvoje Niksic  <hniksic@xemacs.org>
955
956         * http.c (http_loop): Check for wildcards in the URL path
957         component, not in the whole URL.
958
959         * ftp.c (ftp_loop): Check for wildcards in URL path before
960         unescaping, so the users can escape globbing metacharacters with %
961         escapes.
962
963 2005-05-08  Hrvoje Niksic  <hniksic@xemacs.org>
964
965         * init.c (run_command): Correctly interpret the return value of
966         parse_line.
967         (commands): Re-alphabetize.
968
969 2005-05-08  Hrvoje Niksic  <hniksic@xemacs.org>
970
971         * netrc.c (parse_netrc): Explicitly check for assignment != NULL
972         to silence warning from Borland C.
973
974         * url.c (sync_path): Don't unnecessarily increment p.
975         (url_parse): Don't unnecessarily set url_encode to NULL just
976         prior to return from the function.
977
978 2005-05-08  Hrvoje Niksic  <hniksic@xemacs.org>
979
980         * log.c (escnonprint_internal): Place variable declarations
981         before other statements.
982
983 2005-05-08  Hrvoje Niksic  <hniksic@xemacs.org>
984
985         * html-url.c: Include recur.h.
986
987         * http.c (request_new): Define as accepting no args.
988
989 2005-05-07  Hrvoje Niksic  <hniksic@xemacs.org>
990
991         * url.c (strpbrk_or_eos): Made inline.  Use strchr(s, '\0') for
992         finding the NUL char position.
993
994 2005-05-07  Hrvoje Niksic  <hniksic@xemacs.org>
995
996         * url.c (decide_copy_method): Renamed to char_needs_escaping.
997         Since it now returns only two possible values, change it to return
998         boolean (int).
999
1000 2005-05-07  Hrvoje Niksic  <hniksic@xemacs.org>
1001
1002         * ftp-basic.c (ftp_request): Prevent newlines in VALUE causing
1003         inadvertent sending of multiple FTP commands.
1004
1005 2005-05-07  Hrvoje Niksic  <hniksic@xemacs.org>
1006
1007         * url.c (decide_copy_method): Never cause reencode_escapes to
1008         decode % escapes; it is too intrusive and breaks some servers.
1009
1010 2005-05-07  Hrvoje Niksic  <hniksic@xemacs.org>
1011
1012         * http.c (gethttp): When tunnelling SSL traffic over proxy with
1013         CONNECT, we're really talking to the remote server directly.
1014         Because of this, the request-line argument must be the URL path
1015         rather than the whole URL, as it would be when using regular
1016         proxies.
1017         Reported by Charles Lane.
1018
1019 2005-05-06  Hrvoje Niksic  <hniksic@xemacs.org>
1020
1021         * init.c (cmd_spec_useragent): Allow empty User-Agent.
1022
1023         * http.c (gethttp): Don't print "unknown authentication scheme"
1024         for failed Basic authentication.
1025         (SET_USER_AGENT): Don't set user-agent if opt.useragent is empty.
1026         (gethttp): Use alloca for allocation of www_authenticate.
1027
1028 2005-05-06  Hrvoje Niksic  <hniksic@xemacs.org>
1029
1030         * main.c (print_help): Fix wording of --secure-protocol help text.
1031
1032 2005-05-06  Hrvoje Niksic  <hniksic@xemacs.org>
1033
1034         * cmpt.c (strstr): Updated from glibc 2.3.5.
1035
1036 2005-05-05  Hrvoje Niksic  <hniksic@xemacs.org>
1037
1038         * http.c (http_atotm): Zero out the whole struct tm being passed
1039         to strptime.
1040
1041 2005-05-05  Hrvoje Niksic  <hniksic@xemacs.org>
1042
1043         * main.c (main): Propagate option name to setoptval.
1044
1045         * init.c (setoptval): Accept another argument, OPTNAME.  Propagate
1046         that argument as the option name independently of the actual
1047         command, determined by command_by_name(com).
1048
1049 2005-05-05  Hrvoje Niksic  <hniksic@xemacs.org>
1050
1051         * init.c (parse_line): Make the return value indicate whether
1052         there was a syntax error or a setter failed.
1053         (run_wgetrc): Return an indication on whether an error has been
1054         encountered.
1055         (initialize): Abort if there have been errors running either
1056         .wgetrc file.
1057
1058 2005-05-05  Hrvoje Niksic  <hniksic@xemacs.org>
1059
1060         * log.c (copy_and_escape): Slightly reduce code repetition between
1061         the two loops.
1062
1063 2005-05-05  Charles C.Fu  <ccwf@bacchus.com>
1064
1065         * utils.c (proclist): Strip leading slash when calling fnmatch
1066         too, otherwise wildcard comparisons always fail.
1067
1068 2005-05-05  Hrvoje Niksic  <hniksic@xemacs.org>
1069
1070         * utils.c (touch): Set access time to current time.
1071
1072 2005-05-05  Hrvoje Niksic  <hniksic@xemacs.org>
1073
1074         * url.c (url_unescape): Don't unescape %00, it effectively
1075         truncates the string.
1076
1077 2005-05-05  Hrvoje Niksic  <hniksic@xemacs.org>
1078
1079         * log.c (copy_and_escape): Replace the FOR_URI argument with a
1080         slightly more general mechanism for specifying different kinds of
1081         escape.
1082
1083 2005-05-05  Hrvoje Niksic  <hniksic@xemacs.org>
1084
1085         * ftp-basic.c (ftp_response): Fix printing FTP server response.
1086
1087 2005-05-05  Hrvoje Niksic  <hniksic@xemacs.org>
1088
1089         * retr.c (limit_bandwidth_reset): Reset sleep_adjust.
1090         (limit_bandwidth): Don't allow huge "adjustment" values that
1091         result from being suspended for a while.
1092
1093 2005-05-04  Hrvoje Niksic  <hniksic@xemacs.org>
1094
1095         * wget.h: If gettext was found but libtintl.h wasn't, declare
1096         gettext's return type to avoid type mismatches.
1097
1098 2005-05-03  Hrvoje Niksic  <hniksic@xemacs.org>
1099
1100         * url.c (url_parse): Rename label `error' to avoid conflict with
1101         identifier.
1102
1103         * retr.c (fd_read_body): Rename label `out' to avoid conflict with
1104         identifier.
1105         (fd_read_hunk): Use explicit double constant.
1106         (retrieve_from_file): Don't use string concatenation.
1107         (sleep_between_retrievals): Make sure xsleep is called with a
1108         `double' argument.
1109         (no_proxy_match): Define as static, like it is declared.
1110
1111         * progress.c (bar_create): Use 0.0 instead of 0 because K&R
1112         compilers can't automatically promote it.
1113
1114         * http-ntlm.c (ntlm_output): Replace \xHH sequences with \OOO for
1115         the sake of old compilers.
1116
1117         * ftp.c (ftp_loop_internal): Don't use string concatenation.
1118
1119         * http.c (request_send): Use explicit double constants when
1120         calling fd_read and fd_write.
1121         (post_file): Ditto.
1122         (gethttp): Ditto.
1123         (skip_short_body): Ditto.
1124
1125         * ftp-basic.c: When calling fd_write, specify the last argument as
1126         a `double' constant for the sake of K&R compilers which don't see
1127         the prototype and therefore can't promote it to double
1128         automatically.
1129
1130         * cookies.c (cookie_jar_load): Rename abort label to abort_cookie
1131         to avoid name conflict in K&R compilers.
1132
1133 2005-04-29  Hrvoje Niksic  <hniksic@xemacs.org>
1134
1135         * ptimer.c (posix_init): Since we allow _POSIX_MONOTONIC_CLOCK==0,
1136         it is not enough to check for _POSIX_MONOTONIC_CLOCK-0, we must
1137         also check for defined(_POSIX_MONOTONIC_CLOCK).
1138
1139 2005-04-28  Hrvoje Niksic  <hniksic@xemacs.org>
1140
1141         * ftp.c, hash.c, connect.c, host.c, http.c: Remove unreached code,
1142         such as "break" following return or abort.
1143
1144 2005-04-28  Hrvoje Niksic  <hniksic@xemacs.org>
1145
1146         * init.c (commands): Wrap the use of opt.random_file in #ifdef
1147         HAVE_SSL.
1148
1149 2005-04-28  Hrvoje Niksic  <hniksic@xemacs.org>
1150
1151         * http.c (gethttp): Correctly set the user agent.
1152
1153 2005-04-27  Hrvoje Niksic  <hniksic@xemacs.org>
1154
1155         * init.c (cmd_spec_useragent): Free the old value of
1156         opt.useragent before setting the new one.
1157
1158 2005-04-27  Mauro Tortonesi  <mauro@ferrara.linux.it>
1159
1160         * main.c: Map --ftp-password, --http-password and --proxy-password to
1161         the new ftppassword, httppassword and proxypassword commands
1162         respectively.  Document the --user and --password options in the help
1163         string.
1164         
1165 2005-04-27  Mauro Tortonesi  <mauro@ferrara.linux.it>
1166
1167         * ftp.c: Add support for --user and --password.
1168         
1169         * http.c: Add support for --user and --password.
1170         
1171         * init.c: Deprecated ftppasswd, httppasswd, login, passwd and
1172         proxypasswd commands.  Added ftppassword, ftpuser, httppassword,
1173         password, proxypassword and user commands.
1174
1175         * main.c: Renamed --ftp-passwd to --ftp-password.  Added --ftp-user,
1176         --http-password, --password, --proxy-password and --user.  Deprecated
1177         --http-passwd and --proxy-passwd.  Added documentation for new options
1178         and removed documentation for deprecated options in the help string.
1179         
1180         * options.h (struct options): Added user and passwd members to handle
1181         --user and --password respectively.  Renamed ftp_acc and ftp_pass
1182         members to ftp_user and ftp_passwd for consistency.
1183
1184 2005-04-27  Hrvoje Niksic  <hniksic@xemacs.org>
1185
1186         * main.c (print_help): Advertise "DER", not "ASN1".
1187
1188 2005-04-27  Hrvoje Niksic  <hniksic@xemacs.org>
1189
1190         * openssl.c (init_prng): Disable the weak random seed by default.
1191
1192         * http.c (gethttp): Simplify SSL initialization; disable SSL when
1193         anything goes wrong with the initialization.
1194
1195         * options.h (struct options): New option opt.random_file.
1196
1197 2005-04-27  Hrvoje Niksic  <hniksic@xemacs.org>
1198
1199         * init.c: Wrap private key commands in IF_SSL.
1200
1201 2005-04-27  Hrvoje Niksic  <hniksic@xemacs.org>
1202
1203         * openssl.c (ssl_init): Ditto.
1204
1205         * options.h (struct options): Allow separate specification of key
1206         type and certificate type.
1207
1208         * init.c (cmd_spec_cert_type): Provide a "der" synonym for "asn1"
1209         certificate encoding.
1210
1211 2005-04-26  Hrvoje Niksic  <hniksic@xemacs.org>
1212
1213         * openssl.c: Renamed "gen_sslfunc.c" to "openssl.c" and
1214         "gen_sslfunc.h" to "openssl.h".  This reflects the intent of
1215         openssl.c encapsulating the OpenSSL-specific code.
1216
1217 2005-04-26  Hrvoje Niksic  <hniksic@xemacs.org>
1218
1219         * init.c: Renamed "closure" (a synonym for context in some
1220         cultures) to "place", which more accurately reflects the usage.
1221
1222 2005-04-26  Hrvoje Niksic  <hniksic@xemacs.org>
1223
1224         * gen_sslfunc.c (ssl_init): Use default locations for loading the
1225         certificate bundles.
1226         (ssl_init_prng): Disable the cryptographically weak PRNG
1227         initialization fallback.
1228
1229         * init.c: Renamed SSL command-line arguments and wgetrc commands.
1230         (defaults): Check the server certificate by default.
1231
1232 2005-04-26  Hrvoje Niksic  <hniksic@xemacs.org>
1233
1234         * cookies.c (cookie_handle_set_cookie): Delete the part of the
1235         path after the trailing slash.
1236
1237         * http.c (gethttp): Call cookie_handle_set_cookie with path that
1238         begins with '/'.
1239
1240 2005-04-26  Hrvoje Niksic  <hniksic@xemacs.org>
1241
1242         * http.c (gethttp): Call skip_short_body only if keep_alive is in
1243         use.
1244         (gethttp): Send the User-Agent header with the CONNECT request as
1245         well.
1246
1247 2005-04-25  Hrvoje Niksic  <hniksic@xemacs.org>
1248
1249         * main.c (option_data): Removed support for the undocumented flag
1250         --use-proxy.
1251
1252 2005-04-25  Hrvoje Niksic  <hniksic@xemacs.org>
1253
1254         * main.c (option_data): Don't treat -Y as a boolean switch; treat
1255         it as a value switch instead, so "-Y off" continues to work.
1256
1257 2005-04-24  Hrvoje Niksic  <hniksic@xemacs.org>
1258
1259         * utils.c (aprintf): Delete unreachable statement.
1260
1261 2005-04-24  Hrvoje Niksic  <hniksic@xemacs.org>
1262
1263         * host.c (cmp_prefer_ipv4): New function.
1264         (cmp_prefer_ipv6): New function.
1265         (lookup_host): Use the appropriate comparator according to
1266         opt.prefer_family.
1267
1268         * init.c: New option prefer_family.
1269
1270         * host.c (is_valid_ipv6_address): Spell NS_* constants in lower
1271         case to avoid clash with system headers.
1272         (lookup_host): Reorder the addresses so that IPv4 ones come first.
1273
1274         * utils.c (stable_sort): New function.
1275
1276 2005-04-24  Hrvoje Niksic  <hniksic@xemacs.org>
1277
1278         * connect.c (retryable_socket_connect_error): Return 0 for
1279         ENETUNREACH and EHOSTUNREACH.
1280
1281 2005-04-23  Hrvoje Niksic  <hniksic@xemacs.org>
1282
1283         * cmpt.c: Reenable the memmove implementation for systems that
1284         lack it.
1285
1286         * http.c (gethttp): Store the "authorized" state of the persistent
1287         connection.
1288         (request_remove_header): New function.
1289         (gethttp): Don't send the "Basic" authentication if the connection
1290         is already authorized.
1291
1292 2005-04-23  Hrvoje Niksic  <hniksic@xemacs.org>
1293
1294         * utils.c (base64_encode): Treat input as unsigned chars.
1295         Required for correct encoding of binary stuff.
1296
1297 2005-04-23  Hrvoje Niksic  <hniksic@xemacs.org>
1298
1299         * http-ntlm.c: Format the function definitions in an
1300         ansi2knr-friendly fashion.
1301
1302 2005-04-22  Hrvoje Niksic  <hniksic@xemacs.org>
1303
1304         * http.c (gethttp): Handle multiple WWW-Authentication headers,
1305         only one of which is recognized.  Those are sent by IIS with NTLM
1306         authorization.
1307         (create_authorization_line): Propagate information whether
1308         authorization is finished.
1309         (gethttp): Only stop authorization when it's really finished, not
1310         after fixed two steps.
1311
1312 2005-04-21  Hrvoje Niksic  <hniksic@xemacs.org>
1313
1314         * gen_sslfunc.c (ssl_init): Fix warning message text; mark the
1315         message as translatable.
1316
1317 2005-04-21  Hrvoje Niksic  <hniksic@xemacs.org>
1318
1319         * main.c (print_help): Print the EGD option outside the cluster of
1320         SSL options.
1321
1322 2005-04-21  Hrvoje Niksic  <hniksic@xemacs.org>
1323
1324         * http-ntlm.c (ntlm_output): Fix setting the domain.
1325         Suggested by Sami Krank.
1326
1327 2005-04-20  Mauro Tortonesi  <mauro@ferrara.linux.it>
1328
1329         * connect.c: Set IPV6_V6ONLY socket option when -6 switch is used.
1330
1331 2005-04-20  FUJISHIMA Satsuki  <sf@FreeBSD.org>
1332
1333         * http.c (request_set_header): Fix the check whether a new header
1334         needs to be allocated.
1335
1336 2005-04-18  Hrvoje Niksic  <hniksic@xemacs.org>
1337
1338         * utils.c (base64_encode): Use the parameter order that makes more
1339         sense.  Return the length of the base64 written.  Updated all
1340         callers.
1341
1342 2005-04-17  Hrvoje Niksic  <hniksic@xemacs.org>
1343
1344         * http.c (request_set_header): Free NAME when VALUE is NULL and
1345         freeing the header name is requested.
1346
1347 2005-04-17  Hrvoje Niksic  <hniksic@xemacs.org>
1348
1349         * snprintf.c (fmtstr): Declare VALUE as const char *.
1350         Based on patch by Russ Allbery.
1351
1352 2005-04-17  Hrvoje Niksic  <hniksic@xemacs.org>
1353
1354         * snprintf.c (fmtfp): More correct handling of significant digit
1355         count with %g -- 0.002 has one significant digit, not three.
1356
1357 2005-04-16  Hrvoje Niksic  <hniksic@xemacs.org>
1358
1359         * retr.c (fd_read_body): Respect read timeout with non-interactive
1360         or no progress gauge -- treat ETIMEDOUT specially only when
1361         progress_interactive.
1362         Reported by FUJISHIMA Satsuki.
1363
1364 2005-04-16  FUJISHIMA Satsuki  <sf@FreeBSD.org>
1365
1366         * http.c (gethttp): Don't use HTTP/1.0 persistent connections over
1367         proxy.
1368
1369 2005-04-16  Hrvoje Niksic  <hniksic@xemacs.org>
1370
1371         * snprintf.c: Use the PARAMS macro to handle prototypes.  Write
1372         function definitions in the ansi2knr-friendly way.
1373         (fmtstr): If string precision is specified, don't read VALUE past
1374         it.
1375         (dopr): Actually print %g and %e formats.
1376         (fmtfp): Fix a bug that caused 0.01 to be printed as 0.1.
1377         (fmtfp): Use LLONG in floating point conversions to be able to
1378         convert more digits.
1379         (fmtfp): Interpret precision as number of significant digits with
1380         %g.
1381         (fmtfp): Omit trailing decimal zeros with %g.
1382
1383         * snprintf.c: Don't include <ctype.h> because none of it is used.
1384         Include strings.h/string.h, as per Autoconf.
1385
1386 2005-04-15  Hrvoje Niksic  <hniksic@xemacs.org>
1387
1388         * ptimer.c: Use _POSIX_TIMERS - 0 > 0, which handles the case when
1389         _POSIX_TIMERS is defined but empty, as well as the case when it is
1390         undefined.  Do the same with the check for _POSIX_MONOTONIC_CLOCK.
1391         Suggested by Larry Jones.
1392
1393 2005-04-15  Hrvoje Niksic  <hniksic@xemacs.org>
1394
1395         * ptimer.c: Check that _POSIX_TIMERS is defined as well as > 0.
1396         Problem reported by Steven M. Schweda.
1397
1398 2005-04-14  Hrvoje Niksic  <hniksic@xemacs.org>
1399
1400         * http.c (skip_short_body): Print the skipped body data in debug
1401         mode.
1402         (skip_short_body): Don't skip more than 4k of body data.
1403         (skip_short_body): Return whether the skipping was successful.
1404         (gethttp): If skip_short_body failed, invalidate the connection.
1405
1406 2005-04-12  Gisle Vanem  <giva@bgnett.no>
1407
1408         * ftp.c (getftp): Ditto.
1409
1410         * http.c (gethttp): Open the output file in binary mode.
1411
1412 2005-04-11  Hrvoje Niksic  <hniksic@xemacs.org>
1413
1414         * hash.c: Conditionalize including config.h on HAVE_CONFIG_H
1415         instead of on STANDALONE.
1416
1417 2005-04-11  Hrvoje Niksic  <hniksic@xemacs.org>
1418
1419         * gen_sslfunc.c (ssl_print_errors): Made static.
1420         (ssl_print_errors): Eliminate potentially dangerous fixed-size
1421         error buffer.  Passing NULL to ERR_error_string causes it to use
1422         its own static buffer, which is fine for our purposes.
1423
1424         * gen_sslfunc.c: Include gen_sslfunc.h.  Make the declarations of
1425         ssl_init and ssl_conect match the actual definitions.
1426         (ssl_connect): Simply return a boolean, the SSL context is no
1427         longer useful as a return value.
1428
1429         * retr.c: Don't include SSL headers; we don't need them.
1430
1431 2005-04-11  Hrvoje Niksic  <hniksic@xemacs.org>
1432
1433         * config-post.h: Don't define _VA_LIST under Solaris; it breaks
1434         compilation with GCC 3.4 under Solaris 10.  (It was defined to
1435         avoid a warning with previous versions of GCC.)
1436
1437 2005-04-11  Hrvoje Niksic  <hniksic@xemacs.org>
1438
1439         * xmalloc.c (register_ptr): Warn the user to increase SZ prior to
1440         aborting.
1441
1442 2005-04-11  Hrvoje Niksic  <hniksic@xemacs.org>
1443
1444         * convert.c (convert_cleanup): Free converted_files.
1445
1446 2005-04-10  Hrvoje Niksic  <hniksic@xemacs.org>
1447
1448         * wget.h (DEBUGP): Use __builtin_expect to give a hint to GCC that
1449         opt.debug is false in the vast majority of cases.
1450
1451 2005-04-10  Hrvoje Niksic  <hniksic@xemacs.org>
1452
1453         * config-post.h: Declare alloca as void *, not char *.
1454
1455 2005-04-09  Hrvoje Niksic  <hniksic@xemacs.org>
1456
1457         * recur.c (download_child_p): When -p is used, (temporarily)
1458         ignore accept/reject rules for HTMLs, even when they are at the
1459         maximum recursion depth.  That is because with -p we are, if
1460         necessary, overstepping the max. depth to get the requisites.
1461
1462 2004-06-12  Larry Jones <lawrence.jones@ugsplm.com>
1463
1464         * recur.c (download_child_p): Correct the logic in check number 6:
1465         test opt.reclevel (not DEPTH) against INFINITE_RECURSION.
1466
1467 2005-04-09  Hrvoje Niksic  <hniksic@xemacs.org>
1468
1469         * url.c: Use "static const" in preference to "const static".
1470         Sun's cc warns that "storage class after type is obsolescent".
1471
1472         * url.c (urlchr_table): Don't mark ~ as unsafe, too many broken
1473         web sites are confused when ~ is changed to %7E.  Their servers
1474         redirect /%7Efoo/ to /~foo/, which Wget again accesses using %7E,
1475         causing further redirections, therefore looping infinitely.  See
1476         Debian bug #301624 for an example.
1477
1478 2005-04-09  Hrvoje Niksic  <hniksic@xemacs.org>
1479
1480         * alloca.c: Include wget.h to be able to use xmalloc.  In addition
1481         to defining malloc to xmalloc, also define free to xfree.
1482
1483 2005-04-09  Hrvoje Niksic  <hniksic@xemacs.org>
1484
1485         * http-ntlm.c (ntlm_output): Use "char", not "unsigned char" for
1486         ntlmbuf.  Our base64 functions accept char anyway.
1487         (ntlm_output): Join up the format string, since we nominally
1488         support K&R compilers.
1489         (ntlm_output): Ditto.
1490
1491 2005-04-08  Hrvoje Niksic  <hniksic@xemacs.org>
1492
1493         * ptimer.c: Use Windows timers under Cygwin, whose POSIX timer
1494         implementation is incomplete.
1495
1496 2005-04-08  Hrvoje Niksic  <hniksic@xemacs.org>
1497
1498         * ptimer.c (struct ptimer): Remove the unused initialized field.
1499
1500         * ptimer.c: Renamed function parameters from WT (which used to
1501         stand for wget_timer or wtimer) to PT.
1502
1503 2005-04-08  Hrvoje Niksic  <hniksic@xemacs.org>
1504
1505         * ptimer.c (posix_init): Be smarter about choosing clocks.  In
1506         decreasing order of preference, use CLOCK_MONOTONIC,
1507         CLOCK_HIGHRES, and CLOCK_REALTIME.
1508         (ptimer_allocate): Removed.
1509
1510         * ptimer.c: Refactor the code by cleanly separating the
1511         architecture-dependent code from the architecture-independent
1512         code.
1513
1514 2005-04-08  Hrvoje Niksic  <hniksic@xemacs.org>
1515
1516         * ptimer.c (ptimer_init): Explicitly check that
1517         _POSIX_MONOTONIC_CLOCK is *both* defined and >=0.  (Undefined
1518         symbols are >=0.)
1519
1520 2005-04-08  Hrvoje Niksic  <hniksic@xemacs.org>
1521
1522         * ptimer.c (ptimer_diff): Fix typo affecting Windows build.
1523
1524 2005-04-08  Hrvoje Niksic  <hniksic@xemacs.org>
1525
1526         * ptimer.c (ptimer_init): In fact, _POSIX_MONOTONIC_CLOCK needs to
1527         be >= 0.
1528
1529         * ptimer.c (ptimer_init): Check whether _POSIX_MONOTONIC_CLOCK is
1530         defined instead of whether it's greater than 0.  glibc defines it
1531         to 0, but still makes it available via sysconf.
1532
1533 2005-04-08  Hrvoje Niksic  <hniksic@xemacs.org>
1534
1535         * mswindows.c (str_to_int64): Rename OVERFLOW and UNDERFLOW to
1536         INT64_OVERFLOW and INT64_UNDERFLOW, since those names are used.
1537
1538 2005-04-07  Hrvoje Niksic  <hniksic@xemacs.org>
1539
1540         * ptimer.c: New file.  Move the "wtimer" functions from utils.c to
1541         this file and rename them to ptimer_.
1542
1543 2005-04-07  Hrvoje Niksic  <hniksic@xemacs.org>
1544
1545         * host.c (NO_ADDRESS): Define NO_ADDRESS only after the system
1546         headers have been included.
1547
1548 2005-04-06  Hrvoje Niksic  <hniksic@xemacs.org>
1549
1550         * http.c (pconn): Include NTLM data, which is per-connection.
1551         (known_authentication_scheme_p): Recognize NTLM authorization.
1552         (create_authorization_line): Call ntlm_input and ntlm_output.
1553
1554         * http-ntlm.c: New file, donated by Daniel Stenberg and originally
1555         written for curl, heavily modified for Wget.
1556
1557         * utils.c (base64_encode): Relocated from http.c, since it is now
1558         used by http-ntlm.c, and will possibly be used elsewhere.
1559         (base64_decode): New function, originally based on code from GNU
1560         recode.
1561
1562 2005-04-02  Hrvoje Niksic  <hniksic@xemacs.org>
1563
1564         * ftp.c (ftp_loop): Ditto.
1565
1566         * ftp-basic.c (ftp_pasv): Use the xzero shorthand for memset(0).
1567         (ftp_lpsv): Ditto.
1568
1569 2005-04-05  Mauro Tortonesi  <mauro@ferrara.linux.it>
1570
1571         * Makefile.in: removed string_t.c from list of source files.
1572
1573 2005-04-04  Mauro Tortonesi  <mauro@ferrara.linux.it>
1574
1575         * string_t.c: Removed.
1576         
1577         * string_t.h: Removed.
1578
1579 2005-04-02  Hrvoje Niksic  <hniksic@xemacs.org>
1580
1581         * url.c (rewrite_shorthand_url): Only accept recognized schemes.
1582         That way "foo:80" will correctly be rewritten to "http://foo:80"
1583         instead of left unchanged and ultimately rejected because of
1584         "unsupported scheme foo".
1585
1586 2005-03-31  Hrvoje Niksic  <hniksic@xemacs.org>
1587
1588         * utils.c (number_to_string): Avoid explicit 64-bit constants;
1589         construct them by multiplication at compile-time.
1590
1591         * utils.c, elsewhere: Don't append "L" to 32-bit integer
1592         constants; we aren't really compilable on 16-bit systems anyway.
1593
1594         * hash.c (prime_size): Remove primes larger than 2^31, but include
1595         2^31-1, which is prime.
1596
1597 2005-03-30  Hrvoje Niksic  <hniksic@xemacs.org>
1598
1599         * utils.c (string_set_to_array): New function.
1600
1601         * convert.c: Replace the use of "slists" with sets/hash-tables,
1602         which in fact suit the intended purpose much better.
1603         downloaded_html_list is removed altogether.
1604
1605 2005-03-29  Hrvoje Niksic  <hniksic@xemacs.org>
1606
1607         * ftp.h (enum): Rename GLOBALL, GETALL, and GETONE to
1608         GLOB_GLOBALL, GLOB_GETALL, and GLOB_GETONE to avoid conflict with
1609         Linux headers.
1610
1611 2005-03-29  Hrvoje Niksic  <hniksic@xemacs.org>
1612
1613         * utils.c (numdigit): More correct handling of negative numbers.
1614
1615 2005-03-21  Hrvoje Niksic  <hniksic@xemacs.org>
1616
1617         * http.c (gethttp): Print the human-readable size.
1618
1619         * ftp.c (getftp): Print the human-readable size of the file to be
1620         downloaded.
1621
1622         * utils.c (human_readable): New function.
1623
1624         * utils.c: Renamed "legible" to "with_thousand_seps",
1625         "legible_large_int" to "with_thousand_seps_large", and "legible_1"
1626         to "add_thousand_seps".
1627
1628 2005-03-21  Hrvoje Niksic  <hniksic@xemacs.org>
1629
1630         * http.c (gethttp): Inhibit persistent connections when talking to
1631         proxies, as mandated by RFC 2068.
1632
1633 2005-03-20  Hrvoje Niksic  <hniksic@xemacs.org>
1634
1635         * url.c (unescape_single_char): New function.
1636         (url_escape_dir): Use it to unescape slashes in directory
1637         components.
1638         (url_string): Escape unsafe chars in host name, except for the ':'
1639         charaters, which can appear in IPv6 addresses.
1640
1641         * main.c (main): Don't access the cookie jar directly.
1642
1643         * log.c (escnonprint_internal): Correctly calculate the needed
1644         string size.  Don't forget the buffer's new size after having
1645         reallocated it.
1646         (log_cleanup): New function.  Free the escnonprint ring data.
1647
1648         * init.c (cleanup): Don't free the cookie jar explicitly, it is
1649         now done by http_cleanup.
1650         (cleanup): opt.user_headers is now a vector, free it with
1651         free_vec.
1652
1653         * http.c (gethttp): Make sure to free the request data, the status
1654         message, and the response data before returning from the function.
1655         (save_cookies): New function.
1656         (http_cleanup): Free the cookie jar here.
1657
1658         * hash.c: Renamed string_hash to hash_string and ptrhash to
1659         hash_pointer.  Exported hash_pointer.
1660
1661         * xmalloc.c: Organized malloc_table (previously malloc_debug) as a
1662         simple EQ hash table.  register_ptr and unregister_ptr are now of
1663         O(1) complexity.
1664
1665         * xmalloc.c: Renamed "*_debug" to debugging_* and "*_real" to
1666         checking_*.
1667
1668 2005-03-12  Hrvoje Niksic  <hniksic@xemacs.org>
1669
1670         * utils.c (debug_test_md5): Moved to gen-md5.c.
1671
1672         * mswindows.h: Don't declare inet_ntop, since we don't use it.
1673
1674         * mswindows.h: For consistency, also wrap closesocket, it being
1675         a Winsock call.
1676
1677         * mswindows.h: Don't declare sleep and usleep; we're defining
1678         xsleep now.
1679
1680         * mswindows.h (mkdir): Don't special-case Borland C, _mkdir
1681         works there as well.
1682
1683         * host.c: Don't include winsock header files; the correct ones
1684         are already included by mswindows.h.
1685
1686         * mswindows.c (xsleep): Round toward the nearest millisecond
1687         in an attempt to avoid average short sleeps.
1688
1689         * utils.c (wtimer_granularity): Report correct values for
1690         Windows timers and for high-resolution timers.
1691
1692         * utils.c (wtimer_initialize_once): New function, called to
1693         initialize the timer frequency.
1694
1695         * utils.c: Replace the use of GetSystemTime with high-resolution
1696         counters under Windows.  When high-resolution counters are
1697         unavailable, use GetTickCount().
1698
1699 2005-03-15  Hrvoje Niksic  <hniksic@xemacs.org>
1700
1701         * retr.c (fd_read_body): Undo the 2004-11-18 change.  Instead,
1702         always be "exact".
1703
1704 2005-03-17  Hrvoje Niksic  <hniksic@xemacs.org>
1705
1706         * ftp-basic.c (ftp_login): Don't free the string if ftp_response
1707         returned an error status because the line didn't get allocated in
1708         the first place.
1709
1710 2005-03-15  Hrvoje Niksic  <hniksic@xemacs.org>
1711
1712         * http.c (read_http_response_head): Limit the response size to 64k
1713         bytes.
1714
1715         * retr.c (fd_read_hunk): Accept a MAXSIZE argument that limits the
1716         number of bytes the function is allowed to allocate.
1717         (fd_read_line): Limit the line to 4096 bytes.
1718
1719 2005-03-12  Hrvoje Niksic  <hniksic@xemacs.org>
1720
1721         * wget.h: Include options.h after wgint has been defined.
1722
1723         * options.h (struct options): Declare options processed with
1724         cmd_bytes as wgint, not long.
1725
1726 2005-03-18  Hrvoje Niksic  <hniksic@xemacs.org>
1727
1728         * init.c (cmd_file): Use concat_strings.
1729
1730         * http.c (basic_authentication_encode): Use concat_strings.
1731
1732         * ftp-ls.c (ftp_index): Use concat_strings.
1733
1734         * ftp-basic.c (ftp_request): Use concat_strings.
1735
1736         * utils.c (concat_strings): New function.
1737
1738 2005-03-12  Hrvoje Niksic  <hniksic@xemacs.org>
1739
1740         * init.c (simple_atof): Handle negative numbers; skip whitespace
1741         before the number.
1742         (simple_atoi): Ditto.  Also, check for overflow and underflow.
1743         (cmd_number): Bail out on negative numbers.
1744         (parse_bytes_helper): Ditto.
1745
1746 2005-03-06  Hrvoje Niksic  <hniksic@xemacs.org>
1747
1748         * http.c (gethttp): Handle multiple Set-Cookie headers sent by
1749         remote server.
1750
1751 2005-03-06  Hrvoje Niksic  <hniksic@xemacs.org>
1752
1753         * init.c (defaults): Use passive FTP by default.
1754
1755 2005-03-06  Hrvoje Niksic  <hniksic@xemacs.org>
1756
1757         * mswindows.c: Provide wrappers to Winsock functions that set
1758         errno to WSAGetLastError() in case of failure.  Also provide a
1759         Windows-specific version of strerror.
1760
1761         * mswindows.h: Wrap calls to socket, bind, connect, recv, send,
1762         select, getsockname, getpeername, and setsockopt.
1763
1764 2005-03-06  Hrvoje Niksic  <hniksic@xemacs.org>
1765
1766         * url.c (url_parse): Reject port numbers larger than 65535.  We
1767         also check for overflow while parsing port numbers.
1768
1769 2005-03-06  Hrvoje Niksic  <hniksic@xemacs.org>
1770
1771         * utils.c (read_file): Don't use wgint for file size; LFS won't
1772         work since the file is mmap'ed as a whole.
1773
1774         * options.h: Don't include stdio.h.
1775
1776         * log.c: Ditto.
1777
1778         * init.c: Disambiguate assignment from non-zero test to avoid
1779         Borland C warning.
1780
1781         * http.c (response_new): Don't needlessly post-increment count.
1782
1783         * hash.c: Include stdio.h.
1784
1785         * gnu-md5.h: Don't include stdio.h.
1786
1787         * getopt.h (struct option): Always use const.
1788
1789         * ftp.c (getftp): Avoid unnecessary assignment to RES to avoid
1790         Borland C warning.
1791
1792         * ftp-ls.c: Disambiguate assignment from non-zero test to avoid
1793         Borland C warning.
1794
1795         * cmpt.c (strptime_internal): Don't initialize rp_backup when
1796         !_NL_CURRENT to avoid Borland C warning.
1797
1798 2005-03-06  Hrvoje Niksic  <hniksic@xemacs.org>
1799
1800         * utils.c (fopen_excl): Fix parse error when O_BINARY is
1801         available.
1802
1803 2005-03-05  Hrvoje Niksic  <hniksic@xemacs.org>
1804
1805         * url.c (url_file_name): Don't allow hosts named ".." to be
1806         appended as path elements.
1807
1808 2005-03-03  Hrvoje Niksic  <hniksic@xemacs.org>
1809
1810         * retr.c (retrieve_url): Escape location header.
1811
1812         * http.c (print_server_response_1): Escape server response when
1813         printing it.
1814         (gethttp): Escape host name, status message, location header, and
1815         content type.
1816         (http_loop): Escape error message from server.
1817
1818         * host.c (lookup_host): Escape host name when printing it.
1819
1820         * ftp.c (getftp): Escape user name when printing it.
1821         (getftp): Escape remote file and directory for printing.
1822         (getftp): Escape server listing when printing it.
1823         (ftp_retrieve_list): Escape link name and file name.
1824         (ftp_retrieve_glob): Escape file name.
1825
1826         * ftp-basic.c (ftp_response): Escape server response when printing
1827         it.
1828
1829         * cookies.c (parse_set_cookies): Escape the cookie field when
1830         printing it.
1831         (parse_set_cookies): Escape contents of remote header.
1832         (cookie_handle_set_cookie): Escape host name and cookie domain.
1833
1834         * connect.c (connect_to_ip): Escape the host name.
1835
1836         * log.c (escnonprint): New function, used for printing strings
1837         coming from the server that possibly contain non-ASCII characters.
1838         (escnonprint_uri): Ditto.
1839
1840 2005-02-24  Hrvoje Niksic  <hniksic@xemacs.org>
1841
1842         * ftp.c (getftp): Ditto.
1843
1844         * http.c (gethttp): When we're not supposed to overwrite files,
1845         use fopen_excl to open the file and recompute the file name.
1846
1847         * log.c (redirect_output): Use unique_create to avoid a race
1848         condition.
1849
1850         * mswindows.c (fake_fork_child): Use unique_create.
1851
1852         * utils.c (fopen_excl): New function that opens a stdio stream
1853         with the O_EXCL flag (where available).
1854         (unique_create): New function, like unique_name, but also creating
1855         the file and returning a file pointer.
1856         (fork_to_background): Use unique_create to create the file
1857         immediately to avoid race condition with multiple instances of
1858         wget -b.
1859
1860 2005-02-24  Hrvoje Niksic  <hniksic@xemacs.org>
1861
1862         * host.c (lookup_host): Test for AI_ADDRCONFIG directly, instead
1863         of checking for HAVE_GETADDRINFO_AI_ADDRCONFIG.
1864
1865 2005-02-23  Hrvoje Niksic  <hniksic@xemacs.org>
1866
1867         * host.c (is_valid_ipv6_address): Move here from url.c.
1868         (lookup_host): If the address is numeric, don't print the
1869         "resolving..." line, don't set up DNS timeouts, and set the
1870         AI_NUMERICHOST hint, where available.
1871
1872 2005-02-26  Gisle Vanem  <giva@bgnett.no>
1873
1874         * utils.c: Use the nnnLL syntax under GCC.  Define struct_stat to
1875         struct _stati64 under __MINGW32__ as well as under MS VC.
1876
1877 2005-02-26  Hrvoje Niksic  <hniksic@xemacs.org>
1878
1879         * utils.c: Use the nnnI64 syntax for __int64 constants under all
1880         Windows compilers.
1881         (SPRINTF_WGINT): Use "%I64" under all Windows compilers.
1882
1883         * mswindows.h (WGINT_MAX): Use the nnnI64 syntax for
1884         __int64 constants under all Windows compilers.
1885         (struct_stat): Use `struct stati64' under Borland C.
1886         (fstat): Don't redefine to _fstati64 under Borland.
1887
1888         * mswindows.c: Define str_to_int64 under Borland C as well as
1889         under (older) Visual C.
1890
1891 2005-02-25  Hrvoje Niksic  <hniksic@xemacs.org>
1892
1893         * ftp.c (getftp): Initialize err to suppress compiler warning.
1894
1895 2005-02-24  Hrvoje Niksic  <hniksic@xemacs.org>
1896
1897         * ftp.c (ftp_expected_bytes): Fix bug that caused infloop because
1898         of not correctly skipping the '(' character.
1899
1900 2005-02-24  Hrvoje Niksic  <hniksic@xemacs.org>
1901
1902         * mswindows.c (wget_ftello): Removed.
1903
1904         * mswindows.h: Remove bogus definition of stat.
1905         (wget_ftello): Remove the leftover ftello replacement.
1906
1907 2005-02-20  Hrvoje Niksic  <hniksic@xemacs.org>
1908
1909         * mswindows.c (wget_ftello): Wget's replacement for ftello.
1910
1911         * utils.c (file_size): Use ftello where available.
1912
1913         * ftp-ls.c (ftp_parse_unix_ls): Use str_to_wgint to parse the file
1914         size.
1915         (ftp_parse_winnt_ls): Ditto.
1916
1917         * ftp-basic.c (ftp_size): Use str_to_wgint to convert number to
1918         wgint; pass 10 instead of 0 as the BASE argument.
1919
1920         * ftp.c (ftp_expected_bytes): Use str_to_wgint to parse the file
1921         size.
1922
1923         * sysdep.h (LARGE_INT_FMT): Use __int64 as LARGE_INT on
1924         MSVC/Windows; print it with "%I64".
1925
1926         * wget.h: Define a `wgint' type, normally aliased to (the possibly
1927         64-bit variant of) off_t.
1928
1929         * all: Use `wgint' instead of `long' for numeric variables that
1930         can hold file sizes.
1931
1932         * utils.c (number_to_string): Support printing of `wgint'
1933         argument.
1934         (number_to_static_string): New function.
1935
1936         * all: Replace printf("%ld", long_value) with printf("%s",
1937         number_to_static_string(wgint_value)).
1938
1939 2005-02-18  Mauro Tortonesi <mauro@ferrara.linux.it>
1940
1941         * main.c: Added the --ftp-passwd command line option.
1942
1943         * init.c: Renamed command passwd to ftppasswd.
1944
1945 2005-02-11  Mauro Tortonesi <mauro@ferrara.linux.it>
1946         
1947         * string_t.c: Fixed a bug in do_escape and triggered escape of
1948         backslashes in string_escape to avoid ambiguities in the result
1949         string.
1950         
1951 2005-02-10  Mauro Tortonesi <mauro@ferrara.linux.it>
1952
1953         * string.h: Renamed to string_t.h to fix a compilation conflict 
1954         with the string.h header in the standard C library.
1955         
1956         * string.c: Renamed to string_t.c for consistency with string.h.
1957         
1958         * string_t.c: Ditto.
1959
1960         * string_t.h: Ditto.
1961         
1962 2004-12-31  Mauro Tortonesi <mauro@ferrara.linux.it>
1963
1964         * string.c: New file.
1965
1966         * string.h: New file.
1967
1968         * Makefile.in: Added string.c to the list of modules to compile.
1969
1970         * main.c: Updated copyright.
1971
1972 2004-11-18  Ulf Harnhammar <ulf.harnhammar.9485@student.uu.se>
1973
1974         * ftp-ls.c: Fixed a problem in ftp_parse_winnt_ls that could allow a
1975         malicious remote FTP server to crash wget.
1976
1977 2004-11-18  Hans-Andreas Engel <engel@node.ch>
1978
1979         * http.c: Enable --convert-links (-k) when a single page is downloaded
1980         via --output-document (-O).
1981
1982 2004-11-18  Mauro Tortonesi <mauro@deepspace6.net>
1983
1984         * connect.c: Minor correction to the comment in front of fd_peek.
1985
1986 2004-11-18  Leonid Petrov <nouser@lpetrov.net>
1987
1988         * retr.c: Fix a timeout problem in fd_read_body when using http_proxy.
1989
1990 2004-11-15  YAMAZAKI Makoto <Yamazaki.Makoto@fujixerox.co.jp>
1991
1992         * netrc.c: Fix termination by assertion bug in netrc parsing.
1993
1994 2004-05-09  David Fritz  <zeroxdf@att.net>
1995
1996         * mswindows.c (fake_fork): Pass entire command line to the child
1997         process.
1998
1999 2004-03-31  Hrvoje Niksic  <hniksic@xemacs.org>
2000
2001         * http.c (gethttp): Fix typo: SCHEME_SSL -> SCHEME_HTTPS.
2002
2003 2004-03-30  Hrvoje Niksic  <hniksic@xemacs.org>
2004
2005         * http.c (gethttp): Send the Proxy-Authorization header over
2006         non-SSL connections too.
2007
2008 2004-03-25  David Fritz  <zeroxdf@att.net>
2009
2010         * mswindows.c (fake_fork_child): Ignore error code when
2011         OpenFileMapping() fails; assume it failed because the object does
2012         not exist.
2013
2014 2004-03-24  David Fritz  <zeroxdf@att.net>
2015
2016         * mswindows.c (fake_fork): New function.
2017
2018         * mswindows.c (fork_to_background): Use it.
2019
2020 2004-03-19  David Fritz  <zeroxdf@att.net>
2021
2022         * mswindows.c (ws_hangup): Incorporate old fork_to_background()
2023         code.  Add event name argument.
2024         (fork_to_backgorund): Now a simple wrapper around ws_hangup().
2025         (ws_handler): Correctly handle the case when neither CTRLC_BACKGND
2026         nor CTRLBREAK_BACKGND are defined.  Don't bother handling close,
2027         logoff, or shutdown events.  Call ws_hangup() with the correct
2028         event name; don't assume it was CTRL+Break.
2029
2030 2004-03-19  Hrvoje Niksic  <hniksic@xemacs.org>
2031
2032         * url.c (url_parse): Decode %HH sequences in host name.
2033
2034 2004-03-04  Hrvoje Niksic  <hniksic@xemacs.org>
2035
2036         * convert.c (local_quote_string): Quote "#" as "%23" and "%" as
2037         "%25" when creating links to local files.
2038
2039 2004-03-02  David Fritz  <zeroxdf@att.net>
2040
2041         * mswindows.c (ws_percenttitle): Guard against future changes by
2042         doing nothing if the proper variables have not been initialized.
2043         Clamp percentage value.
2044
2045 2004-03-04  Gisle Vanem  <giva@bgnett.no>
2046
2047         * retr.c (fd_read_body): Don't change console title if quiet.
2048
2049 2004-02-25  David Fritz  <zeroxdf@att.net>
2050
2051         * mswindows.c (set_sleep_mode): Remove argument and return value.
2052         Call GetModuleHandle() instead of LoadLibrary()/FreeLibrary() for
2053         kernel32.dll.  Use typedef for function-pointer.  Don't cast
2054         l-value.  Don't use dereference operator when calling through
2055         function-pointer.
2056         (ws_startup): Update call to set_sleep_mode().
2057         (ws_cleanup): Remove call to set_sleep_mode().
2058
2059 2004-02-23  David Fritz  <zeroxdf@att.net>
2060
2061         * http.c (http_loop): Ditto.
2062
2063         * ftp.c (ftp_loop_internal): Update call to ws_changetitle().
2064
2065         * main.c (main): Don't bother calling ws_changetitle().
2066
2067         * mswindows.h (ws_changetitle): Update prototype.
2068
2069         * mswindows.c (ws_changetitle): Remove second argument.  Use
2070         xfree_null().
2071         (ws_percenttitle): Only update title when percentage has changed.
2072
2073 2004-02-23  David Fritz  <zeroxdf@att.net>
2074
2075         * mswindows.h: Ditto.
2076
2077         * mswindows.c: Misc. formatting/comment tweaks throughout.
2078
2079 2004-02-20  David Fritz  <zeroxdf@att.net>
2080
2081         * main.c (print_help): Remove call to ws_help().
2082
2083         * mswindows.c (ws_help): Remove.
2084
2085         * mswindows.h (ws_help): Remove.
2086
2087 2004-02-16  David Fritz  <zeroxdf@att.net>
2088
2089         * init.c (home_dir): Use aprintf() instead of xmalloc()/sprintf().
2090         Under Windows, if $HOME is not defined, use the directory that
2091         contains the Wget binary instead of hard-coded `C:\'.
2092         (wgetrc_file_name): Under Windows, look for $HOME/.wgetrc then, if
2093         not found, look for wget.ini in the directory of the Wget binary.
2094
2095         * mswindows.c (ws_mypath): Employ slightly more robust methodology.
2096         Strip trailing path separator.
2097
2098 2004-02-06  Hrvoje Niksic  <hniksic@xemacs.org>
2099
2100         * http.c (gethttp): Respect --ignore-length.
2101         (gethttp): Inhibit keep-alive if --ignore-length is specified.
2102
2103 2004-02-06  Hrvoje Niksic  <hniksic@xemacs.org>
2104
2105         * connect.c (sockaddr_set_data): Zero out
2106         sockaddr_in/sockaddr_in6.  Apparently BSD-derived stacks need this
2107         when binding a socket to local address.
2108
2109 2004-02-04  Hrvoje Niksic  <hniksic@xemacs.org>
2110
2111         * hash.c: Make the file compilable outside Wget source tree when
2112         -DSTANDALONE is used.
2113
2114 2004-01-29  Hrvoje Niksic  <hniksic@xemacs.org>
2115
2116         * utils.c (determine_screen_width): Return 0 if not running on
2117         Windows or on a TIOCGWINSZ-capable system.
2118
2119 2004-01-28  David Fritz  <zeroxdf@att.net>
2120
2121         * utils.c (determine_screen_width): Correctly determine console
2122         width under Windows.
2123
2124 2004-01-28  Christian Biere  <christianbiere@gmx.de>
2125
2126         * progress.c (bar_set_params): Fixed syntax error when HAVE_ISATTY
2127         was undefined.
2128
2129         * ftp.c (ftp_loop_internal): Allocate a larger buffer in case
2130         "try" gets translated to something large.  Ditto in http_loop in
2131         http.c.
2132
2133         * http.c (response_header_copy): Don't write to buf[BUFSIZE].
2134
2135         * ftp-opie.c (skey_response): Eliminate unnecessary string
2136         concatenation; just call gen_md5_update twice.
2137
2138 2004-01-25  Hrvoje Niksic  <hniksic@xemacs.org>
2139
2140         * utils.c (xsleep): Don't call usleep with values larger than
2141         1,000,000.
2142
2143 2003-12-16  Hrvoje Niksic  <hniksic@xemacs.org>
2144
2145         * http.c (gethttp): Fix generation of `Content-Length'.
2146
2147 2003-12-15  Gisle Vanem  <giva@bgnett.no>
2148
2149         * url.c (url_skip_credentials): Fixed return value; 'url' if no
2150         credentials.
2151
2152 2003-12-14  Hrvoje Niksic  <hniksic@xemacs.org>
2153
2154         * url.c (url_skip_credentials): Return a pointer directly.
2155
2156 2003-12-14  Hrvoje Niksic  <hniksic@xemacs.org>
2157
2158         * url.c (url_file_name): Ditto.
2159         (parse_errors): Ditto.
2160
2161         * retr.c (retr_rate): Ditto.
2162
2163         * progress.c (create_image): Ditto.
2164
2165         * netrc.c (parse_netrc): Ditto.
2166
2167         * main.c (struct cmdline_option): Ditto.
2168         (redirect_output_signal): Ditto.
2169
2170         * init.c (commands): Ditto.
2171
2172         * ftp-ls.c (ftp_index): Ditto.
2173
2174         * cookies.c (check_domain_match): Declare the pointer to a literal
2175         string as `const'.
2176
2177 2003-12-12  Hrvoje Niksic  <hniksic@xemacs.org>
2178
2179         * retr.c (fd_read_body): Pass total size to progress_create, not
2180         the remaining amount.
2181
2182 2003-12-12  Hrvoje Niksic  <hniksic@xemacs.org>
2183
2184         * retr.c (fd_read_body): Don't fiddle with "interactive timeout"
2185         if read timeout is unset.
2186
2187 2003-12-12  Hrvoje Niksic  <hniksic@xemacs.org>
2188
2189         * connect.c (bind_local): Don't set the IPV6_V6ONLY option on the
2190         socket.
2191
2192 2003-12-06  Hrvoje Niksic  <hniksic@xemacs.org>
2193
2194         * url.c (url_file_name): Respect the setting of
2195         opt.protocol_directories.
2196
2197         * main.c (main): Only check for ret=='?' when longindex is unset.
2198         (option_data): New option --protocol-directories.
2199
2200 2003-12-06  Hrvoje Niksic  <hniksic@xemacs.org>
2201
2202         * ftp.c (getftp): Ditto.
2203
2204         * http.c (gethttp): Correctly calculate bandwidth as total data
2205         read divided with download time.
2206
2207         * retr.c (fd_read_body): Separate the return values for data
2208         written and read.
2209
2210 2003-12-05  Hrvoje Niksic  <hniksic@xemacs.org>
2211
2212         * http.c (H_REDIRECTED): Respect the HTTP/1.1 "303 See Other"
2213         response code.
2214         Suggested by Dan Razzell.
2215
2216 2003-11-30  Hrvoje Niksic  <hniksic@xemacs.org>
2217
2218         * retr.c (fd_read_body): Report the amount of data *written* as
2219         amount_read.  This is not entirely logical, but that's what the
2220         callers expect, and it's not easy to change.
2221
2222         * ftp.c (ftp_loop_internal): Ditto.
2223
2224         * http.c (http_loop): Be smarter about assigning restval; if we're
2225         in the nth pass of a download, simply use the information we have
2226         about how much data has been retrieved as restval.
2227
2228         * ftp.c (getftp): Ditto for FTP "REST" command.
2229
2230         * http.c (gethttp): When the server doesn't respect range, skip
2231         the first RESTVAL bytes of the read body.  Never truncate the
2232         output file.
2233
2234         * retr.c (fd_read_body): Support skipping initial STARTPOS octets.
2235
2236 2003-11-30  Hrvoje Niksic  <hniksic@xemacs.org>
2237
2238         * http.c (skip_short_body): Renamed skip_body to skip_short_body;
2239         don't bother calling fd_read_body.
2240
2241 2003-11-30  Hrvoje Niksic  <hniksic@xemacs.org>
2242
2243         * retr.c (fd_read_body): Sanitize arguments and document them
2244         better.  Make sure the timer is created and updated only if
2245         necessary.  Updated callers.
2246
2247 2003-11-30  Hrvoje Niksic  <hniksic@xemacs.org>
2248
2249         * http.c (skip_body): New function.
2250         (gethttp): Use it to skip the body of the responses we don't care
2251         to download.  That allows us to reuse the connection.
2252         (gethttp): Trust that the HEAD requests will not generate body
2253         data.
2254
2255         * retr.c (fd_read_body): Don't write to OUT if it's NULL.
2256
2257 2003-11-29  Hrvoje Niksic  <hniksic@xemacs.org>
2258
2259         * http.c (gethttp): Initialize SSL only the first time when SSL
2260         URL is downloaded.
2261
2262 2003-11-29  Hrvoje Niksic  <hniksic@xemacs.org>
2263
2264         * cookies.c (cookie_header): Only generate the contents of the
2265         header, not the leading "Cookie: " or the trailing "\r\n".
2266
2267         * http.c (gethttp): When adding headers specified with `--header',
2268         allow them to override the headers generated by Wget.
2269
2270         * init.c (cmd_spec_header): Made opt.user_headers a vector.
2271
2272         * http.c (request_new): New function.  Returns a request structure
2273         which can be modified in various ways, most notably by adding HTTP
2274         headers to the request.
2275         (request_set_header): New function for adding the header to the
2276         request.  If the header is already available, it gets replaced.
2277         (request_send): Construct and send the request.
2278         (gethttp): Use the request_* functions to generate the request.
2279
2280 2003-11-28  Hrvoje Niksic  <hniksic@xemacs.org>
2281
2282         * http.c (gethttp): Don't include the Proxy-Authorization header
2283         in the request tunneled through proxy.
2284
2285 2003-11-28  Hrvoje Niksic  <hniksic@xemacs.org>
2286
2287         * http.c (gethttp): Use the CONNECT handle to establish SSL
2288         passthrough through non-SSL proxies.
2289
2290 2003-11-28  Hrvoje Niksic  <hniksic@xemacs.org>
2291
2292         * init.c: Don't #include netinet/Winsock stuff.
2293
2294 2003-11-28  Hrvoje Niksic  <hniksic@xemacs.org>
2295
2296         * http.c: Deleted the old functions header_process,
2297         header_extract_number, header_exists, header_strdup,
2298         http_process_range, http_process_none, http_process_type, and
2299         http_process_connection.
2300
2301         * http.c (response_new): New function.
2302         (response_header_bounds): Ditto.
2303         (response_header_copy): Ditto.
2304         (response_header_strdup): Ditto.
2305         (response_status): Ditto.
2306         (gethttp): Use the new response_* functions to parse the response.
2307         Support HTTP/0.9 responses.
2308
2309 2003-11-27  Hrvoje Niksic  <hniksic@xemacs.org>
2310
2311         * progress.c (create_image): Don't calculate ETA if nothing has
2312         been downloaded yet, because it causes division by zero.
2313
2314 2003-11-27  Hrvoje Niksic  <hniksic@xemacs.org>
2315
2316         * connect.c (bind_local): Rename sa_len to addrlen because IRIX
2317         headers define sa_len as a macro.
2318
2319 2003-11-26  Hrvoje Niksic  <hniksic@xemacs.org>
2320
2321         * html-parse.c (convert_and_copy): Remove embedded newlines when
2322         AP_TRIM_BLANKS is specified.
2323
2324 2003-11-26  Hrvoje Niksic  <hniksic@xemacs.org>
2325
2326         * ftp.c: Set con->csock to -1 where rbuf_uninitialize was
2327         previously used.
2328
2329 2003-11-26  Hrvoje Niksic  <hniksic@xemacs.org>
2330
2331         * Makefile.in (http$o): Added the trailing backslash that was
2332         missing.
2333
2334 2003-11-21  Hrvoje Niksic  <hniksic@xemacs.org>
2335
2336         * headers.c: Removed.  The file is no longer relevant, now that no
2337         special handling of headers is done by the rbuf code.  Moved
2338         portions to http.c.
2339
2340 2003-11-21  Hrvoje Niksic  <hniksic@xemacs.org>
2341
2342         * rbuf.c: Removed.
2343
2344         * ftp-basic.c (ftp_response): Use fd_read_line.  No longer use
2345         struct rbuf.  Updated all callers.
2346
2347         * http.c (gethttp): Use fd_read_head to read all the headers in
2348         one go.
2349         (next_header): New function.
2350
2351         * retr.c (fd_read_line): New function: reads a line from FD,
2352         leaving the rest of the data unread.
2353         (fd_read_head): New function.
2354
2355         * connect.c (fd_peek): New function, implements peeking.
2356         (poll_internal): New function.
2357         (fd_read): Use it.
2358         (fd_write): Ditto.
2359         (fd_peek): Ditto.
2360         (fd_register_transport): Allow registering a "peeker" callback.
2361
2362 2003-11-20  Hrvoje Niksic  <hniksic@xemacs.org>
2363
2364         * connect.c: Renamed xread/xwrite/xclose to
2365         fd_read/fd_write/fd_close.  The "x" prefix is not appropriate
2366         because the semantics have diverged from read/write/close too
2367         significantly.  Updated all callers.
2368
2369 2003-11-20  Hrvoje Niksic  <hniksic@xemacs.org>
2370
2371         * connect.c (sock_write): It's not necessary to initialize RES.
2372
2373 2003-11-19  Hrvoje Niksic  <hniksic@xemacs.org>
2374
2375         * main.c (main): Don't reference opt.ipv4_only and opt.ipv6_only
2376         if IPv6 is disabled.
2377
2378 2003-11-19  Hrvoje Niksic  <hniksic@xemacs.org>
2379
2380         * connect.c (socket_has_inet6): Only compile it if IPv6 is enabled
2381         and AI_ADDRCONFIG is missing.
2382
2383 2003-11-18  Hrvoje Niksic  <hniksic@xemacs.org>
2384
2385         * gen_sslfunc.c (ssl_init_prng): Warn the user when using a weak
2386         random seed.
2387
2388 2003-11-18  Hrvoje Niksic  <hniksic@xemacs.org>
2389
2390         * host.c (address_list_contains): Renamed address_list_find to
2391         address_list_contains because its result is boolean.
2392
2393 2003-11-18  Hrvoje Niksic  <hniksic@xemacs.org>
2394
2395         * connect.c (select_fd): Return 1 if select is not available.
2396
2397 2003-11-17  Hrvoje Niksic  <hniksic@xemacs.org>
2398
2399         * connect.c (connect_to_host): Don't reference address list after
2400         releasing it.
2401
2402 2003-11-17  Hrvoje Niksic  <hniksic@xemacs.org>
2403
2404         * main.c (print_help): Fix alignment of FTP options output.
2405
2406 2003-11-17  Hrvoje Niksic  <hniksic@xemacs.org>
2407
2408         * host.c (lookup_host): Check for the ability to create IPv6
2409         sockets here.
2410
2411         * init.c (defaults): Don't auto-set --inet4-only on IPv6-less
2412         systems.
2413
2414 2003-11-16  Hrvoje Niksic  <hniksic@xemacs.org>
2415
2416         * main.c (print_help): Fix typo in `-O' help message.  Fix docs of
2417         -Y/--proxy.  Fix docs of `--cookies' and `--glob'.  Improve docs
2418         of --convert-links.  Fix docs of SSL options.
2419
2420 2003-11-16  Hrvoje Niksic  <hniksic@xemacs.org>
2421
2422         * ftp-basic.c: Don't include <arpa/inet.h> and others because
2423         they're no longer needed.
2424
2425 2003-11-16  Hrvoje Niksic  <hniksic@xemacs.org>
2426
2427         * main.c (main): Don't allow setting of both opt.ipv4_only and
2428         opt.ipv6_only.
2429
2430         * init.c (defaults): Mark opt.ipv4_only specially when set
2431         automatically.
2432
2433 2003-11-15  Hrvoje Niksic  <hniksic@xemacs.org>
2434
2435         * host.c (lookup_host): Use AI_ADDRCONFIG only if the family is
2436         unspecified.  This ensures that specifying `--no-inet4' on systems
2437         where IPv6 resolves, but doesn't work behaves the same regardless
2438         of the availability of AI_ADDRCONFIG.
2439
2440 2003-11-15  Hrvoje Niksic  <hniksic@xemacs.org>
2441
2442         * host.c: Don't refer to the now-removed function
2443         forget_host_lookup in the documentation of lookup_host.
2444
2445 2003-11-15  Hrvoje Niksic  <hniksic@xemacs.org>
2446
2447         * http.c (persistent_available_p): Correctly specify the endpoint
2448         argument to socket_ip_address.
2449         (gethttp): When printing the "reusing connection to..." message,
2450         specify the host name of the reused connection, not the current
2451         host name.  That makes more sense because it provides a useful
2452         piece of information -- we know to which host we're supposed to
2453         connect anyway!
2454
2455 2003-11-15  Hrvoje Niksic  <hniksic@xemacs.org>
2456
2457         * init.c: Make sure the options are in alphabetic order!
2458
2459         * host.c (lookup_host): Merge lookup_host_passive and lookup_host
2460         after all -- having both would result in some code duplication.
2461         (lookup_host): Set hints.ai_family to AF_INET if ipv4_only is
2462         requested.  Likewise, set it to AF_INET6 for ipv6_only.  Specify
2463         AI_ADDRCONFIG where available.
2464         (lookup_host): New flag LH_REFRESH that specifies that a cached
2465         entry for HOST should be refreshed.
2466         (cache_query): New function.
2467         (cache_store): Ditto.
2468         (cache_remove): Ditto.
2469         (forget_host_lookup): No longer necessary, replaced with static
2470         function cache_remove.
2471
2472 2003-11-14  Hrvoje Niksic  <hniksic@xemacs.org>
2473
2474         * main.c: Enable -4 and -6 only if IPv6 is enabled.
2475
2476 2003-11-14  Hrvoje Niksic  <hniksic@xemacs.org>
2477
2478         * connect.c (register_transport): Renamed from register_extended.
2479         Explain the intended usage.
2480
2481 2003-11-14  Hrvoje Niksic  <hniksic@xemacs.org>
2482
2483         * url.c (uri_merge): Merging "foo" and "bar" should result in
2484         "bar", not in "foo/bar".
2485         (path_simplify): Don't remove empty path elements; don't
2486         special-case leading slash.
2487         (path_simplify): Don't swallow ".."'s at the beginning of string.
2488         E.g. simplify "foo/../../bar" as "../bar", not as "bar".
2489         (append_uri_pathel): Defang ".." path element upon encountering
2490         it.
2491
2492 2003-11-13  Hrvoje Niksic  <hniksic@xemacs.org>
2493
2494         * http.c (persistent_available_p): Don't attempt to talk to two
2495         different SSL sites over the same secure connection.
2496
2497 2003-11-13  Hrvoje Niksic  <hniksic@xemacs.org>
2498
2499         * http.c (gethttp): Ditto.
2500
2501         * ftp.c (getftp): Use retryable_socket_connect_error instead of
2502         CONNECT_ERROR.
2503
2504         * wget.h (CONNECT_ERROR): Removed.
2505
2506         * connect.c (retryable_socket_connect_error): New function instead
2507         of unsupported_socket_family_error.
2508
2509 2003-11-13  Hrvoje Niksic  <hniksic@xemacs.org>
2510
2511         * wget.h (CONNECT_ERROR): Use it.
2512
2513         * connect.c (unsupported_socket_family_error): New function.
2514
2515 2003-11-13  Hrvoje Niksic  <hniksic@xemacs.org>
2516
2517         * connect.c (bind_local): Renamed bindport to bind_local; return
2518         the socket directly.  Updated callers.
2519         (accept_connection): Renamed acceptport to accept_connection;
2520         return the created socket directly.  Updated callers.
2521
2522 2003-11-13  Hrvoje Niksic  <hniksic@xemacs.org>
2523
2524         * init.c (defaults): Turn on opt.ipv4_only if we're compiling with
2525         IPv6, and AI_ADDRINFO is not available, and AF_INET6 sockets can't
2526         be created.
2527
2528 2003-11-13  Hrvoje Niksic  <hniksic@xemacs.org>
2529
2530         * host.c (lookup_host): Document the fact that the addresses are
2531         returned in order.
2532
2533 2003-11-12  Hrvoje Niksic  <hniksic@xemacs.org>
2534
2535         * utils.c: Use limits.h only where available.
2536
2537         * hash.c: Use INVALID_PTR and INVALID_PTR_BYTE.  Include limits.h.
2538
2539 2003-11-11  Hrvoje Niksic  <hniksic@xemacs.org>
2540
2541         * main.c: Added options --inet4-only and --inet6-only.
2542
2543 2003-11-11  Hrvoje Niksic  <hniksic@xemacs.org>
2544
2545         * host.c (host_errstr): Use the more standard message "Unknown
2546         host".
2547
2548 2003-11-10  Hrvoje Niksic  <hniksic@xemacs.org>
2549
2550         * connect.c (connect_to_host): Use that flag to decide whether to
2551         re-resolve the host name.
2552
2553         * host.c (struct address_list): Added a flag that maintains
2554         whether the connection worked at some point.
2555
2556 2003-11-10  Hrvoje Niksic  <hniksic@xemacs.org>
2557
2558         * host.c (lookup_host): Special-case the numeric addresses only in
2559         the non-IPv6 case.
2560
2561 2003-11-10  Hrvoje Niksic  <hniksic@xemacs.org>
2562
2563         * connect.c (resolve_bind_address): Call lookup_host_passive.
2564         Make sure that opt.bind_address is resolved only once.
2565
2566         * host.c (lookup_host_passive): New function, handles "passive"
2567         lookups.
2568         (lookup_host): Remove the passive flags.  Remove the
2569         family-related flags -- use ip_default_family instead.
2570
2571 2003-11-09  Hrvoje Niksic  <hniksic@xemacs.org>
2572
2573         * html-url.c: Get URLs from <object data="...">.
2574
2575 2003-11-09  Hrvoje Niksic  <hniksic@xemacs.org>
2576
2577         * main.c (option_data): Specify the command to use for --mirror.
2578
2579 2003-11-08  Hrvoje Niksic  <hniksic@xemacs.org>
2580
2581         * cookies.c (cookie_handle_set_cookie): Specify exact match for
2582         unspecified domains.
2583
2584 2003-11-08  Hrvoje Niksic  <hniksic@xemacs.org>
2585
2586         * main.c (main): Removed one-letter options `-C', `-g', `-G', and
2587         `-s'.
2588
2589 2003-11-08  Hrvoje Niksic  <hniksic@xemacs.org>
2590
2591         * main.c (main): Add --dont-remove-listing for backward
2592         compatibility with previous versions.
2593         (print_help): Fix typo, spotted by Dennis Smit.
2594
2595 2003-11-08  Gisle Vanem  <giva@bgnett.no>
2596
2597         * ftp-basic.c: Support Windows-2000 ftp servers. Win-2000 *is*
2598         Win-NT 5.0 so calling it ST_WINNT is okay I guess.
2599
2600 2003-11-08  Hrvoje Niksic  <hniksic@xemacs.org>
2601
2602         * progress.c (update_speed_ring): Clear the speed ring when the
2603         download stalls.
2604
2605         * retr.c (get_contents): Specify 0.95s read timeout, so that the
2606         progress gauge can be updated even when data arrives very slowly
2607         or stalls.
2608
2609 2003-11-08  Hrvoje Niksic  <hniksic@xemacs.org>
2610
2611         * utils.c (wtimer_allocate): Bless the use of wtimer_read on a
2612         timer that has merely been allocated because get_contents() does
2613         that.
2614         (wtimer_update): Abort if the timer is not initialized.
2615
2616 2003-11-08  Hrvoje Niksic  <hniksic@xemacs.org>
2617
2618         * retr.c (get_contents): Pass the timer to limit_bandwidth().
2619
2620         * utils.c (wtimer_update): New function instead of wget_elapsed;
2621         just update the timer, but don't return anything.
2622         (wtimer_read): Read and return the last known value of the timer.
2623
2624 2003-11-08  Hrvoje Niksic  <hniksic@xemacs.org>
2625
2626         * http.c (persistent_available_p): Instead of matching all the
2627         addresses of HOST and last host, determine the peer's IP address
2628         with socket_ip_address and see if that address is one of those
2629         HOST resolves to.
2630
2631         * host.c (address_list_match_all): Removed.
2632         (address_list_find): New function, finds an IP address in the
2633         address list.
2634
2635         * ftp.c (ftp_do_pasv): Get the peer's address here, and pass it to
2636         ftp_epsv so it doesn't need to call getpeername.
2637
2638         * ftp-basic.c (ftp_port): Use socket_ip_address instead of
2639         getpeername.
2640         (ftp_lprt): Ditto.
2641
2642         * connect.c (socket_ip_address): Replaces conaddr, generalized to
2643         either get peer's or local address.
2644         (sockaddr_get_data): Made local to this file.
2645
2646 2003-11-08  Hrvoje Niksic  <hniksic@xemacs.org>
2647
2648         * hash.c (HASH_POSITION): Explicitly accept the hash function.
2649         (grow_hash_table): Extract ht->hash_function outside the loop.
2650         (hash_table_remove): Ditto.
2651         (hash_table_clear): Fill entries with 0xff to clear them.
2652         (hash_table_remove): Mark entries as deleted with the correct
2653         marker.
2654
2655 2003-11-08  Hrvoje Niksic  <hniksic@xemacs.org>
2656
2657         * http.c (persistent_available_p): No reason for the host lookup
2658         to be silent -- it's a lookup like any other.
2659
2660 2003-11-08  Hrvoje Niksic  <hniksic@xemacs.org>
2661
2662         * connect.c (register_extended): Check that fd >= 0.
2663
2664 2003-11-07  Hrvoje Niksic  <hniksic@xemacs.org>
2665
2666         * connect.c (LAZY_RETRIEVE_INFO): Set LAST_INFO.
2667
2668 2003-11-07  Hrvoje Niksic  <hniksic@xemacs.org>
2669
2670         * hash.c (NON_EMPTY): Use the all-bit-set value as the marker that
2671         the field is empty.  This allows NULL pointer and 0 value to be
2672         used as keys, which is necessary for the connect.c code to work
2673         when fd==0.
2674         (hash_table_new): Fill mappings with 0xff.
2675         (grow_hash_table): Ditto.
2676
2677 2003-11-07  Hrvoje Niksic  <hniksic@xemacs.org>
2678
2679         * url.c (url_parse): Allow empty ports.
2680
2681 2003-11-07  Hrvoje Niksic  <hniksic@xemacs.org>
2682
2683         * main.c (print_help): Break the help string into multiple chunks.
2684         (cmdline_option): New option handler OPT_FUNCALL.  Generalized
2685         HANDLE_CMD to generic DATA.
2686         (option_data): Use the new OPT_FUNCALL feature.
2687
2688 2003-11-06  Hrvoje Niksic  <hniksic@xemacs.org>
2689
2690         * log.h: Declare log_init, log_close, and
2691         log_request_redirect_output here.
2692
2693 2003-11-05  Dennis Smit  <ds@nerds-incorporated.org>
2694
2695         * main.c: (main): added --preserve-permissions option.
2696
2697         * ftp.c (ftp_retrieve_list): added support for
2698         --preserve-permissions option.
2699
2700         * init.c: added support for --preserve-permission option.
2701
2702         * option.h: added support for --preserve-permission option.
2703
2704 2003-11-06  Hrvoje Niksic  <hniksic@xemacs.org>
2705
2706         * main.c (init_switches): New function.  Convert option_data to
2707         long_options and short_options, which can be fed to getopt_long.
2708         (main): Execute command-line options by consulting option_data.
2709
2710 2003-11-06  Hrvoje Niksic  <hniksic@xemacs.org>
2711
2712         * gen_sslfunc.c (ssl_read): Implement a more correct check for
2713         EINTR.
2714         (ssl_write): Ditto.
2715         (init_ssl): Use a global SSL context.
2716
2717 2003-11-06  Hrvoje Niksic  <hniksic@xemacs.org>
2718
2719         * connect.c (xclose): Free INFO even if it doesn't provide a
2720         closer.
2721
2722 2003-11-06  Hrvoje Niksic  <hniksic@xemacs.org>
2723
2724         * connect.c: Updated all callers of
2725         iread/ssl_iread/iwrite/ssl_iwrite to use xread and xwrite instead.
2726
2727         * rbuf.h (struct rbuf): Removed the SSL member because SSL is
2728         handled automatically by xread.
2729
2730         * hash.c (ptrhash): Made private.
2731         (ptrcmp): Ditto.
2732         (inthash): Removed.
2733
2734         * connect.c (select_fd): Don't set errno, leave it to the caller.
2735
2736         * gen_sslfunc.c (connect_ssl): Use register_extended to register
2737         SSL callbacks for communication with SSL-enabled endpoints.
2738         (ssl_read): New function.
2739         (ssl_write): Ditto.
2740         (ssl_poll): Ditto.
2741         (ssl_close): Ditto.
2742
2743         * connect.c (register_extended): New function -- register
2744         callbacks for basic socket operations.
2745         (xread): Ditto.
2746         (xwrite): Ditto.
2747         (xclose): Ditto.
2748         (sock_read): New function, default implementation for reading.
2749         (sock_write): Ditto for writing.
2750         (sock_poll): Ditto for polling.
2751         (sock_close): Ditto for closing.
2752
2753 2003-11-05  Hrvoje Niksic  <hniksic@xemacs.org>
2754
2755         * connect.c (bindport): Fix compilation under pre-C99 compilers.
2756
2757 2003-11-05  Hrvoje Niksic  <hniksic@xemacs.org>
2758
2759         * connect.c (connect_to_ip): More compact error checking.
2760         (bindport): Don't treat failed setsockopt as a fatal error.
2761
2762 2003-11-05  Hrvoje Niksic  <hniksic@xemacs.org>
2763
2764         * connect.c (resolve_bind_address): Use a more accurate error
2765         message -- we're not binding to ANY, we're disabling bind
2766         altogether.
2767
2768 2003-11-05  Hrvoje Niksic  <hniksic@xemacs.org>
2769
2770         * cookies.c (save_cookies_mapper): Respect the setting of
2771         keep-session-cookies.
2772         (cookie_jar_load): Import session cookies.
2773         Based on code submitted by Nicolas Schodet.
2774
2775         * utils.c (datetime_str): Use information in TM when it's
2776         non-NULL.
2777
2778         * main.c (main): New option `--keep-session-cookies'.
2779
2780 2003-11-04  Hrvoje Niksic  <hniksic@xemacs.org>
2781
2782         * Makefile.in (realclean): Delete config.h.in.
2783
2784 2003-11-04  Hrvoje Niksic  <hniksic@xemacs.org>
2785
2786         * config-post.h: New file, included from now autogenerated
2787         config.h.in.
2788
2789 2003-11-04  Hrvoje Niksic  <hniksic@xemacs.org>
2790
2791         * progress.c (progress_handle_sigwinch): Don't call
2792         determine_screen_width() from the signal handler.  Instead, just
2793         set a volatile variable.
2794         (bar_create): Check whether SIGWINCH was received.
2795         (bar_update): Ditto.
2796
2797         * sysdep.h: Define SYSTEM_FNMATCH only if HAVE_FNMATCH_H is true.
2798
2799 2003-11-03  Hrvoje Niksic  <hniksic@xemacs.org>
2800
2801         * utils.c (xsleep): New function.  Uses nanosleep where available,
2802         resuming sleeps interrupted by signals.  Updated callers of sleep
2803         and usleep to use xsleep.
2804
2805 2003-11-03  Hrvoje Niksic  <hniksic@xemacs.org>
2806
2807         * ftp-basic.c (ftp_login): Remove shadowing (and bogus)
2808         declaration of SEED.
2809
2810 2003-11-03  Hrvoje Niksic  <hniksic@xemacs.org>
2811
2812         * log.c (logvprintf): Documented better.  Renamed to
2813         log_vprintf_internal to avoid confusion with the public API
2814         functions logprintf and logputs.
2815
2816 2003-11-03  Hrvoje Niksic  <hniksic@xemacs.org>
2817
2818         * wget.h (N_): Don't parenthesize argument.
2819
2820 2003-11-03  Hrvoje Niksic  <hniksic@xemacs.org>
2821
2822         * host.h (ADDRESS_IPV4_DATA): Don't take the address of in.s_addr
2823         because that doesn't work on machines that define it as bitfield.
2824
2825 2003-11-03  Hrvoje Niksic  <hniksic@xemacs.org>
2826
2827         * connect.c (select_fd): Generalize the third argument into WAIT,
2828         so that the caller can request waiting for both read and write.
2829         Updated callers.
2830
2831 2003-11-02  Hrvoje Niksic  <hniksic@xemacs.org>
2832
2833         * html-url.c (cleanup_html_url): Destroy the hash tables, don't
2834         just call free on them.
2835         (init_interesting): Use hash_table_put instead of string_set_add
2836         because we don't need the strdup that the latter function
2837         performs.
2838
2839         * init.c (cleanup): Don't pass NULL to cookie_jar_delete.
2840
2841         * xmalloc.c (xfree_real): Abort when passed a NULL pointer.
2842         (xfree_debug): Print at the file and line of the offending call to
2843         free.
2844
2845 2003-11-02  Hrvoje Niksic  <hniksic@xemacs.org>
2846
2847         * wget.h: Retired the `boolean' type.  Moved the DEFAULT_LOGFILE
2848         define to log.h.  Moved the INFINITE_RECURSION define to recur.h.
2849
2850         * xmalloc.h: Renamed FREE_MAYBE to xfree_null and moved the
2851         definition from wget.h to xmalloc.h.
2852
2853 2003-11-02  Hrvoje Niksic  <hniksic@xemacs.org>
2854
2855         * html-parse.c (decode_entity): New function; split the decoding
2856         of entities here.
2857         (convert_and_copy): Use it to decode entities.
2858         (decode_entity): Handle the &apos entity.
2859         (decode_entity): Don't decode Latin 1 numeric entities.  Don't
2860         decode &#0.
2861
2862 2003-11-01  Hrvoje Niksic  <hniksic@xemacs.org>
2863
2864         * ftp-opie.c (calculate_skey_response): Use uint32_t instead of
2865         `unsigned long' for the cheksum array.  Document the function.
2866
2867 2003-11-01  Hrvoje Niksic  <hniksic@xemacs.org>
2868
2869         * connect.c (acceptport): Don't call select_fd when timeout is not
2870         requested.
2871
2872 2003-11-01  Hrvoje Niksic  <hniksic@xemacs.org>
2873
2874         * host.c: Removed the ip_default_family global variable.
2875
2876         * host.c (lookup_host): Document the function.  Fixed declaration
2877         of VEC.
2878
2879 2003-10-31  Hrvoje Niksic  <hniksic@xemacs.org>
2880
2881         * various: Use new macros xnew, xnew0, xnew_array, and xnew0_array
2882         in various places.
2883
2884 2003-10-31  Hrvoje Niksic  <hniksic@xemacs.org>
2885
2886         * wget.h: Move declarations of malloc and logging code to
2887         xmalloc.h and log.h respectively to unclutter this file.
2888         (STRDUP_ALLOCA): Made it side-effect free.
2889
2890         * xmalloc.h: New files.  Define macros xnew, xnew0, xnew_array,
2891         and xnew0_array.
2892
2893         * xmalloc.c: New file.  Move the xmalloc routines here.
2894
2895 2003-10-31  Hrvoje Niksic  <hniksic@xemacs.org>
2896
2897         * connect.c (sockaddr_set_data): Remove the broken code that
2898         checked for NULL address.
2899
2900 2003-10-31  Hrvoje Niksic  <hniksic@xemacs.org>
2901
2902         * host.c (address_list_from_single): Removed.
2903         (address_list_from_ipv4_addresses): Renamed from
2904         address_list_from_vector.
2905
2906 2003-10-31  Hrvoje Niksic  <hniksic@xemacs.org>
2907
2908         * sysdep.h (CLOSE): Don't call close on file descriptors less than
2909         0, i.e. on uncreated sockets.
2910
2911         * connect.c (resolve_bind_address): Work on struct sockaddr
2912         directly.
2913         (connect_to_host): Replacement for connect_to_many.  Resolve HOST
2914         and connect to any of its addresses.  If we can't connect and the
2915         host name lookup was cached, try to resolve it again.  This should
2916         fix problems with hosts behind dynamic DNS.  Updated all callers.
2917         (connect_to_ip): Replacement for connect_to_one.  Removed SILENT;
2918         added the argument PRINT instead.  Updated all callers.
2919         (set_connection_host_name): Removed.
2920
2921         * host.c (address_list_address_at): New function instead of
2922         address_list_copy_one. It returns a pointer to ip_address *, so
2923         it's not necessary to copy the data.
2924         (address_list_cached_p): New function.
2925         (forget_host_lookup): Ditto.
2926
2927         * connect.c: Got rid of the MSOCK global variable.  Made bindport
2928         return the local socket it creates.  Added a new argument to
2929         acceptport, the socket to call accept on.  Updated callers.
2930         (closeport): Removed.
2931
2932         * connect.c: Moved the sockaddr code from host.c to this file,
2933         because most of that stuff is used for connecting, and has nothing
2934         to do with host names anyway.
2935         (sockaddr_set_data, sockaddr_get_data): New functions, replace the
2936         old sockaddr_set_address, sockaddr_set_port, sockaddr_get_address,
2937         and sockaddr_get_port.
2938
2939 2003-10-30  Hrvoje Niksic  <hniksic@xemacs.org>
2940
2941         * sysdep.h: Use `S >= 8' rather than `S == 8' when looking for
2942         large integers.
2943
2944 2003-10-30  Hrvoje Niksic  <hniksic@xemacs.org>
2945
2946         * url.c (append_uri_pathel): New argument ESCAPED_P that says
2947         whether [B, E) is to be treated as URL-escaped or not.  If
2948         ESCAPED_P is false, don't unescape the region.
2949         (url_file_name): u->file is not URL-escaped.
2950
2951 2003-10-30  Hrvoje Niksic  <hniksic@xemacs.org>
2952
2953         * retr.c (retrieve_from_file): Use retrieve_tree for
2954         page-requisites.
2955
2956         * main.c (main): Don't define opt.recursive when -p is used.
2957         Instead, make sure that recursion is used for HTTP in that case.
2958
2959 2003-10-29  Hrvoje Niksic  <hniksic@xemacs.org>
2960
2961         * host.h: Defined accessors for elements of ip_address.  Updated
2962         all callers.
2963         (address_list_match_all): Use memcmp in the non-IPv6 case.
2964
2965         * wget.h (CONNECT_ERROR): Don't retry connecting if connect()
2966         returned EAFNOSUPPORT.
2967
2968 2003-10-27  Mauro Tortonesi <mauro@deepspace6.net>
2969
2970         * connect.h: changed bindport prototype and added the related
2971         BIND_ON_IPV4_ONLY and BIND_ON_IPV6_ONLY flags.
2972
2973         * connect.c: changed bindport and resolve_bind_address to allow
2974         protocol-version specific DNS resolution. modified conaddr,
2975         acceptport and connect_to_one to make use of struct
2976         sockaddr_storage and of the new ip_address structure.
2977
2978         * ftp-basic.c: added LPRT/LPSV (RFC1639) support, refactored
2979         PORT/PASV (RFC959) and EPRT/EPSV (RFC2428) support code.
2980
2981         * ftp.c: added the ftp_do_port and ftp_do_pasv functions to
2982         handle FTP over IPv6.
2983
2984         * ftp.h: changed prototype of ftp_epsv and added prototypes for
2985         ftp_lpsv, ftp_lprt and ftp_eprt.
2986
2987         * host.c: renamed the
2988         wget_sockaddr_set_address and wget_sockaddr_get_addr, and
2989         wget_sockaddr_{s,g}et_port couples to sockaddr_{s,g}et_address and
2990         sockaddr_{g,s}et_port respectively.  changed
2991         address_list_match_all, address_list_from_addrinfo sockaddr_len,
2992         pretty_print_address, lookup_host, sockaddr_{s,g}et_address and
2993         sockaddr_{g,s}et_port to make use of struct sockaddr_storage and
2994         of the new ip_address structure.  removed map_ipv4_to_ip and
2995         map_ip_to_ipv4.
2996
2997         * host.h: redefined structure ip_address and removed structure
2998         wget_sockaddr.
2999
3000 2003-10-26  Hrvoje Niksic  <hniksic@xemacs.org>
3001
3002         * sysdep.h: Include inttypes.h where available.
3003
3004         * host.c: Switch from u_int32_t to uint32_t.
3005
3006 2003-10-26  Hrvoje Niksic  <hniksic@xemacs.org>
3007
3008         * netrc.c (parse_netrc): Reset the QUOTE flag after the closing
3009         quote.
3010
3011 2003-10-25  Hrvoje Niksic  <hniksic@xemacs.org>
3012
3013         * url.c (is_valid_ipv6_address): Reformat to GNU coding style.
3014         Use enums for NS_IN* constants.  Use ISXDIGIT.
3015
3016         * convert.c (construct_relative): Document better how the function
3017         works.
3018
3019 2003-10-23  Hrvoje Niksic  <hniksic@xemacs.org>
3020
3021         * config.h.in: Deploy preprocessor magic to avoid Ultrix's
3022         <netdb.h> include <bitypes.h> which defines its own u_int32_t.
3023         Reported by Bernhard Simon.
3024
3025 2003-10-23  Hrvoje Niksic  <hniksic@xemacs.org>
3026
3027         * version.c: Bump version.
3028
3029 2003-10-23  Hrvoje Niksic  <hniksic@xemacs.org>
3030
3031         * url.c: Ditto.
3032
3033         * html-parse.c (advance_declaration): Don't use trailing comma in
3034         enum because older compilers don't support it.
3035
3036         * utils.c: Don't redefine HAVE_SIGSETJMP.
3037
3038 2003-10-16  Hrvoje Niksic  <hniksic@xemacs.org>
3039
3040         * convert.c (construct_relative): Don't handle absolute files
3041         specially -- for example, -P/tmp/foo shouldn't imply that
3042         converted files must refer to "/tmp/foo/..."!
3043
3044 2003-10-15  Hrvoje Niksic  <hniksic@xemacs.org>
3045
3046         * http.c: Consider status 307 a valid redirect.
3047
3048 2003-10-15  Philip Stadermann  <philip.stadermann@credativ.de>
3049
3050         * ftp.c (ftp_retrieve_glob): Correctly loop through the list whose
3051         elements might have been deleted.
3052
3053 2003-10-13  Hrvoje Niksic  <hniksic@xemacs.org>
3054
3055         * html-url.c (tag_handle_meta): Set the Refresh link to expect
3056         HTML.
3057         (append_one_url): Renamed to append_url.
3058
3059 2003-10-13  Hrvoje Niksic  <hniksic@xemacs.org>
3060
3061         * sysdep.h: Only define u_int32_t.
3062
3063 2003-10-11  Hrvoje Niksic  <hniksic@xemacs.org>
3064
3065         * utils.c (large_int_to_string): Use snprintf() to print the
3066         number.  This will work even on systems where libc doesn't
3067         understand %lld, but the compiler does, because it will use our
3068         snprintf replacement.
3069
3070         * init.c (parse_bytes_helper): New function.
3071         (cmd_bytes): Use it to parse bytes, but cast the result to long.
3072         (cmd_bytes_large): Ditto, but store the result to LARGE_INT.  Used
3073         for --quota so that --quota=10G works even on machines without
3074         long long.
3075
3076         * options.h (struct options): Declare quota as LARGE_INT.
3077
3078         * retr.c (downloaded_exceeds_quota): Removed.
3079         (downloaded_increase): Ditto.
3080         (total_downloaded_bytes): New variable, replaces opt.downloaded,
3081         which was the wrong place for it anyway.  Updated callers of
3082         downloaded_exceeds_quota and downloaded_increase to check this
3083         variable directly.
3084
3085         * sysdep.h: Get rid of VERY_LONG_TYPE.  Use LARGE_INT for the same
3086         purpose, defined as `long', `long long' or `double', depending on
3087         size of long and whether long long is available.
3088
3089 2003-10-11  Hrvoje Niksic  <hniksic@xemacs.org>
3090
3091         * sysdep.h: Also check size of short for int32_t.
3092
3093 2003-10-11  Hrvoje Niksic  <hniksic@xemacs.org>
3094
3095         * host.c (lookup_host): Use u_int32_t to store the result of
3096         inet_addr().  That removes the need for offset fiddling, caring
3097         about endian-ness, etc.
3098
3099         * sysdep.h: Define int32_t and u_int32_t if not available.
3100
3101 2003-10-11  Hrvoje Niksic  <hniksic@xemacs.org>
3102
3103         * ftp-basic.c (ftp_epsv): Use socklen_t * as the third argument to
3104         getpeername.
3105
3106         * config.h.in: Define socklen_t stub.
3107
3108         * host.c (sockaddr_len): Return socklen_t.
3109
3110         * connect.c (conaddr): Use socklen_t as the third argument to
3111         accept, getsockname, and connect.
3112
3113 2003-10-10  Hrvoje Niksic  <hniksic@xemacs.org>
3114
3115         * recur.c (retrieve_tree): Don't descend into documents that are
3116         not expected to contain HTML, regardless of their content-type.
3117
3118         * html-url.c (tag_url_attributes): Record which attributes are
3119         supposed to yield HTML links that can be followed.
3120         (tag_find_urls): Propagate that information to the caller through
3121         struct urlpos.
3122
3123 2003-10-10  Hrvoje Niksic  <hniksic@xemacs.org>
3124
3125         * hash.c (find_mapping): Return the next available mapping when
3126         the key is not found, not NULL.
3127         (hash_table_put): Use find_mapping to find the storage for the new
3128         data.
3129         (hash_table_put): Grow the table before exceeding maximum
3130         fullness, not afterwards.
3131
3132 2003-10-10  Hrvoje Niksic  <hniksic@xemacs.org>
3133
3134         * hash.c (hash_table_new): Slightly change the meaning of the
3135         first parameter.  Instead of being the minimum initial size, it is
3136         now the minimum number of items that the hash table can take
3137         without needing to resize.
3138
3139 2003-10-09  Hrvoje Niksic  <hniksic@xemacs.org>
3140
3141         * html-url.c (init_interesting): Initialize interesting_tags and
3142         interesting_attributes as hash tables.  This simplifies the code
3143         immensely because hash tables handle allocation and remove
3144         duplicates automatically.
3145         (find_tag): Removed.
3146         (collect_tags_mapper): Instead of calling find_tag, simply get the
3147         entry from interesting_tags hash table, which is both simpler and
3148         faster.
3149
3150 2003-10-09  Hrvoje Niksic  <hniksic@xemacs.org>
3151
3152         * hash.c (hash_table_get): Declare hash-table argument as const.
3153         (find_mapping): Ditto.
3154         (hash_table_get_pair): Ditto.
3155         (hash_table_contains): Ditto.
3156         (hash_table_count): Ditto.
3157
3158 2003-10-08  Hrvoje Niksic  <hniksic@xemacs.org>
3159
3160         * html-url.c (get_urls_html): Parse the appropriate flags to
3161         html-parse.c.
3162
3163         * html-parse.c (map_html_tags): Accept FLAGS from the caller
3164         instead of examining OPT.
3165
3166 2003-10-08  Hrvoje Niksic  <hniksic@xemacs.org>
3167
3168         * html-url.c (find_tag): Switch to binary search.
3169
3170 2003-10-08  Hrvoje Niksic  <hniksic@xemacs.org>
3171
3172         * main.c (print_help): Fix typo; stured -> stored.
3173
3174 2003-10-08  Hrvoje Niksic  <hniksic@xemacs.org>
3175
3176         * getopt.c: Add definitions of getopt_long and getopt_long_only.
3177
3178 2003-10-08  Hrvoje Niksic  <hniksic@xemacs.org>
3179
3180         * config.h.in: Renamed DEBUG to ENABLE_DEBUG.  ENABLE_DEBUG is, I
3181         think, a better name, because it implies that debugging output is
3182         merely possible, not "on by default", as might be construed from
3183         just DEBUG.
3184
3185 2003-10-08  Hrvoje Niksic  <hniksic@xemacs.org>
3186
3187         * ftp.c (has_insecure_name_p): Define it here.
3188
3189         * utils.c (has_wildcards_p): Define it here.
3190
3191         * sysdep.h: Declare fnmatch-related macros here, if not using
3192         system fnmatch().  Update .c files to not declare fnmatch.h
3193         directly.
3194
3195         * cmpt.c (fnmatch): Moved here.  Use it only under non-GNU libc.
3196
3197 2003-10-08  Hrvoje Niksic  <hniksic@xemacs.org>
3198
3199         * getopt.c: Newer version, imported from Free libit.
3200
3201 2003-10-07  Hrvoje Niksic  <hniksic@xemacs.org>
3202
3203         * cookies.c (struct cookie): Remove unused backpointer to cookie
3204         jar.
3205
3206 2003-10-07  Hrvoje Niksic  <hniksic@xemacs.org>
3207
3208         * cmpt.c (memmove): Comment out, since it's no longer used.
3209
3210         * cookies.c (cookie_jar_generate_cookie_header): Allocate room for
3211         chains in one pass.
3212         (find_chains_of_host): Assume that the caller has allocated DEST
3213         to be sufficiently large to take all the data.
3214         (eliminate_dups): Run through the array and eliminate dups on the
3215         fly instead of using memmove.
3216         (cookie_jar_process_set_cookie): Free cookie->domain before
3217         re-setting it.
3218
3219 2003-10-05  Gisle Vanem  <giva@bgnett.no>
3220
3221         * mswindows.c (set_sleep_mode): Fix type of
3222         _SetThreadExecutionState.
3223
3224 2003-10-05  Hrvoje Niksic  <hniksic@xemacs.org>
3225
3226         * utils.c (file_size): Return -1 if fopen() returns NULL.  Prior
3227         to this patch, wget --post-file=nosuchfile dumped core.
3228
3229 2003-10-04  Gisle Vanem  <giva@bgnett.no>
3230
3231         * mswindows.c (run_with_timeout): Use WaitForSingleObject to wait
3232         for thread termination.
3233
3234 2003-10-04  Hrvoje Niksic  <hniksic@xemacs.org>
3235
3236         * log.c: Use `...' in function definitions; ansi2knr will convert
3237         them to va_dcl.  This allowed removal of the ugly VA_START_1 and
3238         VA_START_2 macros.
3239
3240 2003-10-03  Gisle Vanem  <giva@bgnett.no>
3241
3242         * connect.c: And don't include them here.
3243
3244         * mswindows.h: Include winsock headers here.
3245
3246 2003-10-03  Hrvoje Niksic  <hniksic@xemacs.org>
3247
3248         * html-parse.c (convert_and_copy): Move variable declarations
3249         before statements.
3250
3251 2003-10-02  Gisle Vanem  <giva@bgnett.no>
3252         
3253         * mswindows.c (run_with_timeout): For Windows: Run the 'fun' in a
3254         thread via a helper function. Continually query the thread's
3255         exit-code until finished or timed out.
3256
3257 2003-10-02  Hrvoje Niksic  <hniksic@xemacs.org>
3258
3259         * wget.h (XMALLOC_ARRAY): Removed.
3260         (ALLOCA_ARRAY): Ditto.
3261
3262         * html-parse.c: Renamed alloca_p to resized.
3263         (GROW_ARRAY): Renamed DO_REALLOC_FROM_ALLOCA to GROW_ARRAY and
3264         returned it to html-parse.c, since nothing else was using it.
3265
3266 2003-10-02  Hrvoje Niksic  <hniksic@xemacs.org>
3267
3268         * retr.c (retrieve_url): Initialize DUMMY storage for DT.  Caught
3269         by valgrind.
3270
3271 2003-10-02  Hrvoje Niksic  <hniksic@xemacs.org>
3272
3273         * html-parse.c (convert_and_copy): Handle numeric entities in
3274         hexadecimal, &#xHH.
3275         (convert_and_copy): Copy the contents directly to the pool without
3276         a stack-allocated intermediary.
3277
3278 2003-10-02  Hrvoje Niksic  <hniksic@xemacs.org>
3279
3280         * utils.c (alarm_set): New function; use either setitimer or alarm
3281         to set up the alarm.
3282         (alarm_cancel): New function; cancel the alarm set up by
3283         alarm_set.
3284         (run_with_timeout): Use them.
3285
3286 2003-10-01  Hrvoje Niksic  <hniksic@xemacs.org>
3287
3288         * url.c (url_parse): Don't leak memory when a reencoded URL turns
3289         out to be invalid.
3290
3291         * url.c (parse_errors): Mark error messages for translation.
3292         (url_error): Translate error messages returned to the caller.
3293
3294 2003-10-01  Hrvoje Niksic  <hniksic@xemacs.org>
3295
3296         * ftp.c (ftp_loop_internal): Initialize TMRATE to NULL to shut up
3297         the compiler.
3298
3299 2003-09-26  Gisle Vanem  <giva@bgnett.no>
3300
3301         * src/mswindows.c: Added ws_percenttitle() showing progress in the
3302         window titlebar. Called from retr.c. Secured ws_mypath().
3303
3304         * windows/config.h.ms: alloca() prototype not needed.  Removed
3305         "#undef ENABLE_NLS"; should be in Makefile IMHO. Moved
3306         WGET_USE_STDARG from mswindows.h to config.ms.h because of #ifdef
3307         in log.c. (MSVC's vararg.h and stdarg.h are incompatible).
3308
3309 2003-09-29  Aaron Hawley <Aaron.Hawley@uvm.edu>
3310
3311         * ftp.c (getftp): --spider option should now work with FTP
3312         downloads.
3313         (ftp_loop_internal): quiet reports and calculations of downloads
3314         when --spider option set, nor try deleting when --delete-after
3315         also set.
3316         (ftp_loop): --spider will skip HTML-ification of .listing file.
3317
3318 2003-09-26  Gisle Vanem  <giva@bgnett.no>
3319
3320         * mswindows.c (read_registry): Removed.
3321         (set_sleep_mode): New function.
3322         (windows_main_junk): Call it.
3323
3324 2003-09-26  Gisle Vanem  <giva@bgnett.no>
3325
3326         * mswindows.c (read_registry): Fix invocation of registry
3327         functions.
3328
3329         * mswindows.c (read_registry): Condition definitions of sleep and
3330         usleep with not HAVE_SLEEP and HAVE_USLEEP respectively.  Define
3331         HAVE_SLEEP and HAVE_USLEEP under __DMC__.
3332
3333 2003-09-24  Hrvoje Niksic  <hniksic@xemacs.org>
3334
3335         * url.c (url_escape_1): Revert unintentional change to lowercase
3336         xdigit escapes.
3337         (url_escape_dir): Document that this function depends on the
3338         output of url_escape_1.
3339
3340 2003-09-23  Hrvoje Niksic  <hniksic@xemacs.org>
3341
3342         * progress.c (create_image): Print the current ETA if we're done
3343         with the download.
3344         (create_image): Change '-' display char to '+' in the progress bar.
3345
3346         * Makefile.in (clean): Remove .libs.
3347
3348 2003-09-23  Hrvoje Niksic  <hniksic@xemacs.org>
3349
3350         * cookies.c (struct cookie): New flag domain_exact.
3351         (update_cookie_field): Skip leading dot in domain.
3352         (find_matching_chains): Match numeric addresses exactly; don't
3353         needlessly copy HOST to the stack.
3354         (matching_cookie): Added argument HOST.  If cookie->domain_exact
3355         is set, check that HOST is equal to cookie->domain.
3356         (cookie_jar_load): Only use TAB as delimiter.  Document the
3357         meaning of DOMAIN-FLAG.  Skip leading dot in domain.
3358         (cookie_jar_load): Don't ignore DOMAIN-FLAG -- instead, set
3359         domain_exact to true if DOMAIN-FLAG is false.
3360         (save_cookies_mapper): If domain_exact is false, prepend the
3361         domain with dot, like Mozilla does.
3362
3363 2003-09-22  Hrvoje Niksic  <hniksic@xemacs.org>
3364
3365         * progress.c (create_image): Print the initial part of the
3366         download with '-' characters, analogous to how dot progress prints
3367         the initial part with ','.
3368
3369         * hash.c (ptrhash): New function.
3370         (ptrcmp): Ditto.
3371         (hash_table_new): Default to identity hash table.
3372
3373 2003-09-22  Hrvoje Niksic  <hniksic@xemacs.org>
3374
3375         * safe-ctype.h (_sch_test): The cast of BIT to unsigned char was
3376         broken -- _sch_istable bitmasks are 16-bit, not 8-bit!  Cast BIT
3377         to unsigned short instead.
3378
3379 2003-09-22  Hrvoje Niksic  <hniksic@xemacs.org>
3380
3381         * url.c (path_simplify): Instead of calls to memmove, handle "./"
3382         and "../" by advancing pointers.
3383
3384 2003-09-22  Hrvoje Niksic  <hniksic@xemacs.org>
3385
3386         * retr.c (getproxy): Moved from url.c.
3387
3388         * convert.c: Split off link conversion from url.c into separate
3389         file.  Also included the book-keeping stuff from recur.c.
3390
3391 2003-09-21  Hrvoje Niksic  <hniksic@xemacs.org>
3392
3393         * init.c: Improved documentation of functions.
3394         (cmd_boolean): Attempt to make code that tries to avoid calling
3395         strcmp for "speed" a bit more readable.
3396
3397         * init.c (simple_atof): Report error on encountering non-digit,
3398         non-"." character.
3399         (simple_atoi): Replacement for myatoi(), calling interface
3400         compatible with simple_atof.  Updated myatoi's callers.
3401
3402 2003-09-21  Bertrand Demiddelaer  <bert@b3rt.org>
3403
3404         * url.c (path_simplify): Would read two bytes past the end of the
3405         string in the "./" case.
3406
3407 2003-09-21  Matthew J. Mellon  <mellon@tymenet.com>
3408
3409         * http.c (gethttp): Recognize content-type "application/xhtml+xml"
3410         as what Wget considers "text/html".
3411
3412 2003-09-21  Hrvoje Niksic  <hniksic@xemacs.org>
3413
3414         * connect.c (connect_with_timeout): Made timeout type double.
3415
3416         * options.h (struct options): New members read_timeout,
3417         dns_timeout, and connect_timeout.
3418         Use them.
3419
3420 2003-09-21  Hrvoje Niksic  <hniksic@xemacs.org>
3421
3422         * init.c (simple_atof): New function.
3423         (cmd_time): Use it.
3424         (cmd_bytes): Accept things like "1.5k" and such.  Use simple_atof
3425         to parse decimals.
3426
3427         * retr.c (limit_bandwidth): Adjust each sleep by the error of the
3428         previous one.
3429
3430 2003-09-21  Hrvoje Niksic  <hniksic@xemacs.org>
3431
3432         * main.c (main): Use setoptval() for setting the options.  Use
3433         run_command for `-e'.
3434
3435         * init.c (parse_line): Rewritten to return COMIND right away.
3436         Changed linkage to static.
3437         (run_wgetrc): Use the available comind when calling setval, so it
3438         doesn't have to be computed twice.
3439         (setval_internal): New function, runs the command's action without
3440         any error checking.
3441         (setoptval): New function, does what setval used to do, but exits
3442         in case of error.
3443         (run_command): New function.
3444
3445 2003-09-21  Hrvoje Niksic  <hniksic@xemacs.org>
3446
3447         * connect.c (select_fd): Change MAXTIME's type to double.  Handle
3448         its decimal part.
3449
3450         * retr.c (sleep_between_retrievals): In the random-wait case, use
3451         random_float() to wait between 0 and 2*opt.wait seconds.
3452
3453         * utils.c (run_with_timeout): Accept `double' timeouts.  Correctly
3454         handle timeout values in (0, 1) range.
3455         (random_float): New function.
3456
3457         * options.h (struct options): Change the types of wait, waitretry,
3458         and timeout to double.
3459
3460         * init.c (cmd_time): Accept floating point time.
3461
3462 2003-09-20  Hrvoje Niksic  <hniksic@xemacs.org>
3463
3464         * retr.c (get_contents): Cosmetic fixes.
3465
3466 2003-09-20  Hrvoje Niksic  <hniksic@xemacs.org>
3467
3468         * url.c (uri_merge): Get rid of uri_merge_1.
3469         (uri_merge): Merge "foo//", "bar" as "foo//bar", not "foo///bar",
3470         i.e. don't add an extra slash merely because BASE ends with two
3471         slashes.
3472         (parse_credentials): Renamed from parse_uname.  Rewrittern in
3473         standard [beg, end) calling style.
3474         (url_skip_credentials): Renamed from url_skip_uname.  Made static.
3475         (url_skip_credentials): Include # and ; as terminators.  Old code
3476         would mistakenly consider "http://foo.com#hniksic@iskon.hr" to
3477         contain a username.
3478         (url_skip_scheme): Removed because it was unused.
3479         (url_has_scheme): Require "scheme" to be at least one char long.
3480
3481 2003-09-19  Hrvoje Niksic  <hniksic@xemacs.org>
3482
3483         * url.c (url_file_name): Expect NULL dir_prefix.
3484
3485         * init.c (cmd_file): Use a macro to prevent multiple #ifdef
3486         WINDOWS.
3487         (defaults): Set dir_prefix to NULL by default.
3488
3489 2003-09-19  Hrvoje Niksic  <hniksic@xemacs.org>
3490
3491         * safe-ctype.h (_sch_test): Cast BIT to unsigned char, like latest
3492         gcc does.
3493
3494 2003-09-19  Hrvoje Niksic  <hniksic@xemacs.org>
3495
3496         * wget.h (BOUNDED_TO_ALLOCA): Evaluate PLACE only once.
3497         (ARRAY_SIZE): Renamed to countof.  All callers updated.
3498
3499 2003-09-19  Hrvoje Niksic  <hniksic@xemacs.org>
3500
3501         * main.c (main): New option --strict-comments.
3502
3503         * html-parse.c (find_comment_end): New function: simple BM search
3504         for "-->".
3505         (map_html_tags): Use it if looking at a comment and not in strict
3506         comments mode.
3507
3508 2003-09-17  Aurelien Marchand  <artaxerxes@users.sf.net>
3509
3510         * ftp.h: Added OS400 system in enum
3511         * ftp-basic.c: recognize OS400 systems
3512         * ftp.c: don't prepend the CWD if talking to OS400, since it
3513         breaks the change in library
3514
3515 2003-09-18  Hrvoje Niksic  <hniksic@xemacs.org>
3516
3517         * retr.c (get_contents): Pass the correct argument to ssl_iread.
3518
3519 2003-09-18  Hrvoje Niksic  <hniksic@xemacs.org>
3520
3521         * safe-ctype.h: Don't #define ctype.h macros to errors because
3522         that loses when someone #include's ctype.h after safe-ctype.h.
3523
3524 2003-09-17  Hrvoje Niksic  <hniksic@xemacs.org>
3525
3526         * url.c: Undef U, W, C after use.
3527
3528 2003-09-17  Hrvoje Niksic  <hniksic@xemacs.org>
3529
3530         * init.c (cmd_spec_restrict_file_names): Allow the OS setting to
3531         be augmented by ",nocontrol" which means don't escape the control
3532         characters, but otherwise keep OS settings.
3533
3534         * url.c (file_unsafe_char): Deleted.
3535         (append_uri_pathel): Query filechr_table directly.
3536         (filechr_table): Separated Unix, Windows, and control-unsafe
3537         characters.
3538
3539 2003-09-17  Hrvoje Niksic  <hniksic@xemacs.org>
3540
3541         * url.c (url_escape_1): New function.
3542         (url_escape): Use it.
3543         (sync_path): Handle pathological cases where u->file and u->dir
3544         contain really strange characters.
3545         (ENCODE): Deleted.
3546         (REENCODE): Deleted.
3547
3548 2003-09-16  Hrvoje Niksic  <hniksic@xemacs.org>
3549
3550         * url.c (url_file_name): Don't reallocate FNAME if the file
3551         doesn't exist, as is usually the case.
3552
3553         * utils.c (unique_name): New flag allow_passthrough.
3554
3555 2003-09-16  Hrvoje Niksic  <hniksic@xemacs.org>
3556
3557         * utils.c (wtimer_sys_diff): Convert the time difference to signed
3558         __int64, then to double.  This works around MS VC++ 6 which can't
3559         convert unsigned __int64 to double directly.
3560
3561 2003-09-16  Hrvoje Niksic  <hniksic@xemacs.org>
3562
3563         * Makefile.in (clean): Also remove the core.<number> files
3564         produced by recent Linux systems.
3565
3566 2003-09-16  Hrvoje Niksic  <hniksic@xemacs.org>
3567
3568         * http.c (post_file): Don't pad the file if it's not large
3569         enough.  Bail out instead.
3570
3571 2003-09-15  Hrvoje Niksic  <hniksic@xemacs.org>
3572
3573         * retr.c (get_contents): Reduce the buffer size to the amount of
3574         data that may pass through for one second.  This prevents long
3575         sleeps when limiting bandwidth.
3576
3577         * connect.c (connect_to_one): Reduce the socket's RCVBUF when
3578         bandwidth limitation to small values is requested.
3579
3580 2003-09-15  Hrvoje Niksic  <hniksic@xemacs.org>
3581
3582         * progress.c (update_speed_ring): Moved the speed ring update to a
3583         separate function and documented it better.
3584
3585         * progress.c: Use `double' for most timers to support granularity
3586         smaller than 1ms.
3587
3588 2003-09-15  Hrvoje Niksic  <hniksic@xemacs.org>
3589
3590         * wget.h (XDIGIT_TO_XCHAR): Implement as index into a literal
3591         string.
3592         (XDIGIT_TO_xchar): Ditto.
3593
3594 2003-09-15  Hrvoje Niksic  <hniksic@xemacs.org>
3595
3596         * utils.c: Change the type of timer-related functions from long to
3597         double, for better precision.  On machines supporting gettimeofday
3598         the timers now work with granularity of less than one millisecond.
3599
3600 2003-09-15  Hrvoje Niksic  <hniksic@xemacs.org>
3601
3602         * cookies.c (parse_set_cookies): Fixed the parser to handle more
3603         edge conditions.
3604         (test_cookies): New function, contains a test suite for
3605         parse_set_cookies.
3606
3607 2003-09-15  Hrvoje Niksic  <hniksic@xemacs.org>
3608
3609         * url.c (strpbrk_or_eos): Implement as a macro under Gcc.
3610
3611 2003-09-15  Hrvoje Niksic  <hniksic@xemacs.org>
3612
3613         * cookies.c (parse_set_cookies): Allow trailing space in
3614         set-cookies header.  Also, allow any amount of whitespace, not
3615         only one character.  Allow empty set-cookies header without
3616         spewing an error.
3617
3618 2003-09-14  Hrvoje Niksic  <hniksic@xemacs.org>
3619
3620         * url.c (append_uri_pathel): Use opt.restrict_file_names when
3621         calling file_unsafe_char.
3622
3623         * init.c: New command restrict_file_names.
3624
3625         * main.c (main): New option --restrict-file-names[=windows,unix].
3626
3627         * url.c (url_file_name): Renamed from url_filename.
3628         (url_file_name): Add directory and hostdir prefix here, not in
3629         mkstruct.
3630         (append_dir_structure): New function, does part of the work that
3631         used to be in mkstruct.  Iterates over path elements in u->path,
3632         calling append_uri_pathel on each one to append it to the file
3633         name.
3634         (append_uri_pathel): URL-unescape a path element and reencode it
3635         with a different set of rules, more appropriate for handling of
3636         files.
3637         (file_unsafe_char): New function, uses a lookup table to decide
3638         whether a character should be escaped for use in file name.
3639         (append_string): New utility function.
3640         (append_char): Ditto.
3641         (file_unsafe_char): New argument restrict_for_windows, decide
3642         whether Windows file names should be escaped in run-time.
3643
3644         * connect.c: Include <stdlib.h> to get prototype for abort().
3645
3646 2003-09-14  Hrvoje Niksic  <hniksic@xemacs.org>
3647
3648         * utils.c (wtimer_sys_set): Extracted the code that sets the
3649         current time here.
3650         (wtimer_reset): Call it.
3651         (wtimer_sys_diff): Extracted the code that calculates the
3652         difference between two system times here.
3653         (wtimer_elapsed): Call it.
3654         (wtimer_elapsed): Don't return a value smaller than the previous
3655         one, which could previously happen when system time is set back.
3656         Instead, reset start time to current time and note the elapsed
3657         offset for future calculations.  The returned times are now
3658         guaranteed to be monotonically nondecreasing.
3659
3660 2003-09-10  Hrvoje Niksic  <hniksic@xemacs.org>
3661
3662         * host.c (lookup_host): Print the result of the DNS lookup.
3663
3664 2003-09-10  Hrvoje Niksic  <hniksic@xemacs.org>
3665
3666         * init.c (cmd_boolean): Accept yes/no along with on/off.
3667         (cmd_lockable_boolean): Ditto.
3668
3669 2003-09-10  Hrvoje Niksic  <hniksic@xemacs.org>
3670
3671         * init.c: New command dns_cache.
3672
3673         * main.c (main): New option --dns-cache[=off].
3674
3675 2003-09-09  Hrvoje Niksic  <hniksic@xemacs.org>
3676
3677         * config.h.in: Initialize HAVE_GETADDRINFO and ENABLE_IPV6.
3678
3679         * all: Use #ifdef ENABLE_IPV6 instead of the older INET6.  Use
3680         HAVE_GETADDRINFO for getaddrinfo-related stuff.
3681
3682 2003-09-09  Hrvoje Niksic  <hniksic@xemacs.org>
3683
3684         * url.c (url_parse): Return an error if the URL contains a [...]
3685         IPv6 numeric address and we don't support IPv6.
3686
3687 2003-09-05  Hrvoje Niksic  <hniksic@xemacs.org>
3688
3689         * url.c (is_valid_ipv6_address): Modified to not require
3690         zero-terminated strings.
3691         (is_valid_ipv4_address): Ditto.
3692
3693 2003-09-05  Mauro Tortonesi <mauro@deepspace6.net>
3694
3695         src/url.c: added RFC 2732 compliance for URL parsing. The
3696         functions is_*_address valid are a modified version of
3697         glibc 2.3.2 inet_pton's code.
3698
3699 2003-09-03  Ahmon Dancy  <dancy@dancysoft.com>
3700
3701         * main.c init.c options.h: Added --retry-connrefused option so
3702         that Connection Refused failures are treated as non-fatal (when
3703         trying to retrieve from busy servers).
3704
3705         * wget.h: New CONNECT_ERROR macro for encapsulating this
3706         modification.
3707
3708         * ftp.c http.c : Use CONNECT_ERROR macro in places where
3709         ECONNREFUSED was checked.
3710
3711 2003-01-11  Ian Abbott  <abbotti@mev.co.uk>
3712
3713         * ftp.c (ftp_retrieve_glob): Reject insecure filenames as determined
3714         by calling new function has_insecure_name_p.  This is based on a
3715         patch by Red Hat.
3716
3717         * fnmatch.c (has_insecure_name_p): New function: returns non-zero
3718         if filename starts with `/' or contains `../' and is therefore
3719         considered insecure.
3720
3721         * fnmatch.h: Declare has_insecure_name_p().
3722
3723 2002-08-03  Hrvoje Niksic  <hniksic@xemacs.org>
3724
3725         * init.c (cmd_file): Allocate RESULT correctly.
3726
3727 2002-07-24  Hrvoje Niksic  <hniksic@xemacs.org>
3728
3729         * recur.c (retrieve_tree): Check whether downloaded_html_set is
3730         non-NULL before using it.
3731
3732 2002-05-27  Hrvoje Niksic  <hniksic@arsdigita.com>
3733
3734         * html-parse.c (NAME_CHAR_P): Allow almost any character here.
3735
3736 2002-05-24  Hrvoje Niksic  <hniksic@arsdigita.com>
3737
3738         * progress.c (bar_set_params): Fall back to dot progress if the
3739         terminal type is "emacs".
3740
3741 2002-05-20  Hrvoje Niksic  <hniksic@arsdigita.com>
3742
3743         * log.c: Don't #undef WGET_USE_STDARG.
3744
3745 2002-05-16  Hrvoje Niksic  <hniksic@arsdigita.com>
3746
3747         * hash.c (prime_size): Store the offset of the prime number in the
3748         prime table.  When searching, start with the given offset.
3749         (hash_table_new): Pass the pointer to ht->prime_offset to
3750         prime_size.
3751         (grow_hash_table): Ditto.
3752         (prime_size): Make 13 the first prime to make empty hash tables
3753         slightly smaller.
3754
3755 2002-05-16  Ian Abbott  <abbotti@mev.co.uk>
3756
3757         * recur.c (download_child_p): Minor optimization to avoid an
3758         unnecessary additional call to schemes_are_similar_p function.
3759
3760 2002-05-16  Ian Abbott  <abbotti@mev.co.uk>
3761
3762         * url.c (schemes_are_similar_p): New function to test enumerated
3763         scheme codes for similarity.
3764
3765         * url.h: Declare it.
3766
3767         * recur.c (download_child_p): Use it to compare schemes.  This
3768         also fixes a bug that allows hosts to be spanned (without the
3769         -H option) when the parent scheme is https and the child's is
3770         http or vice versa.
3771
3772 2002-05-14  Bill Richardson  <bill@riverstonenet.com>
3773
3774         * ftp.c (getftp): Don't ftruncate stdout.
3775
3776         * http.c (gethttp): Don't ftruncate stdout.
3777
3778 2002-05-09  Ian Abbott  <abbotti@mev.co.uk>
3779
3780         * cmpt.c (strptime_internal): Synched with glibc-2.1.3.
3781         (get_number): Ditto.
3782         (get_alt_number): Ditto.
3783         (__isleap): New function-like macro used by strptime.
3784         (day_of_the_week): New function used by strptime.
3785         (day_of_the_year): Ditto.
3786         (__mon_yday): Now shared by mktime and strptime implementations.
3787
3788 2002-05-08  Hrvoje Niksic  <hniksic@arsdigita.com>
3789
3790         * cookies.c (check_domain_match): Use match_tail in case
3791         insensitive mode.
3792
3793         * utils.c (match_tail): Allow the caller to specify case
3794         insensitive mode.
3795
3796         * cookies.c (store_cookie): When expiry_time is 0, print it as
3797         undefined, not indefinite.
3798
3799 2002-05-07  Ian Abbott  <abbotti@mev.co.uk>
3800
3801         * cookies.c (cookie_jar_process_set_cookie): Do not store
3802         discarded cookie.
3803
3804 2002-04-21  Hrvoje Niksic  <hniksic@arsdigita.com>
3805
3806         * cookies.c (check_domain_match): Allow cookies to be set for
3807         subdomains of unknown top-level domains under some circumstances.
3808
3809 2002-04-21  Thomas Lussnig  <thomas.lussnig@bewegungsmelder.de>
3810
3811         * gen_ssl.c:
3812         - allow checking of server cert
3813         - allow defining client cert type
3814         - allow limit of ssl protocol
3815         - check more return values
3816         - added debug message on break
3817
3818 2002-04-21  Hrvoje Niksic  <hniksic@arsdigita.com>
3819
3820         * recur.c (download_child_p): Revert order of items in check
3821         number 6 for clarity.
3822
3823 2002-04-20  Hrvoje Niksic  <hniksic@arsdigita.com>
3824
3825         * init.c: Ditto.
3826
3827         * main.c: Ditto.
3828
3829         * http.c: Use the new interface.
3830
3831         * cookies.c: Provide an OO-style "cookie jar" interface to enable
3832         separate cookie jars.
3833
3834         * http.c (http_atotm): Declare argument as const.
3835
3836 2002-04-20  Hrvoje Niksic  <hniksic@arsdigita.com>
3837
3838         * cookies.c (cookie_new): Default to PORT_ANY.
3839         (find_cookie_chain_exact): Only search by DOMAIN.
3840         (find_matching_cookie): Also check that PORT matches.
3841         (store_cookie): Only match the domain.
3842         (set_cookie_header_cb): When a cookie "fakes" a domain, assume it
3843         is valid for that host rather than discarding it completely.
3844         (find_matching_chains): Don't search by PORT.
3845         (matching_cookie): Also match PORT.
3846         (load_cookies): Set the port if specified, otherwise leave it as
3847         ANY.
3848         (save_cookies_mapper): Save the port if specified, otherwise leave
3849         it empty.
3850
3851 2002-04-19  Thomas Lussnig  <thomas.lussnig@bewegungsmelder.de>
3852
3853         * init.c: The option `egdfile' was not in sort order.
3854
3855 2002-04-16  Hrvoje Niksic  <hniksic@arsdigita.com>
3856
3857         * ftp.c (getftp): Treat directories that begin with <letter>: as
3858         absolute.
3859         (getftp): Strip trailing slashes from con->id before merging it
3860         with TARGET.
3861
3862 2002-04-16  Hrvoje Niksic  <hniksic@arsdigita.com>
3863
3864         * http.c (gethttp): If Content-Type is not given, assume
3865         text/html.
3866
3867 2002-04-15  Hrvoje Niksic  <hniksic@arsdigita.com>
3868
3869         * recur.c (download_child_p): Don't ignore rejection of HTML
3870         documents that are themselves leaves of recursion.
3871
3872 2002-04-15  Ian Abbott  <abbotti@mev.co.uk>
3873
3874         Makefile.in: Updated several dependencies for object files to take
3875         account of nested include files.
3876
3877 2002-04-15  Ian Abbott  <abbotti@mev.co.uk>
3878
3879         Makefile.in: The target `connect$o' (connect.o) now depends on
3880         `utils.h'
3881
3882 2002-04-15  Ian Abbott  <abbotti@mev.co.uk>
3883
3884         * host.c (SET_H_ERRNO): New function-like macro to set `h_errno'.
3885         (gethostbyname_with_timeout): Use it.
3886
3887         * utils.c: Don't define `SETJMP()', `run_with_timeout_env' or
3888         `abort_run_with_timeout()' when `USE_SIGNAL_TIMEOUT' is undefined.
3889
3890 2002-04-15  Hrvoje Niksic  <hniksic@arsdigita.com>
3891
3892         * host.c (getaddrinfo_with_timeout): New function.
3893         (gethostbyname_with_timeout): Ditto.
3894         (lookup_host): Use them.
3895
3896 2002-04-14  Hrvoje Niksic  <hniksic@arsdigita.com>
3897
3898         * utils.c (number_to_string): Handle the case when n < -INT_MAX.
3899
3900 2002-04-14  Hrvoje Niksic  <hniksic@arsdigita.com>
3901
3902         * init.c (comind): Use a marginally faster implementation of
3903         binary search.  To quote Martin Buchholz, "a nanosecond saved is a
3904         nanosecond earned."
3905
3906 2002-04-14  Hrvoje Niksic  <hniksic@arsdigita.com>
3907
3908         * main.c (print_help): Document `--post-data' and `--post-file'.
3909
3910 2002-04-14  Hrvoje Niksic  <hniksic@arsdigita.com>
3911
3912         * http.c (gethttp): Ditto.
3913
3914         * retr.c (retrieve_url): Initialize variables to appease the
3915         compiler.
3916
3917         * gen_sslfunc.c (ssl_iread): Don't handle EINTR when calling
3918         select_fd.
3919         (ssl_iwrite): Ditto.
3920
3921         * connect.c (select_fd): Rewrite to handle EINTR.  Set errno to
3922         ETIMEDOUT in case of timeout.
3923         (iread): No need to handle EINTR when calling select_fd.
3924         (iwrite): Ditto.
3925
3926 2002-04-14  Hrvoje Niksic  <hniksic@arsdigita.com>
3927
3928         * retr.c (retrieve_url): Make sure that POST is not honored for
3929         redirections.
3930
3931         * http.c (gethttp): Send the POST data when requested.
3932         (post_file): New function.
3933         (gethttp): Use it.
3934
3935         * main.c (main): Ditto.
3936
3937         * init.c: Add new options.
3938
3939         * options.h (struct options): New options post_data and
3940         post_file_name.
3941
3942 2002-04-14  Hrvoje Niksic  <hniksic@arsdigita.com>
3943
3944         * connect.c (connect_with_timeout): Firing SIGALRM can result in
3945         connect() exiting with EINTR.  Treat EINTR the same as ETIMEDOUT.
3946
3947 2002-04-13  Hrvoje Niksic  <hniksic@arsdigita.com>
3948
3949         * connect.c (connect_with_timeout): Use it.
3950
3951         * utils.c (run_with_timeout): New function.
3952
3953 2002-04-13  Hrvoje Niksic  <hniksic@arsdigita.com>
3954
3955         * url.c (getproxy): Accept a struct url argument.  This obviates
3956         the need for USE_PROXY_P.
3957
3958         * retr.c (retrieve_url): Allow proxy to be a non-FTP URL.
3959
3960         * ftp.c (getftp): Recognize FWTK-style proxy.
3961
3962 2002-04-12  Hrvoje Niksic  <hniksic@arsdigita.com>
3963
3964         * config.h.in: Only define _VA_LIST when compiled with gcc.
3965
3966 2002-04012  Ian Abbott  <abbotti@mev.co.uk>
3967
3968         * http.c (http_loop): Compensate for MS Windows two-second
3969         granularity of file modification time when comparing timestamps.
3970
3971         * ftp.c (ftp_retrieve_list): Ditto.
3972
3973 2002-04-12  Ian Abbott  <abbotti@mev.co.uk>
3974
3975         * utils.c (has_html_suffix_p): New function to test filename for
3976         common html extensions.
3977
3978         * utils.h: Declare it.
3979
3980         * http.c (http_loop): Use it instead of previous test.
3981
3982         * retr.c (retrieve_url): Ditto.
3983
3984         * recur.c (download_child_p): Ditto.
3985
3986 2002-04-12  Hrvoje Niksic  <hniksic@arsdigita.com>
3987
3988         * config.h.in: Define _VA_LIST on Solaris to prevent stdio.h from
3989         declaring va_list.
3990         From Kevin Rodgers <kevinr@ihs.com>.
3991
3992 2002-04-12  Ian Abbott  <abbotti@mev.co.uk>
3993
3994         * Makefile.in: Specify libtool mode explicitly when linking.
3995
3996 2002-04-12  Hrvoje Niksic  <hniksic@arsdigita.com>
3997
3998         * connect.c (connect_with_timeout): New function.
3999         (connect_to_one): Use it.
4000
4001         * config.h.in: Add stubs for HAVE_SIGSETJMP, HAVE_SIGBLOCK, and
4002         HAVE_SETJMP_H.
4003
4004 2002-04-11  Hrvoje Niksic  <hniksic@arsdigita.com>
4005
4006         * log.c: Set WGET_USE_STDARG if __STDC__ is defined and stdarg.h
4007         is present.
4008
4009 2002-04-11  Hrvoje Niksic  <hniksic@arsdigita.com>
4010
4011         * progress.c (bar_create): If INITIAL is larger than TOTAL, fix
4012         TOTAL.
4013         (bar_finish): Likewise.
4014
4015 2002-04-11  Hrvoje Niksic  <hniksic@arsdigita.com>
4016
4017         * html-url.c (tag_handle_form): New function.  Pick up form
4018         actions and mark them for conversion only.
4019
4020 2002-04-11  Hrvoje Niksic  <hniksic@arsdigita.com>
4021
4022         * progress.c (struct progress_implementation): Use PARAMS when
4023         declaring the parameters of *create, *update, *finish, and
4024         *set_params.
4025
4026         * netrc.c: Ditto.
4027
4028         * http.c: Reformat some function definitions so that ansi2knr can
4029         read them.
4030
4031         * hash.c (struct hash_table): Use the PARAMS macro around
4032         parameters in the declaration of hash_function and test_function.
4033         (prime_size): Spell 2580823717UL and 3355070839UL as (unsigned
4034         long)0x99d43ea5 and (unsigned long)0xc7fa5177 respectively, so
4035         that pre-ANSI compilers can read them.
4036         (find_mapping): Use PARAMS when declaring EQUALS.
4037         (hash_table_put): Ditto.
4038
4039         * ftp.h: Wrap the parameters of ftp_index declaration in PARAMS.
4040
4041         * cookies.c (cookie_new): Use (unsigned long)0 instead of 0UL,
4042         which was unsupported by pre-ANSI compilers.
4043
4044         From Nelson H. F. Beebe <beebe@math.utah.edu>, for the most part.
4045
4046 2002-04-11  Hrvoje Niksic  <hniksic@arsdigita.com>
4047
4048         * url.c (url_filename): Use compose_file_name regardless of
4049         whether opt.dirstruct is set.
4050         (mkstruct): Don't handle the query and the reencoding of DIR; that
4051         is done in compose_file_name.
4052
4053 2002-04-10  Hrvoje Niksic  <hniksic@arsdigita.com>
4054
4055         * wget.h: Ditto for extern char *exec_name.
4056
4057         * options.h: Don't guard against OPTIONS_DEFINED_HERE -- it is
4058         perfectly legal to follow an `extern' with a non-`extern' ones,
4059         provided the types match.
4060
4061         * main.c: Don't define OPTIONS_DEFINED_HERE.
4062
4063 2002-04-10  Hrvoje Niksic  <hniksic@arsdigita.com>
4064
4065         * progress.c (create_image): Revert to calculating ETA based on
4066         average download speed.
4067         (create_image): Don't print ETA until the download has been active
4068         for at least 3 seconds.
4069         (create_image): When ETA is not available, don't print anything.
4070         The previous version would print --:--.
4071
4072 2002-04-10  Hrvoje Niksic  <hniksic@arsdigita.com>
4073
4074         * progress.c (bar_update): Keep updating a subinterval until it
4075         reaches or exceeds a watermark.  That way the measurement will be
4076         guaranteed to span a configurable minimum of time.  The current
4077         default is 3s in 30 100ms intervals.
4078
4079 2002-04-09  Hrvoje Niksic  <hniksic@arsdigita.com>
4080
4081         * progress.c (bar_update): Maintain an array of the time it took
4082         to perform previous 30 network reads.
4083         (create_image): Calculate the download speed and ETA based on the
4084         last 30 reads, not the entire download.
4085         (create_image): Make sure that the ETA is not changed more than
4086         once per second.
4087
4088 2002-04-09  Ian Abbott  <abbotti@mev.co.uk>
4089
4090         * mswindows.c (borland_utime): New function conditionally defined
4091         when `HACK_BCC_UTIME_BUG' is defined.  A reimplementation of
4092         `utime()' as Borland's `utime()' function is broken on Windows 9x
4093         systems.  (Original patch by Chin-yuan Kuo <sr1111111@yahoo.com.tw>.)
4094
4095 2002-04-08  Hrvoje Niksic  <hniksic@arsdigita.com>
4096
4097         * ftp.c (ftp_loop): Propagate the result of ftp_retrieve_glob.
4098
4099 2002-03-26  Ian Abbott  <abbotti@mev.co.uk>
4100
4101         * Makefile.in: Updated several dependencies for object files.
4102
4103 2002-03-20  Ian Abbott  <abbotti@mev.co.uk>
4104
4105         * mswindows.c: Include "utils.h".
4106
4107 2002-03-18  Ian Abbott  <abbotti@mev.co.uk>
4108
4109         * host.h: Don't include netdb.h on windows.
4110
4111 2002-02-19  Hrvoje Niksic  <hniksic@arsdigita.com>
4112
4113         * recur.c (retrieve_tree): Handle the case when start_url doesn't
4114         parse.
4115
4116 2002-02-19  Andreas Damm  <andreas-sourceforge@radab.org>
4117
4118         * wget.h (DO_REALLOC_FROM_ALLOCA): Multiply with sizeof(type) when
4119         calling xmalloc and memcpy.
4120
4121 2002-02-19  Hrvoje Niksic  <hniksic@arsdigita.com>
4122
4123         * host.h: Include Unix-specific includes #ifndef WINDOWS.
4124         Patch originally provided by Christian Lackas.
4125
4126 2002-02-11  Christian Lackas  <delta@lackas.net>
4127
4128         * recur.c: recurive downloading for https fixed.
4129
4130 2002-02-19  Alan Eldridge  <alane@geeksrus.net>
4131
4132         * host.h: Also include <netinet/in.h> and <sys/socket.h>.
4133
4134         * ftp-basic.c: Also include <netinet/in.h>.
4135
4136 2002-02-05  Ian Abbott  <abbotti@mev.co.uk>
4137
4138         * http.c (gethttp): when -c used, mark already fully retrieved
4139         file as successfully retrieved.
4140
4141 2002-02-19  Hrvoje Niksic  <hniksic@arsdigita.com>
4142
4143         * url.c (url_parse): Don't treat '?' as query string separator
4144         when parsing FTP URLs.
4145
4146 2002-02-01  Hrvoje Niksic  <hniksic@arsdigita.com>
4147
4148         * html-url.c (tag_handle_meta): Don't crash on <meta
4149         http-equiv=refresh> where content is missing.
4150
4151 2002-01-31  Herold Heiko  <Heiko.Herold@previnet.it>
4152
4153         * ftp-basic.c, host.c: don't include sys/socket.h, arpa/inet.h,
4154         netdb.h on windows.
4155
4156 2002-01-30  Hrvoje Niksic  <hniksic@arsdigita.com>
4157
4158         * retr.c (retrieve_url): Remove redirection cycle detection.  This
4159         is because some sites legitimately redirect the user back to the
4160         same location, e.g. after an authorization check performed by
4161         another page.  MAX_REDIRECTIONS is still used to prevent infinite
4162         redirection loops.
4163
4164 2002-01-26  Hrvoje Niksic  <hniksic@arsdigita.com>
4165
4166         * http.c (gethttp): Wrap host name in square brackets if it
4167         contains a colon.
4168
4169 2002-01-26  Hrvoje Niksic  <hniksic@arsdigita.com>
4170
4171         * url.c (url_parse): Allow all hex digits, not only decimal ones,
4172         to form an IP address.
4173
4174 2002-01-26  Hrvoje Niksic  <hniksic@arsdigita.com>
4175
4176         * url.c (urlchr_table): Make square braces reserved, so we can
4177         parse http://[::1]/.
4178         (url_parse): Handle host in braces.
4179         (url_string): If url->host contains colons, wrap it in braces.
4180
4181 2002-01-24  Hrvoje Niksic  <hniksic@arsdigita.com>
4182
4183         * connect.c (resolve_bind_address): New function.
4184         (connect_to_one): Use it.
4185         (bindport): Ditto.
4186
4187         * init.c: Don't resolve bind-address here.
4188
4189         * host.c (wget_sockaddr_set_address): Would bug out with ADDR == NULL.
4190
4191 2002-01-24  Hrvoje Niksic  <hniksic@arsdigita.com>
4192
4193         * host.c (lookup_host): Use sizeof(ip4_address) to calculate the
4194         offset.
4195         (address_list_new): Use map_ipv4_to_ip.
4196         (wget_sockaddr_set_address): Convert ADDR to IPv4 before using it
4197         in IPv4 context.
4198
4199 2002-01-24  Hrvoje Niksic  <hniksic@arsdigita.com>
4200
4201         * source: Integrated IPv6 support.
4202         Written by Thomas Lussnig <thomas.lussnig@bewegungsmelder.de>.
4203
4204 2002-01-15  Ian Abbott  <abbotti@mev.co.uk>
4205
4206         * init.c (cmd_file): Change `\' to `/' for Windows (yes, really!)
4207         (cmd_directory): New function. Like cmd_file(), but strips
4208         trailing directory separators.
4209         (commands): Change action for "dirprefix" from `cmd_file' to
4210         `cmd_directory'.
4211
4212         * utils.c (make_directory): Allow intermediate `mkdir' calls to
4213         fail, as not all path components that do not exist should be
4214         directory components, especially under Windows.
4215
4216 2002-01-17  Hrvoje Niksic  <hniksic@arsdigita.com>
4217
4218         * netrc.c (parse_netrc): Skip leading whitespace before testing
4219         whether the line is empty.  Empty lines still contain the line
4220         terminator.
4221
4222 2002-01-15  Hrvoje Niksic  <hniksic@arsdigita.com>
4223
4224         * gen_sslfunc.c (ssl_iread): Call select on the file descriptor
4225         only if no data is pending in SSL buffers.
4226         From tony@bluetail.com.
4227
4228 2002-01-14  Hrvoje Niksic  <hniksic@arsdigita.com>
4229
4230         * headers.c (header_get): Strip trailing whitespace from the
4231         header.
4232
4233 2002-01-14  Hrvoje Niksic  <hniksic@arsdigita.com>
4234
4235         * url.c (parse_uname): URL-decode *USER and *PASSWD.
4236
4237 2002-01-07  Ian Abbott <abbotti@mev.co.uk>
4238
4239         * url.c (uri_merge_1): Deal with "net path" relative URL (one that
4240         starts with "//").
4241
4242 2002-01-14  Hrvoje Niksic  <hniksic@arsdigita.com>
4243
4244         * http.c (gethttp): Invalidate SOCK if get_contents encountered an
4245         error.
4246
4247 2001-12-24  Hrvoje Niksic  <hniksic@arsdigita.com>
4248
4249         * version.c: Wget 1.8.1 is released.
4250
4251 2001-12-19  Hrvoje Niksic  <hniksic@arsdigita.com>
4252
4253         * version.c: Wget 1.8.1-pre3 is released.
4254
4255 2001-12-19  Hrvoje Niksic  <hniksic@arsdigita.com>
4256
4257         * recur.c (retrieve_tree): Enqueue the canonical representation of
4258         start_url, so that the test against dl_url_file_map works.
4259
4260 2001-12-19  Hrvoje Niksic  <hniksic@arsdigita.com>
4261
4262         * log.c (logputs): Check for requested verbosity before printing
4263         anything.
4264
4265 2001-12-19  Hrvoje Niksic  <hniksic@arsdigita.com>
4266
4267         * html-url.c (tag_handle_link): Treat the "shortcut icon" link as
4268         inline.
4269
4270 2001-12-18  Hrvoje Niksic  <hniksic@arsdigita.com>
4271
4272         * recur.c (retrieve_tree): Make a copy of file obtained from
4273         dl_url_file_map because the code calls xfree(file) later.
4274
4275 2001-12-18  Hrvoje Niksic  <hniksic@arsdigita.com>
4276
4277         * recur.c (register_html): Maintain a hash table of HTML files
4278         along with the list.  Disallow duplicates.
4279         (retrieve_tree): Use downloaded_html_set to check whether the file
4280         found in dl_url_file_map is an HTML file, and descend into it if
4281         so.
4282         (convert_all_links): Don't guard against duplicates in
4283         downloaded_html_list, since they are no longer possible.
4284
4285 2001-12-18  Ian Abbott  <abbotti@mev.co.uk>
4286
4287         * recur.c (retrieve_tree): Pass on referring URL when retrieving
4288         recursed URL.
4289
4290 2001-12-17  Hrvoje Niksic  <hniksic@arsdigita.com>
4291
4292         * version.c: Wget 1.8.1-pre2 is released.
4293
4294 2001-12-17  Hrvoje Niksic  <hniksic@arsdigita.com>
4295
4296         * retr.c (sleep_between_retrievals): Simplify indentation.
4297
4298 2001-12-17  Hrvoje Niksic  <hniksic@arsdigita.com>
4299
4300         * gen_sslfunc.c (ssl_init_prng): Use random_number to get a byte
4301         of "randomness" at a time.
4302         (ssl_init_prng): Don't seed the PRNG; random_number will do that.
4303
4304         * retr.c (sleep_between_retrievals): Use it.  Make sure that the
4305         random amount averages in opt.wait.
4306         (sleep_between_retrievals): Don't seed the PRNG; random_number
4307         will do that.
4308
4309         * utils.c (random_number): New function.
4310
4311 2001-12-14  Hrvoje Niksic  <hniksic@arsdigita.com>
4312
4313         * url.c (path_simplify): Move here from utils.c, and make static.
4314
4315 2001-12-13  Hrvoje Niksic  <hniksic@arsdigita.com>
4316
4317         * init.c (wgetrc_file_name): Print correct message when loading
4318         getenv("WGETRC") fails.
4319
4320 2001-12-13  Hrvoje Niksic  <hniksic@arsdigita.com>
4321
4322         * recur.c (register_download): Don't abort when one URL references
4323         two different files.
4324
4325 2001-12-13  Hrvoje Niksic  <hniksic@arsdigita.com>
4326
4327         * http.c (gethttp): Check for conn->scheme, not u->scheme, before
4328         calling ssl_iwrite.
4329
4330 2001-12-13  Hrvoje Niksic  <hniksic@arsdigita.com>
4331
4332         * version.c: Wget 1.8.1-pre1 is released.
4333
4334 2001-12-13  Hrvoje Niksic  <hniksic@arsdigita.com>
4335
4336         * res.c (matches): Fix broken URL in the docstring.
4337
4338 2001-12-13  Hrvoje Niksic  <hniksic@arsdigita.com>
4339
4340         * html-url.c (tag_url_attributes): Mark <embed href=...> as
4341         external.
4342
4343 2001-12-12  Hrvoje Niksic  <hniksic@arsdigita.com>
4344
4345         * url.c (get_urls_file): Cosmetic changes.
4346
4347 2001-12-12  Hrvoje Niksic  <hniksic@arsdigita.com>
4348
4349         * html-url.c (append_one_url): Resurrect warning when unable to
4350         resolve a relative link.
4351
4352 2001-12-12  Hrvoje Niksic  <hniksic@arsdigita.com>
4353
4354         * html-url.c (collect_tags_mapper): Break into several functions.
4355         (tag_url_attributes): Collect <embed href=...>.
4356
4357 2001-12-11  Hrvoje Niksic  <hniksic@arsdigita.com>
4358
4359         * host.c: New type ipv4_address.  Use it consistently instead of
4360         `unsigned char[4]' and `unsigned char *'.
4361         (pretty_print_address): Accept a `const void *', to require even
4362         less casting.
4363
4364 2001-12-11  Hrvoje Niksic  <hniksic@arsdigita.com>
4365
4366         * ftp-ls.c (ftp_parse_vms_ls): Fix obvious memory leaks.
4367
4368 2001-12-10  Hrvoje Niksic  <hniksic@arsdigita.com>
4369
4370         * main.c (main): Initialize progress after fork_to_background, so
4371         that it knows when to use dots.
4372
4373         * mswindows.c (ws_hangup): Call log_request_redirect_output.
4374
4375         * utils.c (fork_to_background): Print the PID of the child
4376         process.
4377
4378         * log.c (log_request_redirect_output): Set a flag that output
4379         redirection has been requested.  Doing anything else in a signal
4380         handler is unsafe.
4381         (check_redirect_output): New function: check whether redirection
4382         has been requested and, if so, call redirect_output().
4383         (logputs): Call check_redirect_output.
4384         (logprintf): Ditto.
4385         (debug_logprintf): Ditto.
4386         (redirect_output): Print clearer messages.
4387
4388         * main.c (redirect_output_signal): Don't call
4389         redirect_output_signal directly.  Instead, call
4390         log_request_redirect_output.
4391
4392         * utils.c (memfatal): Ditto.
4393
4394         * progress.c (display_image): Use it.
4395
4396         * log.c (log_set_save_context): New function: allow the caller to
4397         turn off saving log context lines.
4398
4399 2001-12-10  Hrvoje Niksic  <hniksic@arsdigita.com>
4400
4401         * host.c (address_list_set_faulty): Uncomment a sanity check.
4402
4403 2001-12-10  Hrvoje Niksic  <hniksic@arsdigita.com>
4404
4405         * utils.c (long_to_string): Return a pointer after where the
4406         number ends.
4407         (long_to_string): Rename to number_to_string.
4408
4409 2001-12-10  Hrvoje Niksic  <hniksic@arsdigita.com>
4410
4411         * utils.c (path_simplify): Correctly handle the unlikely case that
4412         b starts out as path + 1.
4413
4414 2001-12-10  Hrvoje Niksic  <hniksic@arsdigita.com>
4415
4416         * utils.c (path_simplify): Rewrite, with better comments, and
4417         without the use of strcpy to move overlapping blocks.
4418
4419 2001-12-09  Hrvoje Niksic  <hniksic@arsdigita.com>
4420
4421         * init.c (cmd_spec_progress): Resurrect.  Check whether VAL is a
4422         valid progress type before setting it.
4423
4424 2001-12-09  Hrvoje Niksic  <hniksic@arsdigita.com>
4425
4426         * main.c (main): Remove stray debugging message.
4427
4428 2001-12-09  Hrvoje Niksic  <hniksic@arsdigita.com>
4429
4430         * progress.c (create_image): Fix ETA padding when hours are prined.
4431
4432 2001-12-09  Hrvoje Niksic  <hniksic@arsdigita.com>
4433
4434         * version.c: Wget 1.8 is released.
4435
4436 2001-12-09  Hrvoje Niksic  <hniksic@arsdigita.com>
4437
4438         * url.c (reencode_string): Declare static.
4439
4440         * res.c (registered_specs): Declare static.
4441
4442         * progress.c (current_impl_locked): Declare static.
4443
4444         * log.c (flush_log_p): Declare static.
4445         (needs_flushing): Ditto.
4446
4447         * http.c (digest_authentication_encode): Declare static.
4448
4449         * html-url.c (init_interesting): Declare static.
4450
4451         * host.c (host_name_addresses_map): Declare static.
4452
4453         * cookies.c (find_matching_chains): Declare static.
4454
4455         * ftp-ls.c (ftp_parse_vms_ls): Warn about the memory leak
4456         indicated by lint.
4457
4458         * utils.c (path_simplify): Remove unused variable STUB_CHAR.
4459
4460         * host.c (address_list_set_faulty): Document that INDEX is
4461         currently unused.
4462
4463         * url.c (rewrite_shorthand_url): Remove unused variable PATH.
4464
4465 2001-12-08  Hrvoje Niksic  <hniksic@arsdigita.com>
4466
4467         * version.c: Wget 1.8-pre2 is released.
4468
4469 2001-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
4470
4471         * progress.c (progress_handle_sigwinch): Set up the signal again.
4472
4473         * utils.c: Include <sys/termios.h>, where Solaris defines
4474         TIOCGWINSZ.
4475
4476         * progress.c (bar_create): Don't use the last column on the screen.
4477         (create_image): Pad ETA to constant size.  Pad SIZE to nine digits
4478         only until it exceeded them.
4479
4480 2001-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
4481
4482         * version.c: Wget 1.8-pre1 is released.
4483
4484 2001-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
4485
4486         * progress.c (progress_create): Make sure that, when the output is
4487         redirected, the progress implementation gets changed to the
4488         fallback one.
4489         (bar_set_params): Set current_impl_locked to 1 when "force" is
4490         specified.
4491         (progress_create): Don't change the progress implementation if
4492         current_impl_locked is non-zero.
4493
4494         * main.c (redirect_output_signal): Call
4495         progress_schedule_redirect.
4496
4497         * progress.c (progress_schedule_redirect): New function.
4498
4499 2001-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
4500
4501         * log.c (logvprintf): Restructure to allow being called multiple
4502         times.
4503         (logprintf): Call logvprintf in a loop.
4504         (debug_logprintf): Ditto.
4505
4506 2001-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
4507
4508         * gen_sslfunc.c (ssl_init_prng): Allow the user to disable EGD by
4509         setting egd_file it to empty string.
4510
4511         * main.c (main): Change the option name from --sslegdsock to
4512         --egd-file.
4513
4514 2001-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
4515
4516         * gen_sslfunc.c (ssl_init_prng): Make the printed message
4517         translatable.
4518
4519 2001-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
4520
4521         * url.c (scheme_disable): New function.
4522
4523         * main.c (main): Call ssl_init_prng from here rather than from
4524         init_ssl, so that it has a chance to disable support for https
4525         before a URL has been resolved.
4526
4527         * gen_sslfunc.c (ssl_init_prng): Seed with rand() if all else
4528         failed.
4529         (ssl_init_prng): Disable support for https if seeding the PRNG
4530         fails.
4531
4532 2001-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
4533
4534         * utils.c (read_whole_line): Handle lines beginning with \0.
4535
4536 2001-12-05  Hrvoje Niksic  <hniksic@arsdigita.com>
4537
4538         * recur.c (convert_all_links): Guard against duplicates in
4539         downloaded_html_files.
4540         (register_download): Don't invalidate similar-looking URLs.
4541         (match_except_index): New function.
4542
4543 2001-12-05  Hrvoje Niksic  <hniksic@arsdigita.com>
4544
4545         * utils.c (path_simplify): Document with test cases.
4546
4547 2001-12-04  Hrvoje Niksic  <hniksic@arsdigita.com>
4548
4549         * gen_sslfunc.c: Ditto.
4550
4551         * rbuf.c: Include <string.h>.
4552
4553 2001-12-04  Hrvoje Niksic  <hniksic@arsdigita.com>
4554
4555         * recur.c (retrieve_tree): Check whether the URL was already
4556         downloaded before downloading it again.
4557         (descend_child_p): Renamed to download_child_p.
4558         (register_download): When one URL is downloaded to a file already
4559         "owned" by another URL, delete all references that map any URL to
4560         that file.
4561         (register_delete_file): New function.
4562         (retrieve_tree): Use it after deleting a file.
4563
4564         * url.c (url_parse): Re-canonicalize the URL also if the path is
4565         empty, so that e.g. "http://www.server.com" ->
4566         "http://www.server.com/".
4567         (lowercase_str): Use ISUPPER instead of !ISLOWER.
4568
4569         * retr.c (retrieve_url): Use the canonical URL form when calling
4570         register_download().
4571
4572 2001-12-04  Ian Abbott <abbotti@mev.co.uk>
4573
4574         * snprintf.c (dopr): Use `unsigned int' as the second argument to
4575         va_arg when casting to `unsigned short' is intended.
4576
4577 2001-12-04  Herold Heiko  <Heiko.Herold@previnet.it>
4578
4579         * gen_sslfunc.c: on windows provide ssl crypto random 
4580           initialization through RAND_screen(); could possibly
4581           be not enough for strong ssl communication (see the 
4582           relevant manual page from the openssl package).
4583
4584 2001-12-04  Hrvoje Niksic  <hniksic@arsdigita.com>
4585
4586         * url.c (local_quote_string): Reenable quoting of question marks,
4587         but only when `--html-extension' is used.
4588
4589 2001-12-03  Hrvoje Niksic  <hniksic@arsdigita.com>
4590
4591         * version.c: Wget 1.8-beta3 is released.
4592
4593 2001-12-03  Hrvoje Niksic  <hniksic@arsdigita.com>
4594
4595         * snprintf.c (dopr): Cast the result of va_arg to short int and
4596         short unsigned int where these types are expected to be used.
4597
4598 2001-12-03  Hrvoje Niksic  <hniksic@arsdigita.com>
4599
4600         * snprintf.c (dopr): Replace `short int' and `unsigned short int'
4601         with `int' when using it as the second argument to `va_arg'.
4602
4603 2001-12-03  Hrvoje Niksic  <hniksic@arsdigita.com>
4604
4605         * host.c (address_list_new_one): New function.
4606         (lookup_host): Use it.
4607
4608 2001-12-03  Andre Majorel  <amajorel@teaser.fr>
4609
4610         * host.c (lookup_host): Don't initialize TMPSTORE directly because
4611         it's not legal C.
4612
4613 2001-12-03  Hrvoje Niksic  <hniksic@arsdigita.com>
4614
4615         * ftp-basic.c (ftp_port): Don't return HOSTERR if we fail getting
4616         the socket data.
4617
4618         * ftp.c: Ditto.
4619
4620         * http.c: No need to declare h_errno.
4621
4622         * host.c: Declare h_errno.
4623
4624 2001-12-02  Hrvoje Niksic  <hniksic@arsdigita.com>
4625
4626         * utils.c (file_merge): If BASE doesn't contain a slash, just
4627         return a copy of FILE.
4628
4629 2001-12-02  Hrvoje Niksic  <hniksic@arsdigita.com>
4630
4631         * version.c: Wget 1.8-beta2 is released.
4632
4633 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
4634
4635         * ftp.c (getftp): When PWD fails, assume "/".
4636
4637         * ftp-basic.c (ftp_syst): Fix indentation.
4638
4639 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
4640
4641         * url.c (get_urls_file): If opt.base_href is specified, merge each
4642         URL with the base.
4643
4644 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
4645
4646         * main.c (print_help): Don't document the removed `-nh'.
4647
4648 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
4649
4650         * url.c (url_full_path): Document better.
4651
4652         * http.c (gethttp): Use the full path when creating digest
4653         authorization.
4654
4655 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
4656
4657         * cookies.c (path_matches): Return 0 if PREFIX doesn't begin with
4658         '/'.
4659
4660 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
4661
4662         * cookies.c (path_matches): FULL_PATH doesn't begin with '/', but
4663         PREFIX does.
4664
4665 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
4666
4667         * cookies.c (check_domain_match): Reimplement to match Netscape's
4668         "preliminary specification" for cookies.
4669
4670 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
4671
4672         * url.c (replace_attr_refresh_hack): New function.
4673         (convert_links): Call replace_attr_refresh_hack for Refresh
4674         links.  It will add the "TMOUT; URL=" junk before the link.
4675
4676         * html-url.c (collect_tags_mapper): Set ID to the ID of the
4677         "content" attribute, not "http-equiv".
4678         (collect_tags_mapper): Don't use OFFSET to hack the raw_* values;
4679         instead, store the information that this entry belongs to a
4680         "refresh" link.
4681
4682 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
4683
4684         * version.c: Wget 1.8-beta1 is released.
4685
4686 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
4687
4688         * recur.c (retrieve_tree): Allow -p retrievals to exceed maximum
4689         depth by more than one.
4690
4691 2001-11-30  Hrvoje Niksic  <hniksic@arsdigita.com>
4692
4693         * retr.c (retrieve_url): Don't allow more than 20 redirections.
4694
4695 2001-11-30  Hrvoje Niksic  <hniksic@arsdigita.com>
4696
4697         * recur.c (retrieve_tree): Skip the non-inline entries when
4698         enqueuing the children of a leaf HTML node in -p mode.
4699         (descend_url_p): Ignore opt.no_parent when in -p mode and UPOS is
4700         "inline".
4701
4702         * html-url.c (get_urls_html): Don't accept dash_p_leaf_HTML.
4703         (collect_tags_mapper): When an entry is "inline", mark it as such.
4704
4705         * recur.c (descend_url_p): Fix test when checking for
4706         acceptance/rejection rules.
4707
4708 2001-10-31 Daniel BODEA <dali@dali-designs.com>
4709
4710         * netrc.c (search_netrc): When slack_default is 0, still look for
4711         an account with matching password, just not the "default account".
4712         HTTP Authorization using .netrc should now work as expected.
4713
4714 2001-11-30  T. Bharath  <TBharath@responsenetworks.com>
4715
4716         * http.c (persistent_available_p): Call SHUTDOWN_SSL if
4717         test_socket_open fails.
4718
4719 2001-11-30  Hrvoje Niksic  <hniksic@arsdigita.com>
4720
4721         * progress.c (display_image): Just print one CR to reset the
4722         cursor position.
4723
4724 2001-11-30  Christian Fraenkel  <c.fraenkel@gmx.net>
4725
4726         * init.c: New command `ssl_egd_sock'.
4727
4728         * main.c (main): New option `--sslegdsock'.
4729
4730         * gen_sslfunc.c (ssl_init_prng): Seed the RNG using EGD.
4731
4732 2001-11-29  Hrvoje Niksic  <hniksic@arsdigita.com>
4733
4734         * cmpt.c (memmove): Include a simple memmove implementation.
4735
4736 2001-11-29  Hrvoje Niksic  <hniksic@arsdigita.com>
4737
4738         * headers: Guard against header files being included twice.
4739
4740 2001-11-29  Hrvoje Niksic  <hniksic@arsdigita.com>
4741
4742         * gen-md5.c: Use unsigned char * as the buffer argument to
4743         gen_md5_update.
4744
4745 2001-11-29  Hrvoje Niksic  <hniksic@arsdigita.com>
4746
4747         * connect.h: Declare select_fd.
4748
4749 2001-11-29  Hrvoje Niksic  <hniksic@arsdigita.com>
4750
4751         * recur.c (descend_url_p): When resolving no_parent, compare with
4752         start_url, not parent url.  Otherwise link from /a/b/ to /a/c/
4753         wouldn't be followed, although the download started from /a/.
4754
4755 2001-01-23  Herold Heiko  <Heiko.Herold@previnet.it>
4756
4757         * config.h.ms, mswindows.h: defined HAVE_ISATTY, use _isatty for
4758         MS VC; somebody with Borland compiler please check and provide
4759         patch if possible;
4760
4761         * cmpt.c: provided a usleep emulation.
4762
4763 2001-11-29  Hrvoje Niksic  <hniksic@arsdigita.com>
4764
4765         * host.c (address_list_new): Initialize al->faulty.
4766
4767 2001-11-29  Hrvoje Niksic  <hniksic@arsdigita.com>
4768
4769         * http.c (http_process_range): Accept the broken output of
4770         "JavaWebServer/1.1.1".
4771
4772 2001-11-28  Hrvoje Niksic  <hniksic@arsdigita.com>
4773
4774         * progress.c (dot_set_params): If PARAMS is unspecified, use
4775         dot_style, if available.
4776
4777         * init.c: Ditto.
4778
4779         * main.c (main): Resurect --dot-style.
4780
4781         * progress.c (dot_finish): Print the quantity if we're left at the
4782         beginning of a row.
4783
4784 2001-11-27  Hrvoje Niksic  <hniksic@arsdigita.com>
4785
4786         * cmpt.c (random): Removed.
4787
4788         * retr.c (sleep_between_retrievals): Use the more portable rand()
4789         instead of random().
4790
4791 2001-11-27  Ian Abbott <abbotti@mev.co.uk>
4792
4793         * retr.c (retrieve_from_file): Initialize `new_file' to NULL to
4794         prevent seg fault.
4795
4796 2001-11-27  Hrvoje Niksic  <hniksic@arsdigita.com>
4797
4798         * connect.c (connect_to_many): Use address_list_set_faulty to
4799         prevent the faulty address from being reused.
4800
4801         * host.c (address_list_set_faulty): New function.
4802         (address_list_get_bounds): New function, instead of
4803         address_list_count.
4804
4805 2001-11-27  Hrvoje Niksic  <hniksic@arsdigita.com>
4806
4807         * url.c (convert_links): Don't translate %d-%d.
4808
4809         * main.c (print_help): Remove stray HAVE_RANDOM code.
4810
4811 2001-11-27  Hrvoje Niksic  <hniksic@arsdigita.com>
4812
4813         * ftp.c (getftp): Improve output after sending PASV.  Don't
4814         attempt to "look up" the IP address we already know; call
4815         connect_to_one directly.
4816
4817 2001-11-27  Hrvoje Niksic  <hniksic@arsdigita.com>
4818
4819         * progress.c: Change the default progress implementation to "bar".
4820
4821 2001-11-27  Hrvoje Niksic  <hniksic@arsdigita.com>
4822
4823         * progress.c (bar_create): Print two newlines.
4824
4825 2001-11-27  Hrvoje Niksic  <hniksic@arsdigita.com>
4826
4827         * cmpt.c (random): New function, a simple-minded replacement for
4828         random() on systems that don't have it.
4829
4830 2001-11-26  Hrvoje Niksic  <hniksic@arsdigita.com>
4831
4832         * config.h.in: Put a HAVE_USLEEP stub.
4833
4834         * cmpt.c (usleep): Replacement implementation of usleep using
4835         select.
4836
4837         * init.c: New option init_rate.
4838
4839         * main.c (main): New option --limit-rate.
4840
4841         * retr.c (limit_bandwidth): New function.
4842         (get_contents): Call it to limit the bandwidth used when
4843         downloading.
4844
4845         * progress.c (dot_update): Would print the wrong download speed on
4846         rows other than the first one when the download was continued.
4847         (dot_finish): Ditto.
4848
4849 2001-11-26  Ian Abbott <abbotti@mev.co.uk>
4850
4851         * http.c (gethttp): fix undeclared variable 'err' when compiled
4852         with HAVE_SSL.
4853
4854 2001-11-26  Hrvoje Niksic  <hniksic@arsdigita.com>
4855
4856         * progress.c: Don't allocate new timers; use the timing data
4857         propagated from the caller.
4858
4859         * retr.c (get_contents): Allocate and use a timer.
4860
4861 2001-11-26  Hrvoje Niksic  <hniksic@arsdigita.com>
4862
4863         * http.c (last_host_ip): Made into an address_list.
4864         (invalidate_persistent): Release pc_last_host_ip.
4865         (register_persistent): Use lookup_host.
4866         (persistent_available_p): Check for equality of hosts using
4867         address_list_match_all.  Call address_list_release.
4868         (http_cleanup): New function.
4869
4870         * ftp.c (getftp): Use lookup_host and connect_to_many.
4871
4872         * http.c (gethttp): Use lookup_host and connect_to_many.
4873
4874         * connect.c (make_connection): Removed.
4875         (connect_to_one): New function.
4876         (connect_to_many): Ditto.
4877         (set_connection_host_name): Ditto.
4878
4879         * host.c (lookup_host): New function; new return type.
4880         (address_list_new): New function.
4881         (address_list_count): Ditto.
4882         (address_list_copy_one): Ditto.
4883         (address_list_delete): Ditto.
4884         (address_list_release): Ditto.
4885         (pretty_print_address): Ditto.
4886
4887 2001-11-26  Hrvoje Niksic  <hniksic@arsdigita.com>
4888
4889         * recur.c (retrieve_tree): In case of followed redirection,
4890         blacklist the pre-redirection URL.
4891
4892 2001-11-26  Hrvoje Niksic  <hniksic@arsdigita.com>
4893
4894         * recur.c (descend_redirect_p): New function.
4895         (retrieve_tree): Make sure redirections are not blindly followed.
4896
4897 2001-11-04  Alan Eldridge  <alane@geeksrus.net>
4898
4899         * config.h.in: added HAVE_RANDOM.
4900
4901         * options.h: added random_wait to struct options.
4902
4903         * main.c (print_help [HAVE_RANDOM], main): added arg parsing, help
4904         for --random-wait.
4905
4906         * retr.c (sleep_between_retrievals) [HAVE_RANDOM]: added
4907         implementation of random wait times.
4908
4909         * init.c (commands): added "randomwait" keyword.
4910
4911 2001-11-25  Hrvoje Niksic  <hniksic@arsdigita.com>
4912
4913         * recur.c (descend_url_p): Be more conservative with blacklisting
4914         URLs.
4915         (convert_all_links): Print how many files have been converted, and
4916         how long it took.
4917
4918         * progress.c (create_image): Place the number of downloaded bytes
4919         right after the progress bar.
4920
4921         * utils.c (suffix): Return a pointer into the string.
4922
4923 2001-11-25  Hrvoje Niksic  <hniksic@arsdigita.com>
4924
4925         * url.c (convert_links): Handle CO_NULLIFY_BASE.
4926
4927         * recur.c (retrieve_tree): Ignore download-ignorable children.
4928         (convert_all_links): Specify CO_NULLIFY_BASE when link_base_p.
4929
4930         * html-url.c (handle_link): Return the newly created urlpos.
4931         (collect_tags_mapper): When dealing with BASE, store the base
4932         reference and mark it as download-ignorable.
4933
4934 2001-11-25  Hrvoje Niksic  <hniksic@arsdigita.com>
4935
4936         * url.c (convert_links): Attempt to quote '?' as "%3F" when
4937         linking to local files.  Given up on the attempt, as it breaks
4938         local browsing.
4939
4940 2001-11-25  Hrvoje Niksic  <hniksic@arsdigita.com>
4941
4942         * main.c (private_initialize): Removed.
4943         (main): Don't call private_initialize.
4944
4945         * http.c: Call lookup_host.
4946
4947         * host.c (host_init): Removed.
4948         (add_host_to_cache): Initialize host_name_address_map here, on
4949         demand.
4950         (ngethostbyname): Commented out.
4951
4952         * connect.c (make_connection): Remove dead code; use lookup_host.
4953
4954         * host.c (store_hostaddress): Renamed to lookup_host and reversed
4955         the args.
4956         Removed host_address_name_map and host_slave_master_map.
4957
4958 2001-11-25  Hrvoje Niksic  <hniksic@arsdigita.com>
4959
4960         * progress.c (dot_create): Align the "[ skipping ... ]" string
4961         with the dots.
4962
4963         * retr.c (rate): Split into two functions: calc_rate and
4964         retr_rate.
4965
4966         * progress.c (create_image): Draw a dummy progress bar even when
4967         total size is unknown.
4968         (display_image): Place the text cursor at the end of the "image".
4969
4970 2001-11-25  Hrvoje Niksic  <hniksic@arsdigita.com>
4971
4972         * url.c (reencode_string): Use unsigned char, not char --
4973         otherwise the hex digits come out wrong for 8-bit chars such as
4974         nbsp.
4975         (lowercase_str): New function.
4976         (url_parse): Canonicalize u->url if needed.
4977         (get_urls_file): Parse each URL, and return only the valid ones.
4978         (free_urlpos): Call url_free.
4979         (mkstruct): Add :port if the port is non-standard.
4980         (mkstruct): Append the query string to the file name, if any.
4981         (urlpath_length): Use strpbrk_or_eos.
4982         (uri_merge_1): Handle the cases where LINK is an empty string,
4983         where LINK consists only of query, and where LINK consists only of
4984         fragment.
4985         (convert_links): Count and report both kinds of conversion.
4986         (downloaded_file): Use a hash table, not a list.
4987         (downloaded_files_free): Free the hash table.
4988
4989         * retr.c (retrieve_from_file): Ditto.
4990
4991         * main.c (main): Call either retrieve_url or retrieve_tree
4992         for each URL, not both.
4993
4994         * retr.c (register_all_redirections): New function.
4995         (register_redirections_mapper): Ditto.
4996         (retrieve_url): Register the redirections.
4997         (retrieve_url): Make the string "Error parsing proxy ..." 
4998         translatable.
4999
5000         * res.c (add_path): Strip leading slash from robots.txt paths so
5001         that the path representations are "compatible".
5002         (free_specs): Free each individual path, too.
5003         (res_cleanup): New function.
5004         (cleanup_hash_table_mapper): Ditto.
5005
5006         * recur.c (url_queue_new): New function.
5007         (url_queue_delete): Ditto.
5008         (url_enqueue): Ditto.
5009         (url_dequeue): Ditto.
5010         (retrieve_tree): New function, replacement for recursive_retrieve.
5011         (descend_url_p): New function.
5012         (register_redirection): New function.
5013
5014         * progress.c (create_image): Cosmetic changes.
5015
5016         * init.c (cleanup): Do all those complex cleanups only if
5017         DEBUG_MALLOC is defined.
5018
5019         * main.c: Removed --simple-check and the corresponding
5020         simple_host_check in init.c.
5021
5022         * html-url.c (handle_link): Parse the URL here, and propagate the
5023         parsed URL to the caller, who would otherwise have to parse it
5024         again.
5025
5026         * host.c (xstrdup_lower): Moved to utils.c.
5027         (realhost): Removed.
5028         (same_host): Ditto.
5029
5030 2001-11-24  Hrvoje Niksic  <hniksic@arsdigita.com>
5031
5032         * utils.c (path_simplify): Preserver the (non-)existence of
5033         leading slash.  Return non-zero if changes were made.
5034
5035 2001-11-24  Hrvoje Niksic  <hniksic@arsdigita.com>
5036
5037         * progress.c (bar_update): Don't modify bp->total_length if it is
5038         zero.
5039
5040 2001-11-24  Hrvoje Niksic  <hniksic@arsdigita.com>
5041
5042         * retr.c (retrieve_url): When the redirection URL doesn't parse,
5043         print the correct error message rather than "UNKNOWN".
5044
5045 2001-11-24  Hrvoje Niksic  <hniksic@arsdigita.com>
5046
5047         * progress.c (bar_finish): If the timer didn't record any time
5048         since the download beginning, fake 1ms.
5049
5050 2001-11-24  Hrvoje Niksic  <hniksic@arsdigita.com>
5051
5052         * recur.c (recursive_retrieve): Fix typo.
5053
5054 2001-11-23  Hrvoje Niksic  <hniksic@arsdigita.com>
5055
5056         * progress.c (create_image): Don't translate "%ld ".
5057
5058 2001-11-23  Hrvoje Niksic  <hniksic@arsdigita.com>
5059
5060         * progress.c (bar_set_params): Allow the user to force the use of
5061         the bar.
5062
5063 2001-11-23  Lemble Gregory  <gregory.lemble@st.com>
5064
5065         * gen_sslfunc.c (ssl_init_prng): New function; seed the SSL RNG.
5066
5067 2001-11-23  Hrvoje Niksic  <hniksic@arsdigita.com>
5068
5069         * progress.c: Renamed dp_* functions to dot_* for greater clarity
5070         and consistency with bar_*.
5071         (print_download_speed): Get rid of the unneeded '@' character.
5072         (create_image): Fix download rate geometry.
5073
5074         * progress.c (print_elapsed): Remove spurious space.
5075         (print_elapsed): Renamed to print_download_speed, since that's
5076         what it does.
5077
5078 2001-11-23  Hrvoje Niksic  <hniksic@arsdigita.com>
5079
5080         * progress.c (bar_update): If the downloaded amount becomes larger
5081         than the expected amount, adjust the expected amount accordingly.
5082
5083 2001-11-23  Hrvoje Niksic  <hniksic@arsdigita.com>
5084
5085         * utils.c (determine_screen_width): New function.
5086
5087         * main.c (main): New option `--progress=TYPE'.
5088         (main): Implement compatibility with the old option `--dot-style'.
5089
5090         * init.c: Removed cmd_spec_dotstyle -- that logic is now in
5091         dp_set_params.
5092         (cmd_spec_progress): New function.
5093
5094         * retr.c (get_contents): Use the progress_* functions instead of
5095         the old show_progress().
5096         (show_progress): Removed.
5097         (rate): Print "xxxx.xx K/s" instead of "KB/s".  Ditto for MB/s,
5098         etc.
5099
5100         * progress.c (set_progress_implementation): New function.
5101         (valid_progress_implementation_p): Ditto.
5102         (progress_create): Ditto.
5103         (progress_update): Ditto.
5104         (progress_finish): Ditto.
5105         (dp_create): Ditto.
5106         (dp_update): Ditto.
5107         (dp_finish): Ditto.
5108         (dp_set_params): Ditto.
5109         (print_elapsed): Ditto.
5110
5111 2001-11-22  Hrvoje Niksic  <hniksic@arsdigita.com>
5112
5113         * retr.c (show_progress): Use it.
5114
5115         * log.c (log_set_flush): New function.
5116
5117 2001-11-22  Hrvoje Niksic  <hniksic@arsdigita.com>
5118
5119         * utils.c (path_simplify): Don't remove trailing slashes.
5120
5121         * ftp.c (ftp_get_listing): Use it.
5122
5123         * utils.c (file_merge): New function.
5124
5125         * url.c (opt_url): Removed.
5126
5127         * recur.c (recursive_retrieve): Inline "opt_url" logic.
5128
5129         * main.c (main): Use xfree(), not free().
5130
5131         * url.c (rewrite_url_maybe): Renamed to rewrite_shorthand_url.
5132
5133         * ftp.c (ccon): Move `ccon' typedef here, since it's only used
5134         internally.
5135
5136         * config.h.in: Include a stub for HAVE_STRPBRK.
5137
5138         * cmpt.c (strpbrk): Include a replacement for systems without
5139         strpbrk().
5140
5141         * ftp.c: Use url_set_dir and url_set_file when modifying the URL.
5142
5143         * url.c (url_set_dir): New function.
5144         (url_set_file): Ditto.
5145
5146         * ftp-basic.c (ftp_process_type): Process FTP type here; the URL
5147         parser makes the URL "params" available, so we can do that in this
5148         function.
5149
5150         * retr.c: Ditto.
5151
5152         * ftp.c: Ditto; pass the local file information in `ccon'.
5153
5154         * http.c: Get rid of the ugly kludge that had URL being replaced
5155         with the proxy URL when proxy retrieval was requested.  Use a
5156         separate parameter to http_loop and gethttp for the proxy URL.
5157
5158         * http.c: Changed to reflect the fact that local file, proxy, and
5159         referer information are no longer stored in struct url.  The local
5160         file information is passed in `struct hstat' now.
5161
5162         * url.c: Reworked URL parsing to be more regular.  Reencode the
5163         URL using reencode_string.
5164         Removed non-URL-related information from struct url.  This
5165         includes fields `proxy', `local', and `referer'.
5166
5167 2001-11-22  Jochen Hein  <jochen@jochen.org>
5168
5169         * main.c (main): Split the copyright notice for easier
5170         translation.
5171
5172 2001-08-21  Dave Turner <dct25@hermes.cam.ac.uk>
5173
5174         * ftp-basic.c (ftp_size): New function to send non-standard SIZE
5175           command to server to request file size.
5176         * ftp.h (ftp_size): Export it.
5177         * ftp.c (getftp): Use new ftp_size function if restoring
5178           transfer of a file with unknown size.
5179
5180 2001-11-20  Hrvoje Niksic  <hniksic@arsdigita.com>
5181
5182         * url.c (parseurl): Don't depend on the now-obsolete TYPE.
5183
5184 2001-11-19  Hrvoje Niksic  <hniksic@arsdigita.com>
5185
5186         * url.c (getproxy): Handle URL shorthands.
5187
5188 2001-11-19  Hrvoje Niksic  <hniksic@arsdigita.com>
5189
5190         * main.c: Remove --wait / --waitretry backwards compatibility
5191         code.
5192         
5193 2001-11-19  Hrvoje Niksic  <hniksic@arsdigita.com>
5194
5195         * main.c (main): Use it.
5196
5197         * url.c (rewrite_url_maybe): New function.
5198
5199 2001-11-19  Hrvoje Niksic  <hniksic@arsdigita.com>
5200
5201         * url.c: Clean up handling of URL schemes.
5202
5203 2001-05-13  Hrvoje Niksic  <hniksic@arsdigita.com>
5204
5205         * url.c: Get rid of `protostrings'.
5206         (skip_proto): Don't use protostrings.
5207         (has_proto): Ditto.
5208
5209 2001-11-18  Hrvoje Niksic  <hniksic@arsdigita.com>
5210
5211         * Makefile.in: Conditionally compile getopt.o.
5212
5213 2001-11-18  Hrvoje Niksic  <hniksic@arsdigita.com>
5214
5215         * md5.h: Renamed to gnu-md5.h.
5216
5217         * md5.c: Renamed to gnu-md5.c.
5218
5219         * http.c: Ditto.
5220
5221         * ftp-opie.c: Use the new macros.
5222
5223         * sysdep.h: Define md5-related macros.
5224
5225         * config.h.in: Define HAVE_SOLARIS_MD5 or HAVE_BUILTIN_MD5
5226         depending on which md5 implementation is used.
5227
5228 2001-11-18  Hrvoje Niksic  <hniksic@arsdigita.com>
5229
5230         * res.c (res_register_specs): Initialize OLD and HP_OLD to appease
5231         the compiler.
5232
5233 2001-11-18  Hrvoje Niksic  <hniksic@arsdigita.com>
5234
5235         * http.c (gethttp): Print the whole response line when printing
5236         headers is requested.
5237
5238 2001-05-12  Hrvoje Niksic  <hniksic@arsdigita.com>
5239
5240         * res.c: New file.  Implement all RES-related code here.
5241
5242 2001-11-18  Hrvoje Niksic  <hniksic@arsdigita.com>
5243
5244         * version.c: Wget 1.7.1 is released.
5245
5246 2001-11-16  Hrvoje Niksic  <hniksic@arsdigita.com>
5247
5248         * headers.c (header_extract_number): Ignore trailing whitespace.
5249
5250 2001-08-24  Ian Abbott  <abbotti@mev.co.uk>
5251
5252         * html-url.c (collect_tags_mapper): Fix bug converting links
5253         with -k option for tags with multiple link attributes by
5254         handling links in the order they appear.
5255
5256 2001-08-15  Ian Abbott  <abbotti@mev.co.uk>
5257
5258         * ftp.c (ftp_loop_internal): Avoid a potential buffer overflow in
5259           the call to the 'rate' function by moving it past the error
5260           checking for the 'getftp' function return value.
5261
5262 2001-11-16  Hrvoje Niksic  <hniksic@arsdigita.com>
5263
5264         * html-parse.c (advance_declaration): Use 0x22 instead of '"' or
5265         '\"'.  Different compilers' assert macros are broken in different
5266         ways.
5267
5268 2001-09-29  Christian Fraenkel  <c.fraenkel@gmx.net>
5269
5270         * http.c (gethttp): print debug output for errors occuring during
5271         the ssl handshake.
5272
5273 2001-11-16  Chris Seawood  <cls@seawood.org>
5274
5275         * init.c: Ditto.
5276
5277         * host.c: Ditto.
5278
5279         * connect.c: Ditto.
5280
5281         * sysdep.h: Support compilation under BEOS.
5282
5283 2001-06-08  Edward J. Sabol  <sabol@alderaan.gsfc.nasa.gov>
5284
5285         * url.c (url_equal): Fix a memory leak when parseurl returns an
5286         error on the second URL. Also, since url_equal is not used at the
5287         moment, do not compile it.
5288
5289         * url.h: Ditto for the prototype of url_equal.
5290
5291 2001-11-16  Hrvoje Niksic  <hniksic@arsdigita.com>
5292
5293         * html-parse.c (map_html_tags): Support XML-style empty tags.
5294
5295 2001-06-26  Hrvoje Niksic  <hniksic@arsdigita.com>
5296
5297         * wget.h (DO_REALLOC_FROM_ALLOCA): Check for do_realloc_newsize in
5298         loop condition because we're no longer setting SIZEVAR here.
5299
5300 2001-06-26  Hrvoje Niksic  <hniksic@arsdigita.com>
5301
5302         * wget.h (DO_REALLOC_FROM_ALLOCA): Set SIZEVAR after the memcpy()
5303         call because it needs the old value.
5304
5305 2001-06-18  Hrvoje Niksic  <hniksic@arsdigita.com>
5306
5307         * cookies.c (ATTR_NAME_CHAR): Allow almost any character to be in
5308         an attribute name.
5309
5310 2001-06-18  Hrvoje Niksic  <hniksic@arsdigita.com>
5311
5312         * url.c (url_filename): Make sure that slashes that sneak in to
5313         u->file via query string get protected.
5314         (file_name_protect_query_string): New function.
5315
5316 2001-06-14  Hrvoje Niksic  <hniksic@arsdigita.com>
5317
5318         * recur.c (recursive_retrieve): Also check undesirable_urls with
5319         canonicalized URL.
5320
5321 2001-06-14  Hrvoje Niksic  <hniksic@arsdigita.com>
5322
5323         * http.c (gethttp): Search `.netrc' with real host, not the proxy
5324         one.
5325
5326 2001-06-14  Hrvoje Niksic  <hniksic@arsdigita.com>
5327
5328         * sysdep.h (MAP_FAILED): Provide MAP_FAILED for systems that don't
5329         define it.
5330
5331 2001-06-09  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
5332
5333         * ftp.h: Provide correct prototype for ftp_parse_ls().
5334
5335 2001-06-04  Hrvoje Niksic  <hniksic@arsdigita.com>
5336
5337         * version.c: Wget 1.7 is released.
5338
5339 2001-06-03  Karl Eichwalder  <ke@suse.de>
5340
5341         * ftp-ls.c (ftp_parse_ls): Fix typo.
5342
5343 2001-05-27  Hrvoje Niksic  <hniksic@arsdigita.com>
5344
5345         * all: Update copyright information.
5346
5347 2001-05-26  Hrvoje Niksic  <hniksic@arsdigita.com>
5348
5349         * http.c (gethttp): Indicate that the continued download failed
5350         for *this* file.
5351
5352 2001-05-26  Hrvoje Niksic  <hniksic@arsdigita.com>
5353
5354         * version.c: Wget 1.7-pre1 is released.
5355
5356 2001-05-26  Hrvoje Niksic  <hniksic@arsdigita.com>
5357
5358         * version.c: Updated version to 1.7-pre1.
5359
5360 2001-05-14  Hrvoje Niksic  <hniksic@arsdigita.com>
5361
5362         * gen_sslfunc.c: Don't include <sys/time.h> directly.
5363
5364 2001-05-14  Hrvoje Niksic  <hniksic@arsdigita.com>
5365
5366         * http.c (gethttp): Use real URL data for cookies, not the proxy
5367         stuff.
5368
5369 2001-05-12  Hrvoje Niksic  <hniksic@arsdigita.com>
5370
5371         * main.c (print_help): Document `--no-http-keep-alive'.
5372
5373         * utils.c (numdigit): Handle negative numbers *correctly*.
5374
5375         * hash.c (make_nocase_string_hash_table): Use term "nocase" rather
5376         than the confusing "unsigned".
5377
5378         * utils.c (string_set_contains): Renamed from string_set_exists.
5379
5380         * hash.c (hash_table_contains): Renamed from hash_table_exists.
5381
5382         * cookies.c: Move case-insensitive hash tables to hash.c.
5383
5384 2001-05-09  Hrvoje Niksic  <hniksic@arsdigita.com>
5385
5386         * http.c (gethttp): Before concluding that the file is already
5387         fully retrieved, make sure that the file existed and `Range' was
5388         actually requested.
5389
5390 2001-05-09  Hrvoje Niksic  <hniksic@arsdigita.com>
5391
5392         * cookies.c (eliminate_dups): New function.
5393         (build_cookies_request): Use it.
5394         (build_cookies_request): Set chain_store_size after reallocating
5395         all_chains.
5396         (check_domain_match): Annotated for easier future debugging.
5397         (store_cookie): In the debug message, print whether the cookie is
5398         permanent.
5399
5400 2001-05-08  Hrvoje Niksic  <hniksic@arsdigita.com>
5401
5402         * http.c (http_loop): Reset no_truncate before deciding whether to
5403         set it.
5404         (gethttp): Further clarify "-c conflicts with existing file" error
5405         message, based on input from Herold Heiko.
5406
5407 2001-05-07  Hrvoje Niksic  <hniksic@arsdigita.com>
5408
5409         * http.c (http_loop): If restval is set, set no_truncate to 1
5410         unconditionally.
5411
5412 2001-05-02  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
5413
5414         * ftp-ls.c (ftp_parse_winnt_ls): Assure months are being correctly
5415         converted. Pointed out by <Stefan.Weil@de.heidelberg.com>.
5416         (ftp_parse_vms_ls): Ditto.
5417
5418 2001-04-30  Hrvoje Niksic  <hniksic@arsdigita.com>
5419
5420         * init.c (cmd_address): Zero SIN before using it; apparently
5421         needed on *BSD.
5422
5423 2001-04-29  Hrvoje Niksic  <hniksic@arsdigita.com>
5424
5425         * ftp.c (ftp_loop_internal): Don't set NO_TRUNCATE if the file is
5426         empty.
5427
5428 2001-04-29  Hrvoje Niksic  <hniksic@arsdigita.com>
5429
5430         * main.c (main): Make `--cookies' respect its argument.
5431
5432 2001-04-28  Hrvoje Niksic  <hniksic@arsdigita.com>
5433
5434         * main.c (main): Removed undocumented option `--email-address'.
5435
5436         * netrc.c: Use the latest read_whole_line.
5437
5438         * init.c (defaults): Set opt.ftp_pass to "-wget@".
5439
5440         * mswindows.c (pwd_cuserid): Ditto.
5441
5442         * utils.c (pwd_cuserid): Removed.
5443
5444         * host.c (ftp_getaddress): Removed.
5445
5446 2001-04-28  Hrvoje Niksic  <hniksic@arsdigita.com>
5447
5448         (http_loop): Allocate space for filename_plus_orig_suffix with
5449         alloca; this is more efficient and removes the need to free it
5450         before each and every return.
5451
5452 2001-04-28  Hrvoje Niksic  <hniksic@arsdigita.com>
5453
5454         * http.c (gethttp): Return RETRUNNEEDED when the retrieval is
5455         unneeded because the file is already there and fully downloaded,
5456         and -c is specified.
5457         (http_loop): Handle RETRUNNEEDED.
5458
5459         * wget.h (uerr_t): New value RETRUNNEEDED.
5460
5461         * http.c (http_loop): Set no_truncate for files that both exist
5462         and are non-empty.
5463         (gethttp): Consider the download finished when restval >= contlen,
5464         not only when restval==contlen.
5465         (gethttp): Handle redirection before giving up due to -c.
5466         (gethttp): Clarify error message which explains that -c will not
5467         truncate the file.
5468         (gethttp): When returning CONTNOTSUPPORTED, don't forget to free
5469         the stuff that needs freeing and release the socket.
5470
5471 2001-04-27  Hrvoje Niksic  <hniksic@arsdigita.com>
5472
5473         * main.c (print_help): Wget booleans accept "off", not "no".
5474
5475 2001-04-27  Hrvoje Niksic  <hniksic@arsdigita.com>
5476
5477         * http.c (http_loop): If allow_cache is zero, always disable
5478         caching, not only when retrieving through proxy.
5479
5480         * init.c: Ditto.
5481
5482         * options.h (struct options): Rename proxy_cache to allow_cache.
5483
5484 2001-04-27  Hrvoje Niksic  <hniksic@arsdigita.com>
5485
5486         * http.c (mktime_from_utc): Improve documentation.
5487         (http_atotm): Put format strings into a separate array.
5488
5489 2001-04-27  Hrvoje Niksic  <hniksic@arsdigita.com>
5490
5491         * safe-ctype.h: Instead of throwing #error when isalpha is
5492         defined, redefine it to something that will throw a compile-time
5493         error if actually *used*.  Do the same for the rest of the
5494         standard C macros.
5495
5496 2001-04-26  Hrvoje Niksic  <hniksic@arsdigita.com>
5497
5498         * url.c (getproxy): Ignore empty proxy vars.
5499
5500 2001-04-25  Hrvoje Niksic  <hniksic@arsdigita.com>
5501
5502         * http.c (http_loop): Would load cookies every time.
5503
5504         * cookies.c (load_cookies): Handle cookies whose values contain
5505         embedded spaces.
5506
5507 2001-04-25  Hrvoje Niksic  <hniksic@arsdigita.com>
5508
5509         * utils.c: Define each DIGITS_* in one line.
5510
5511 2001-04-25  Roger L. Beeman  <beeman@cisco.com>
5512
5513         * http.c (http_atotm): Initialize t.tm_isdst to 0.
5514         (mktime_from_utc): Prevent mktime() from having discontinuities at
5515         DST transition points.
5516
5517 2001-04-25  Hrvoje Niksic  <hniksic@arsdigita.com>
5518
5519         * html-url.c (get_urls_html): Fix documentation.
5520
5521 2001-04-25  Hrvoje Niksic  <hniksic@arsdigita.com>
5522
5523         * url.c (UNSAFE_CHAR): Reimplement using a static table.
5524         (url_init): Removed.
5525         (init_unsafe_char_table): Removed.
5526
5527 2001-04-25  Hrvoje Niksic  <hniksic@arsdigita.com>
5528
5529         * snprintf.c (dopr): Replace ISDIGIT with '0' <= ch && ch <= '9'.
5530
5531 2001-04-25  Hrvoje Niksic  <hniksic@arsdigita.com>
5532
5533         * utils.c: Document timer functions.
5534
5535         * retr.c (rate): Use it.
5536         (rate): Print in GB/s if transfer rate exceeds 1 GB/s.
5537
5538         * utils.c (wtimer_granularity): New function.
5539
5540 2001-04-24  Hrvoje Niksic  <hniksic@arsdigita.com>
5541
5542         * retr.c (show_progress): Ditto.
5543
5544         * ftp.c (getftp): Ditto.
5545
5546         * http.c (gethttp): Use new timer functions.
5547
5548         * utils.c (wtimer_allocate): New function.
5549         (wtimer_new): Ditto.
5550         (wtimer_delete): Ditto.
5551         (wtimer_reset): Ditto.
5552         (wtimer_elapsed): Ditto.
5553
5554 2001-04-24  Hrvoje Niksic  <hniksic@arsdigita.com>
5555
5556         * utils.c (long_to_string): New, faster version.  Favors smaller
5557         numbers; much of the calculation is now done at compile-time.
5558
5559 2001-04-24  Hrvoje Niksic  <hniksic@arsdigita.com>
5560
5561         * utils.c (numdigit): Handle negative numbers.
5562
5563 2001-04-23  Hrvoje Niksic  <hniksic@arsdigita.com>
5564
5565         * retr.c (show_progress): Print the download rate even when the
5566         percentages are not available.
5567
5568 2001-04-21  Hrvoje Niksic  <hniksic@arsdigita.com>
5569
5570         * ftp.c (getftp): Adjust expected_bytes if the length is
5571         authoritative.
5572
5573 2001-04-14  Hrvoje Niksic  <hniksic@arsdigita.com>
5574
5575         * url.c: Don't declare `construct'.
5576
5577         * hash.c (grow_hash_table): Speed up rehashing; inline storing of
5578         mappings to new locations.
5579         (hash_table_new): Make resize_threshold a field in the hash table,
5580         so we don't have to recalculate it in each hash_table_put.
5581         (grow_hash_table): Update resize_threshold.
5582         (MAX): Remove unused macro.
5583         (prime_size): Made static.
5584
5585 2001-04-14  Hrvoje Niksic  <hniksic@arsdigita.com>
5586
5587         * retr.c (retrieve_url): Call uri_merge, not url_concat.
5588
5589         * html-url.c (collect_tags_mapper): Call uri_merge, not
5590         url_concat.
5591
5592         * url.c (mkstruct): Use encode_string instead of xstrdup followed
5593         by URL_CLEANSE.
5594         (path_simplify_with_kludge): Deleted.
5595         (contains_unsafe): Deleted.
5596         (construct): Renamed to uri_merge_1.
5597         (url_concat): Renamed to uri_merge.
5598
5599 2001-04-13  Hrvoje Niksic  <hniksic@arsdigita.com>
5600
5601         * url.c (str_url): Use encode_string instead of the unnecessary
5602         CLEANDUP.
5603         (encode_string_maybe): New function, returns input string if no
5604         encoding is needed.
5605         (encode_string): Call encode_string_maybe to do the dirty work,
5606         xstrdup if no work needed.
5607
5608 2001-04-13  Hrvoje Niksic  <hniksic@arsdigita.com>
5609
5610         * wget.h (XDIGIT_TO_xchar): Define here.
5611
5612         * url.c (decode_string): Use new name.
5613         (encode_string): Ditto.
5614
5615         * http.c (XDIGIT_TO_xchar): Rename HEXD2asc to XDIGIT_TO_xchar.
5616         (dump_hash): Use new name.
5617
5618         * wget.h: Rename ASC2HEXD and HEXD2ASC to XCHAR_TO_XDIGIT and
5619         XDIGIT_TO_XCHAR respectively.
5620
5621 2001-04-13  Hrvoje Niksic  <hniksic@arsdigita.com>
5622
5623         * init.c: Include cookies.h.
5624
5625         * cookies.h: Declare cookies_cleanup.
5626
5627         * cookies.c (check_domain_match): Remove unused variable.
5628         (save_cookies): Remove extraneous argument from debug statement.
5629
5630         * host.c (same_host): Don't call skip_url.
5631
5632         * url.c (skip_url): Removed.  Removed its calls from various
5633         functions in url.c.
5634
5635 2001-04-13  Hrvoje Niksic  <hniksic@arsdigita.com>
5636
5637         * cookies.c (unsigned_string_hash): Use the new code in
5638         string_hash as reference.
5639
5640         * hash.c (hash_table_map): Allow deletion and change of the
5641         element processed by MAPFUN.
5642         (string_hash): Use the function from glib.
5643
5644 2001-04-12  Hrvoje Niksic  <hniksic@arsdigita.com>
5645
5646         * config.h.in: Include #undef stub.
5647
5648         * hash.c (hash_table_remove): Rewrite to actually clear deleted
5649         entries instead of just marking them as deleted.
5650
5651 2001-04-12  Hrvoje Niksic  <hniksic@arsdigita.com>
5652
5653         * hash.h: Declare hash_table_get_pair and hash_table_count.
5654
5655 2001-04-12  Hrvoje Niksic  <hniksic@arsdigita.com>
5656
5657         * cookies.c: Declare http_atotm.
5658
5659 2001-04-12  Hrvoje Niksic  <hniksic@arsdigita.com>
5660
5661         * ftp-ls.c (ftp_parse_unix_ls): Use octal constants for
5662         permissions.  A compiler that doesn't accept octal constants is
5663         seriously broken and shouldn't be used -- octal constants were
5664         present in K&R C!
5665
5666 2001-01-20  Karl Eichwalder  <ke@suse.de>
5667
5668         * Makefile.in: Provide and use DESTDIR according to the Coding
5669         Standards.
5670
5671 2001-04-12  Hrvoje Niksic  <hniksic@arsdigita.com>
5672
5673         * ftp-ls.c (ftp_parse_vms_ls): Make seconds optional in time
5674         specification.
5675
5676 2001-04-11  Hrvoje Niksic  <hniksic@arsdigita.com>
5677
5678         * url.c (parseurl): Don't strip trailing slash when u->dir is "/"
5679         because that strips the *leading* slash, thus forcing relative
5680         FTP retrieval.
5681
5682 2001-04-10  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
5683
5684         * ftp.c (getftp): Convert initial FTP directory from VMS to UNIX
5685         notation for VMS servers. 
5686         (ftp_retrieve_dirs): Do not prepend '/' to f->name when
5687         odir is an empty string.
5688
5689 2001-04-10  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
5690
5691         * ftp-ls.c (ftp_parse_winnt_ls): Made the fix for AM/PM more
5692         effective. Suggested by Edward J. Sabol.
5693
5694 2001-04-10  Hrvoje Niksic  <hniksic@arsdigita.com>
5695
5696         * cookies.c (build_cookies_request): Use and sort cookies from all
5697         matching domains.
5698         (build_cookies_request): Check for duplicates before generating
5699         the `Cookies' header.
5700
5701         * main.c (main): Don't load cookies here.
5702         (main): Make loadcookies and savecookies call the correct command.
5703
5704         * http.c (http_loop): Load cookies on-demand.
5705
5706 2001-04-09  Hrvoje Niksic  <hniksic@arsdigita.com>
5707
5708         * http.c (gethttp): Fix indentation of SSL ifdef.
5709
5710 2001-04-09  Hrvoje Niksic  <hniksic@arsdigita.com>
5711
5712         * ftp.c (ftp_retrieve_dirs): Don't forcibly prepend "/" to u->dir;
5713         that hack is no longer necessary.
5714         (getftp): Prepend initial directory to *non*-absolute u->dir's.
5715
5716 2001-04-09  Hrvoje Niksic  <hniksic@arsdigita.com>
5717
5718         * init.c (cmd_file): New function.
5719         (enable_tilde_expansion): New variable.
5720         (run_wgetrc): Use it.
5721         (cmd_file): Use it.
5722
5723 2001-04-08  Hrvoje Niksic  <hniksic@arsdigita.com>
5724
5725         * init.c: Include cookie-related options.
5726
5727         * main.c (main): Include cookie-specific options.
5728         (main): Load cookies before download is finished.
5729         (main): Save cookies when done.
5730
5731         * http.c (gethttp): Process the `Set-Cookie' header.
5732         (gethttp): Include cookies in the response.
5733
5734         * cookies.c: New file.
5735
5736 2001-04-08  Hrvoje Niksic  <hniksic@arsdigita.com>
5737
5738         * utils.c (datetime_str): New function.
5739
5740 2001-04-08  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
5741
5742         * ftp-ls.c (ftp_parse_winnt_ls): The AM/PM change did assume
5743         12:01PM == 00:01, which was obviously wrong. Taken care of this
5744         anomaly.
5745
5746         * ChangeLog: Removed an excess conflict marker. Reformatted the
5747         entry by Philipp Thomas from 2001-03-09.
5748
5749         * ftp-ls.c (ftp_parse_winnt_ls): Ensure that adjusted PM hours lay
5750         between 0 and 23. Elminate unused variable `sec'.
5751
5752 2001-04-08  Hrvoje Niksic  <hniksic@arsdigita.com>
5753
5754         * hash.c (hash_table_count): New function.
5755
5756 2001-04-06  Hrvoje Niksic  <hniksic@arsdigita.com>
5757
5758         * utils.c (read_file): Cast MAP_FAILED to char *.  Enforced by
5759         Digital Unix cc.
5760
5761 2001-04-06  Hrvoje Niksic  <hniksic@arsdigita.com>
5762
5763         * config.h.in: Oops, do the namespace tweaks only on systems we
5764         know about.
5765
5766 2001-04-06  Hrvoje Niksic  <hniksic@arsdigita.com>
5767
5768         * hash.c: Include <string.h>.
5769
5770 2001-04-06  Hrvoje Niksic  <hniksic@arsdigita.com>
5771
5772         * config.h.in: Define "compilation environment" options that work
5773         under Linux and Solaris.  To be reviewed on other OS'es.
5774
5775 2001-04-06  Hrvoje Niksic  <hniksic@arsdigita.com>
5776
5777         * http.c (gethttp): Prepend literal newline with `\n\'.
5778
5779 2001-04-06  Hrvoje Niksic  <hniksic@arsdigita.com>
5780
5781         * sysdep.h: Don't define VERY_LONG_FORMAT.
5782
5783         * utils.c (very_long_to_string): New function.
5784         (legible_very_long): Use it; don't use VERY_LONG_FORMAT.
5785
5786 2001-04-04  Christian Fraenkel  <christian.fraenkel@gmx.net>
5787
5788         * url.c (parse_uname): Would run past the end of the string if the
5789         username was present, but the URL did not contain a slash, e.g.
5790         http://foo:bar@myhost.
5791
5792 2001-04-03  KOJIMA Hajime  <kjm@rins.ryukoku.ac.jp>
5793
5794         * http.c (http_atotm): Use %A instead of %a to match full
5795         weekday.  (On most systems there is no difference.)
5796
5797 2001-04-03  Paul Bludov  <paul@ozero.net>
5798
5799         * mswindows.c (sleep): Use SleepEx() instead of Sleep().
5800         (ws_changetitle): Use alloca() instead of malloc() to avoid memory
5801         leak.
5802         (ws_mypath): Use GetModuleFileName instead of argv[0].
5803         (ws_startup): Use data.wVersion for comparison.
5804
5805 2001-04-02  Hrvoje Niksic  <hniksic@arsdigita.com>
5806
5807         * http.c (http_loop): Ditto.
5808
5809         * ftp.c (ftp_loop_internal): Made the check whether to continue
5810         retrieval `-O'-friendly.
5811
5812 2001-04-02  Hrvoje Niksic  <hniksic@arsdigita.com>
5813
5814         * netrc.c (parse_netrc): Don't trim the line endings explicitly;
5815         they will be handled as whitespace.
5816         (parse_netrc): Correctly handle lines that end with whitespace.
5817
5818 2001-04-02  Hrvoje Niksic  <hniksic@arsdigita.com>
5819
5820         * retr.c (retrieve_url): New variable global_download_count used
5821         to identify first retrieval.
5822
5823         * ftp.c (getftp): Ditto.
5824
5825         * http.c (gethttp): Rewind opt.dfp only on first retrieval.
5826
5827 2001-04-02  Hrvoje Niksic  <hniksic@arsdigita.com>
5828
5829         * init.c (cmd_address): Heap-allocate the address that gets stored
5830         to CLOSURE.  Old code would simply assign an address on the stack.
5831
5832 2001-04-01  Nicolas Lichtmaier <nick@debian.org>
5833
5834         * ftp.c (ftp_get_listing): Propagate error status.
5835         (ftp_retrieve_glob): Use it.
5836         (ftp_loop): Ditto.
5837
5838 2001-04-01  Nicolas Lichtmaier <nick@debian.org>
5839
5840         * main.c (main): Add -C to the string that is the third arg to
5841         getopt_long().
5842
5843 2001-04-01  Hrvoje Niksic  <hniksic@arsdigita.com>
5844
5845         * ftp.c (getftp): Don't start the download from scratch if `-c'
5846         was specified, but the file is already fully downloaded.
5847
5848         * http.c (gethttp): Don't truncate a pre-existing file if `-c' was
5849         specified and the server doesn't support continued download.
5850         (gethttp): Don't start the download from scratch if `-c' was
5851         specified, but the file is already fully downloaded.
5852
5853 2001-03-31  Hrvoje Niksic  <hniksic@arsdigita.com>
5854
5855         (recursive_retrieve): Don't clear the hash tables at this point at
5856         all; it interferes with the normal operation of register_download.
5857
5858 2001-03-31  Hrvoje Niksic  <hniksic@arsdigita.com>
5859
5860         * recur.c (recursive_retrieve): Clear the hash tables only when
5861         they are defined.
5862
5863 2001-03-31  Hrvoje Niksic  <hniksic@arsdigita.com>
5864
5865         * http.c (gethttp): Make sure the socket is closed with
5866         CLOSE_INVALIDATE before we have drained the body.
5867
5868 2001-03-31  Hrvoje Niksic  <hniksic@arsdigita.com>
5869
5870         * retr.c (retrieve_url): Call register_download() for downloaded
5871         files and register_html() for downloaded HTML files.
5872
5873         * recur.c (register_download): New function; register here that a
5874         file has been downloaded, rather than in recursive_retrieve().
5875         (register_html): New function; enqueue the location of HTML files
5876         here rather than in recursive_retrieve().
5877
5878 2001-03-31  Hrvoje Niksic  <hniksic@arsdigita.com>
5879
5880         * main.c (print_help): Use multiple fputs instead of a single ugly
5881         printf().
5882         (main): Consistently assign numbers >128 to options without a
5883         corresponding character.
5884
5885 2001-03-09  Philipp Thomas  <pthomas@suse.de>
5886
5887         * safe-ctype.h: New file. Locale independent ctype.h replacement
5888         taken from libiberty.
5889
5890         * safe-ctype.c: New file. Tables for above.
5891
5892         * Makefile.in: Add safe-ctype$o to OBJS.  Add dependencies for
5893         safe-ctype$o.
5894
5895         * cmpt.c: Remove include of ctype.h. Use ISSPACE instead of
5896         isspace.
5897
5898         * ftp-basic.c: Don't include ctype.h.
5899
5900         * ftp-ls.c: Likewise.
5901
5902         * ftp.c: Likewise.
5903
5904         * headers.c: Likewise.
5905
5906         * host.c: Likewise.
5907
5908         * html-parse.c: Likewise.
5909
5910         * html-url.c: Likewise.
5911
5912         * http.c: Likewise.
5913
5914         * init.c: Likewise.
5915
5916         * main.c: Likewise. Set LC_CTYPE along with LC_MESSAGES.
5917
5918         * netrc.c: Likewise.
5919
5920         * recur.c: Likewise.
5921
5922         * retr.c: Likewise.
5923
5924         * snprintf.c: Replace ctype.h with safe-ctype.h. Use ISDIGIT
5925         instead of isdigit.
5926
5927         * sysdep.h: Remove defines of ctype macros as they aren't needed
5928         for safe-ctype-h.
5929
5930         * url.c: Don't include ctype.h.
5931
5932         * utils.c: Likewise.
5933
5934         * wget.h: Include safe-ctype.h.
5935
5936 2001-03-27  Dan Harkless  <wget@harkless.org>
5937
5938         * Makefile.in: Moved top_builddir out of "User configuration
5939         section" of top Makefile and analogous spot in this one.
5940
5941 2001-03-17  Dan Harkless  <wget@harkless.org>
5942
5943         * Makefile.in: Include @SSL_INCLUDES@ substition in INCLUDES.
5944         Define top_builddir.  Link wget with libtool so the user doesn't
5945         have to supply a bunch of custom environment variables to 
5946         correctly link with the OpenSSL shared libraries.
5947
5948 2001-03-06  Hack Kampbjorn  <hack@hackdata.com>
5949
5950         * http.c (gethttp): skip :port in host header if it is the
5951         DEFAULT_HTTPS_PORT when using SSL.
5952
5953         * url.c: move the #define of DEFAULT_HTTP_PORT, DEFAULT_FTP_PORT
5954         and DEFAULT_HTTPS_PORT to the header file so it can be use in the
5955         rest of the code. 
5956         * url.h: Ditto
5957
5958 2001-03-01  Jonas Jensen  <bones@huleboer.dk>
5959
5960         * retr.c (show_progress): Correctly calculate the number of bytes
5961         in the first line of the download that have been actually
5962         downloaded in this run.
5963
5964 2001-02-23  Dan Harkless  <wget@harkless.org>
5965
5966         * main.c (print_help): --help documentation for -N said it would
5967         re-download files if they had the _same_ timestamp on server.
5968         (print_help): -nr belongs in "FTP options" section of --help
5969         output, not "Recursive retrieval" section.  Alphabetized FTP
5970         options by long option name.
5971
5972 2001-02-16  Dan Harkless  <wget@harkless.org>
5973
5974         * init.c (commands): Hack Kampbjørn <hack@hackdata.com> discovered
5975         that "httpsproxy" had been inserted into commands[] out of
5976         alphabetical order, causing "BUG: unknown command `httpuser'".
5977
5978 2001-02-13  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
5979
5980         * ftp-ls.c (ftp_parse_ls): Added support of ST_MACOS (Unix-like
5981         listing without correct permissons).
5982
5983         * ftp.h (stype): Added ST_MACOS to identify the NetPresenz MacOS
5984         FTP server. 
5985
5986         * ftp.c (ftp_retrieve_list): New mirroring logic: A remote file
5987         shall be donwloaded only when it's newer than the local copy or
5988         when it has the same timeestamp but its size is different. ST_VMS
5989         and ST_MACOS as special cases that lie about file size. 
5990
5991         * ftp-ls.c (ftp_parse_ls): Support for ST_MACOS.
5992
5993         * Makefile.in: Removed dependency on ftpparse library due to unclear
5994         copyright issues and absence of any feedback to our queries. 
5995
5996         * ftp-ls.c: Removed dependency on ftpparse library due to unclear
5997         copyright issues and absence of any feedback to our queries.   
5998         (ftp_parse_ls): Added a warning message when remote server system
5999         does not seem to be suported by wget. 
6000         (ftp_parse_vms_ls): New function for parsing VMS ftp
6001         server listing output.
6002         (clean_line): New function responsible for removing
6003         end-of-line characters from FTP listing texts.
6004
6005         * ftp.c (getftp): Global variables pwd and host_type are now
6006         member of the ccon structure under names ccon.id and ccon.rs. 
6007
6008         * ftp.h (struct ccon): Added formed global variables from ftp.c,
6009         enum stype rs (remote system identification) and char *id (initial
6010         working directory), as suggested by Hrvoje.
6011
6012         * url.c (parse_uname): Added support for passwords containing '@'
6013         characters.
6014         (skip_uname): Ditto.
6015
6016 2001-02-11  Hrvoje Niksic  <hniksic@arsdigita.com>
6017
6018         * ftp.c (ftp_loop): Reset con.
6019
6020 2001-01-06  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
6021
6022         * url.c (parse_uname): Added support for passwords containing '@'
6023         characters.
6024         (skip_uname): Ditto.
6025
6026 2001-02-11  Hack Kampbjørn  <hack@hackdata.com>
6027
6028         * url.c (parseurl): Debug-print u->ftp_type.
6029
6030 2001-02-11  Hrvoje Niksic  <hniksic@arsdigita.com>
6031
6032         * ftp.c (ftp_loop_internal): Disable padding.
6033         (getftp): Ditto.
6034
6035         * http.c (http_loop): Disable padding.
6036
6037         * retr.c (show_progress): Use it to enable padding.
6038
6039         * retr.c (rate): Optional parameter PAD for padding the rate.
6040
6041 2001-02-10  Hrvoje Niksic  <hniksic@arsdigita.com>
6042
6043         * retr.c (show_progress): Make sure that the last output line
6044         includes progress.
6045
6046 2001-02-10  Jonas Jensen  <bones@huleboer.dk>
6047
6048         * retr.c (show_progress): Print the download rate along with the
6049         percentages.
6050         Along with Anders Thorsby <anders@thorsby.dk>.
6051
6052 2001-02-10  Tim Mooney  <mooney@dogbert.cc.ndsu.NoDak.edu>
6053
6054         * ftp.h: Rename enums `command' to `wget_ftp_command' and
6055         `fstatus' to `wget_ftp_status' because old names clash with Tru64
6056         net/if.h.
6057
6058 2001-02-08  Christian Fraenkel <christian.fraenkel@gmx.net>
6059
6060         * gen_sslfunc.c: verify_callback is now static
6061
6062         * gen_sslfunc.c (init_ssl): load certificate if specified
6063
6064         * gen_sslfunc.c (ssl_printerr): new function
6065
6066         * init.c: added new --sslcertfile and --sslcertkey switches
6067
6068         * main.c: ditto
6069
6070         * options.h: ditto
6071
6072         * http.c (gethttp): abort when init_ssl fails
6073
6074 2001-01-23  Herold Heiko  <Heiko.Herold@previnet.it>
6075
6076         * mswindows.h: Include <malloc.h>; it's needed for alloca().
6077
6078 2001-01-10  Dan Harkless  <wget@harkless.org>
6079
6080         * url.c (str_url): Clarified this function's comment header after
6081         Hrvoje answered my question on the list as to when hide != 1.
6082         Also Hrvoje pointed out I need to use xstrdup() on the string literal.
6083
6084 2001-01-06  Hrvoje Niksic  <hniksic@arsdigita.com>
6085
6086         * connect.c (bindport): Declare addrlen as int.  Diagnosed by
6087         Drazen Kacar <dave@arsdigita.com>.
6088         (conaddr): Ditto.
6089
6090 2001-01-09  Dan Harkless  <wget@harkless.org>
6091
6092         * html-url.c: A bunch of fixup of `--page-requisites'-related
6093         comments to reflect Hrvoje's changes to my code when transplanting
6094         it into this new file, to fix spelling mistakes, to clarify, etc.
6095
6096         * url.c (write_backup_file): Clarified a comment.
6097         (str_url): Henrik van Ginhoven pointed out on the list that we
6098         shouldn't give away the number of characters in the password by
6099         replacing each character with a 'x'.  Use "<password>" instead.
6100
6101         * ftp.c (ftp_retrieve_dirs): The bug where recursion into FTP
6102         directories didn't work if logging in put you in a directory other
6103         than "/" is fixed now.  Removed the comment here warning of the bug.
6104
6105         * main.c (print_help): --continue's description was misleading.
6106         We don't "restart", we "resume".  Also, better to say
6107         "partially-downloaded file" rather than just "existing file".
6108
6109 2001-01-06  Dan Harkless  <wget@harkless.org>
6110
6111         * ChangeLog: The '[Not in 1.6 branch.]'s were decided not to be
6112         the best way to go about my aim.  Removed them in favor of:
6113
6114         * ChangeLog-branches/1.6_branch.ChangeLog: New file.
6115
6116 2001-01-04  Hrvoje Niksic  <hniksic@arsdigita.com>
6117
6118         * url.c (replace_attr): New function, to be used by both
6119         TO_COMPLETE and TO_RELATIVE case in convert_links.
6120         (find_fragment): New function for finding URL fragments.
6121         (replace_attr): Better handle the case where the original string
6122         is not quoted.  Use find_fragment.
6123         (convert_links): Use replace_attr().
6124
6125 2000-12-31  Dan Harkless  <wget@harkless.org>
6126
6127         * ChangeLog: Since this flat file doesn't have multiple branches,
6128         looking at the dates would make you think that things went into
6129         1.6 that actually just went into the 1.7-dev branch.  Added "[Not
6130         in 1.6 branch.]" where appropriate to clarify.
6131         
6132 2000-12-30  Dan Harkless  <wget@harkless.org>
6133
6134         * ftp.c, http.c:  Applied Hack Kampbjørn <hack@hackdata.com>'s
6135         patch to deal with h_errno not being defined in netdb.h under Cygwin.
6136
6137 2000-12-18  Csaba Raduly  <csaba.raduly@sophos.com>
6138
6139         * sysdep.h: Include <malloc.h> and <io.h> under Watcom.
6140
6141 2000-12-17  Igor Khristophorov  <igor@atdot.org>
6142
6143         * http.c (check_end): Fix test for '+' or '-'.
6144
6145 2000-12-17  Hrvoje Niksic  <hniksic@arsdigita.com>
6146
6147         * url.c (parseurl): Rename inner loop var from i to ind to avoid
6148         clash with the function top-level-declared variable i.
6149         (str_url): Likewise, rename inner-loop i to j.
6150
6151         * recur.c (parse_robots): Don't declare LEN at top of function.
6152         (robots_match): Renamed parameter FORBIDDEN to avoid hiding of
6153         global variable.
6154
6155         * main.c (main): Change erroneous use of bitwise and to logical.
6156
6157         * init.c (cmd_address): Don't heap-allocate `sin'; it can be on
6158         the stack because it will be copied to closure.
6159
6160         Thanks to Csaba Raduly's run of PC-LINT over the sources.
6161
6162 2000-12-17  Hrvoje Niksic  <hniksic@arsdigita.com>
6163
6164         * http.c (basic_authentication_encode): Use xmalloc(), not
6165         malloc().  Thanks to Csaba Raduly's run of PC-LINT over the
6166         sources.
6167
6168 2000-12-17  Csaba Raduly  <csaba.raduly@sophos.com>
6169
6170         * sysdep.h: Test for __EMX__ rather than for EMXOS2 for OS/2
6171         compilation.
6172
6173 2000-12-17  Hrvoje Niksic  <hniksic@arsdigita.com>
6174
6175         * mswindows.c: Include <errno.h>.
6176
6177         * gen_sslfunc.c: Include <errno.h>.
6178
6179         * ftp-basic.c: Don't attempt to declare errno or h_errno because
6180         they're not used.
6181
6182         * main.c: Include <errno.h> because errno is used.
6183
6184         * ftp.c: Ditto.
6185
6186         * http.c: Include <netdb.h> for h_errno.
6187
6188 2000-12-13  Hrvoje Niksic  <hniksic@arsdigita.com>
6189
6190         * html-parse.c (advance_declaration): MSVC assert() chokes on
6191         '\"'.  Use '"' instead.
6192
6193 2000-12-11  Hrvoje Niksic  <hniksic@arsdigita.com>
6194
6195         * utils.c (xfree_real): Removed.
6196         (xfree_debug): Just call free().
6197
6198         * wget.h (xfree): Make it an alias for free.
6199
6200 2000-12-11  Hrvoje Niksic  <hniksic@arsdigita.com>
6201
6202         * http.c (http_loop): Furthermore, touch output_document only if
6203         it is known to be an existing regular file.
6204
6205 2000-12-11  Hrvoje Niksic  <hniksic@arsdigita.com>
6206
6207         * ftp.c (ftp_retrieve_list): Ditto.
6208
6209         * http.c (http_loop): Touch output_document if that is used for
6210         output.
6211
6212 2000-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
6213
6214         * http.c: Include gen_sslfunc.h after including Wget's headers.
6215         (persistent_available_p): Needed coma before `int ssl'.
6216
6217 2000-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
6218
6219         * ftp.c (ftp_loop_internal): Ditto.
6220
6221         * http.c (http_loop): Use it.
6222
6223         * retr.c (sleep_between_retrievals): New function that handles the
6224         logic of opt.wait and opt.waitretry.
6225
6226 2000-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
6227
6228         * rbuf.h: Implement only a single version of RBUF_READCHAR, using
6229         rbuf_read_bufferful when the buffer is depleted.
6230
6231         * rbuf.c (rbuf_read_bufferful): New function.
6232
6233 2000-12-06  Hrvoje Niksic  <hniksic@arsdigita.com>
6234
6235         * gen_sslfunc.h: Use ansi2knr style function declarations.
6236
6237         * gen_sslfunc.c: Reformat according to the GNU coding standards.
6238         More should be done.
6239
6240         * http.c (persistent_available_p): Place the cheap SSL test nearer
6241         the top of the function.
6242         (CLOSE_FINISH, CLOSE_INVALIDATE): Define only one version of each.
6243
6244 2000-12-05  Hrvoje Niksic  <hniksic@arsdigita.com>
6245
6246         * url.c (init_unsafe_char_table): Reinstate space as an unsafe
6247         char.
6248
6249 2000-12-03  Christian Fraenkel <christian.fraenkel@gmx.net>
6250
6251         * Makefile.in: added gen_sslfunc object
6252         * config.h.in: added HAVE_SSL define
6253         * connect.c: changed select_fd from static int to int
6254         * connect.h: ditto
6255         * gen_sslfunc.h: New file
6256         * gen_sslfunc.c: ditto
6257         * http.c: added HTTPS fuctionality
6258         * retrc.c: ditto
6259         * url.c: ditto
6260         * init.c: added opt.httpsproxy
6261         * options.h: ditto
6262         * rbuf.h: added alternate rbuf struct
6263         * wget.h: added CONSSLERR
6264         * rbuf.c: ditto
6265
6266         * http.c: Added HTTPS fuctionality.
6267
6268         * retrc.c: Ditto.
6269
6270         * url.c: Ditto.
6271
6272         * init.c: Added opt.httpsproxy.
6273
6274         * options.h: Ditto.
6275
6276         * rbuf.h: Added alternate rbuf struct.
6277
6278         * wget.h: Added CONSSLERR.
6279
6280         * rbuf.c: Ditto.
6281
6282 2000-11-30  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
6283
6284         * ftp-ls.c (ftp_parse_unix_ls): Added second parameter
6285         "ignore_perms" to ignore file and directory permissions for
6286         Windows NT FTP server listings.
6287         (ftp_parse_winnt_ls): New function.
6288         (ftp_parse_ls): Parses UNIX and Windows NT listings
6289         separately. Simple heuristics for distinguishing between UNIX and
6290         MS-DOS-like FTP listing provided by Windows NT FTP service.
6291
6292 2000-11-18  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
6293
6294         * ftpparse.c, ftpparse.h: New files.
6295
6296         * ftp-ls.c (ftp_parse_ls): Use ftp_parse_unix_ls for UNIX servers
6297         only. Use ftp_parse_nonunix_ls otherwise.
6298         (ftp_parse_nonunix_ls): Stub to the ftpparse library handling all
6299         exotic FTP servers.
6300
6301         * ftp.h (stype): New enum, distinguishes UNIX, VMS, and "other"
6302         FTP servers.
6303
6304         * ftp.c: New static wariables host_type, pwd, and pwd_len. 
6305         (getftp): Support for VMS. Support for FTP servers that do not
6306         place you in the root directory after login.
6307         (ftp_retrieve_list): VMS is silent about the real file size, issue
6308         a more appropriate message.
6309         (ftp_get_listing): Pass host_type to ftp_parse_ls.
6310
6311         * ftp-basic.c (ftp_pwd, ftp_syst): New functions.
6312
6313 2000-11-30  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
6314
6315         * ftp-ls.c (ftp_parse_unix_ls): Added second parameter
6316         "ignore_perms" to ignore file and directory permissions for
6317         Windows NT FTP server listings.
6318         (ftp_parse_winnt_ls): New function.
6319         (ftp_parse_ls): Parses UNIX and Windows NT listings
6320         separately. Simple heuristics for distinguishing between UNIX
6321         and MS-DOS-like FTP listing provided by Windows NT FTP service.
6322
6323 2000-11-29  John Summerfield  <summer@OS2.ami.com.au>
6324
6325         * netrc.c (parse_netrc): Get rid of line ending.
6326
6327 2000-11-25  Hrvoje Niksic  <hniksic@arsdigita.com>
6328
6329         * ftp.c (ftp_retrieve_list): Undo typo "fix" until resolution by
6330         Dan.
6331
6332 2000-11-24  Karl Eichwalder  <ke@suse.de>
6333
6334         * main.c (print_help): Untabify.
6335
6336 2000-11-23  Hrvoje Niksic  <hniksic@arsdigita.com>
6337
6338         * utils.c (xrealloc_debug): Do the unregister/register thing only
6339         if the pointer has actually changed.
6340         (xmalloc_real): Declare `static' in DEBUG_MALLOC builds.
6341         (xfree_real): Ditto.
6342         (xrealloc_real): Ditto.
6343         (xstrdup_real): Ditto.
6344
6345 2000-11-22  Hrvoje Niksic  <hniksic@arsdigita.com>
6346
6347         * ftp.c (getftp): ftp_getaddress() returns a malloc'ed copy of the
6348         string; no need to strdup() it.
6349         (getftp): Make pwd_len a local variable.
6350         (ftp_loop): Free PWD before returning.
6351
6352         * init.c (cleanup): Free opt.ftp_pass only if it's non-NULL.
6353
6354 2000-11-22  Hrvoje Niksic  <hniksic@arsdigita.com>
6355
6356         * all: Use xfree() instead of free.
6357
6358         * utils.c (xfree): New function.
6359
6360 2000-11-21  Hrvoje Niksic  <hniksic@arsdigita.com>
6361
6362         * url.c (convert_links): HTML-quote the converted string.
6363
6364         * utils.c (html_quote_string): Move here from ftp-ls.c
6365         (html_quote_string): Make non-static; declare in utils.h.
6366         (html_quote_string): Convert SP to &#32;.
6367
6368 2000-11-21  Hrvoje Niksic  <hniksic@arsdigita.com>
6369
6370         * ftp.c (getftp): Reformat Jan's code according to GNU coding
6371         standards; remove (debugging?) printf's; use '\0' for the ASCII
6372         zero character.  Use alloca() instead of malloc() for
6373         inter-function temporary allocations.
6374
6375 2000-11-18  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
6376
6377         * ftpparse.c, ftpparse.h: New files.
6378
6379         * ftp-ls.c (ftp_parse_ls): Use ftp_parse_unix_ls for UNIX servers
6380         only. Use ftp_parse_nonunix_ls otherwise.
6381         (ftp_parse_nonunix_ls): Stub to the ftpparse library handling all
6382         exotic FTP servers.
6383
6384         * ftp.h (stype): New enum, distinguishes UNIX, VMS, and "other"
6385         FTP servers.
6386
6387         * ftp.c: New static wariables host_type, pwd, and pwd_len. 
6388         (getftp): Support for VMS. Support for FTP servers that do not
6389         place you in the root directory after login.
6390         (ftp_retrieve_list): VMS is silent about the real file size, issue
6391         a more appropriate message.
6392         (ftp_get_listing): Pass host_type to ftp_parse_ls.
6393
6394         * ftp-basic.c (ftp_pwd, ftp_syst): New functions.
6395
6396 2000-11-21  Hrvoje Niksic  <hniksic@arsdigita.com>
6397
6398         * hash.c (hash_table_put): Don't overwrite deleted mappings.
6399
6400 2000-11-21  Hrvoje Niksic  <hniksic@arsdigita.com>
6401
6402         * hash.c (find_mapping): New function.
6403         (hash_table_get): Use it.
6404         (hash_table_get_pair): Ditto.
6405         (hash_table_exists): Ditto.
6406         (hash_table_remove): Ditto.
6407         (hash_table_remove): Really delete the entry if the mapping
6408         following LOCATION is empty.
6409
6410         * utils.c (string_set_add): Check whether the element has existed
6411         before.
6412
6413         * hash.c (hash_table_get_pair): New function.
6414
6415 2000-11-20  Hrvoje Niksic  <hniksic@arsdigita.com>
6416
6417         * http.c (http_process_type): Ignore trailing whitespace; use
6418         strdupdelim().
6419
6420         * recur.c (recursive_retrieve): Use the new `convert' field.
6421         (convert_all_links): Ditto.
6422         (convert_all_links): Don't respect meta_disallow_follow.
6423
6424         * html-url.c (handle_link): Fill out link_relative_p and
6425         link_complete_p.
6426
6427         * url.h (struct _urlpos): Make elements more readable.
6428
6429         * recur.c (recursive_retrieve): Call slist_prepend instead of
6430         slist_append.
6431         (convert_all_links): Call slist_nreverse before iterating through
6432         urls_html.
6433
6434         * utils.c (slist_prepend): New function.
6435         (slist_nreverse): Ditto.
6436
6437 2000-11-20  Hrvoje Niksic  <hniksic@arsdigita.com>
6438
6439         * http.c (check_end): Constify.
6440
6441 2000-11-20  Hrvoje Niksic  <hniksic@arsdigita.com>
6442
6443         * http.c (http_loop): If username and password are known, try the
6444         `Basic' authentication scheme by default.
6445
6446         * connect.h: Declare test_socket_open.
6447
6448 2000-11-20  Hrvoje Niksic  <hniksic@arsdigita.com>
6449
6450         * version.c: Bump version from 1.5.3+dev to 1.7-dev.
6451
6452 2000-11-20  Hrvoje Niksic  <hniksic@arsdigita.com>
6453
6454         * http.c (gethttp): Don't use the return value of sprintf().
6455         (gethttp): Inhibit keep-alive if opt.http_keep_alive is 0.
6456
6457 2000-11-20  Hrvoje Niksic  <hniksic@arsdigita.com>
6458
6459         * recur.c (recursive_retrieve): Print the "so we don't load"
6460         debugging message only if we really don't load.
6461
6462         * http.c (gethttp): Inhibit keep-alive if proxy is being used.
6463         (gethttp): Don't request keep-alive if keep-alive is inhibited.
6464
6465 2000-11-19  Hrvoje Niksic  <hniksic@arsdigita.com>
6466
6467         * http.c (gethttp): Make the HTTP persistent connections more
6468         robust.
6469
6470 2000-11-19  Hrvoje Niksic  <hniksic@arsdigita.com>
6471
6472         * retr.c (get_contents): If use_expected, make sure that the
6473         appropriate amount of data is being read.
6474
6475         * http.c (gethttp): Check for both `Keep-Alive: ...' and
6476         `Connection: Keep-Alive'.
6477
6478         * wget.h (DEBUGP): Call debug_logprintf only if opt.debug is
6479         turned on.
6480
6481 2000-11-19  Hrvoje Niksic  <hniksic@arsdigita.com>
6482
6483         * http.c (connection_available_p): Use it.
6484
6485         * connect.c (test_socket_open): New function.
6486
6487         * http.c (gethttp): Support persistent connections.  Based on the
6488         ideas, and partly on code, by Sam Horrocks <sam@daemoninc.com>.
6489         (register_persistent): New function.
6490         (connection_available_p): Ditto.
6491         (invalidate_connection): Ditto.
6492
6493 2000-11-19  Hrvoje Niksic  <hniksic@arsdigita.com>
6494
6495         * url.c (convert_links): Handle UREL2ABS case.
6496
6497         * recur.c (recursive_retrieve): Instead of the list
6498         urls_downloaded, use hash tables dl_file_url_map and
6499         dl_url_file_map.
6500         (convert_all_links): Use them to retrieve data.
6501
6502         * host.c (clean_hosts): Free the hash tables.
6503
6504         * main.c (private_initialize): Call host_init().
6505
6506         * host.c (store_hostaddress): Use a saner, hash table-based data
6507         model.
6508         (realhost): Ditto.
6509         (host_init): Initialize the hash tables.
6510
6511 2000-11-18  Hrvoje Niksic  <hniksic@arsdigita.com>
6512
6513         * utils.c (slist_append): Eviscerate NOSORT.  Hash tables are now
6514         used for what the sorted slists used to be used for.
6515         (slist_contains): Don't rely on the list being sorted.
6516         (slist_append): Simplify the code.
6517
6518         * recur.c (recursive_cleanup): Use free_string_set.
6519
6520         * utils.c (string_set_add, string_set_exists, string_set_free):
6521         New functions for easier freeing of hash tables whose keys are
6522         strdup'ed strings.
6523
6524         * recur.c (recursive_retrieve): Use the hash table functions for
6525         storing undesirable URLs.
6526
6527         * hash.c: New file.
6528
6529 2000-11-17  Hrvoje Niksic  <hniksic@arsdigita.com>
6530
6531         * main.c (private_initialize): Call url_init.
6532         (main): Call private_initialize.
6533
6534         * url.c (unsafe_char_table): New table.
6535         (UNSAFE_CHAR): Use it.
6536         (init_unsafe_char_table): New function.
6537         (url_init): New function; call init_unsafe_char_table.
6538
6539 2000-11-16  Hrvoje Niksic  <hniksic@arsdigita.com>
6540
6541         * mswindows.h: Define snprintf and vsnprintf to _snprintf and
6542         _vsnprintf respectively.
6543
6544 2000-11-15  Hrvoje Niksic  <hniksic@arsdigita.com>
6545
6546         * config.h.in: Do the _XOPEN_SOURCE and _SVID_SOURCE things only
6547         on Linux.
6548
6549 2000-11-15  Hrvoje Niksic  <hniksic@arsdigita.com>
6550
6551         * html-url.c (handle_link): Handle HTML fragment identifiers.
6552
6553         * recur.c (recursive_retrieve): If norobot info is respected and
6554         the file is specified not to be followed by robots, respect that.
6555
6556         * html-url.c (collect_tags_mapper): Handle <meta name=robots
6557         content=X>.  For us the important cases are where X is NONE or
6558         where X contains NOFOLLOW.
6559         (get_urls_html): Propagate that information to the caller.
6560
6561 2000-11-13  Hrvoje Niksic  <hniksic@arsdigita.com>
6562
6563         * url.c (convert_links): Unlink the file we might be reading from
6564         before writing to it.
6565         (convert_links): Use alloca instead of malloc for
6566         filename_plus_orig_suffix.
6567
6568 2000-11-12  Hrvoje Niksic  <hniksic@arsdigita.com>
6569
6570         * host.c (realhost): Add HOST to the list with quality==0 only if
6571         it wasn't already there.
6572         Based on analysis by Lu Guohan <feng@public.bjnet.edu.cn>.
6573
6574 2000-11-10  Hrvoje Niksic  <hniksic@arsdigita.com>
6575
6576         * url.c (get_urls_file): Ditto.
6577         (convert_links): Ditto.
6578
6579         * html-url.c (get_urls_html): Use read_file() instead of
6580         load_file().
6581
6582         * utils.c (read_file): New function, instead of the old
6583         load_file().
6584         (read_file_free): Ditto.
6585
6586         * url.c (findurl): Search only for the supported protocols.
6587         (convert_links): Use fwrite() when writing out a region of
6588         characters.
6589
6590 2000-11-10  Hrvoje Niksic  <hniksic@arsdigita.com>
6591
6592         * ftp-ls.c: Move html_quote_string and ftp_index here.
6593
6594         * url.c: Remove get_urls_html, since that's now in html-url.c.
6595
6596         * html-url.c: New file.
6597
6598         * html-parse.c: New file.
6599
6600 2000-11-10  Hrvoje Niksic  <hniksic@arsdigita.com>
6601
6602         * init.c (run_wgetrc): Don't bother killing off '\r' since
6603         pars_line() skips whitespace at end of line anyway.
6604         (parse_line): Oops, it didn't.  Now it does.
6605
6606         * recur.c (parse_robots): Ditto here.
6607
6608         * ftp-ls.c (ftp_parse_unix_ls): Kill off the newline character
6609         manually because read_whole_line no longer does.
6610
6611         * utils.c (read_whole_line): Rewrite to: a) use less memory
6612         (reallocates to needed size after work), b) work faster -->
6613         fgets() instead of getc, c) be more correct --> doesn't kill the
6614         newline character at the end of line.
6615
6616 2000-11-10  Hrvoje Niksic  <hniksic@arsdigita.com>
6617
6618         * init.c (comind): Initialize MAX to array size - 1.
6619
6620 2000-11-08  Hrvoje Niksic  <hniksic@arsdigita.com>
6621
6622         * url.c (construct): Changed last_slash[-1] to *(last_slash - 1).
6623         Suggested by Edward J. Sabol.
6624
6625 2000-11-08  Hrvoje Niksic  <hniksic@arsdigita.com>
6626
6627         * url.c (construct): Handle the case where host name is not
6628         followed by a slash.
6629
6630 2000-11-06  Hrvoje Niksic  <hniksic@arsdigita.com>
6631
6632         * init.c: commands[] need to be sorted!  ("base" wasn't.)
6633
6634 2000-11-05  Hrvoje Niksic  <hniksic@arsdigita.com>
6635
6636         * wget.h (DO_REALLOC_FROM_ALLOCA): Use braces to disambiguate
6637         `if'.
6638
6639 2000-11-05  Hrvoje Niksic  <hniksic@arsdigita.com>
6640
6641         * url.c (construct): Insert unneeded initialization for the
6642         compiler to shut up.
6643
6644         * config.h.in: Define _XOPEN_SOURCE to 500 to get the prototype
6645         for strptime() (*duh*).  Define _SVID_SOURCE to get S_IFLNK which
6646         otherwise gets lost when you define _XOPEN_SOURCE.
6647
6648         * utils.c (touch): Include the file name in the error message.
6649         From Debian.
6650
6651 2000-11-05  Hrvoje Niksic  <hniksic@arsdigita.com>
6652
6653         * log.c (logvprintf): Use vsnprintf() in all cases.  If necessary,
6654         resize the buffer to fit the formated message.  That way, messages
6655         of arbitrary size may be printed.
6656         (logvprintf): Use saved_append() to optionally log the last
6657         several lines of output.
6658         (logputs): Ditto.
6659         (log_close): Adapt to new data structures.
6660         (log_dump): Ditto.
6661         (redirect_output): Print messages to stderr, not to stdout.
6662
6663         * log.c (saved_append_1): New function.  Replaces the old logging
6664         system ("log all output until 10M characters") with a new, much
6665         more reasonable one ("log last screenful of text").
6666         (saved_append): New function; call saved_append_1.
6667         (free_log_line): New function.
6668
6669 2000-11-05  Hrvoje Niksic  <hniksic@arsdigita.com>
6670
6671         * url.c (construct): Fix comment.
6672         (find_last_char): Document.
6673
6674 2000-11-04  Hrvoje Niksic  <hniksic@arsdigita.com>
6675
6676         * snprintf.c: New file.
6677
6678 2000-11-03  Hrvoje Niksic  <hniksic@arsdigita.com>
6679
6680         * wget.h: If HAVE_STDARG_H is not defined, don't declare argument
6681         types to logprintf() and debug_logprintf().
6682
6683 2000-11-02  Hrvoje Niksic  <hniksic@arsdigita.com>
6684
6685         * ftp.c (ftp_loop_internal): Hide the password from the URL when
6686         printing non-verbose.  Problem spotted by Dariusz Mlynarczyk
6687         <darekm@bydg.lomac.com.pl>.
6688
6689 2000-11-02  Junio Hamano  <junio@twinsun.com>
6690
6691         * ftp-basic.c (ftp_login): Make comparison case-insensitive.
6692
6693 2000-11-02  Tyler Riddle  <triddle@liquidmarket.com>
6694
6695         * http.c (known_authentication_scheme_p): Recognize NTML
6696         authentication.
6697         (create_authorization_line): Treat NTML the same as `Basic'.
6698
6699 2000-11-02  Hrvoje Niksic  <hniksic@arsdigita.com>
6700
6701         * retr.c (retrieve_url): Free url before returning.
6702         (retrieve_url): Free mynewloc before returning.
6703         Spotted by Mark A. Mankins <Mankins_Mark@prc.com>.
6704
6705 2000-11-02  Hrvoje Niksic  <hniksic@arsdigita.com>
6706
6707         * url.c (parseurl): Remove possible reading past the end of
6708         sup_protos[].  Spotted by Mark A. Mankins <Mankins_Mark@prc.com>.
6709
6710 2000-11-01  Hrvoje Niksic  <hniksic@arsdigita.com>
6711
6712         * main.c (main): In case of opt.downloaded overflowing, print
6713         <overflow> instead of a totally bogus random value.
6714
6715         * retr.c (retrieve_from_file): Ditto.
6716
6717         * recur.c (recursive_retrieve): Ditto.
6718
6719         * main.c (main): Ditto.
6720
6721         * http.c (http_loop): Ditto.
6722
6723         * ftp.c (ftp_loop_internal): Use downloaded_increase() instead of
6724         `+=', and downloaded_exceeds_quota() instead of the simple-minded
6725         check.
6726         (ftp_retrieve_list): Ditto.
6727         (ftp_retrieve_dirs): Ditto.
6728         (ftp_retrieve_glob): Ditto.
6729
6730         * retr.c (downloaded_increase): New function.  Notice overflows of
6731         opt.downloaded.
6732         (downloaded_exceeds_quota): Make sure that opt.downloaded is not
6733         used if it overflowed.
6734
6735         * options.h (struct options): New member downloaded_overflow.
6736
6737 2000-11-01  Hrvoje Niksic  <hniksic@arsdigita.com>
6738
6739         * wget.h (enum): Remove extra space after last enumeration.
6740
6741 2000-11-01  Hrvoje Niksic  <hniksic@arsdigita.com>
6742
6743         * main.c (main): Use legible_very_long() for printing
6744         opt.downloaded.
6745
6746         * utils.c (legible_1): New function that operates on strings and
6747         does the brunt of legible()'s work.
6748         (legible): Use legible_1().
6749         (legible_very_long): New function; dump the argument with
6750         sprintf(), and call legible_1().
6751
6752         * options.h (struct options): Use VERY_LONG_TYPE for
6753         opt.downloaded.
6754
6755         * sysdep.h (VERY_LONG_TYPE): Define it to have a 64-bit or greater
6756         type.
6757
6758         * config.h.in: Make sure that SIZEOF_LONG and SIZEOF_LONG_LONG get
6759         defined.  Define HAVE_LONG_LONG if long long is available.
6760
6761 2000-11-01  Hrvoje Niksic  <hniksic@arsdigita.com>
6762
6763         * utils.c (long_to_string): Update with a later, better version.
6764
6765 2000-11-01  Hrvoje Niksic  <hniksic@arsdigita.com>
6766
6767         * url.c (path_simplify_with_kludge): New function.
6768         (path_simplify_with_kludge): Disable it.  Instead...
6769         (parse_dir): ...make sure that at this point the right thing is
6770         done, i.e. that "query" part of the URL (?...) is always assigned
6771         to the file, never to the directory portion of the path.
6772
6773 2000-11-01  Hrvoje Niksic  <hniksic@arsdigita.com>
6774
6775         * retr.c (retrieve_url): Detect redirection cycles.
6776
6777 2000-11-01  Hrvoje Niksic  <hniksic@arsdigita.com>
6778
6779         * url.c (get_urls_html): Decode HTML entities using
6780         html_decode_entities.
6781
6782         * html.c (htmlfindurl): Don't count the `#' in numeric entities
6783         (&#NNN;) as an HTML fragemnt.
6784         (html_decode_entities): New function.
6785
6786 2000-11-01  Hrvoje Niksic  <hniksic@arsdigita.com>
6787
6788         * html.c (htmlfindurl): Fix recognition of # HTML fragments.
6789
6790 2000-11-01  Hrvoje Niksic  <hniksic@arsdigita.com>
6791
6792         * url.c (construct): Rewritten for clarity.  Avoids the
6793         unnecessary copying and stack-allocation the old version
6794         performed.
6795
6796 2000-10-31  Hrvoje Niksic  <hniksic@arsdigita.com>
6797
6798         * ftp.c (getftp): Ditto.
6799
6800         * http.c (gethttp): Rewind the stream when retrying from scratch.
6801
6802 2000-10-31  Hrvoje Niksic  <hniksic@arsdigita.com>
6803
6804         * retr.c (retrieve_url): Use url_concat() to handle relative
6805         redirections instead of /ad hoc/ code.
6806
6807         * url.c (url_concat): New function encapsulating weird
6808         construct().
6809         (urllen_http_hack): New function.
6810         (construct): When constructing new URLs, recognize that `?' does
6811         not form part of the file name in HTTP.
6812
6813 2000-10-13  Adrian Aichner  <adrian@xemacs.org>
6814
6815         * retr.c: Add msec timing support for WINDOWS.
6816         * retr.c (reset_timer): GetSystemTime() on WINDOWS.
6817         * retr.c (elapsed_time): Calculate delta time to msec on WINDOWS.
6818
6819 2000-10-27  Dan Harkless  <wget@harkless.org>
6820
6821         * retr.c (retrieve_url): Manually applied T. Bharath
6822         <TBharath@responsenetworks.com>'s patch to get wget to grok
6823         illegal relative URL redirects.  Reformatted and re-commented it.
6824
6825 2000-10-23  Dan Harkless  <wget@harkless.org>
6826
6827         * connect.c (make_connection and bindport): Manually applied Rob
6828         Mayoff <mayoff@dqd.com>'s 1.5.3 patch to add --bind-address,
6829         changing coding style to GNU's.
6830
6831         * ftp.c (ftp_loop_internal): --delete-after wasn't implemented for
6832         files downloaded via FTP.  Per a comment, .listing files were not
6833         counted towards number of bytes and files downloaded because they're 
6834         deleted anyway.  Well, they aren't under -nr, so count them then.
6835
6836         * init.c: Manually applied Rob Mayoff's 1.5.3 patch to add
6837         --bind-address, alphabetizing, changing coding style to GNU's,
6838         commenting, and renaming cmd_ip_address() to cmd_address() to
6839         imply hostnames also okay.
6840                 
6841         * main.c (main): --delete-after didn't delete the root of the
6842         tree.  Ignore --convert-links if --delete-after was specified.
6843         Manually applied Rob Mayoff's 1.5.3 patch to add --bind-address,
6844         fixing duplicate use of added-since-1.5.3 case value.
6845         (print_help): Clarified that --delete-after deletes local files.
6846         Rob forgot to add a line for his new --bind-address option.
6847                 
6848         * options.h (struct options): Manually applied Rob Mayoff's patch
6849         to add --bind-address (bind_address structure member).
6850                 
6851         * recur.c (recursive_retrieve): Improved comment; added DEBUGP().
6852         Ignore --convert-links if --delete-after was specified.
6853                 
6854         * retr.c (retrieve_from_file): Just added a DEBUGP().
6855                 
6856 2000-10-19  Dan Harkless  <wget@harkless.org>
6857
6858         * ftp.c (ftp_loop_internal): downloaded_file() enumerators changed.
6859         (getftp): Applied Piotr Sulecki <Piotr.Sulecki@ios.krakow.pl>'s
6860         patch to work around FTP servers that incorrectly respond to the
6861         "REST" command with the remaining size rather than the total file size.
6862                 
6863         * http.c (gethttp): Improved a comment and added code to tack on
6864         ".html" to text/html files without that extension when -E specified.
6865         (http_loop): Use new downloaded_file() enumerators and deal with
6866         the case of gethttp() called xrealloc() on u->local.
6867
6868         * init.c (commands): Added new "htmlextension" command.
6869         Also renamed John Daily's cmd_quad() to the more descriptive
6870         cmd_lockable_boolean(), alpha-sorted the CMD_DECLARE()s and
6871         removed duplicate cmd_boolean() declaration.
6872
6873         * main.c (print_help): Added my new -E / --html-extension option.
6874         (main): Undocumented --email-address option previously used -E synonym.
6875         Stole it away for the much more deserving --html-extension's use.
6876
6877         * options.h (struct options): Added html_extension field.
6878
6879         * url.c (convert_links): URL X that we saved as X.html locally due
6880         to -E needs to be backed up as X.orig, not X.html.orig.  Added comments.
6881         (downloaded_file): Now remembers if we added .html extension to a file.
6882
6883         * url.h (downloaded_file_t): Added extra enumerators to support above.
6884         (downloaded_file): Now takes and returns a downloaded_file_t.
6885
6886         * wget.h (unnamed "dt" enum): Added ADDED_HTML_EXTENSION enumerator.
6887         
6888 2000-10-09  Dan Harkless  <wget@harkless.org>
6889
6890         * html.c (htmlfindurl): Added unneeded initialization to quiet warning.
6891                 
6892         * main.c (print_help): Clarified what --retr-symlinks does.
6893         
6894 2000-09-15  John Daily  <jdaily@cyberdude.com>
6895
6896         * init.c: Add support for "always" and "never" values to allow
6897         .wgetrc to override commandline (useful e.g. with .pm files
6898         calling `wget --passive-ftp' when your firewall doesn't allow that).
6899
6900         * ftp.c (getftp): passive_ftp is first option to support always/never.
6901
6902 2000-08-30  Dan Harkless  <wget@harkless.org>
6903
6904         * ftp.c (ftp_retrieve_list): Use new INFINITE_RECURSION #define.
6905         
6906         * html.c: htmlfindurl() now takes final `dash_p_leaf_HTML' parameter.
6907         Wrapped some > 80-column lines.  When -p is specified and we're at a 
6908         leaf node, do not traverse <A>, <AREA>, or <LINK> tags other than 
6909         <LINK REL="stylesheet">.
6910         
6911         * html.h (htmlfindurl): Now takes final `dash_p_leaf_HTML' parameter.
6912         
6913         * init.c: Added new -p / --page-requisites / page_requisites option.
6914
6915         * main.c (print_help): Clarified that -l inf and -l 0 both allow
6916         infinite recursion.  Changed the unhelpful --mirrior description
6917         to simply give the options it's equivalent to.  Added new -p option.
6918         (main): Added some comments; handle new -p / --page-requisites.
6919         
6920         * options.h (struct options): Added new page_requisites field.
6921
6922         * recur.c: Changed "URL-s" to "URLs" and "HTML-s" to "HTMLs".
6923         Calculate and pass down new `dash_p_leaf_HTML' parameter to
6924         get_urls_html().  Use new INFINITE_RECURSION #define.
6925
6926         * retr.c: Changed "URL-s" to "URLs".  get_urls_html() now takes
6927         final `dash_p_leaf_HTML' parameter.
6928
6929         * url.c: get_urls_html() and htmlfindurl() now take final
6930         `dash_p_leaf_HTML' parameter.
6931
6932         * url.h (get_urls_html): Now takes final `dash_p_leaf_HTML' parameter.
6933
6934         * wget.h: Added some comments and new INFINITE_RECURSION #define.
6935         
6936 2000-08-23  Dan Harkless  <wget@harkless.org>
6937
6938         * main.c (print_help): -B / --base was not mentioned.
6939
6940 2000-08-22  Dan Harkless  <wget@harkless.org>
6941
6942         * main.c (print_help): Modified -nc description to mention that it
6943         also prevents the creation of multiple versions of the same file
6944         with ".<number>" suffixes.
6945
6946 2000-07-14  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
6947
6948         * retr.c (retrieve_url): Consistently strdup opt.referer when
6949         setting u->referer.
6950
6951 2000-06-09  Dan Harkless  <wget@harkless.org>
6952
6953         * main.c (print_help): --help output for --waitretry was over 80 cols.
6954
6955 2000-06-09  Hrvoje Niksic  <hniksic@iskon.hr>
6956
6957         * url.c (encode_string): Fix comment.
6958         Suggested by Herold Heiko <Heiko.Herold@previnet.it>.
6959
6960 2000-06-01  Const Kaplinsky  <const@ce.cctpu.edu.ru>
6961
6962         * ftp.c (ftp_retrieve_list): Change permissions only on plain
6963         files.
6964
6965 2000-06-01  Hrvoje Niksic  <hniksic@iskon.hr>
6966
6967         * url.c (str_url): Print the port number only if it's different
6968         from the default port number for that protocol.
6969
6970 2000-05-22  Dan Harkless  <wget@harkless.org>
6971
6972         * main.c (print_help): Added --help line for Damir Dzeko
6973         <ddzeko@zesoi.fer.hr>'s until-now-undocumented --referer option.
6974         Removed comments that --referer and --waitretry were undocumented.
6975         Changed "`.wgetrc' command" to "`.wgetrc'-style command" on --help
6976         line for --execute.
6977
6978 2000-05-18  Hrvoje Niksic  <hniksic@iskon.hr>
6979
6980         * ftp.c (getftp): Ditto.
6981
6982         * http.c (gethttp): Check for return value of fclose/fflush.
6983
6984 2000-04-12  Hrvoje Niksic  <hniksic@iskon.hr>
6985
6986         * host.c (store_hostaddress): Instead of shifting ADDR, start
6987         copying from the correct address.
6988
6989 2000-04-12  Hrvoje Niksic  <hniksic@iskon.hr>
6990
6991         * http.c (gethttp): Don't free REQUEST -- it was allocated with
6992         alloca().
6993         Pointed out by Gisle Vanem <gvanem@eunet.no>.
6994
6995 2000-04-04  Dan Harkless  <wget@harkless.org>
6996
6997         * host.c (store_hostaddress): R. K. Owen's patch introduces a
6998         "left shift count >= width of type" warning on 32-bit
6999         architectures.  Got rid of it by tricking the compiler w/ a variable.
7000         
7001         * url.c (UNSAFE_CHAR): The macro didn't include all the illegal
7002         characters per RFC1738, namely everything above '~'.  It also
7003         generated a warning on OSes where char =~ unsigned char.  Fixed.
7004         
7005 1998-10-17  Hrvoje Niksic  <hniksic@srce.hr>
7006
7007         * http.c (http_process_type): Removed needless strdup(), a memory
7008         leak.
7009
7010 1998-09-25  Hrvoje Niksic  <hniksic@srce.hr>
7011
7012         * html.c (htmlfindurl): Set PH to the first occurrence of `#'.
7013
7014 1998-09-25  Simon Munton  <simonm@m4data.co.uk>
7015
7016         * init.c (wgetrc_file_name): Don't free HOME under Windows.
7017
7018 1998-12-01  "R. K. Owen"  <rkowen@Nersc.GOV>
7019
7020         * host.c (store_hostaddress): Fix for big endian 64-bit machines.
7021
7022 1998-12-01  Hrvoje Niksic  <hniksic@srce.hr>
7023
7024         * url.c (UNSAFE_CHAR): New macro.
7025         (contains_unsafe): Use it.
7026         (encode_string): Ditto.
7027
7028 1998-12-01  Hrvoje Niksic  <hniksic@srce.hr>
7029
7030         * main.c (i18n_initialize): Use LC_MESSAGES only if available.
7031
7032 2000-03-31  Hrvoje Niksic  <hniksic@srce.hr>
7033
7034         * Use TOUPPER/TOLOWER.
7035
7036 1998-12-22  Alexander V. Lukyanov  <lav@yars.free.net>
7037
7038         * ftp-opie.c (btoe): Zero-terminate OSTORE.
7039
7040 2000-03-21  Hrvoje Niksic  <hniksic@iskon.hr>
7041
7042         * wget.h (DO_REALLOC_FROM_ALLOCA): Ditto.
7043
7044         * sysdep.h (ISALNUM): New macro.
7045         (TOLOWER): Ditto.
7046         (TOUPPER): Ditto.
7047
7048 2000-03-10  Dan Harkless  <wget@harkless.org>
7049
7050         * html.c (idmatch): Implemented checking of my new --follow-tags
7051         and --ignore-tags options.
7052         
7053         * init.c (commands): Added comment reminding people adding new
7054         entries doing allocation to add corresponding freeing in cleanup().
7055         (commands): Added new followtags and ignoretags commands.
7056         (cleanup): Free storage for new followtags and ignoretags.
7057         
7058         * main.c: Use of "comma-separated list" was random -- normalized
7059         it.  Did some alphabetization.  Added comments pointing out
7060         "Options without arguments" and "Options accepting an argument"
7061         sections of long_options[].  Added new options --follow-tags and
7062         -G / --ignore-tags.  Added comment that Damir's --referer is
7063         currently undocumented.  Added comment that Heiko's --waitretry is
7064         partially undocumented (mentioned in --help but not in
7065         wget.texi).  Moved improperly sorted 24, 129, and 'G' cases.
7066         
7067         * options.h (struct options): Added new fields follow_tags and
7068         ignore_tags. 
7069         
7070         * wget.h: Added "#define EQ 0" so we can say "strcmp(a, b) == EQ".
7071         
7072 2000-03-02  Dan Harkless  <wget@harkless.org>
7073
7074         * ftp.c (ftp_loop_internal): Heiko introduced "suggest explicit
7075         braces to avoid ambiguous `else'" warnings.  Eliminated them.
7076         
7077         * http.c (gethttp): Dan Berger's query string patch is totally
7078         bogus.  If you have two different URLs, gen_page.cgi?page1 and
7079         get_page.cgi?page2, they'll both be saved as get_page.cgi and the
7080         second will overwrite the first.  Also, parameters to implicit
7081         CGIs, like "http://www.host.com/db/?2000-03-02" cause the URLs to
7082         be printed with trailing garbage characters, and could seg fault.
7083         Backing out the patch, which Dan B. informed me by email was just
7084         a kludge to download StarOffice from Sun made necessary due to
7085         wget's unconditional escaping of certain characters (room for an
7086         option there?).
7087         (http_loop): Heiko introduced "suggest explicit braces to avoid
7088         ambiguous `else'" warnings.  Eliminated them.
7089         
7090         * main.c: Heiko's --wait / --waitretry backwards compatibility
7091         code looks to have been totally untested -- automatic variable
7092         'wr' was used without being initialized, and a long int was passed
7093         into setval()'s char* val parameter.
7094         
7095         * recur.c (parse_robots): Applied Edward J. Sabol
7096         <sabol@alderaan.gsfc.nasa.gov>'s patch for Guan Yang's reported
7097         problem with "User-agent:<space>*<space>" lines in robots.txt.
7098         
7099         * url.c (parseurl, str_url): Removing Dan Berger's code (see
7100         http.c above for explanation).
7101         
7102 1999-08-25  Heiko Herold  <Heiko.Herold@previnet.it>
7103
7104         * ftp.c: Respect new option waitretry.
7105
7106 2000-01-30  Damir Dzeko  <ddzeko@zesoi.fer.hr>
7107
7108         * http.c (gethttp): Send custom Referer, if required.
7109
7110 1999-09-24  Charles G Waldman  <cgw@fnal.gov>
7111
7112         * netrc.c (parse_netrc): Allow passwords to contain spaces.
7113
7114         * netrc.c (parse_netrc): New function.
7115
7116 1999-09-17  Dan Berger  <dberger@ix.netcom.com>
7117
7118         * http.c (gethttp): Send it.
7119
7120         * url.c (parseurl): Detect query string in HTTP URL-s.
7121         (str_url): Print it.
7122
7123 2000-03-02  HIROSE Masaaki  <hirose31@t3.rim.or.jp>
7124
7125         * html.c (html_allow): Add <link href=...> and <script src=...>.
7126
7127 1999-05-02  andrew deryabin  <djsf@softhome.net>
7128
7129         * http.c (gethttp): Specify port in `Host' header only if it's
7130         different from 80.
7131
7132 1998-11-03  Edward J. Sabol  <sabol@alderaan.gsfc.nasa.gov>
7133
7134         * recur.c (recursive_retrieve): If a finite maximum depth is
7135         specified, and we're are already at that depth, don't download the
7136         HTML file for parsing.
7137
7138 2000-03-01  Dan Harkless  <wget@harkless.org>
7139
7140         * ftp.c (ftp_loop_internal): Call new downloaded_file() function,
7141         even though we don't do conversion on HTML files retrieved via
7142         FTP, so _current_ usage of downloaded_file() makes this call unneeded. 
7143         (ftp_retrieve_list): Added a comment saying where we need to
7144         stat() a .orig file if FTP'd HTML file conversion is ever implemented.
7145         (ftp_retrieve_list): "Local file '%s' is more recent," is sometimes
7146         a lie -- reworded as "Server file no newer than local file '%s' --".
7147         
7148         * http.c (http_loop): Fixed a typo and clarified a comment.
7149         (http_loop): When -K and -N are specified together, compare size
7150         and timestamp of server file X against local file X.orig (if
7151         extant) rather than converted local file X.
7152         (http_loop): "Local file '%s' is more recent," is sometimes a lie
7153         -- reworded as "Server file no newer than local file '%s' --".
7154         (http_loop): Call new downloaded_file() function to prevent
7155         wrongful overwriting of .orig file when -N is specified.
7156         
7157         * url.c (convert_links): When -K specified, only rename X to
7158         X.orig if downloaded_file() returns TRUE.  Otherwise when we skip
7159         file X due to -N, we clobber an X.orig from a previous invocation.
7160         (convert_links): Call the failsafe xstrdup(), not the real strdup().
7161         (convert_links): Added a note asking anyone who understands how
7162         multiple URLs can correspond to a single file to comment it.
7163         (downloaded_file): Added this new function.
7164         
7165         * url.h (downloaded_file): Added prototype for this new function
7166         as well as its downloaded_file_t enum type.
7167
7168         * wget.h (boolean): Added this new typedef and TRUE and FALSE #defines.
7169
7170 2000-02-29  Dan Harkless  <wget@harkless.org>
7171
7172         * version.c: Upped version to developer-only "1.5.3+dev".
7173
7174 2000-02-18  Dan Harkless  <wget@harkless.org>
7175
7176         * init.c (backup_converted): Added this new option.
7177
7178         * main.c (-K / --backup-converted): Added this new option.
7179
7180         * options.h (backup_converted): Added this new option.
7181
7182         * url.c (convert_links): When backup_converted is specified, save
7183         file X as X.orig before converting.
7184
7185         * url.h (urlpos): Fixed typo -- said "Rekative" instead of "Relative".
7186
7187 1998-09-21  Hrvoje Niksic  <hniksic@srce.hr>
7188
7189         * version.c: Wget 1.5.3 is released.
7190
7191 1998-09-21  Hrvoje Niksic  <hniksic@srce.hr>
7192
7193         * host.c (ftp_getaddress): Don't warn when reverse-lookup of local 
7194         address doesn't yield FQDN.
7195
7196 1998-09-21  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
7197
7198         * cmpt.c (strerror): Fix declaration of sys_errlist.
7199
7200 1998-09-11  Hrvoje Niksic  <hniksic@srce.hr>
7201
7202         * main.c (main): Don't use an array subscript as the first
7203         argument to STRDUP_ALLOCA.
7204         From Kaveh R. Ghazi.
7205
7206 1998-09-11  Szakacsits Szabolcs  <szaka@sienet.hu>
7207
7208         * html.c (htmlfindurl): Download table background.
7209
7210 1998-09-11  Hans Grobler  <grobh@conde.ee.sun.ac.za>
7211
7212         * init.c (parse_line): Would free *com before allocating it.
7213         (parse_line): Would free com instead of *com.
7214
7215 1998-09-10  Howard Gayle  <howard@fjst.com>
7216
7217         * url.c (get_urls_html): Would drop the last character of the
7218         link.
7219
7220 1998-09-10  Hrvoje Niksic  <hniksic@srce.hr>
7221
7222         * http.c (http_loop): Don't print status code if quiet.
7223
7224 1998-09-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7225
7226         * log.c: Use <stdarg.h> only when __STDC__.
7227
7228 1998-09-10  Adam D. Moss  <adam@foxbox.org>
7229
7230         * html.c (htmlfindurl): Download <layer src=...>.
7231
7232 1998-09-10  Howard Gayle  <howard@fjst.com>
7233
7234         * ftp.c (ftp_retrieve_list): Don't update the time stamp of a file 
7235         not retrieved.
7236
7237 1998-06-27  Hrvoje Niksic  <hniksic@srce.hr>
7238
7239         * utils.c: Include <libc.h> on NeXT.
7240
7241 1998-06-26  Heinz Salzmann  <heinz.salzmann@intermetall.de>
7242
7243         * url.c (get_urls_html): Fix calculation of URL position.
7244
7245 1998-06-23  Hrvoje Niksic  <hniksic@srce.hr>
7246
7247         * version.c: Wget 1.5.2 is released.
7248
7249 1998-06-23  Dave Love  <d.love@dl.ac.uk>
7250
7251         * ftp.c, init.c, netrc.c: Include errno.h.
7252
7253         * http.c: Include errno.h and time header.
7254
7255         * Makefile.in (exext): Define.
7256         (install.bin, uninstall.bin): Use it.
7257
7258 1998-06-21  Hrvoje Niksic  <hniksic@srce.hr>
7259
7260         * http.c (http_loop): Don't attempt to compare local and remote
7261         sizes if the remote size is unknown.
7262
7263 1998-06-16  Hrvoje Niksic  <hniksic@srce.hr>
7264
7265         * url.c (get_urls_html): Use malloc() instead of alloca in the
7266         loop.
7267
7268 1998-06-13  Hrvoje Niksic  <hniksic@srce.hr>
7269
7270         * version.c: Wget 1.5.2-b4 is released.
7271
7272 1998-06-13  Hrvoje Niksic  <hniksic@srce.hr>
7273
7274         * url.c (get_urls_html): Ignore spaces before and after the URI.
7275
7276 1998-06-08  Wanderlei Antonio Cavassin  <cavassin@conectiva.com.br>
7277
7278         * ftp.c (getftp): Translate `done'.
7279
7280 1998-06-06  Hrvoje Niksic  <hniksic@srce.hr>
7281
7282         * version.c: Wget 1.5.2-b3 is released.
7283
7284 1998-06-06  Alexander Kourakos  <awk@bnt.com>
7285
7286         * init.c (cleanup): Close dfp, don't free it.
7287
7288 1998-06-06  Hrvoje Niksic  <hniksic@srce.hr>
7289
7290         * utils.c (make_directory): Twiddle.
7291
7292         * config.h.in: Added template for access().
7293
7294 1998-06-05  Mathieu Guillaume  <mat@cythere.com>
7295
7296         * html.c (htmlfindurl): Download <input src=...>
7297
7298 1998-06-03  Hrvoje Niksic  <hniksic@srce.hr>
7299
7300         * utils.c (file_exists_p): Use access() with two arguments.
7301
7302 1998-05-27  Martin Kraemer  <Martin.Kraemer@mch.sni.de>
7303
7304         * netrc.c (parse_netrc): Correct logic.
7305
7306 1998-05-27  Hrvoje Niksic  <hniksic@srce.hr>
7307
7308         * ftp.c (getftp): Added `break'; suggested by Lin Zhe Min
7309         <ljm@ljm.wownet.net>.
7310
7311 1998-05-24  Hrvoje Niksic  <hniksic@srce.hr>
7312
7313         * version.c: Wget 1.5.2-b2 is released.
7314
7315 1998-05-18  Juan Jose Rodriguez  <jcnsoft@jal1.telmex.net.mx>
7316
7317         * mswindows.h: Don't translate mkdir to _mkdir under Borland.
7318
7319 1998-05-17  Hrvoje Niksic  <hniksic@srce.hr>
7320
7321         * retr.c (elapsed_time): Return correct value when
7322         HAVE_GETTIMEOFDAY is undefined.
7323
7324 1998-05-13  Hrvoje Niksic  <hniksic@srce.hr>
7325
7326         * version.c: Wget 1.5.2-b1 is released.
7327
7328 1998-05-08  Hrvoje Niksic  <hniksic@srce.hr>
7329
7330         * getopt.c (_getopt_internal): Use exec_name instead of argv[0].
7331         (_getopt_internal): Don't translate `#if 0'-ed strings.
7332
7333 1998-05-06  Douglas E. Wegscheid  <wegscd@whirlpool.com>
7334
7335         * mswindows.c (ws_handler): Use fork_to_background().
7336
7337 1998-05-05  Hrvoje Niksic  <hniksic@srce.hr>
7338
7339         * version.c: Wget 1.5.1 is released.
7340
7341 1998-05-05  Hrvoje Niksic  <hniksic@srce.hr>
7342
7343         * http.c (parse_http_status_line): Avoid `minor' and `major'
7344         names.
7345
7346 1998-05-02  Hrvoje Niksic  <hniksic@srce.hr>
7347
7348         * utils.c (mkdirhier): Renamed to make_directory.
7349
7350 1998-05-01  Hrvoje Niksic  <hniksic@srce.hr>
7351
7352         * mswindows.c (fork_to_background): Define under Windows.
7353
7354         * utils.c (fork_to_background): New function.
7355
7356         * html.c (htmlfindurl): Removed rerdundant casts.
7357
7358 1998-05-01  Douglas E. Wegscheid  <wegscd@whirlpool.com>
7359
7360         * mswindows.c (ws_mypath): Cache the path.
7361
7362 1998-04-30  Douglas E. Wegscheid  <wegscd@whirlpool.com>
7363
7364         * ftp.h: Prefix enum ftype members with FT_.
7365
7366         * ftp-ls.c, ftp.c, html.h: Adjust accordingly.
7367
7368         * mswindows.h: Use stat under Borland, _stat under MSVC.
7369
7370 1998-04-28  Hrvoje Niksic  <hniksic@srce.hr>
7371
7372         * http.c (known_authentication_scheme_p): New function.
7373         (gethttp): Handle authorization more correctly.
7374
7375         * ftp-basic.h: Removed.
7376
7377         * cmpt.h: Removed.
7378
7379         * utils.c: Include <unistd.h> before <pwd.h>; needed under SunOS
7380         with gcc 2.8.
7381         (numdigit): Use `while' loop.
7382
7383         * http.c (create_authorization_line): Detect authentication
7384         schemes case-insensitively.
7385
7386         * http.c (extract_header_attr): Use strdupdelim().
7387         (digest_authentication_encode): Move declaration of local
7388         variables to smaller scope.
7389         (digest_authentication_encode): Reset REALM, OPAQUE and NONCE.
7390         (create_authorization_line): Detect authentication schemes
7391         case-insensitively.
7392
7393         * utils.c (touch): Constify.
7394
7395         * http.c (gethttp): Report a nicer error when no data is received.
7396
7397         * rbuf.h (RBUF_READCHAR): Ditto.
7398
7399         * ftp-basic.c (ftp_response): Use sizeof.
7400
7401 1998-04-27  Hrvoje Niksic  <hniksic@srce.hr>
7402
7403         * retr.c (print_percentage): EXPECTED is long, not int.
7404         (print_percentage): Use floating-point arithmetic to avoid
7405         overflow with large files' sizes multiplied with 100.
7406
7407 1998-04-27  Gregor Hoffleit  <flight@mathi.uni-heidelberg.de>
7408
7409         * config.h.in: Added pid_t stub.
7410
7411         * sysdep.h (S_ISREG): Moved here from mswindows.h (NeXT doesn't
7412         define it).
7413
7414 1998-04-20  Hrvoje Niksic  <hniksic@srce.hr>
7415
7416         * version.c: Wget 1.5.0 is released.
7417
7418 1998-04-18  Hrvoje Niksic  <hniksic@srce.hr>
7419
7420         * url.c (str_url): Ditto.
7421
7422         * ftp-basic.c (ftp_rest): Use new name.
7423
7424         * utils.c (long_to_string): Renamed from prnum().
7425
7426 1998-04-16  Hrvoje Niksic  <hniksic@srce.hr>
7427
7428         * version.c: Wget 1.5-b17 is released.
7429
7430 1998-04-08  Hrvoje Niksic  <hniksic@srce.hr>
7431
7432         * headers.c (header_get): New argument FLAGS.
7433
7434         * http.c (gethttp): If request is malformed, bail out of the
7435         header loop.
7436         (gethttp): Check for empty header *after* the status line checks.
7437         (gethttp): Disallow continuations for status line.
7438
7439 1998-04-08  Hrvoje Niksic  <hniksic@srce.hr>
7440
7441         * version.c: Wget 1.5-b16 is released.
7442
7443 1998-04-08  Hrvoje Niksic  <hniksic@srce.hr>
7444
7445         * init.c (commands): Renamed `always_rest' to `continue'.
7446
7447 1998-04-05  Hrvoje Niksic  <hniksic@srce.hr>
7448
7449         * all: Use it.
7450
7451         * log.c (logputs): New argument.
7452         (logvprintf): Ditto.
7453         (logprintf): Ditto.
7454
7455 1998-04-04  Hrvoje Niksic  <hniksic@srce.hr>
7456
7457         * http.c (http_atotm): Update comment.
7458
7459         * main.c (i18n_initialize): Set LC_MESSAGES, not LC_ALL.
7460
7461         * wget.h: Renamed ENABLED_NLS to HAVE_NLS.
7462
7463         * main.c (i18n_initialize): New function.
7464         (main): Use it.
7465
7466         * log.c: Include <unistd.h>.
7467
7468         * retr.c (show_progress): Cast alloca to char *.
7469
7470 1998-04-04  Hrvoje Niksic  <hniksic@srce.hr>
7471
7472         * version.c: Wget 1.5-b15 is released.
7473
7474 1998-04-04  Hrvoje Niksic  <hniksic@srce.hr>
7475
7476         * utils.h: Declare file_non_directory_p().
7477
7478 1998-04-03  Hrvoje Niksic  <hniksic@srce.hr>
7479
7480         * main.c (main): It's `tries', not `numtries' now.
7481
7482 1998-04-01  Hrvoje Niksic  <hniksic@srce.hr>
7483
7484         * init.c (getperms): Removed.
7485
7486 1998-04-01  Tim Charron  <tcharron@interlog.com>
7487
7488         * log.c (logvprintf): Don't use ARGS twice.
7489
7490 1998-04-01  John  <john@futuresguide.com>
7491
7492         * mswindows.c: Cleaned up.
7493
7494 1998-04-01  Hrvoje Niksic  <hniksic@srce.hr>
7495
7496         * version.c: Wget 1.5-b14 is released.
7497
7498 1998-04-01  Hrvoje Niksic  <hniksic@srce.hr>
7499
7500         * ftp-opie.c (STRLEN4): New macro.
7501         (btoe): Use it.
7502
7503 1998-04-01  Junio Hamano  <junio@twinsun.com>
7504
7505         * http.c: Document all the Digest functions.
7506
7507 1998-04-01  Hrvoje Niksic  <hniksic@srce.hr>
7508
7509         * utils.c (file_non_directory_p): Renamed from isfile().
7510
7511         * mswindows.h (S_ISREG): New macro, suggested by Tim Adam.
7512
7513 1998-03-31  Hrvoje Niksic  <hniksic@srce.hr>
7514
7515         * utils.c (mkdirhier): Use 0777 instead of opt.dirmode.
7516
7517         * init.c (cmd_spec_dotstyle): Use 48 dots per line for binary
7518         style.
7519         (cmd_permissions): Removed.
7520
7521         * config.h.in: Add template for WORDS_BIGENDIAN.
7522
7523 1998-03-31  Junio Hamano  <junio@twinsun.com>
7524
7525         * http.c (HEXD2asc): New macro.
7526         (dump_hash): Use it.
7527
7528 1998-03-31  Hrvoje Niksic  <hniksic@srce.hr>
7529
7530         * version.c: Wget 1.5-b13 is released.
7531
7532 1998-03-31  Hrvoje Niksic  <hniksic@srce.hr>
7533
7534         * main.c (main): Don't try to use `com'.
7535
7536 1998-03-30  Hrvoje Niksic  <hniksic@srce.hr>
7537
7538         * init.c (cmd_permissions): New function.
7539
7540 1998-03-30  Hrvoje Niksic  <hniksic@srce.hr>
7541
7542         * version.c: Wget 1.5-b12 is released.
7543
7544 1998-03-30  Hrvoje Niksic  <hniksic@srce.hr>
7545
7546         * init.c (commands): Renamed `numtries' to `tries'.
7547         (cmd_spec_debug): Removed.
7548         (home_dir): Under Windows, return `C:\' if HOME is undefined.
7549
7550 1998-03-29  Hrvoje Niksic  <hniksic@srce.hr>
7551
7552         * config.h.in: Define _XOPEN_SOURCE.
7553
7554         * init.c (check_user_specified_header): New function.
7555         (cmd_spec_header): Use it.
7556         (cmd_spec_useragent): New function.
7557
7558 1998-03-29  Hrvoje Niksic  <hniksic@srce.hr>
7559
7560         * version.c: Wget 1.5-b11 is released.
7561
7562 1998-03-28  Hrvoje Niksic  <hniksic@srce.hr>
7563
7564         * wget.h: Include <libintl.h> only if NLS is enabled.
7565
7566 1998-03-26  Hrvoje Niksic  <hniksic@srce.hr>
7567
7568         * options.h (struct options): Made `wait' a long.
7569         (struct options): Ditto for `timeout'.
7570
7571 1998-03-19  Hrvoje Niksic  <hniksic@srce.hr>
7572
7573         * utils.c (exists): Renamed to file_exists_p.
7574         (file_exists_p): Use access() if available.
7575
7576 1998-03-17  Hrvoje Niksic  <hniksic@srce.hr>
7577
7578         * utils.c (memfatal): Set save_log_p to 0 to avoid potential
7579         infloop.
7580
7581         * log.c: do_logging -> save_log_p.
7582
7583         * config.h.in: Added template for HAVE_VSNPRINTF.
7584
7585 1998-03-16  Hrvoje Niksic  <hniksic@srce.hr>
7586
7587         * init.c: Ditto.
7588
7589         * http.c: Protect declaration against non-ANSI compiler.
7590
7591         * log.c (logvprintf): Use vsnprintf() if available.
7592
7593         * getopt.c (main): Don't translate test stuff.
7594
7595 1998-03-16  Hrvoje Niksic  <hniksic@srce.hr>
7596
7597         * version.c: Wget 1.5-b10 is released.
7598
7599 1998-03-11  Hrvoje Niksic  <hniksic@srce.hr>
7600
7601         * ftp.c (getftp): Don't translate "CWD %s".
7602
7603         * wget.h (GCC_FORMAT_ATTR): Renamed from FORMAT_ATTR.
7604
7605 1998-03-07  Hrvoje Niksic  <hniksic@srce.hr>
7606
7607         * ftp-opie.c (btoe): Use memcpy() instead of strncat().
7608
7609         * log.c (logputs): New function.
7610         (logvprintf): Renamed from vlogmsg; use logputs().
7611
7612         * retr.c (show_progress): Print `[100%]' when the retrieval is
7613         finished.
7614
7615         * init.c (run_wgetrc): Use FILE, not PATH.
7616         (wgetrc_file_name): Ditto.
7617
7618 1998-03-07  Tim Adam  <tma@osa.com.au>
7619
7620         * recur.c (parse_robots): Correctly reset `entries' on empty
7621         disallow.
7622
7623 1998-03-07  Hrvoje Niksic  <hniksic@srce.hr>
7624
7625         * init.c (cmd_spec_debug): Use cmd_boolean().
7626
7627 1998-02-23  Hrvoje Niksic  <hniksic@srce.hr>
7628
7629         * http.c (gethttp): Create proxy-authorization correctly.
7630
7631 1998-02-22  Hrvoje Niksic  <hniksic@srce.hr>
7632
7633         * md5.c: Ditto.
7634
7635         * getopt.c: Use ANSI function definitions.
7636
7637         * ftp-opie.c: New file.
7638
7639         * options.h: Don't redefine EXTERN.
7640
7641         * init.c: Sort it correctly.
7642
7643 1998-02-22  Hrvoje Niksic  <hniksic@srce.hr>
7644
7645         * version.c: Wget 1.5-b9 is released.
7646
7647 1998-02-22  Hrvoje Niksic  <hniksic@srce.hr>
7648
7649         * recur.c (recursive_retrieve): Reset `first_time'.
7650
7651         * ftp.c (getftp): Added `default' clause to switches of uerr_t.
7652
7653         * rbuf.c (rbuf_peek): Simplified.
7654         (rbuf_flush): Use MINVAL.
7655
7656         * wget.h (MINVAL): Moved from url.h.
7657
7658         * rbuf.h (RBUF_FD): New macro.
7659
7660         * url.c (add_url): Add to the head of the list.
7661
7662         * ftp.c (ftp_retrieve_list): Set the permissions to downloaded
7663         file.
7664         (getftp): Set the default permissions to 0600.
7665
7666 1998-02-21  Hrvoje Niksic  <hniksic@srce.hr>
7667
7668         * url.c (get_urls_html): Ditto.
7669         (convert_links): Ditto.
7670
7671         * recur.c (parse_robots): Ditto.
7672
7673         * html.c (ftp_index): Ditto.
7674
7675         * ftp-ls.c (ftp_parse_unix_ls): Open file as binary.
7676
7677         * init.c (defaults): Initialize `opt' to zero via memset.
7678
7679         * http.c (digest_authentication_encode): goto considered harmful.
7680
7681 1998-02-19  Hrvoje Niksic  <hniksic@srce.hr>
7682
7683         * ftp.c (delelement): Simplify and fix leak.
7684
7685 1998-02-18  Hrvoje Niksic  <hniksic@srce.hr>
7686
7687         * http.c (dump_hash): Use HEXD2ASC instead of home-grown stuff.
7688
7689         * url.h (HEXD2ASC): Removed warning.
7690
7691         * init.c (comind): Use binary search.
7692         (commands): Reorganized.
7693         (setval): Ditto.
7694         (cmd_boolean): New function.
7695         (cmd_number): Ditto.
7696         (cmd_number_inf): Ditto.
7697         (cmd_string): Ditto.
7698         (cmd_vector): Ditto.
7699         (cmd_directory_vector): Ditto.
7700         (cmd_bytes): Ditto.
7701         (cmd_time): Ditto.
7702         (cmd_spec_debug): Ditto.
7703         (cmd_spec_dirmode): Ditto.
7704         (cmd_spec_dirstruct): Ditto.
7705         (cmd_spec_dotstyle): Ditto.
7706         (cmd_spec_header): Ditto.
7707         (cmd_spec_htmlify): Ditto.
7708         (cmd_spec_mirror): Ditto.
7709         (cmd_spec_outputdocument): Ditto.
7710         (cmd_spec_recursive): Ditto.
7711         (settime): Merged with cmd_time().
7712         (setbytes): Merged with cmd_bytes().
7713         (setonoff): Merged with cmd_boolean().
7714         (onoff): Ditto.
7715
7716 1998-02-17  Hrvoje Niksic  <hniksic@srce.hr>
7717
7718         * Makefile.in (distclean): Remove `config.h'.
7719
7720 1998-02-17  Hrvoje Niksic  <hniksic@srce.hr>
7721
7722         * version.c: Wget 1.5-b8 is released.
7723
7724 1998-02-17  Hrvoje Niksic  <hniksic@srce.hr>
7725
7726         * http.c (digest_authentication_encode): New function.
7727         (create_authorization_line): Use it.
7728         (dump_hash): New function.
7729         (digest_authentication_encode): Use it.
7730
7731         * fnmatch.c: Renamed from `mtch.c'.
7732
7733 1998-02-15  Karl Eichwalder  <ke@suse.de>
7734
7735         * main.c (main): Tag "Written by..." string as translatable.
7736
7737 1998-02-15  Hrvoje Niksic  <hniksic@srce.hr>
7738
7739         * wget.h (FREE_MAYBE): New macro.
7740
7741         * http.c (create_authorization_line): Don't use ANSI C string
7742         concatenation feature.
7743         (basic_authentication_encode): Use alloca() for temporary
7744         variables.
7745
7746         * recur.h: Ditto.
7747
7748         * http.c: Ditto.
7749
7750         * headers.h: Ditto.
7751
7752         * ftp-basic.c: Protect declaration against non-ANSI compiler.
7753
7754         * http.c (create_authorization_line): Cast `unsigned char *' to
7755         `char *' for sprintf, to shut up the noisy Digital Unix cc.
7756
7757 1998-02-15  Hrvoje Niksic  <hniksic@srce.hr>
7758
7759         * version.c: Wget 1.5-b7 is released.
7760
7761 1998-02-15  Hrvoje Niksic  <hniksic@srce.hr>
7762
7763         * cmpt.c (strstr): Synched with glibc-2.0.6.
7764
7765         * ftp-basic.c (calculate_skey_response): Ditto.
7766         (calculate_skey_response): Use alloca().
7767
7768         * http.c (create_authorization_line): Work with FSF's version of
7769         md5.c.
7770
7771         * md5.c: New file, from GNU libc.
7772
7773 1998-02-14  Hrvoje Niksic  <hniksic@srce.hr>
7774
7775         * url.h (URL_CLEANSE): Name the temporary variable more carefully.
7776
7777 1998-02-13  Hrvoje Niksic  <hniksic@srce.hr>
7778
7779         * http.c (basic_authentication_encode): New function, instead of
7780         the macro.
7781
7782 1998-02-13  Junio Hamano  <junio@twinsun.com>
7783
7784         * http.c: Add HTTP-DA support.
7785         * ftp-basic.c: Add Opie/S-key support.
7786         * config.h.in, Makefile.in: Add HTTP-DA and Opie/S-key support.
7787         * md5.c, md5.h: New files.
7788
7789 1998-02-13  Hrvoje Niksic  <hniksic@srce.hr>
7790
7791         * http.c (http_process_range): Renamed from hprocrange().
7792         (http_process_range): Parse the whole header.
7793
7794         * headers.c: New file.
7795         (header_process): New function.
7796         (header_get): Renamed from fetch_next_header.
7797
7798         * all: Include utils.h only where necessary.
7799
7800         * wget.h: Declare xmalloc(), xrealloc() and xstrdup() here.
7801
7802         * wget.h: Add provisions for dmalloc.
7803
7804 1998-02-12  Hrvoje Niksic  <hniksic@srce.hr>
7805
7806         * version.c: Wget 1.5-b6 is released.
7807
7808 1998-02-12  Hrvoje Niksic  <hniksic@srce.hr>
7809
7810         * ftp.c (ftp_loop): Determine `filename' more precisely.
7811
7812         * init.c (setval): Don't set `opt.quiet' if output-document is
7813         `-'.
7814
7815         * log.c (log_init): Print to STDERR instead of STDOUT.
7816         (vlogmsg): Use STDERR by default.
7817         (logflush): Ditto.
7818
7819 1998-02-11  Simon Josefsson  <jas@pdc.kth.se>
7820
7821         * host.c: Use addr_in again.
7822
7823 1998-02-08  Karl Eichwalder  <karl@suse.de>
7824
7825         * http.c (gethttp): Fixed typo.
7826
7827 1998-02-08  Hrvoje Niksic  <hniksic@srce.hr>
7828
7829         * version.c: Wget 1.5-b5 is released.
7830
7831 1998-02-08  Hrvoje Niksic  <hniksic@srce.hr>
7832
7833         * retr.c (show_progress): Use it.
7834
7835         * log.c (logflush): New function.
7836
7837         * wget.h: Utilize __attribute__ if on gcc.
7838
7839 1998-02-07  Hrvoje Niksic  <hniksic@srce.hr>
7840
7841         * http.c (base64_encode_line): New argument LENGTH.
7842         (BASIC_AUTHENTICATION_ENCODE): Use it.
7843         (BASIC_AUTHENTICATION_ENCODE): Take length of HEADER into account.
7844
7845         * main.c (main): Fixed fprintf() format mismatch.
7846
7847 1998-02-06  Hrvoje Niksic  <hniksic@srce.hr>
7848
7849         * version.c: Wget 1.5-b4 is released.
7850
7851 1998-02-03  Simon Josefsson  <jas@pdc.kth.se>
7852
7853         * host.c: use sockaddr_in instead of addr_in.
7854
7855 1998-02-04  Hrvoje Niksic  <hniksic@srce.hr>
7856
7857         * init.c (cleanup): Use it.
7858
7859         * recur.c (recursive_cleanup): New function.
7860
7861         * retr.c (retrieve_from_file): Ditto.
7862
7863         * main.c (main): Use it.
7864
7865         * recur.c (recursive_reset): New function.
7866
7867         * retr.c (retrieve_from_file): Ditto.
7868
7869         * main.c (main): Simplify call to recursive_retrieve().
7870
7871         * recur.c (recursive_retrieve): Removed FLAGS argument.
7872
7873         * http.c (gethttp): Changed call to iwrite().
7874
7875 1998-02-03  Hrvoje Niksic  <hniksic@srce.hr>
7876
7877         * url.c (get_urls_html): Ditto.
7878         (free_urlpos): Ditto.
7879         (mkstruct): Ditto.
7880         (construct): Ditto.
7881
7882         * retr.c (retrieve_url): Move declaration of local variables to
7883         smaller scope.
7884
7885         * url.c (urlproto): Use it.
7886         (parseurl): Ditto.
7887         (str_url): Ditto.
7888         (get_urls_html): Ditto.
7889
7890         * utils.h (ARRAY_SIZE): New macro.
7891
7892         * url.c (proto): Moved from url.h.
7893
7894         * url.h (URL_CLEANSE): Reformatted.
7895         (USE_PROXY_P): Renamed from USE_PROXY.
7896
7897         * ftp-basic.c: Adjust to the new interface of iwrite().
7898
7899         * ftp-basic.c (ftp_port): Use alloca().
7900
7901 1998-02-03  Hrvoje Niksic  <hniksic@srce.hr>
7902
7903         * version.c: Wget 1.5-b3 is released.
7904
7905         * host.c (ftp_getaddress): Don't print to stderr directly.
7906
7907         * init.c (setbytes): Support `g' for gigabytes.
7908         (cmdtype): New specification CTIME.
7909         (setval): Use it with settime().
7910         (commands): Use it for WAIT and TIMEOUT.
7911
7912 1998-02-02  Hrvoje Niksic  <hniksic@srce.hr>
7913
7914         * http.c (BASIC_AUTHENTICATION_ENCODE): New macro.
7915         (gethttp): Use it.
7916
7917         * utils.c (unique_name_1): Moved from url.c.
7918         (unique_name): Ditto.
7919
7920         * url.c (url_filename): Ditto.
7921
7922         * log.c (redirect_output): Changed call to unique_name().
7923
7924         * url.c (unique_name_1): Renamed from unique_name().
7925         (unique_name): Changed interface.
7926
7927         * init.c (enum cmdid): Moved from init.h.
7928         (cmdtype): Ditto.
7929         (struct cmd): Ditto.
7930
7931         * main.c (main): Use it.
7932         (main): Moved `--backups' to not have a short option.
7933
7934         * options.h (struct options): New member BACKGROUND.
7935
7936         * main.c (print_help): Rearranged.
7937         (main): New long options for -n* short options: --no-directories,
7938         --no-host-directories, --non-verbose, --no-host-lookup and
7939         --dont-remove-listing.
7940
7941 1998-02-01  Hrvoje Niksic  <hniksic@srce.hr>
7942
7943         * main.c (main): Use log_close().
7944
7945         * log.c: New variable LOGFP.
7946         (vlogmsg): Use it.
7947         (redirect_output): Don't open /dev/null; set LOGFP to stdin
7948         instead.
7949         (log_close): New function.
7950
7951         * options.h (struct options): Removed LFILE.
7952
7953         * log.c (log_enable): Removed.
7954
7955         * main.c (main): Use it.
7956
7957         * log.c (log_init): New function.
7958
7959         * url.c (get_urls_html): Removed needless assignment to BASE.
7960
7961         * host.c (add_hlist): Don't set CMP needlessly.
7962
7963         * utils.c (match_backwards): Ditto.
7964         (in_acclist): Ditto.
7965
7966         * url.c (findurl): Ditto.
7967
7968         * netrc.c (parse_netrc): Ditto.
7969
7970         * log.c (log_dump): Ditto.
7971
7972         * html.c (html_quote_string): Ditto.
7973
7974         * ftp-basic.c (ftp_request): Made static.
7975
7976         * connect.c: Made global variables static.
7977
7978         * url.c (construct): Ditto.
7979
7980         * init.c (init_path): Avoid assignment inside `if'-condition.
7981
7982         * ftp.c: Don't include in.h or winsock.h.
7983
7984         * ftp.c (ftp_loop): Use SZ.
7985
7986         * connect.c (bindport): Cast &addrlen to int *.
7987         (conaddr): Ditto.
7988
7989         * init.c (initialize): Don't use SYSTEM_WGETRC unconditionally.
7990
7991 1998-01-31  Hrvoje Niksic  <hniksic@srce.hr>
7992
7993         * ftp.c (getftp): Initialize opt.ftp_pass here.
7994         (ftp_retrieve_dirs): Use alloca().
7995
7996         * init.c (defaults): Don't initialize opt.ftp_pass.
7997
7998         * sysdep.h (S_ISLNK): Declare for OS/2; ditto for lstat.
7999         From Ivan F. Martinez <ivanfm@ecodigit.com.br>.
8000
8001 1998-01-31  Hrvoje Niksic  <hniksic@srce.hr>
8002
8003         * recur.c (parse_robots): Check for comments more correctly.
8004
8005         * host.c (ftp_getaddress): Use STRDUP_ALLOCA.
8006         (ftp_getaddress): Add diagnostics when reverse-lookup yields only
8007         hostname.
8008
8009 1998-01-31  Hrvoje Niksic  <hniksic@srce.hr>
8010
8011         * version.c: Wget 1.5-b2 is released.
8012
8013         * netrc.c (NETRC_FILE_NAME): Moved from netrc.h.
8014
8015         * utils.c (proclist): Pass FNM_PATHNAME to fnmatch().
8016
8017         * ftp-basic.c (ftp_pasv): Avoid unnecessary casting to unsigned
8018         char.
8019
8020         * log.c: Don't attempt to hide arguments from ansi2knr.
8021
8022         * cmpt.c: Synched strptime() and mktime() with glibc-2.0.6.
8023
8024         * ansi2knr.c: Use a later version, from fileutils-3.16l alpha.
8025
8026         * ftp.c (getftp): Ditto.
8027
8028         * http.c (gethttp): Use it.
8029
8030         * retr.c (get_contents): New argument EXPECTED; pass it to
8031         show_progress().
8032         (show_progress): New argument EXPECTED; use it to display
8033         percentages.
8034
8035         * init.c (setval): Ditto.
8036
8037         * http.c (gethttp): Ditto.
8038         (http_loop): Ditto.
8039
8040         * ftp.c (getftp): Ditto.
8041         (ftp_loop_internal): Ditto.
8042
8043         * ftp-ls.c (ftp_parse_unix_ls): Use abort() instead of assert(0).
8044
8045         * sysdep.h (CLOSE): Simplify; use DEBUGP.
8046
8047         * netrc.c (search_netrc): Use alloca().
8048
8049         * init.c (defaults): Initialize no_flush.
8050
8051         * log.c (vlogmsg): Don't flush if no_flush.
8052
8053         * options.h (struct options): New variable no_flush.
8054
8055         * main.c (main): Don't play games with buffering.
8056
8057         * log.c (vlogmsg): Flush the output after every message.
8058
8059 1998-01-31  Hrvoje Niksic  <hniksic@srce.hr>
8060
8061         * init.c (parse_line): Ditto.
8062
8063         * url.c (get_urls_html): Ditto.
8064
8065         * main.c (main): Don't cast to unsigned char.
8066
8067         * init.c (run_wgetrc): Don't cast to unsigned char.
8068         (parse_line): Accept char instead of unsigned char.
8069
8070         * html.c (htmlfindurl): Use char instead of unsigned char.
8071
8072         * all: Use them.
8073
8074         * sysdep.h: Add wrappers to ctype macros to make them
8075         eight-bit-clean:
8076
8077 1998-01-30  Hrvoje Niksic  <hniksic@srce.hr>
8078
8079         * html.c (htmlfindurl): Download <img lowsrc=...>
8080
8081         * main.c (main): Ignore SIGPIPE.
8082
8083         * connect.c (select_fd): New argument WRITEP.
8084         (iwrite): Call select_fd().
8085
8086 1997-02-27  Fila Kolodny <fila@ibi.com>
8087
8088         * ftp.c (ftp_retrieve_list): If retrieving symlink and the proper
8089         one already exists, just skip it.
8090
8091 1998-01-30  Hrvoje Niksic  <hniksic@srce.hr>
8092
8093         * http.c (gethttp): Cosmetic changes.
8094
8095         * http.c (check_end): Allow `+D...' instead of `GMT'.
8096         From Fabrizio Pollastri <pollastri@cstv.to.cnr.it>.
8097
8098         * url.c (process_ftp_type): New function.
8099         (parseurl): Use it.
8100
8101         * connect.c (iwrite): Allow writing in a few chunks.
8102         (bindport): Made SRV static, so addr can point to it.
8103         (select_fd): Removed HPUX kludge.
8104
8105         * host.c (free_hlist): Incorporated into clean_hosts().
8106
8107 1998-01-29  Hrvoje Niksic  <hniksic@srce.hr>
8108
8109         * host.c (hlist): Made static.
8110         (search_address): Cosmetic change.
8111
8112 1998-01-29  Hrvoje Niksic  <hniksic@srce.hr>
8113
8114         * version.c: Wget v1.5-b1 is released.
8115
8116         * http.c (hgetlen): Use sizeof() to get the header length.
8117         (hgetrange): Ditto.
8118         (hgettype): Ditto.
8119         (hgetlocation): Ditto.
8120         (hgetmodified): Ditto.
8121         (haccepts_none): Ditto.
8122
8123         * main.c (main): Updated `--version' and `--help' output, as per
8124         Francois Pinard's suggestions.
8125
8126         * main.c: Include locale.h; call setlocale(), bindtextdomain() and 
8127         textdomain().
8128
8129         * config.h.in: Define stubs for I18N3.
8130
8131         * wget.h: Include libintl.h.
8132
8133 1998-01-28  Hrvoje Niksic  <hniksic@srce.hr>
8134
8135         * url.c (mkstruct): Check for opt.cut_dirs.
8136         (mkstruct): alloca()-te more, xmalloc() less.
8137
8138         * utils.c (load_file): Check for ferror().
8139
8140         * url.c (get_urls_file): Close only the files we opened.
8141         (get_urls_html): Ditto.
8142         (count_slashes): New function.
8143
8144         * http.h: Removed.
8145
8146         * http.c (gethttp): Respect username and password provided by
8147         proxy URL.
8148         (base64_encode_line): Write into an existing buffer instead of
8149         malloc-ing a new one.
8150         (struct http_stat): Moved from http.h
8151
8152         * retr.c (retrieve_url): Free SUF.
8153
8154         * all: Removed lots of unnecessary .h dependencies.
8155
8156         * html.c (global_state): Made static.
8157
8158         * utils.h (ALLOCA_ARRAY): New macro.
8159
8160         * main.c (main): New option `--cut-dirs'.
8161
8162         * url.c (construct): Use alloca() for T.
8163
8164         * utils.c (mkdirhier): Use STRDUP_ALLOCA.
8165
8166         * host.c (_host_t): Moved from host.h.
8167         (struct host): Renamed from _host_t.
8168         (store_hostaddress): Use STRDUP_ALLOCA for INET_S.
8169         (realhost): Ditto.
8170
8171         * host.h: Don't include url.h.
8172
8173         * ftp.c (LIST_FILENAME): Moved from ftp.h.
8174
8175         * init.c (DEFAULT_FTP_ACCT): Moved from ftp.h.
8176
8177         * main.c (main): Enable log if the output goes to a TTY.
8178
8179         * connect.h: Removed unused constant `BACKLOG'.
8180
8181         * config.h.in: Check for isatty().
8182
8183         * Makefile.in (LINK): Use CFLAGS when linking.
8184
8185 1998-01-27  Hrvoje Niksic  <hniksic@srce.hr>
8186
8187         * mswindows.c (ws_hangup): Use redirect_output().
8188
8189         * main.c (redirect_output_signal): New function; use
8190         redirect_output().
8191
8192         * log.c (redirect_output): New function, based on hangup(), which
8193         is deleted.
8194
8195         * log.c (vlogmsg): New function.
8196
8197         * wget.h (DEBUGP): Use debug_logmsg().
8198
8199         * main.c (hangup): Use it.
8200
8201         * log.c (log_dump): New function.
8202
8203         * utils.h (DO_REALLOC): Use `long' for various sizes.
8204
8205         * http.c (hskip_lws): Use `while', for clarity.
8206         (HTTP_DYNAMIC_LINE_BUFFER): New constant.
8207         (fetch_next_header): Use it instead of DYNAMIC_LINE_BUFFER.
8208
8209         * ftp-basic.c (FTP_DYNAMIC_LINE_BUFFER): New constant.
8210         (ftp_response): Use it instead of DYNAMIC_LINE_BUFFER.
8211
8212         * utils.c (DYNAMIC_LINE_BUFFER): Moved from utils.c.
8213         (LEGIBLE_SEPARATOR): Ditto.
8214         (FILE_BUFFER_SIZE): Ditto.
8215
8216         * retr.c (BUFFER_SIZE): Moved from retr.h.
8217
8218         * log.c: New file.
8219         (logmsg): Moved from utils.c.
8220         (debug_logmsg): New function.
8221
8222         * mswindows.h: Include it here.
8223
8224         * init.c: Ditto.
8225
8226         * utils.c: Don't include <windows.h>.
8227
8228 1998-01-25  Hrvoje Niksic  <hniksic@srce.hr>
8229
8230         * host.c (ftp_getaddress): Ditto.
8231
8232         * main.c (main): Use it.
8233
8234         * utils.h (STRDUP_ALLOCA): New macro.
8235
8236         * init.c: Prepend `wget: ' to error messages printed on stderr.
8237
8238         * utils.c (mkdirhier): Renamed from mymkdir.
8239         (touch): Renamed from my_touch.
8240         (pwd_cuserid): Renamed from my_cuserid().
8241
8242 1998-01-24  Andy Eskilsson  <andy.eskilsson@telelogic.se>
8243
8244         * utils.c (accdir): Process wildcards.
8245         (proclist): New function.
8246         (accdir): Use it to avoid code repetition.
8247
8248 1998-01-24  Hrvoje Niksic  <hniksic@srce.hr>
8249
8250         * recur.c (parse_robots): Respect opt.useragent; use alloca().
8251
8252         * http.c (gethttp): Construct useragent accordingly.
8253
8254         * version.c: Changed version string to numbers-only.
8255
8256         * main.c (print_help): List all the options.
8257
8258         * mswindows.c (windows_main_junk): Initialize argv0 here.
8259
8260 1998-01-24  Karl Heuer  <kwzh@gnu.org>
8261
8262         * netrc.c (search_netrc): Initialize `l' only after processing
8263         netrc.
8264
8265         * main.c (main): Don't trap SIGHUP if it's being ignored.
8266
8267 1998-01-24  Hrvoje Niksic  <hniksic@srce.hr>
8268
8269         * all: Use logmsg().
8270
8271         * utils.c (time_str): Moved from retr.c.
8272         (logmsg): New function.
8273         (logmsg_noflush): Ditto.
8274
8275         * rbuf.c: New file, moved buf_* functions here.
8276
8277         * ftp.c (ftp_expected_bytes): Moved from ftp-basic.c.
8278
8279         * ftp-basic.c (ftp_rest): Use prnum().
8280
8281         * ftp-basic.c: Ditto.
8282
8283         * ftp.c: Use the new reading functions and macros.
8284
8285         * retr.c (buf_initialize): New function.
8286         (buf_initialized_p): Ditto.
8287         (buf_uninitialize): Ditto.
8288         (buf_fd): Ditto.
8289
8290         * http.c (fetch_next_header): Use the BUF_READCHAR macro for
8291         efficiency.
8292         (gethttp): Use alloca() where appropriate.
8293
8294         * retr.c (buf_readchar): Use it.
8295         (buf_peek): Use rstreams.
8296
8297         * retr.h (BUF_READCHAR): New macro.
8298
8299         * init.c (home_dir): Rewritten for clarity.
8300         (init_path): Ditto.
8301
8302         * mswindows.c (ws_backgnd): Made static.
8303         (read_registry): Ditto.
8304         (ws_cleanup): Ditto.
8305         (ws_handler): Ditto.
8306
8307 1998-01-23  Hrvoje Niksic  <hniksic@srce.hr>
8308
8309         * alloca.c: New file.
8310
8311         * Makefile.in (ALLOCA): Define.
8312
8313         * mswindows.c (ws_help): Constify.
8314         (ws_help): Use alloca.
8315
8316         * mswindows.c: Reformat.
8317
8318         * all: Added _(...) annotations for I18N snarfing and translation.
8319
8320         * host.c (ftp_getaddress): Nuke SYSINFO.
8321         (ftp_getaddress): Don't use getdomainname().
8322         (ftp_getaddress): Use uname(), where available.
8323
8324         * http.c (gethttp): Protect a stray fprintf().
8325
8326         * init.c (settime): New function.
8327         (setval): Treat WAIT specially, allowing suffixes like `m' for
8328         minutes, etc.
8329
8330 1998-01-21  Hrvoje Niksic  <hniksic@srce.hr>
8331
8332         * url.c (get_urls_html): Use alloca() for TEMP.
8333
8334 1998-01-21  Jordan Mendelson  <jordy@wserv.com>
8335
8336         * url.c (rotate_backups): New function.
8337
8338         * http.c (gethttp): Ditto.
8339
8340         * ftp.c (getftp): Rotate backups.
8341
8342 1997-12-18  Hrvoje Niksic  <hniksic@srce.hr>
8343
8344         * all: Renamed nmalloc(), nrealloc() and nstrdup() to xmalloc(),
8345         xrealloc() and xstrdup().  Use the new functions.
8346
8347         * url.c (decode_string): Made static.
8348         (has_proto): Ditto.
8349         (parse_dir): Ditto.
8350         (parse_uname): Ditto.
8351         (mkstruct): Ditto.
8352         (construct): Ditto.
8353         (construct_relative): Ditto.
8354
8355         * retr.c (show_progress): Made static.
8356
8357         * recur.c (robots_url): Made static.
8358         (retrieve_robots): Ditto.
8359         (parse_robots): Ditto.
8360         (robots_match): Ditto.
8361
8362         * main.h: Removed.
8363
8364         * main.c (printhelp): Made static.
8365         (hangup): Ditto.
8366
8367         * init.c (comind): Made static.
8368         (defaults): Ditto.
8369         (init_path): Ditto.
8370         (run_wgetrc): Ditto.
8371         (onoff): Ditto.
8372         (setonoff): Ditto.
8373         (setnum): Ditto.
8374         (myatoi): Ditto.
8375         (getperms): Ditto.
8376         (setbytes): Ditto.
8377
8378         * http.c (fetch_next_header): Made static.
8379         (hparsestatline): Ditto.
8380         (hskip_lws): Ditto.
8381         (hgetlen): Ditto.
8382         (hgetrange): Ditto.
8383         (hgettype): Ditto.
8384         (hgetlocation): Ditto.
8385         (hgetmodified): Ditto.
8386         (haccepts_none): Ditto.
8387         (gethttp): Ditto.
8388         (base64_encode_line): Ditto.
8389         (mktime_from_utc): Ditto.
8390         (http_atotm): Ditto.
8391
8392         * html.c (idmatch): Made static.
8393
8394         * host.c (search_host): Made static.
8395         (search_address): Ditto.
8396         (free_hlist): Ditto.
8397
8398         * ftp.c (getftp): Made static.
8399         (ftp_loop_internal): Ditto.
8400         (ftp_get_listing): Ditto.
8401         (ftp_retrieve_list): Ditto.
8402         (ftp_retrieve_dirs): Ditto.
8403         (ftp_retrieve_glob): Ditto.
8404         (freefileinfo): Ditto.
8405         (delelement): Ditto.
8406
8407         * ftp-ls.c (symperms): Made static.
8408         (ftp_parse_unix_ls): Ditto.
8409
8410         * connect.c (select_fd): Made static.
8411
8412         * utils.c (xmalloc): Renamed from nmalloc.
8413         (xrealloc): Renamed from nrealloc.
8414         (xstrdup): Renamed from nstrdup.
8415
8416         * getopt.c (exchange): Use alloca.
8417
8418         * mswindows.c (mycuserid): Use strncpy.
8419
8420         * New files mswindows.c, mswindows.h, sysdep.h.  winjunk.c,
8421         systhings.h, windecl.h and winjunk.h removed.
8422
8423         * mswindows.c (sleep): New function.
8424
8425         * utils.c: Include <windows.h> under Windows.
8426
8427 1997-06-12  Darko Budor  <dbudor@zesoi.fer.hr>
8428
8429         * url.h (URL_UNSAFE): Change default under Windows.
8430
8431         * retr.c (retrieve_from_file): Respect opt.delete_after.
8432
8433         * main.c (main): Call ws_help on Windows.
8434
8435         * winjunk.c (windows_main_junk): New function.
8436
8437         * main.c (main): Junk-process argv[0].
8438
8439         * http.c (mktime_from_utc): Return -1 if mktime failed.
8440
8441         * http.c (http_loop): Ditto.
8442
8443         * ftp.c (ftp_loop_internal): Change title on Windows when using a
8444         new URL.
8445
8446         * winjunk.c (getdomainname): Lots of functions.
8447
8448 1997-06-12  Hrvoje Niksic  <hniksic@srce.hr>
8449
8450         * cmpt.c (strptime_internal): Handle years more correctly for
8451         `%y'.
8452
8453 1997-06-09  Mike Thomas <mthomas@reality.ctron.com>
8454
8455         * http.c (gethttp): Allocate enough space for
8456         `Proxy-Authorization' header.
8457
8458 1997-05-10  Hrvoje Niksic  <hniksic@srce.hr>
8459
8460         * version.c: Wget/1.4.5 is released.
8461
8462 1997-05-10  Hrvoje Niksic  <hniksic@srce.hr>
8463
8464         * retr.c (get_contents): Check return value of fwrite more
8465         carefully.
8466
8467 1997-03-30  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
8468
8469         * cmpt.c (strptime_internal) [case 'Y']: Always subtract 1900 from
8470         year, regardless of century.
8471
8472 1997-03-30  Hrvoje Niksic  <hniksic@srce.hr>
8473
8474         * utils.c (isfile): Use `lstat' instead of `stat'.
8475
8476 1997-03-29  Hrvoje Niksic  <hniksic@srce.hr>
8477
8478         * utils.c (numdigit): Use explicit test.
8479
8480 1997-03-21  Hrvoje Niksic  <hniksic@srce.hr>
8481
8482         * http.c (http_loop): Always use `url_filename' to get u->local.
8483
8484 1997-03-20  Hrvoje Niksic  <hniksic@srce.hr>
8485
8486         * url.c: Recognize https.
8487
8488 1997-03-13  Hrvoje Niksic  <hniksic@srce.hr>
8489
8490         * recur.c (recursive_retrieve): Lowercase just the host name.
8491
8492 1997-03-09  Hrvoje Niksic  <hniksic@srce.hr>
8493
8494         * url.c (get_urls_file): Use the correct test.
8495         (get_urls_html): Ditto.
8496
8497 1997-03-07  Hrvoje Niksic  <hniksic@srce.hr>
8498
8499         * connect.c: Reverted addrlen to int.
8500
8501         * init.c (parse_line): Check for -1 instead of NONE.
8502
8503         * version.c: Changed version to 1.4.5.
8504
8505 1997-02-17  Hrvoje Niksic  <hniksic@srce.hr>
8506
8507         * init.c: New option netrc.
8508         (initialize): Don't parse .netrc.
8509
8510         * cmpt.c (recursive): Return rp.
8511         (strptime_internal): Match the long strings first, the abbreviated
8512         second.
8513
8514 1997-02-16  Hrvoje Niksic  <hniksic@srce.hr>
8515
8516         * http.c (check_end): New function.
8517         (http_atotm): Use it.
8518  
8519 1997-02-13  gilles Cedoc  <gilles@cedocar.fr>
8520
8521         * http.c (gethttp): Use them.
8522
8523         * init.c: New options proxy_user and proxy_passwd.
8524
8525 1997-02-14  Hrvoje Niksic  <hniksic@srce.hr>
8526
8527         * ftp.c (ftp_retrieve_list): Create links even if not relative.
8528
8529 1997-02-10  Hrvoje Niksic  <hniksic@srce.hr>
8530
8531         * recur.c (recursive_retrieve): Lowercase the host name, if the
8532         URL is not "optimized".
8533
8534         * host.c (realhost): Return l->hostname, even if it matches with
8535         host.
8536
8537 1997-02-10  Marin Purgar  <pmc@asgard.hr>
8538
8539         * connect.c: Make addrlen size_t instead of int.
8540         (conaddr): Ditto.
8541
8542 1997-02-09  Gregor Hoffleit  <flight@mathi.uni-heidelberg.DE>
8543
8544         * systhings.h: Define S_ISLNK on NeXT too.
8545
8546 1997-02-09  Hrvoje Niksic  <hniksic@srce.hr>
8547
8548         * version.c: Released 1.4.3.
8549
8550         * url.c: Futher update to list of protostrings.
8551         (skip_proto): Skip `//' correctly for FTP and HTTP.
8552
8553         * url.c (get_urls_html): Handle bogus `http:' things a little
8554         different.
8555
8556         * main.c (main): Removed `follow-ftp' from `f'.
8557         (main): Dumped the `prefix-files' and `file-prefix' options and
8558         features; old and bogus.
8559         (main): Exit on failed setval() in `-e'.
8560
8561         * http.c (fetch_next_header): Use it to detect header continuation
8562         correctly.
8563
8564         * retr.c (buf_peek): New function.
8565
8566 1997-02-08  Hrvoje Niksic  <hniksic@srce.hr>
8567
8568         * wget.h: Include time.h and stuff.
8569
8570 1997-02-08  Roger Beeman  <beeman@cisco.com>
8571
8572         * ftp.c: Include <time.h>
8573
8574 1997-02-07  Hrvoje Niksic  <hniksic@srce.hr>
8575
8576         * url.c (findurl): Would read over buffer limits.
8577
8578 1997-02-06  Hrvoje Niksic  <hniksic@srce.hr>
8579
8580         * ftp-ls.c (ftp_parse_unix_ls): Allow spaces in file names.
8581
8582 1997-02-05  Hrvoje Niksic  <hniksic@srce.hr>
8583
8584         * http.c (http_atotm): Initialize tm.is_dst.
8585
8586 1997-02-02  Hrvoje Niksic  <hniksic@srce.hr>
8587
8588         * http.c (gethttp): Don't print the number of retrieved headers.
8589
8590         * main.c (main): New option `--no-clobber', alias for `-nc'.
8591
8592         * url.c: Recognize `https://'.
8593
8594 1997-02-01  Hrvoje Niksic  <hniksic@srce.hr>
8595
8596         * host.c (herrmsg): Don't use h_errno.
8597
8598 1997-01-30  Hrvoje Niksic  <hniksic@srce.hr>
8599
8600         * host.c (accept_domain): Use it.
8601
8602         * main.c (main): New option `--exclude-domains'.
8603
8604         * retr.c (retrieve_url): Use it.
8605         (retrieve_url): Bail out when an URL is redirecting to itself.
8606
8607         * url.c (url_equal): New function.
8608
8609 1997-01-29  Hrvoje Niksic  <hniksic@srce.hr>
8610
8611         * connect.c: Include arpa/inet.h instead of arpa/nameser.h.
8612
8613         * http.c (mk_utc_time): New function.
8614         (http_atotm): Use it; handle time zones correctly.
8615
8616 1997-01-28  Hrvoje Niksic  <hniksic@srce.hr>
8617
8618         * http.c: Ditto.
8619
8620         * ftp-basic.c: Use it instead of WRITE.
8621
8622         * connect.c (iwrite): New function.
8623
8624 1997-01-27  Hrvoje Niksic  <hniksic@srce.hr>
8625
8626         * cmpt.c (mktime): New function.
8627
8628         * netrc.c: Include <sys/types.h>.
8629
8630         * main.c (main): Wouldn't recognize --spider.
8631
8632         * retr.c (rate): Use `B', `KB' and `MB'.
8633         (reset_timer,elapsed_time): Moved from utils.c.
8634
8635         * ftp.c (ftp_retrieve_list): Ditto.
8636
8637         * http.c (http_loop): Don't touch the file if opt.dfp.
8638
8639 1997-01-24  Hrvoje Niksic  <hniksic@srce.hr>
8640
8641         * cmpt.c: New file.
8642
8643         * ftp.c (ftp_retrieve_glob): New argument semantics.
8644         (ftp_retrieve_dirs): Use it.
8645         (ftp_loop): Ditto.
8646
8647         * html.c (htmlfindurl): Recognize `'' as the quote char.
8648
8649 1997-01-23  Hrvoje Niksic  <hniksic@srce.hr>
8650
8651         * ftp.c (ftp_loop_internal): Use it.
8652
8653         * utils.c (remove_link): New function.
8654
8655 1997-01-22  Hrvoje Niksic  <hniksic@srce.hr>
8656
8657         * retr.c (retrieve_url): Require STRICT redirection URL.
8658
8659         * url.c (parseurl): New argument STRICT.
8660
8661         * http.c (hparsestatline): Be a little-bit less strict about
8662         status line format.
8663
8664 1997-01-21  Hrvoje Niksic  <hniksic@srce.hr>
8665
8666         * http.c (gethttp): Use it.
8667
8668         * main.c (main): Don't use '<digit>' as options.
8669
8670         * init.c: New option ignore_length.
8671
8672         * http.c (gethttp): Ditto.
8673         (http_loop): Check for redirection without Location:.
8674         (gethttp): Don't print Length unless RETROKF.
8675
8676         * ftp.c (getftp): Use it.
8677
8678         * url.c (mkalldirs): New function.
8679
8680         * utils.c (mymkdir): Don't check for existing non-directory.
8681
8682         * url.c (mkstruct): Don't create the directory.
8683
8684 1997-01-20  Hrvoje Niksic  <hniksic@srce.hr>
8685
8686         * init.c (setval): Removed NO_RECURSION checks.
8687
8688 1997-01-19  Hrvoje Niksic  <hniksic@srce.hr>
8689
8690         * version.c: "Released" 1.4.3-pre2.
8691
8692         * recur.c (recursive_retrieve): Bypass host checking only if URL
8693         is ftp AND parent URL is not ftp.
8694
8695         * ftp-basic.c (ftp_request): Print out Turtle Power.
8696
8697         * ftp.c (ftp_loop): Call ftp_retrieve_glob with 0 if there's no
8698         wildcard.
8699         (ftp_retrieve_glob): Call ftp_loop_internal even on empty list, if
8700         not glob.
8701
8702         * http.c (gethttp): Be a little bit smarter about status codes.
8703
8704         * recur.c (recursive_retrieve): Always reset opt.recursive when
8705         dealing with FTP.
8706
8707 1997-01-18  Hrvoje Niksic  <hniksic@srce.hr>
8708
8709         * retr.c (retrieve_url): New variable location_changed; use it for
8710         tests instead of mynewloc.
8711         (retrieve_url): Allow heuristic adding of html.
8712
8713         * url.c (url_filename): Don't use the `%' in Windows file names.
8714
8715         * http.c (http_loop): Always time-stamp the local file.
8716
8717         * http.c (http_loop): Ditto.
8718
8719         * ftp.c (ftp_retrieve_list): Use it.
8720
8721         * utils.c (my_touch): New function.
8722
8723         * ftp.c (ftp_retrieve_list): Use #ifdef HAVE_STRUCT_UTIMBUF
8724         instead of #ifndef NeXT.
8725
8726         * utils.c (strptime): New version, by Ulrich Drepper.
8727
8728 1997-01-17  Hrvoje Niksic  <hniksic@srce.hr>
8729
8730         * http.c (haccepts_none): Renamed from `haccepts_bytes'.
8731         (gethttp): If haccepts_none(), disable ACCEPTRANGES.
8732         (http_loop): Would remove ACCEPTRANGES.
8733
8734         * ftp.c (getftp): Call ftp_list with NULL.
8735
8736 1997-01-15  Hrvoje Niksic  <hniksic@srce.hr>
8737
8738         * html.c (ftp_index): Don't print minutes and seconds if we don't
8739         know them; beautify the output.
8740
8741         * ftp.c (getftp): Don't close the socket on FTPNSFOD.
8742
8743 1997-01-14  Hrvoje Niksic  <hniksic@srce.hr>
8744
8745         * utils.c (strptime): New function.
8746         (strptime): Don't use get_alt_number.
8747         (strptime): Don't use locale.
8748         (match_string): Made it a function.
8749
8750 1997-01-12  Hrvoje Niksic  <hniksic@srce.hr>
8751
8752         * http.c (http_atotm): New function.
8753         (http_loop): Use it.
8754
8755         * atotm.c: Removed from the distribution.
8756
8757         * http.c (base64_encode_line): Rewrite.
8758
8759 1997-01-09  Hrvoje Niksic  <hniksic@srce.hr>
8760
8761         * ftp.c (getftp): Use ftp_expected_bytes; print size.
8762
8763         * ftp-basic.c (ftp_response): Use ftp_last_respline.
8764         (ftp_expected_bytes): New function.
8765
8766         * ftp.c (getftp): Print the unauthoritative file length.
8767
8768         * ftp-ls.c: Renamed from ftp-unix.c.
8769         (ftp_parse_ls): Moved from ftp.c.
8770         (ftp_parse_unix_ls): Recognize seconds in time spec.
8771         (ftp_parse_unix_ls): Recognize year-less dates of the previous
8772         year.
8773
8774 1997-01-08  Hrvoje Niksic  <hniksic@srce.hr>
8775
8776         * ftp-basic.c: Don't declare errno if #defined.
8777
8778         * host.c (ftp_getaddress): Check for sysinfo legally.
8779
8780 1997-01-08  Darko Budor  <dbudor@diana.zems.fer.hr>
8781
8782         * connect.c (iread): Use READ.
8783
8784 1996-12-23  Hrvoje Niksic  <hniksic@srce.hr>
8785
8786         * url.c: Recognize finger, rlogin, tn3270, mid and cid as valid
8787         schemes.
8788
8789 1996-12-22  Hrvoje Niksic  <hniksic@srce.hr>
8790
8791         * host.c (ftp_getaddress): Allow `.' in hostname.
8792
8793 1996-12-26  Darko Budor <dbudor@zems.fer.hr>
8794
8795         * wget.h: READ and WRITE macros for use instead of read and write
8796         on sockets, grep READ *.c, grep WRITE *.c
8797
8798         * wsstartup.c: new file - startup for winsock
8799
8800         * wsstartup.h: new file
8801
8802         * win32decl.h: new file - fixup for <errno.h> and winsock trouble
8803
8804         * configure.bat: Configure utility for MSVC
8805
8806         * src/Makefile.ms,config.h.ms: new files for use with MSVC 4.x
8807
8808 1996-12-22  Hrvoje Niksic  <hniksic@srce.hr>
8809
8810         * version.c: Released 1.4.3-pre.
8811
8812         * utils.c (prnum): Accept long.
8813         (legible): Use prnum().
8814
8815         * connect.c (make_connection): Accept port as short.
8816         (bindport): Ditto.
8817
8818         * http.c (gethttp): Use search_netrc.
8819
8820 1996-12-21  Hrvoje Niksic  <hniksic@srce.hr>
8821
8822         * ftp.c (getftp): Use search_netrc.
8823
8824         * netrc.c (free_netrc): New function.
8825
8826         * init.c (home_dir): New function.
8827
8828         * url.c (convert_links): Allow REL2ABS changes.
8829
8830 1996-12-21  Gordon Matzigkeit  <gord@gnu.ai.mit.edu>
8831
8832         * netrc.c: New file.
8833         (parse_netrc, maybe_add_to_list): New functions.
8834
8835 1996-12-17  Hrvoje Niksic  <hniksic@srce.hr>
8836
8837         * retr.c (retrieve_url): Reset opt.recursion before calling
8838         ftp_loop if it is reached through newloc.
8839
8840         * init.c (run_wgetrc): Print the wgetrc path too, when reporting
8841         error; don't use "Syntax error", since we don't know if it is
8842         really a syntax error.
8843
8844 1996-12-16  Hrvoje Niksic  <hniksic@srce.hr>
8845
8846         * utils.c (acceptable): Extract the filename part of the path.
8847
8848         * recur.c (recursive_retrieve): Call acceptable() with the right
8849         argument; would bug out on wildcards.
8850
8851         * init.c (parse_line): Likewise.
8852
8853         * html.c (htmlfindurl): Cast to char * when calling stuff.
8854
8855 1996-12-15  Hrvoje Niksic  <hniksic@srce.hr>
8856
8857         * ftp.c (getftp): Use ftp_pasv.
8858
8859         * ftp-basic.c (ftp_request): Accept NULL value.
8860         (ftp_pasv): New function.
8861
8862         * options.h (struct options): Add passive FTP option.
8863
8864 1996-12-15  Hrvoje Niksic  <hniksic@srce.hr>
8865
8866         * url.c (parseurl): Debug output.
8867
8868         * utils.c (path_simplify): New one, adapted from bash's
8869         canonicalize_pathname().
8870
8871 1996-12-14  Hrvoje Niksic  <hniksic@srce.hr>
8872
8873         * ftp.c (getftp): Don't discard the buffer.
8874
8875         * retr.c (get_contents): New parameter nobuf.
8876
8877 1996-12-13  Shawn McHorse  <riffraff@txdirect.net>
8878
8879         * html.c (htmlfindurl): Recognize <meta contents="d; URL=...".
8880
8881         * init.c (setval): Strip the trailing slashes on CVECDIR.
8882
8883 1996-12-13  Hrvoje Niksic  <hniksic@srce.hr>
8884
8885         * init.c: Make excludes and includes under CVECDIR instead of
8886         CVEC.
8887
8888 1996-12-13  Shawn McHorse  <riffraff@txdirect.net>
8889
8890         * url.c (get_urls_html): Skip "http:".
8891
8892 1996-12-13  Hrvoje Niksic  <hniksic@srce.hr>
8893
8894         * utils.c (strcasecmp): From glibc.
8895         (strncasecmp): Also.
8896         (strstr): Also.
8897
8898         * url.c: Added javascript: to the list of URLs prefixes.
8899
8900 1996-12-12  Shawn McHorse  <riffraff@txdirect.net>
8901
8902         * recur.c (retrieve_robots): Print the warning message only if
8903         verbose.
8904
8905 1996-12-12  Gregor Hoffleit  <flight@mathi.uni-heidelberg.DE>
8906
8907         * ftp.c (ftp_retrieve_list): Use NeXT old utime interface.
8908
8909 1996-12-12  Hrvoje Niksic  <hniksic@srce.hr>
8910
8911         * systhings.h: New file.
8912
8913         * ../configure.in: Check for utime.h
8914
8915         * ftp.c: Check whether we have unistd.h.
8916
8917 1996-11-27  Hrvoje Niksic  <hniksic@srce.hr>
8918
8919         * recur.c (recursive_retrieve): Send the canonical URL as referer.
8920         (recursive_retrieve): Call get_urls_html with the canonical URL.
8921
8922 1996-12-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8923
8924         * (configure.in, config.h.in, src/Makefile.in, src/*.[ch]): Add
8925         ansi2knr support for compilers which don't support ANSI style
8926         function prototypes and signatures.
8927
8928         * (aclocal.m4, src/ansi2knr.c, src/ansi2knr.1): New files.
8929
8930 1996-11-26  Hrvoje Niksic  <hniksic@srce.hr>
8931
8932         * url.c: Use it; Recognize paths ending with "." and ".." as
8933         directories.
8934         (url_filename): Append .n whenever file exists and could be a
8935         directory.
8936
8937         * url.h (ISDDOT): New macro.
8938
8939         * init.c (parse_line): Use unsigned char.
8940
8941         * url.c (get_urls_html): Cast to unsigned char * when calling
8942         htmlfindurl.
8943
8944         * html.c (htmlfindurl): Use unsigned char.
8945
8946         * version.c: Changed version to 1.4.3.
8947
8948 1996-11-25  Hrvoje Niksic  <hniksic@srce.hr>
8949
8950         * version.c: Released 1.4.2.
8951
8952         * ftp.c (getftp): Simplified assertion.
8953         (ftp_loop_internal): Remove symlink before downloading.
8954         (ftp_retrieve_list): Unlink the symlink name before attempting to
8955         create a symlink!
8956
8957         * options.h (struct options): Renamed print_server_response to
8958         server_response.
8959
8960         * ftp.c (rel_constr): Removed.
8961         (ftp_retrieve_list): Don't use it.
8962         (ftp_retrieve_list): Use opt.retr_symlinks.
8963
8964 1996-11-24  Hrvoje Niksic  <hniksic@srce.hr>
8965
8966         * main.c (main): New option retr_symlinks.
8967
8968         * url.c (convert_links): Print verbose message.
8969
8970 1996-11-24  Hrvoje Niksic  <hniksic@srce.hr>
8971
8972         * http.c (http_loop): Reset newloc in the beginning of function;
8973         would cause FMR in retrieve_url.
8974
8975 1996-11-23  Hrvoje Niksic  <hniksic@srce.hr>
8976
8977         * recur.c (convert_all_links): Find the URL of each HTML document,
8978         and feed it to get_urls_html; would bug out.
8979         (convert_all_links): Check for l2 instead of dl; removed dl.
8980
8981         * url.c (convert_links): Don't refer to freed newname.
8982
8983         * recur.c (recursive_retrieve): Add this_url to urls_downloaded.
8984
8985         * main.c (main): Print the OS_TYPE in the debug output, too.
8986
8987         * recur.c (recursive_retrieve): Check for opt.delete_after.
8988
8989         * main.c (main): New option delete-after.
8990
8991         * init.c (setval): Cleaned up.
8992
8993 1996-11-21  Hrvoje Niksic  <hniksic@srce.hr>
8994
8995         * Makefile.in (wget): Make `wget' the default target.
8996
8997         * ftp.c (ftp_loop_internal): Move noclobber checking out of the
8998         loop.
8999         (ftp_retrieve_list): Warn about non-matching sizes.
9000
9001         * http.c (http_loop): Made -nc non-dependent on opt.recursive.
9002
9003         * init.c (setnum): Renamed from setnuminf; New argument flags.
9004         (setval): Use it.
9005
9006         * main.c (main): Sorted the options.
9007         (main): New option --wait.
9008
9009 1996-11-21  Shawn McHorse  <riffraff@txdirect.net>
9010
9011         * html.c (htmlfindurl): Reset s->in_quote after getting out of
9012         quotes.
9013
9014 1996-11-20  Hrvoje Niksic  <hniksic@srce.hr>
9015
9016         * version.c: Changed version to 1.4.2.
9017
9018 1996-11-20  Hrvoje Niksic  <hniksic@srce.hr>
9019
9020         * version.c: Released 1.4.1.
9021
9022         * html.c (html_quote_string): New function.
9023         (ftp_index): Use it.
9024         (htmlfindurl): A more gentle ending debug message.
9025
9026         * ftp.c (ftp_loop): Check for opt.htmlify.
9027
9028         * init.c: New command htmlify.
9029
9030         * ftp.c (getftp): Nicer error messages, with `'-encapsulated
9031         strings.
9032         (ftp_loop): Print size of index.html.
9033
9034         * init.c (setval): Implement "styles".
9035
9036         * main.c (main): New option dotstyle.
9037
9038 1996-11-19  Hrvoje Niksic  <hniksic@srce.hr>
9039
9040         * ftp.c (getftp): Close the master socket in case of errors, after
9041         bindport().
9042
9043         * connect.c (bindport): Initialize msock to -1.
9044
9045         * ftp.c (getftp): Initialize dtsock to -1.
9046
9047         * connect.c (closeport): Don't close sock if sock == -1.
9048
9049 1996-11-18  Hrvoje Niksic  <hniksic@srce.hr>
9050
9051         * init.c (setnuminf): Nuked default value -- just leave unchanged.
9052         (setval): Don't send default values.
9053         (defaults): Use DEFAULT_TIMEOUT -- aaargh.
9054
9055         * options.h (struct options): Use long for dot_bytes.
9056
9057         * init.c (setquota): Renamed to setbytes.
9058         (setval): Use setbytes on DOTBYTES.
9059
9060 1996-11-17  Hrvoje Niksic  <hniksic@srce.hr>
9061
9062         * ftp.c (getftp): Initialize con->dltime.
9063
9064         * recur.c (recursive_retrieve): Use same_host instead of
9065         try_robots; simply load robots_txt whenever the host is changed.
9066         (recursive_retrieve): Free forbidden before calling parse_robots.
9067
9068 1996-11-16  Hrvoje Niksic  <hniksic@srce.hr>
9069
9070         * retr.c (show_progress): Use them.
9071
9072         * options.h (struct options): New options dot_bytes, dots_on_line
9073         and dot_spacing.
9074
9075 1996-11-16  Mark Boyns  <boyns@sdsu.edu>
9076
9077         * recur.c (recursive_retrieve): Retrieve directories regardless of
9078         acc/rej rules; check for empty u->file.
9079
9080 1996-11-14  Hrvoje Niksic  <hniksic@srce.hr>
9081
9082         * init.c (setval): Use it.
9083
9084         * utils.c (merge_vecs): New function.
9085
9086         * init.c (setval): Reset the list-type functions when encountering
9087         "".
9088
9089 1996-11-14  Shawn McHorse  <riffraff@txdirect.net>
9090
9091         * recur.c (recursive_retrieve): Use base_url instead of this_url
9092         for no_parent.
9093
9094 1996-11-14  Shawn McHorse  <riffraff@txdirect.net>
9095
9096         * html.c (htmlfindurl): Reset s->in_quote after exiting the quote.
9097
9098 1996-11-13  Hrvoje Niksic  <hniksic@srce.hr>
9099
9100         * utils.c (sepstring): Rewrote; don't use strtok.
9101
9102         * recur.c (recursive_retrieve): Enter assorted this_url to slist
9103         when running the first time.
9104         (retrieve_robots): Warn to ignore errors when robots are loaded.
9105
9106         * utils.c (load_file): Moved from url.c.
9107
9108         * http.c: Made static variables const too in h* functions.
9109
9110         * main.c (main): Renamed --continue-ftp to --continue.
9111
9112         * recur.c (recursive_retrieve): Use it.
9113
9114         * utils.c (frontcmp): New function.
9115
9116         * url.c (accdir): New function.
9117
9118         * html.c (htmlfindurl): Recognize <area href=...>.
9119
9120         * ftp.c (ftp_retrieve_dirs): Implemented opt.includes.
9121
9122         * init.c (setval): Free the existing opt.excludes and
9123         opt.includes, if available.
9124
9125         * main.c (main): New option -I.
9126
9127 1996-11-12  Hrvoje Niksic  <hniksic@srce.hr>
9128
9129         * ftp.c (ftp_retrieve_glob): Do not weed out directories.
9130
9131         * version.c: Changed version to 1.4.1.
9132
9133 1996-11-11  Hrvoje Niksic  <hniksic@srce.hr>
9134
9135         * version.c: Released 1.4.0.
9136
9137 1996-11-10  Hrvoje Niksic  <hniksic@srce.hr>
9138
9139         * main.c (main): Free com and val after parse_line.
9140         (printhelp): Reorder the listing.
9141
9142         * http.c: More robust header parsing.
9143
9144         * http.c: Allow any number of spaces, or no spaces, precede ':'.
9145         (hskip_lws): New function.
9146         (haccepts_bytes): New function.
9147         (gethttp): Use it.
9148
9149         * init.c (setval): Check header sanity.
9150         (setval): Allow resetting of headers.
9151
9152 1996-11-10  Hrvoje Niksic  <hniksic@srce.hr>
9153
9154         * http.c (http_loop): Don't use has_wildcards.
9155
9156         * http.c (gethttp): Free all_headers -- would leak.
9157
9158         * recur.c (recursive_retrieve): Initialize depth to 1 instead of
9159         0 -- this fixes a long-standing bug in -rl.
9160
9161 1996-11-09  Hrvoje Niksic  <hniksic@srce.hr>
9162
9163         * ftp.c: Use -1 as "impossible" value for con->fd.
9164
9165         * url.h (URL_SEPARATOR): Don't treat `*' and `+' as separators.
9166
9167         * init.c (parse_line): Use isalpha.
9168
9169         * ftp-unix.c: Use HAVE_UNISTD_H.
9170
9171         * mtch.c (has_wildcards): Don't match \.
9172
9173         * http.c (http_loop): Warn on HTTP wildcard usage.
9174
9175 1996-11-08  Hrvoje Niksic  <hniksic@srce.hr>
9176
9177         * url.c (url_filename): Do not create numbered suffixes if
9178         opt.noclobber -- would bug out on -nc.
9179
9180 1996-11-07  Hrvoje Niksic  <hniksic@srce.hr>
9181
9182         * recur.c (parse_robots): Don't chuck out the commands without
9183         arguments (`Disallow:<empty>' didn't work).
9184         (parse_robots): Compare versions lowercase.
9185         (parse_robots): Match on base_version, not version_string!
9186         (parse_robots): Handle comments properly.
9187         (parse_robots): Match versions in a sane way.
9188
9189         * init.c: Print nicer error messages.
9190
9191         * version.c: Changed version to 1.4.0.
9192
9193 1996-11-06  Hrvoje Niksic  <hniksic@srce.hr>
9194
9195         * version.c: Released 1.4.0-test2.
9196
9197         * init.c (run_wgetrc): Close fp.
9198
9199         * ftp.c (ftp_retrieve_dirs): Allocate the correct length for
9200         u->dir.
9201
9202 1996-11-06  Hrvoje Niksic  <hniksic@srce.hr>
9203
9204         * init.c (setquota): Allow inf as quota specification.
9205
9206 1996-11-05  Hrvoje Niksic  <hniksic@srce.hr>
9207
9208         * ftp.c (ftp_retrieve_dirs): Return QUOTEXC if quota exceeded.
9209         (ftp_retrieve_glob): Return QUOTEXC on quota exceeded.
9210
9211         * main.c (main): Check for quota by comparison with downloaded
9212         stuff, not from status.
9213
9214         * connect.c (select_fd): Should compile on HPUX without warnings now.
9215
9216         * ftp.c (ftp_get_listing): Check whether ftp_loop_internal
9217         returned RETROK.
9218
9219 1996-11-04  Hrvoje Niksic  <hniksic@srce.hr>
9220
9221         * ftp.c (ftp_retrieve_glob): Print the pattern nicely.
9222         (getftp): Return FTPRETRINT on control connection error.
9223
9224         * html.c (htmlfindurl): Recognize <embed src=...> and
9225         <bgsound src=...>.
9226         (ftp_index): Handle username and password correctly.
9227
9228         * main.c (main): Made `-np' a synonim for --no-parent.
9229
9230 1996-11-02  Hrvoje Niksic  <hniksic@srce.hr>
9231
9232         * ftp.c (ftp_loop): Check for opt.ftp_glob too before calling
9233         ftp_retrieve_glob.
9234
9235         * version.c: Changed version to 1.4.0-test2.
9236
9237 1996-11-02  Hrvoje Niksic  <hniksic@srce.hr>
9238
9239         * version.c: Released 1.4.0-test1.
9240
9241         * url.c (str_url): Don't use sprintf when creating %2F-prefixed
9242         directory.
9243         (convert_links): Removed definition of make_backup.
9244
9245         * http.h: Removed definition of MAX_ERROR_LENGTH.
9246
9247         * host.c (ftp_getaddress): Check for "(none)" domains.
9248
9249         * ftp.c (ftp_retrieve_dirs): Docfix.
9250
9251         * http.c (gethttp): Use ou->referer instead of u->referer.
9252
9253         * retr.c (retrieve_url): Reset u to avoid freeing pointers twice;
9254         this was known to cause coredumps on Linux.
9255
9256         * html.c (ftp_index): Cast the argument to local_time to time_t *.
9257
9258 1996-11-01  Hrvoje Niksic  <hniksic@srce.hr>
9259
9260         * connect.c (select_fd): Use exceptfds -- once and for all.
9261
9262         * retr.c (retrieve_from_file): Free filename after
9263         recursive_retrieve.
9264         (retrieve_from_file): Send RFIRST_TIME to recursive_retrieve on
9265         first-time retrieval.
9266         (retrieve_from_file): Return uerr_t; new argument, count.
9267         (retrieve_from_file): Break on QUOTEXC.
9268
9269         * init.c (setquota): Fixed a bug that caused rejection of
9270         non-postfixed values..
9271
9272 1996-10-30  Hrvoje Niksic  <hniksic@srce.hr>
9273
9274         * version.c: Changed name to wget.
9275
9276         * connect.c (iread): Smarter use of select.
9277         (select_fd): Set errno on timeout.  If not timeout, return 1
9278         instead of 0.
9279
9280 1996-10-29  Hrvoje Niksic  <hniksic@srce.hr>
9281
9282         * ftp.c (ftp_loop_internal): Don't use con->cmd before
9283         establishing it.
9284
9285 1996-10-26  Hrvoje Niksic  <hniksic@srce.hr>
9286
9287         * http.c (gethttp): Send correct referer when using proxy.
9288         (gethttp): Use struct urlinfo ou to access the relevant data; send
9289         correct authorization in all cases.
9290
9291         * host.c (same_host): Use skip_uname to skip username and
9292         password.
9293
9294         * url.c (skip_uname): New function.
9295         (parseurl): Use it.
9296
9297         * host.c (same_host): Do not assume HTTP -- same_host should now
9298         be totally foolproof.
9299
9300         * url.c (skip_proto): New function.
9301         (parse_uname): Use it.
9302
9303         * http.c (gethttp): Create local user and passwd from what is
9304         given.
9305
9306         * url.c (parseurl): Check for HTTP username and password too.
9307
9308 1996-10-25  Hrvoje Niksic  <hniksic@srce.hr>
9309
9310         * config.h.in: Removed #define gethostbyname R...
9311
9312 1996-10-22  Hrvoje Niksic  <hniksic@srce.hr>
9313
9314         * version.c: Changed version to 1.4.0-test1.
9315
9316 1996-10-21  Hrvoje Niksic  <hniksic@srce.hr>
9317
9318         * version.c: "Released" 1.4b29.
9319
9320         * recur.c (recursive_retrieve): Check for no_parent.
9321
9322         * init.c (setval): Option update.
9323
9324         * main.c (main): New option no-parent.
9325
9326         * options.h (struct options): New variable no_parent.
9327
9328         * recur.c (recursive_retrieve): Only files are checked for
9329         opt.accepts and opt.rejects.
9330         (recursive_retrieve): Check directories for opt.excludes.
9331         (recursive_retrieve): Make the dir absolute when checking
9332         opt.excludes.
9333
9334         * html.c (htmlfindurl): Recognize <applet code=...> and <script
9335         src=...>
9336
9337 1996-10-18  Hrvoje Niksic  <hniksic@srce.hr>
9338
9339         * ftp.c (getftp): Do not line-break assert entries at all.
9340         (ftp_retrieve_dirs): docfix.
9341
9342         * connect.c (select_fd): Use fd + 1 as nfds.
9343
9344         * version.c: Changed version to 1.4b29.
9345
9346 1996-10-18  Hrvoje Niksic  <hniksic@srce.hr>
9347
9348         * version.c: "Released" 1.4b28.
9349
9350         * ftp.c (ftp_loop_internal): Check whether f->size == len and
9351         don't continue the loop if it is.
9352         (ftp_get_listing): Remove list_filename on unsuccesful loop.
9353
9354 1996-10-17  Hrvoje Niksic  <hniksic@srce.hr>
9355
9356         * ftp.c (ftp_loop_internal): Use strcpy to initialize tmp.
9357         (getftp): Do not use multiline assert.
9358
9359         * http.c (hparsestatline): Use mjr and mnr instead of major and
9360         minor, which don't compile on Ultrix.
9361         (http_loop): Use strcpy() to initialize tmp.
9362
9363         * all: Geturl -> Fetch
9364
9365 1996-10-17  Hrvoje Niksic  <hniksic@srce.hr>
9366
9367         * recur.c (parse_robots): Fixed an off-by-one bug when looking for
9368         ':'.
9369
9370         * html.c (htmlfindurl): Fixed several possible off-by-one bugs by
9371         moving `bufsize &&' to the beginning of each check in for-loops.
9372
9373         * recur.c (parse_robots): Close fp on exit.
9374
9375         * url.c (mymkdir): Check for each directory before creating.
9376
9377 1996-10-16  Hrvoje Niksic  <hniksic@srce.hr>
9378
9379         * version.c: Changed version to 1.4b28.
9380
9381 1996-10-16  Hrvoje Niksic  <hniksic@srce.hr>
9382
9383         * version.c: "Released" 1.4b27.
9384
9385         * init.c (parse_line): Use isspace.
9386         (parse_line): Free *com on all errors.
9387
9388         * ftp.c (ftp_loop): Change FTPOK to RETROK before exiting.
9389         (delelement): Use next instead of f->next and prev instead of
9390         f->prev.
9391         (delelement): Free the members of the deleted element.
9392
9393         * http.c (http_loop): Do not return RETROK on code != 20x.
9394
9395         * init.c (cleanup): Free opt.user_header.
9396         (cleanup): Free opt.domains.
9397
9398         * url.c (freelists): Moved to cleanup().
9399
9400         * http.c (hparsestatline): Docfix.
9401
9402         * main.c (main): Return with error status on unsuccesful
9403         retrieval.
9404
9405         * init.c (setval): Do not remove listing when mirroring.
9406
9407         * url.c (url_filename): Use opt.fileprefix.
9408
9409         * ftp.c (ftp_get_listing): Use url_filename to get filename for
9410         .listing.
9411
9412         * main.c (main): New option: -rn.
9413
9414 1996-10-15  Hrvoje Niksic  <hniksic@srce.hr>
9415
9416         * Makefile.in (RM): Added RM = rm -f.
9417
9418         * host.c (clean_hosts): New function.
9419         (free_hlist): Just free the list, no reset.
9420
9421         * version.c: Changed version to 1.4b27.
9422
9423 1996-10-13  Hrvoje Niksic  <hniksic@srce.hr>
9424
9425         * version.c: "Released" 1.4b26.
9426
9427         * retr.c (retrieve_from_file): If call get_urls_html with
9428         opt.spider to make it silent in spider mode.
9429
9430         * url.c (str_url): Use CLEANDUP instead of URL_CLEANSE.
9431
9432         * url.h (CLEANDUP): New macro.
9433
9434         * http.c (gethttp): Fixed a bug that freed location only when it
9435         was NULL.
9436
9437         * retr.c (retrieve_url): Free url if it will not be stored,
9438         i.e. newloc is NULL.
9439
9440         * html.c (htmlfindurl): Handle exiting from quotes correctly; the
9441         old version would bug out on <a href="x#a"href="y">.
9442
9443         * html.h (state_t): New member in_quote.
9444
9445         * html.c (htmlfindurl): Free s->attr at the beginning of
9446         attr-loop.
9447
9448         * recur.c (recursive_retrieve): Recognize RCLEANUP.
9449         (tried_robots): Make hosts a global variable.
9450         (recursive_retrieve): Free constr after URL host optimization.
9451         (tried_robots): Free urlinfo before exiting.
9452
9453         * utils.c (free_slist): New function.
9454
9455         * recur.c (recursive_retrieve): Use flags to add cleanup
9456         possibility.
9457
9458         * main.c (main): Free filename after recursive_retrieve.
9459
9460         * http.c (gethttp): Store successful responses too.
9461
9462 1996-10-12  Hrvoje Niksic  <hniksic@srce.hr>
9463
9464         * all: Constified the whole source.  This required some minor
9465         changes in many functions in url.c, possibly introducing bugs -- I
9466         hope not.
9467
9468         * ftp-basic.c: Removed last_respline.
9469
9470         * http.c (gethttp): Free type.
9471
9472         * host.c (same_host): Free real1 and real2.
9473
9474         * main.c (main): New option --spider.
9475
9476         * retr.c (get_contents): Don't reset errno.
9477
9478         * main.c (main): Sorted the options.
9479
9480         * connect.c (iread): Set errno to ETIMEDOUT only if it was left
9481         uninitialized by select().
9482
9483         * http.c (http_loop): Print the time when the connection is
9484         closed.
9485         (gethttp): Debug-print the HTTP request.
9486
9487 1996-10-11  Hrvoje Niksic  <hniksic@srce.hr>
9488
9489         * connect.c (iread): Do not try reading after timeout.
9490
9491         * main.c (main): Would bug out on -T.
9492
9493         * connect.c (select_fd): Do not use exceptfds.
9494         (iread): Set ETIMEDOUT on select_fd <= 0.
9495
9496         * version.c: Changed version to 1.4b26.
9497
9498 1996-10-10  Hrvoje Niksic  <hniksic@srce.hr>
9499
9500         * version.c: "Released" 1.4b25.
9501
9502         * ftp-unix.c (ftp_parse_unix_ls): Ignore lines without file name
9503         or link name.
9504
9505         * http.c (gethttp): Add errcode to struct hstat.
9506         (http_loop): Use it.
9507
9508         * url.c (no_proxy_match): Simplify using char** for no_proxy.
9509
9510         * options.h (struct options): Make opt.no_proxy a vector.
9511
9512         * utils.c (sepstring): Use !*s instead of !strlen(s).
9513
9514         * init.c (setval): Set opt.maxreclevel to 0 on --mirror.
9515         (getperms): Use ISODIGIT instead of isdigit.
9516
9517         * ftp.c (getftp): Print time.
9518
9519         * main.c (main): Use legible output of downloaded quantity.
9520
9521         * ftp.c (getftp): Use elapsed_time().
9522         (ftp_loop_internal): Use rate().
9523
9524         * http.c (http_loop): Add download ratio output; Use rate().
9525
9526         * utils.c (rate): New function.
9527
9528 1996-10-09  Hrvoje Niksic  <hniksic@srce.hr>
9529
9530         * http.c (http_loop): Use timer.
9531
9532         * ftp.c: Split to ftp-basic.c and ftp.c
9533
9534         * utils.c (reset_timer): New function.
9535         (elapsed_time): New function.
9536
9537         * retr.c (show_progress): Make bytes_in_line and offs long; should
9538         work on 16-bit machines.
9539
9540 1996-10-08  Hrvoje Niksic  <hniksic@srce.hr>
9541
9542         * url.c (in_acclist): New argument backward.
9543
9544         * ftp.c (ftp_retrieve_glob): Use acceptable() to determine whether
9545         a file should be retrieved according to suffix.
9546         (ftp_get_listing): Check the return value of unlink; Do not call
9547         ftp_retrieve_dirs if depth reached maxreclevel.
9548         (ftp_retrieve_dirs): Check whether the directory is in
9549         exclude-list.
9550
9551         * main.c (main): Print the version number at the beginning of
9552         DEBUG output.
9553         (main): Use strrchr when creating exec_name.
9554
9555         * ftp.c (ftp_retrieve_glob): Do not close control connection.
9556
9557         * version.c: Changed version to 1.4b25.
9558
9559 1996-10-07  Hrvoje Niksic  <hniksic@srce.hr>
9560
9561         * version.c: "Released" 1.4b24.
9562
9563         * Makefile.in: Rewrite.
9564
9565         * ftp.c (ftp_loop_internal): Likewise.
9566
9567         * retr.c (time_str): Check for failed time().
9568
9569         * html.c (htmlfindurl): Recognize <fig src> and <overlay src> from
9570         HTML3.0.
9571
9572         * retr.c (time_str): Return time_t *.
9573
9574         * connect.c (bindport): Close msock on unsuccesful bind.
9575         (bindport): The same for getsockname and listen.
9576
9577         * retr.c (retrieve_url): Allow any number of retries on
9578         proxy.
9579
9580         * http.c (gethttp): Do not treat errno == 0 as timeout.
9581         (http_loop): Likewise.
9582         (http_loop): Cosmetic changes.
9583
9584         * connect.c (iread): Set errno to ETIMEDOUT in case of timeout.
9585
9586         * retr.c (get_contents): Reset errno.
9587
9588         * ftp.c (getftp): Minor fixes.
9589
9590 1996-10-06  Hrvoje Niksic  <hniksic@srce.hr>
9591
9592         * http.c: Do not use backups.
9593
9594         * geturl.1 (WARNING): Warn that man-page could be obsolete.
9595
9596         * getopt.c (getopt_long): Moved to getopt.c
9597
9598         * geturl.texi: Enhanced.
9599
9600         * main.c (main): Use it.
9601
9602         * recur.c (convert_all_links): New function.
9603
9604         * utils.c (add_slist): New argument flags.
9605
9606         * recur.c (recursive_retrieve): Update a list of downloaded URLs.
9607         (parse_robots): Do not chuck out empty value fields.
9608         (parse_robots): Make yourself welcome on empty Disallow.
9609
9610         * version.c: Changed version to 1.4b24.
9611
9612 1996-10-06  Hrvoje Niksic  <hniksic@srce.hr>
9613
9614         * version.c: "Released" 1.4b23.
9615
9616         * ftp.c (ftp_loop_internal): Get the time after getftp.
9617
9618         * Makefile.in (install.info): New target.
9619         (install): Use it.
9620
9621         * http.c (http_loop): Fix output when doing -O.
9622
9623 1996-10-05  Hrvoje Niksic  <hniksic@srce.hr>
9624
9625         * geturl.texi: New file.
9626
9627         * main.c (main): Do not print the warnings and download summary if
9628         opt.quiet is set.
9629
9630         * version.c: Changed version to 1.4b23.
9631
9632 1996-10-05  Hrvoje Niksic  <hniksic@srce.hr>
9633
9634         * "Released" 1.4b22.
9635
9636         * atotm.c (atotm): Use True and False instead of TRUE and FALSE,
9637         to avoid redefinition warnings.
9638
9639         * host.c (store_hostaddress): Use memcpy() to copy the address
9640         returned by inet_addr.
9641
9642         * version.c: Changed version to 1.4b22.
9643
9644 1996-10-04  Hrvoje Niksic  <hniksic@srce.hr>
9645
9646         * version.c: "Released" 1.4b21.
9647
9648         * ftp-unix.c (ftp_parse_ls): Renamed to ftp_parse_unix_ls.
9649
9650         * ftp.c (ftp_port): Use conaddr.
9651         (getftp): Print the file length.
9652         (ftp_retrieve_list): Check the stamps of plain files only.
9653
9654         * connect.c (closeport): Do not call shutdown().
9655         (conaddr): New function.
9656
9657         * html.c (ftp_index): Made it dfp-aware.
9658
9659         * init.c (cleanup): New name of freemem. Close opt.dfp.
9660
9661         * ftp.c (getftp): Use opt.dfp if it is set.
9662
9663         * ftp-unix.c (ftp_parse_ls): Recognize time in h:mm format.
9664
9665         * ftp.c (ftp_retrieve_dirs): Fixed a bug that caused incorrect
9666         CWDs to be sent with recursive FTP retrievals.
9667
9668 1996-10-03  Hrvoje Niksic  <hniksic@srce.hr>
9669
9670         * recur.c (parse_robots): Made it more compliant with "official"
9671         specifications.
9672
9673         * http.c: New function.
9674
9675         * ftp-unix.c (ftp_parse_ls): Added better debug output.
9676
9677         * ftp.c (getftp): Print out the LIST in case of
9678         opt.print_server_response.
9679
9680         * version.c: Changed version to 1.4b21.
9681
9682 1996-10-01  Hrvoje Niksic  <hniksic@srce.hr>
9683
9684         * version.c: "Released" 1.4b20.
9685
9686         * README: Update.
9687
9688         * http.c (gethttp): Preset lengths of various headers instead of
9689         calculating them dynamically.
9690         (gethttp): Check for 206 partial contents.
9691
9692 1996-09-30  Hrvoje Niksic  <hniksic@srce.hr>
9693
9694         * configure.in: Set SYSTEM_GETURLRC to $libdir/geturlrc
9695
9696         * http.c (gethttp): Send the port number in the Host: header.
9697
9698 1996-09-29  Hrvoje Niksic  <hniksic@srce.hr>
9699
9700         * http.c (gethttp): Send host: header.
9701         (gethttp): Add the possibility of user-defined headers.
9702         (gethttp): Move decision about pragma: no-cache to http_loop,
9703         where it belongs.
9704         (gethttp): Pass a struct instead of enormous argument list.
9705         (http_loop): Use a new, fancier display format.
9706         (ftp_loop): Likewise.
9707
9708         * main.c: (hangup): Turn off buffering of the new log file.
9709
9710         * install-sh: Likewise.
9711
9712         * config.sub: Replace with the one in autoconf-2.10
9713
9714         * geturl.1: Update.
9715
9716         * init.c: New options httpuser and httppasswd.
9717
9718         * http.c: (base64_encode_line): New function.
9719         (gethttp): Send authentication.
9720
9721         * connect.c (make_connection): Use store_hostaddress.
9722
9723 1996-09-28  Hrvoje Niksic  <hniksic@srce.hr>
9724
9725         * host.c (store_hostaddress): New function.
9726
9727         * NEWS: Update.
9728
9729         * http.c (hgetrange): New function.
9730         (gethttp): Use ranges.
9731
9732         * utils.c (numdigit): Accept long instead of int.
9733
9734         * http.c (http_loop): Add restart capabilities.
9735
9736         * ftp.c (ftp_retrieve_glob): Fixed a bug that could cause matchres
9737         being used uninitialized.
9738         (ftp_retrieve_list): Similar fix.
9739
9740         * host.c (add_hlist): Fixed a bug that could cause cmp being used
9741         uninitialized.
9742
9743         * url.c (construct_relative): New function.
9744
9745         * recur.c (recursive_retrieve): Use it.
9746
9747         * retr.c (convert_links): New function.
9748
9749 1996-09-27  Hrvoje Niksic  <hniksic@srce.hr>
9750
9751         * url.c (free_urlpos): New function.
9752
9753         * recur.c (recursive_retrieve): Adapt.
9754
9755         * url.c (get_urls_html): Return a linked list instead of a vector.
9756
9757         * url.c (get_urls_file): Return a linked list instead of a vector.
9758
9759         * geturl.1: Update.
9760
9761         * http.c (gethttp): Implement it.
9762
9763         * init.c (setval): New option: SAVEHEADERS
9764
9765         * ftp.c (ftp_loop_internal): Do not set restval if listing is to
9766         be retrieved. Lack of this test caused bugs when the connection
9767         was lost during listing.
9768
9769         * retr.c (retrieve_url): Fixed a bug that caused
9770         coredumps. *newloc is now reset by default.
9771         (retrieve_url): Lift the twenty-tries limit on proxies.
9772
9773         * version.c: Changed version to 1.4b20.
9774
9775 1996-09-20  Hrvoje Niksic  <hniksic@srce.hr>
9776
9777         * version.c: "Released" 1.4b19.
9778
9779 1996-09-19  Hrvoje Niksic  <hniksic@srce.hr>
9780
9781         * ftp.c (ftp_loop_internal): Renamed from ftp_1fl_loop.
9782         (getftp): Changed prototype to accept ccon *.
9783
9784 1996-09-17  Hrvoje Niksic  <hniksic@srce.hr>
9785
9786         * ftp.c (ftp_retrieve_list): Fixed a bug that caused setting
9787         incorrect values to files pointed to by symbolic links.
9788         (ftp_1fl_loop): Do not count listings among the downloaded URL-s.
9789
9790 1996-09-16  Hrvoje Niksic  <hniksic@srce.hr>
9791
9792         * url.c (mkstruct): Do not prepend "./" in front of a pathname.
9793
9794         * main.c (main): New option: --user-agent.
9795
9796         * geturl.1: Ditto.
9797
9798         * init.h: Ditto.
9799
9800         * init.c (setval): Ditto.
9801
9802         * main.c (main): Rename "server-headers" to "server-response".
9803
9804         * ftp-unix.c (ftp_parse_ls): Check for asterisks at the end of
9805         executables in 'ls -F' listings.
9806
9807 1996-09-15  Hrvoje Niksic  <hniksic@srce.hr>
9808
9809         * url.c (parseurl): Remove realloc() and sprintf().
9810         (str_url): Get rid of sprintf().
9811
9812         * recur.c (recursive_retrieve): Enable FTP recursion through proxy
9813         servers.
9814
9815         * url.h (URL_CLEANSE): Made it else-resistant.
9816         (USE_PROXY): New macro.
9817
9818 1996-09-14  Hrvoje Niksic  <hniksic@srce.hr>
9819
9820         * NEWS: Update.
9821
9822         * version.c: Changed version to 1.4b19.
9823
9824 1996-09-14  Hrvoje Niksic  <hniksic@srce.hr>
9825
9826         * version.c: "Released" 1.4b18.
9827
9828         * url.c: Made it reallocate space exponentially.
9829
9830 1996-09-14  Drazen Kacar  <dave@fly.cc.fer.hr>
9831
9832         * html.c (htmlfindurl): Added <frame src> and <iframe src> among
9833         the list of stuff to fetch.
9834
9835 1996-09-13  Hrvoje Niksic  <hniksic@srce.hr>
9836
9837         * url.c (get_urls_html): Fixed a bug that caused SIGSEGV's with
9838         -Fi.
9839
9840         * html.c (htmlfindurl): Rewrite.
9841
9842         * http.c (gethttp): Use opt.proxy_cache.
9843
9844         * main.c (main): Added --cache option.
9845
9846         * ftp.c (ftp_response): Print server response if opt.print_server
9847         response is set.
9848         (getftp): Print newlines after each request if the server response
9849         is to be printed.
9850         (ftp_response): Copy the last response line to last_respline.
9851
9852         * http.c (gethttp): Add Pragma: nocache for retried
9853         proxy-retrievals.
9854
9855         * ftp.c (getftp): Use it.
9856
9857         * retr.c (buf_discard): New function.
9858
9859         * ftp.c (ftp_response): Use buf_readchar().
9860         (getftp): Flush the control connection buffer before calling
9861         get_contents().
9862
9863         * retr.c (buf_readchar): New function.
9864         (buf_flush): New function.
9865         (get_contents): Use buf_readchar() instead of read(x, x, 1).
9866         (get_contents): Use buf_flush.
9867
9868 1996-09-12  Hrvoje Niksic  <hniksic@srce.hr>
9869
9870         * ftp.c: Incorporate changes to ftp_response.
9871
9872         * ftp.c (ftp_response): Allocate the server response dynamically,
9873         as in read_whole_line and fetch_next_header.
9874
9875         * utils.c (read_whole_line): Fixed a bug that prevented reading
9876         the last line if it is not \n-terminated. Also fixed a possible
9877         memory overflow.
9878
9879         * http.c (fetch_next_header): Return malloc-ed string as large as
9880         needed.
9881         (gethttp): Use new fetch_next_header.
9882
9883 1996-09-12  Hrvoje Niksic  <hniksic@srce.hr>
9884
9885         * http.c (hgetlen): Compute the header length the first time only.
9886         (hgettype): Ditto.
9887         (hgetlocation): Ditto.
9888         (hgetmodified): Ditto.
9889
9890 1996-09-11  Hrvoje Niksic  <hniksic@srce.hr>
9891
9892         * sample.geturlrc: Update.
9893
9894 1996-09-10  Hrvoje Niksic  <hniksic@srce.hr>
9895
9896         * http.c (http_loop): Ditto.
9897
9898         * ftp.c (getftp): Open the output file as binary.
9899
9900         * version.c: Changed version to 1.4b18.
9901
9902 1996-09-10  Hrvoje Niksic  <hniksic@srce.hr>
9903
9904         * version.c: "Released" 1.4b17.
9905
9906         * ftp-unix.c (ftp_parse_ls): If unable to open file, return NULL
9907         instead of failed assertion.
9908
9909 1996-09-09  Hrvoje Niksic  <hniksic@srce.hr>
9910
9911         * ftp.c (ftp_get_listing): Add a numbered suffix to LIST_FILENAME
9912         if a file of that name already exists.
9913
9914 1996-09-05  Hrvoje Niksic  <hniksic@srce.hr>
9915
9916         * ftp.c (ftp_1fl_loop): Handler FTPPORTERR and FOPENERR correctly.
9917
9918         * config.h.in: Define gethostbyname as Rgethostbyname when using
9919         Socks.
9920
9921         * configure.in: Check for -lresolv if using Socks.
9922
9923         * version.c: Changed version to 1.4b17.
9924
9925 1996-07-15  Hrvoje Niksic  <hniksic@srce.hr>
9926
9927         * version.c: "Released" 1.4b16.
9928
9929         * http.c (gethttp): More intelligent check for first line of HTTP
9930         response.
9931         (gethttp): Would bug out on time-stamping.
9932
9933         * version.c: Changed version to 1.4b16.
9934
9935 1996-07-11  Hrvoje Niksic  <hniksic@srce.hr>
9936
9937         * version.c: Released 1.4b15.
9938
9939         * http.c (http_loop): Print \n after the loop entry, not before.
9940
9941         * url.c (url_filename): Use ISDOT.
9942
9943         * url.h (ISDOT): New macro.
9944
9945         * recur.c (recursive_retrieve): Change only opt.recursive for
9946         following FTP.
9947
9948 1996-07-11  Antonio Rosella <antonio.rosella@agip.it>
9949
9950         * socks/geturl.cgi: Fixed version No.
9951
9952         * socks/download-netscape.html: Ditto.
9953
9954         * socks/download.html: Changed socks.html to download.html.
9955
9956 1996-07-11  Hrvoje Niksic  <hniksic@srce.hr>
9957
9958         * url.c (url_filename): Check for opt.dirstruct instead for
9959         opt.recursive && opt.dirstruct.
9960
9961         * init.c (defaults): Ditto.
9962         (defaults): Reset dirstruct by default.
9963         (setval): Set opt.dirstruct whenever setting recursive.
9964
9965         * init.h: Removed FORCEDIRHIER.
9966
9967         * INSTALL: Added -L to socks-description.
9968
9969         * version.c: Changed version to 1.4b15.
9970
9971 1996-07-10  Hrvoje Niksic  <hniksic@srce.hr>
9972
9973         * version.c: "Released" 1.4b14.
9974
9975         * geturl.1: Update AUTHOR to include Rosella as contributor.
9976
9977         * NEWS: Update.
9978
9979         * socks/geturl.cgi: Simplified command creation, nuked <blink>.
9980
9981         * socks/geturl.cgi: Wrap nutscape extensions within if $netscape.
9982         (cal_time): Fix == to eq.
9983
9984         * socks/geturl.cgi: GPL-ized with permission of A. Rosella.
9985
9986         * geturl.1 (hostname): Moved URL CONVENTIONS to the beginning.
9987
9988         * Makefile.in: Use @VERSION@.
9989
9990         * configure.in: Check version from version.c.
9991
9992         * socks/geturl.cgi: Changed /pub/bin/perl to /usr/bin/perl.
9993
9994         * socks/download.html: Created from download-netscape.html, made
9995         HTML-2.0 compliant.
9996
9997         * recur.c (recursive_retrieve): Set opt.force_dir_hier when
9998         following FTP links from recursions.
9999
10000 1996-07-09  Hrvoje Niksic  <hniksic@srce.hr>
10001
10002         * url.c (mymkdir): Fixed a bug that prevented mymkdir() to create
10003         absolute directories correctly.
10004
10005         * version.c: Changed version to 1.4b14.
10006
10007 1996-07-09  Hrvoje Niksic  <hniksic@srce.hr>
10008
10009         * version.c: "Released" 1.4b13.
10010
10011         * url.c (make_backup): New function.
10012
10013         * http.c (http_loop): Make a backup copy of the local file (using
10014         rename(2)) before opening it.
10015
10016         * main.c (main): Added --backups.
10017
10018         * host.c (ftp_getaddress): Bail out on failed mycuserid().
10019         (ftp_getaddress): Check for leading dot on MY_DOMAIN.
10020         (ftp_getaddress): Check for empty, null or (null) domain.
10021
10022         * url.c (get_urls_html): If this_url is NULL, the base must have a
10023         protocol.
10024         (parseurl): Use has_proto.
10025
10026         * retr.c (retrieve_url): Warn when proxy is used with more than 20
10027         retries.
10028
10029         * url.c (mkstruct): Create the directory (calling mymkdir()) only
10030         if it is not already there.
10031         (has_proto): New function.
10032         (get_urls_html): Eliminate the remaining call to findurl -- use
10033         has_proto.
10034
10035         * geturl.1: Ditto.
10036
10037         * main.c: Change -X to -x.
10038
10039         * url.c (url_filename): Simplify creation of filename if
10040         prefix_files is set.
10041         (url_filename): Simplify everything. And I do mean *everything*.
10042         (mkstruct): Add dir_prefix before hostname.
10043         (path_simplify): Fixed a bug that caused writing outside the path
10044         string in case of "." and ".." path strings.
10045
10046 1996-07-06  Hrvoje Niksic  <hniksic@srce.hr>
10047
10048         * init.c: Added --mirror.
10049
10050         * main.c (main): Added -X to force saving of directory hierarchy.
10051
10052         * ftp.c (ftp_retrieve_list): Added recursion depth counter.
10053         (ftp_retrieve_list): Check whether quota is exceeded.
10054
10055         * url.c (get_urls_html): Skip leading blanks for absolute URIs.
10056
10057         * http.c (gethttp): Use referer if present.
10058
10059         * recur.c (recursive_retrieve): Set u->referer before calling
10060         retrieve_url.
10061
10062         * url.c (newurl): Use memset to nullify the struct members.
10063         (freeurl): Free the referer field too.
10064
10065         * url.h: Added referer to urlinfo.
10066
10067         * geturl.1: Updated the manual to document some of the new features.
10068
10069         * utils.c (numdigit): Moved from url.c.
10070
10071         * README: Rewritten.
10072
10073         * config.h.in: Add the support for socks.
10074
10075         * configure.in: Add the support for socks.
10076
10077         * url.c (url_filename): If the dir_prefix is ".", work with just
10078         the file name.
10079         (url_filename): Do not look for .n extensions if timestamping if
10080         turned on.
10081
10082         * retr.c (show_progress): Skip the over-abundant restval data, and
10083         print the rest of it with ',' instead of '.'.
10084
10085 1996-07-05  Hrvoje Niksic  <hniksic@srce.hr>
10086
10087         * retr.c (show_progress): Changed second arg. to long (as it
10088         should be).
10089         (show_progress): Moved to retr.c.
10090         (get_contents): Moved to retr.c.
10091
10092         * version.c: Change version to 1.4b13.
10093
10094 1996-07-05  Hrvoje Lacko <hlacko@fly.cc.fer.hr>
10095
10096         * url.c (in_acclist): Would return after the first suffix.
10097
10098 1996-07-04  Hrvoje Niksic  <hniksic@srce.hr>
10099
10100         * version.c: "Released" 1.4b12.
10101
10102         * url.c (path_simplify): More kludgifications.
10103         (get_urls_html): Use new parameters for htmlfindurl.
10104
10105         * html.c: Removed memorizing "parser states", since the new
10106         organization does not require them.
10107
10108         * init.c (run_geturlrc): Use read_whole_line.
10109
10110         * ftp-unix.c (ftp_parse_ls): Use read_whole_line.
10111
10112         * recur.c (parse_robots): Use read_whole_line.
10113
10114         * utils.c (read_whole_line): New function.
10115
10116         * recur.c (tried_robots): Use add_slist/in_slist, *much* cleaner.
10117
10118         * host.c (ngethostbyname): Call inet_addr just once. Yet to be
10119         tested on OSF and Ultrix.
10120         (add_hlist): New function.
10121         (free_hlist): New function.
10122         (search_host): New function.
10123         (search_address): New function.
10124         (realhost): Use search_host, search_address and add_hlist.
10125         (same_host): Replaced realloc() with strdupdelim(), made
10126         case-insensitive, fixed a memory leak.
10127
10128         * html.c (ftp_index): Fixed tm_min and tm_sec to be tm_hour and
10129         tm_min, like intended.
10130
10131         * version.c: Change user agent information to
10132         Geturl/version.
10133
10134 1996-07-03  Hrvoje Niksic  <hniksic@srce.hr>
10135
10136         * utils.c: Renamed nmalloc.c to utils.c, .h likewise.
10137
10138         * url.c (acceptable): Always accept directories.
10139
10140         * ftp-unix.c (ftp_parse_ls): Support brain-damaged "ls -F"-loving
10141         servers by stripping trailing @ from symlinks and trailing / from
10142         directories.
10143
10144         * ftp.c (ftp_loop): Debugged the "enhanced" heuristics. :-)
10145
10146         * url.c (skip_url): Use toupper instead of UCASE.
10147
10148         * host.c (sufmatch): Made it case-insensitive.
10149
10150         * url.c (match_backwards_or_pattern): Fixed i == -1 to j == -1.
10151         (match_backwards): New function, instead of
10152         match_backwards_or_pattern.
10153
10154         * recur.c (recursive_retrieve): Increased performance by
10155         introducing inl, which reduces number of calls to in_slist to only
10156         one.
10157
10158         * ftp.c (ftp_loop): Enhanced the heuristics that decides which
10159         routine to use.
10160
10161         * main.c (printhelp): Removed the warranty stuff.
10162
10163 1996-07-02  Hrvoje Niksic  <hniksic@srce.hr>
10164
10165         * url.c (add_slist): Simplify.
10166         (match_backwards_or_pattern): New function.
10167         (in_acclist): Use match_backwards_or_pattern.
10168         (matches): Remove.
10169
10170 1996-06-30  Hrvoje Niksic  <hniksic@srce.hr>
10171
10172         * ftp.c (ftp_loop): Call ftp_index on empty file names, if not
10173         recursive.
10174
10175         * html.c (ftp_index): Fixed to work. Beautified the output.
10176
10177         * ftp.c (ftp_retrieve_glob): Another argument to control whether
10178         globbing is to be used.
10179         (ftp_retrieve_list): Compare the time-stamps of local and remote
10180         files to determine whether to download.
10181
10182 1996-06-29  Hrvoje Niksic  <hniksic@srce.hr>
10183
10184         * ftp.c (rel_constr): New function.
10185
10186         * retr.c (retrieve_from_file): Check for text/html before
10187         retrieving recursively.
10188
10189         * main.c (main): Check whether the file is HTML before going into
10190         recursive HTML retrieving.
10191
10192         * ftp.c (ftp_retrieve_list): Manage directories.
10193         (ftp_retrieve_glob): Pass all the file-types to ftp_retrieve_list.
10194         (ftp_1fl_loop): Fixed a bug that caused con->com to be incorrectly
10195         initialized, causing bugchecks in getftp to fail.
10196
10197         * configure.in: Check for symlink.
10198
10199         * ftp.c (ftp_retrieve_list): Added support for symlinks.
10200
10201         * version.c: "Released" 1.4b10.
10202
10203         * atotm.c (atotm): Redeclared as time_t.
10204
10205         * init.c: New variable "timestamping".
10206
10207         * main.c (main): New option 'N'.
10208
10209         * http.c (hgetlocation): Case-insensitive match.
10210         (hgetmodified): New function.
10211         (http_loop): Implement time-stamping.
10212
10213 1996-06-28  Hrvoje Niksic  <hniksic@srce.hr>
10214
10215         * version.c: Changed version to 1.4b10
10216
10217         * atotm.c: New file, from phttpd.
10218
10219         * options.h (struct options): New parameter timestamping.
10220
10221         * version.c: 1.4b9 "released".
10222
10223         * recur.c (recursive_retrieve): Used linked list (ulist) for
10224         faster storing of URLs.
10225
10226         * url.c (get_urls_html): Removed the old kludge with comparing the
10227         outputs of htmlfindurl and findurl.
10228         (get_urls_html): Added better protocol support here.
10229         (create_hash): Removed, as well as add_hash and in_hash.
10230         (addslist): New function.
10231         (in_slist): ditto
10232
10233         * version.c: Released 1.4b8, changed version to b9.
10234
10235 1996-06-27  Hrvoje Niksic  <hniksic@srce.hr>
10236
10237         * ftp.c (freefileinfo): New function.
10238         (delelement): New function.
10239
10240         * everywhere: GPL!
10241
10242         * ftp.c (ftp_loop): Use ccon.
10243         (ftp_retrieve_glob): Likewise.
10244
10245         * ftp.h: Define ccon, to define status of control connection.
10246
10247         * ftp.c (ftp_get_listing): New function.
10248         (ftp_retrieve_more): New function.
10249         (ftp_retrieve_glob): New function.
10250
10251 1996-06-25  Hrvoje Niksic  <hniksic@srce.hr>
10252
10253         * configure.in: Removed the search for cuserid().
10254
10255         * init.c (getmode): Renamed to getperms.
10256
10257 1996-06-24  Hrvoje Niksic  <hniksic@srce.hr>
10258
10259         * version.c: New version.
10260
10261         * main.c (hangup): New function, that handles hangup. Hangup
10262         signal now causes geturl to stop writing on stdout, and to write
10263         to a log file.
10264
10265         * ftp.c (getftp): "Released" 1.4b7.
10266
10267         * html.c (htmlfindurl): Ignore everything inside <head>...</head>.
10268         (ftp_index): Use fileinfo/urlinfo.
10269
10270         * ftp-unix.c (ftp_parse_ls): New function.
10271         (symperms): New function.
10272
10273         * ftp.c (ftp_1fl_loop): New function, to handle 1-file loops.
10274
10275         * retr.c (retrieve_url): Added FTP support.
10276
10277 1996-06-23  Hrvoje Niksic  <hniksic@srce.hr>
10278
10279         * geturl.h: Removed NOTFTP2HTML enum.
10280         Added DO_LOGIN, DO_CWD and DO_LIST. LIST_ONLY is obsolete.
10281
10282         * ftp.c (getftp): Resynched with urlinfo.
10283         (getftp): Removed HMTL-ization of index.html from getftp.
10284
10285         * version.c: 1.4b6 "released".
10286
10287         * options.h (options): New struct, to keep options in.
10288
10289         * http.c (http_loop,gethttp): Synched with proxy.
10290
10291         * retr.c (retrieve_url): Implemented proxy retrieval.
10292
10293         * main.c (main): Use retrieve_from_file.
10294
10295 1996-06-22  Hrvoje Niksic  <hniksic@srce.hr>
10296
10297         * retr.c (retrieve_from_file): New function.
10298
10299         * url.c (parseurl): Modified to return URLOK if all OK. Protocol
10300         can be found in u->proto.
10301
10302         * ftp.c (ftp_response): Fixed to accept multi-line responses as
10303         per RFC 959.
10304
10305         * recr.c (recursive_retrieve): Take newloc from retrieve_url.
10306
10307         * url.c (mymkdir): Removed the file of the same name, if one
10308         exists.
10309         (isfile): New function.
10310         (mkstruct): Fixed the '/' glitches.
10311         (path_simplify): Hacked to treat something/.. correctly.
10312
10313 1996-06-21  Hrvoje Niksic  <hniksic@srce.hr>
10314
10315         * http.c (gethttp): Close the socket after error in headers.
10316         (http_loop): HEOF no longer a fatal header.
10317
10318         * loop.c (retrieve_url): When dt is NULL, do not modify it. This
10319         simplifies the syntax of calling retrieve_url.
10320
10321         * recr.c (recursive_retrieve): Modified to use get_urls_html.
10322
10323         * url.c (get_urls_file): New function.
10324         (get_urls_html): New function.
10325
10326         * recr.c (recursive_retrieve): Patched up to conform to the
10327         standards.
10328
10329         * http.c (gethttp): Synched with the rest...
10330         (gethttp): Treat only CONREFUSED specially, with connection
10331         errors.
10332
10333         * init.c,geturl.1,http.c (http_loop): Removed kill_error.
10334
10335 1996-06-20  Hrvoje Niksic  <hniksic@srce.hr>
10336
10337         * http.c (http_loop): New function.
10338
10339         * loop.c: Removed *lots* of stuff from retrieve_url.
10340
10341         * url.c (parseurl): Changed to work with urlinfo. Integrated
10342         username finding and path parsing.
10343         (newurl): New function.
10344         (freeurl): New function.
10345         (mkstruct): Removed the old bogosities, made it urlinfo-compliant.
10346         (url_filename): Likewise.
10347         (path_simplify): Accept relative paths too.
10348         (opt_url): Made urlinfo-compliant, removed bogosities.
10349         (path_simplify): Expanded to accept relative paths.
10350         (str_url): A replacement for hide_url
10351         (decode_string): Fixed a bug that caused malfunctioning when
10352         encountering an illegal %.. combination.
10353         (opt_url): Removed the argument. Dot-optimizations are now default.
10354
10355         * nmalloc.c (strdupdelim): New function.
10356
10357         * url.h: Added the urlinfo structure
10358
10359 1996-06-19  Hrvoje Niksic  <hniksic@srce.hr>
10360
10361         * url.c (hide_url): Thrown out the protocol assertion. Do not
10362         change the URL if the protocol if not recognized.
10363         (findurl): Put continue instead of break.
10364
10365 1996-06-18  Hrvoje Niksic  <hniksic@srce.hr>
10366
10367         * sample.geturlrc: Changed the defaults to be commented out and
10368         harmless (previous defaults caused pains if copied to
10369         ~/.geturlrc).
10370
10371         * http.c (gethttp): Print the HTTP request in debug mode.
10372
10373         * connect.c (iread): Added EINTR check loop to select-ing
10374         too. EINTR is now correctly handled with select().
10375
10376         * TODO: new file
10377
10378 1996-05-07  Hrvoje Niksic  <hniksic@srce.hr>
10379
10380         * host.c (same_host): Made the function a little bit more
10381         intelligent regarding diversified URL syntaxes.
10382
10383         * url.c (skip_url): Spaces are now skipped after URL:
10384
10385         * Released 1.3.1 with the patch to prevent crashing when sending
10386         NULL to robot* functions and the patch to compile "out of the box"
10387         on AIX.
10388
10389         * recr.c (recursive_retrieve): Added checking whether this_url is
10390         NULL when calling the robot functions.
10391
10392         * ChangeLog: New file.