1 --- links-0.97/configure.in Mon May 6 01:07:42 2002
2 +++ links-0.97/configure.in.new Wed Jul 3 10:43:47 2002
5 AC_MSG_RESULT($cf_result)
7 +AC_CHECK_HEADERS(zlib.h)
8 +AC_CHECK_LIB(z, gzdopen)
10 AC_CHECK_LIB(dl, dlopen)
12 AC_ARG_WITH(ssl, [ --without-ssl disable SSL support], [if test "$withval" = no; then disable_ssl=yes; fi])
13 --- links-0.97/file.c Wed Jan 30 14:53:48 2002
14 +++ links-0.97/file.c.new Wed Jul 3 10:44:03 2002
16 if (!(name = get_filename(c->url))) {
17 setcstate(c, S_OUT_OF_MEM); abort_connection(c); return;
20 if ((h = open(name, O_RDONLY | O_NOCTTY)) == -1) {
22 if ((d = opendir(name))) goto dir;
23 + if (strncmp(name + strlen(name) - 3, ".gz", 3) != 0) {
24 + add_to_strn(&name, ".gz");
28 setcstate(c, -er); abort_connection(c); return;
32 setcstate(c, S_FILE_TYPE); abort_connection(c); return;
36 + if (strncmp(name + strlen(name) - 3, ".gz", 3) == 0) {
38 + gzFile gh = gzdopen(h, "r");
43 + setcstate(c, S_OUT_OF_MEM); abort_connection(c); return;
45 + if (!(file = mem_alloc(stt.st_size + 1))) {
47 + setcstate(c, S_OUT_OF_MEM); abort_connection(c); return;
49 + while ((r = gzread(gh, file+fl, stt.st_size)) > 0) {
51 + file = mem_realloc(file, fl + stt.st_size);
54 + setcstate(c, S_OUT_OF_MEM);
55 + abort_connection(c);
66 /* + 1 is there because of bug in Linux. Read returns -EACCES when
67 reading 0 bytes to invalid address */
68 - if (!(file = mem_alloc(stt.st_size + 1))) {
69 + if (!(file = mem_alloc(stt.st_size + 1))) {
71 + setcstate(c, S_OUT_OF_MEM); abort_connection(c); return;
73 + if ((r = read(h, file, stt.st_size)) != stt.st_size) {
74 + mem_free(file); close(h);
75 + setcstate(c, r == -1 ? -errno : S_FILE_ERROR);
76 + abort_connection(c); return;
79 - setcstate(c, S_OUT_OF_MEM); abort_connection(c); return;
81 - if ((r = read(h, file, stt.st_size)) != stt.st_size) {
82 - mem_free(file); close(h);
83 - setcstate(c, r == -1 ? -errno : S_FILE_ERROR);
84 - abort_connection(c); return;
92 if (get_cache_entry(c->url, &e)) {
94 --- links-0.97/links.h Wed Jul 3 10:36:17 2002
95 +++ links-0.97/links.h.new Wed Jul 3 10:44:18 2002
97 #include <openssl/ssl.h>