Compare commits

...

1 Commits

Author SHA1 Message Date
Xavier Roche
0453ffa31e Added 3.48.3 tag. 2014-05-13 19:48:45 +00:00
94 changed files with 1814 additions and 2164 deletions

2
README
View File

@@ -1,5 +1,5 @@
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
Welcome to HTTrack Website Copier! Welcome to HTTrack Website Copier!

20
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for httrack 3.48.6. # Generated by GNU Autoconf 2.69 for httrack 3.48.3.
# #
# Report bugs to <roche+packaging@httrack.com>. # Report bugs to <roche+packaging@httrack.com>.
# #
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='httrack' PACKAGE_NAME='httrack'
PACKAGE_TARNAME='httrack' PACKAGE_TARNAME='httrack'
PACKAGE_VERSION='3.48.6' PACKAGE_VERSION='3.48.3'
PACKAGE_STRING='httrack 3.48.6' PACKAGE_STRING='httrack 3.48.3'
PACKAGE_BUGREPORT='roche+packaging@httrack.com' PACKAGE_BUGREPORT='roche+packaging@httrack.com'
PACKAGE_URL='http://www.httrack.com/' PACKAGE_URL='http://www.httrack.com/'
@@ -1337,7 +1337,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures httrack 3.48.6 to adapt to many kinds of systems. \`configure' configures httrack 3.48.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1407,7 +1407,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of httrack 3.48.6:";; short | recursive ) echo "Configuration of httrack 3.48.3:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@@ -1521,7 +1521,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
httrack configure 3.48.6 httrack configure 3.48.3
generated by GNU Autoconf 2.69 generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2248,7 +2248,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by httrack $as_me 3.48.6, which was It was created by httrack $as_me 3.48.3, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@ $ $0 $@
@@ -3067,7 +3067,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='httrack' PACKAGE='httrack'
VERSION='3.48.6' VERSION='3.48.3'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@@ -16892,7 +16892,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by httrack $as_me 3.48.6, which was This file was extended by httrack $as_me 3.48.3, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@@ -16959,7 +16959,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
httrack config.status 3.48.6 httrack config.status 3.48.3
configured by $0, generated by GNU Autoconf 2.69, configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View File

@@ -1,4 +1,4 @@
AC_INIT([httrack], [3.48.6], [roche+packaging@httrack.com], [httrack], [http://www.httrack.com/]) AC_INIT([httrack], [3.48.3], [roche+packaging@httrack.com], [httrack], [http://www.httrack.com/])
AC_CONFIG_SRCDIR(src/httrack.c) AC_CONFIG_SRCDIR(src/httrack.c)
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS(config.h) AC_CONFIG_HEADERS(config.h)

46
debian/changelog vendored
View File

@@ -1,22 +1,3 @@
httrack (3.48.6-1) unstable; urgency=low
* Updated to 3.48.6 (3.48-6)
-- Xavier Roche <xavier@debian.org> Tue, 13 May 2014 21:23:02 +0200
httrack (3.48.5-1) unstable; urgency=low
* Updated to 3.48.5 (3.48-5)
-- Xavier Roche <xavier@debian.org> Fri, 02 May 2014 16:37:08 +0200
httrack (3.48.4-1) unstable; urgency=low
* Updated to 3.48.4 (3.48-4)
closes:#746173
-- Xavier Roche <xavier@debian.org> Sun, 27 Apr 2014 18:48:57 +0200
httrack (3.48.3-1) unstable; urgency=low httrack (3.48.3-1) unstable; urgency=low
* Updated to 3.48.3 (3.48-3) * Updated to 3.48.3 (3.48-3)
@@ -29,33 +10,6 @@ httrack (3.48.2-1) unstable; urgency=low
-- Xavier Roche <xavier@debian.org> Thu, 10 Apr 2014 18:30:08 +0200 -- Xavier Roche <xavier@debian.org> Thu, 10 Apr 2014 18:30:08 +0200
httrack (3.48.1-5) unstable; urgency=low
* Really call dh_autoreconf, fix configure dependencies.
-- Matthias Klose <doko@ubuntu.com> Wed, 16 Apr 2014 14:46:20 +0200
httrack (3.48.1-4) unstable; urgency=low
* Cleanup in dependencies
-- Xavier Roche <xavier@debian.org> Tue, 15 Apr 2014 22:13:19 +0200
httrack (3.48.1-3) unstable; urgency=low
* Fixed FTBFS due to a missing Build-Depends: dh-autoreconf
-- Xavier Roche <xavier@debian.org> Tue, 15 Apr 2014 21:32:03 +0200
httrack (3.48.1-2) unstable; urgency=low
* Fixed removal of .a files even on architectures where .a are libraries
closes:#744594
Enable verosity of unit tests
Call dh_autoreconf_clean before dh_clean
-- Xavier Roche <xavier@debian.org> Tue, 15 Apr 2014 21:02:14 +0200
httrack (3.48.1-1) unstable; urgency=low httrack (3.48.1-1) unstable; urgency=low
* Updated to 3.48.1 (3.48-1) * Updated to 3.48.1 (3.48-1)

4
debian/control vendored
View File

@@ -2,8 +2,8 @@ Source: httrack
Section: web Section: web
Priority: optional Priority: optional
Maintainer: Xavier Roche <roche@httrack.com> Maintainer: Xavier Roche <roche@httrack.com>
Standards-Version: 3.9.5 Standards-Version: 3.9.4
Build-Depends: debhelper (>= 8.0.0), dh-autoreconf, autotools-dev, autoconf, automake, libtool, zlib1g-dev, libssl-dev Build-Depends: debhelper (>= 8.0.0), zlib1g-dev, libssl-dev, autotools-dev, autoconf, automake, libtool
Homepage: http://www.httrack.com Homepage: http://www.httrack.com
Package: httrack Package: httrack

2
debian/copyright vendored
View File

@@ -5,7 +5,7 @@ The current Debian maintainer is Xavier Roche <xavier@debian.org>
Upstream author: Xavier Roche <roche@httrack.com> Upstream author: Xavier Roche <roche@httrack.com>
Copyright: 1998-2014 Xavier Roche and other contributors Copyright: 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

14
debian/rules vendored
View File

@@ -32,7 +32,7 @@ configure: configure-stamp
configure-stamp: configure-stamp:
dh_testdir dh_testdir
dh_autoreconf autoreconf -v -i
# note: dpkg-buildflags to be removed when compat=9 # note: dpkg-buildflags to be removed when compat=9
dh_auto_configure -- --enable-online-unit-tests=auto $(shell dpkg-buildflags --export=configure) dh_auto_configure -- --enable-online-unit-tests=auto $(shell dpkg-buildflags --export=configure)
@@ -55,7 +55,6 @@ clean:
dh_testroot dh_testroot
rm -f build-stamp configure-stamp rm -f build-stamp configure-stamp
dh_auto_clean dh_auto_clean
dh_autoreconf_clean
dh_clean dh_clean
install: build install: build
@@ -85,17 +84,10 @@ install: build
mkdir -p $(CURDIR)/debian/httrack/usr/lib/httrack/ mkdir -p $(CURDIR)/debian/httrack/usr/lib/httrack/
mv $(CURDIR)/debian/httrack/usr/bin/htsserver \ mv $(CURDIR)/debian/httrack/usr/bin/htsserver \
$(CURDIR)/debian/httrack/usr/lib/httrack/ $(CURDIR)/debian/httrack/usr/lib/httrack/
# remove *.la (https://wiki.debian.org/ReleaseGoals/LAFileRemoval) rm -f $(CURDIR)/debian/httrack/usr/lib/*.a
rm -f $(CURDIR)/debian/httrack/usr/lib/*.la rm -f $(CURDIR)/debian/httrack/usr/lib/*.la
rm -f $(CURDIR)/debian/httrack/usr/lib/httrack/*.a
rm -f $(CURDIR)/debian/httrack/usr/lib/httrack/*.la rm -f $(CURDIR)/debian/httrack/usr/lib/httrack/*.la
# remove *.a unless we do not have *.so files
# see BUG #744594
if ls $(CURDIR)/debian/httrack/usr/lib/*.so >/dev/null 2>/dev/null ; then \
rm -f $(CURDIR)/debian/httrack/usr/lib/*.a ; \
fi
if ls $(CURDIR)/debian/httrack/usr/lib/httrack/*.so >/dev/null 2>/dev/null ; then \
rm -f $(CURDIR)/debian/httrack/usr/lib/httrack/*.a ; \
fi
mv $(CURDIR)/debian/httrack/usr/lib/httrack/lib* \ mv $(CURDIR)/debian/httrack/usr/lib/httrack/lib* \
$(CURDIR)/debian/httrack/usr/share/httrack/libtest/ $(CURDIR)/debian/httrack/usr/share/httrack/libtest/
mkdir -p $(CURDIR)/debian/httrack/usr/lib/httrack/libtest mkdir -p $(CURDIR)/debian/httrack/usr/lib/httrack/libtest

View File

@@ -4,9 +4,7 @@ HTTrack Website Copier release history:
This file lists all changes and fixes that have been made for HTTrack. This file lists all changes and fixes that have been made for HTTrack.
3.48-6 3.48-3
+ Fixed: mitigate the "hashtable internal error: cuckoo/stash collision" errors
+ Fixed: safety cleanup in many strings operations
+ Fixed: buggy option pannels + Fixed: buggy option pannels
+ New: Enforce check against CVE-2014-0160 + New: Enforce check against CVE-2014-0160
+ New: improved hashtables to speedup large mirrors + New: improved hashtables to speedup large mirrors

View File

@@ -52,7 +52,8 @@ offline browser : copy websites to a local directory</p>
<p style="margin-left:11%; margin-top: 1em"><b>httrack [ <p style="margin-left:11%; margin-top: 1em"><b>httrack [
url ]... [ &minus;filter ]... [ +filter ]... [ &minus;O, url ]... [ &minus;filter ]... [ +filter ]... [ &minus;O,
&minus;&minus;path</b> ] [ <b>&minus;w, &minus;&minus;path</b> ] [ <b>&minus;%O,
&minus;&minus;chroot</b> ] [ <b>&minus;w,
&minus;&minus;mirror</b> ] [ <b>&minus;W, &minus;&minus;mirror</b> ] [ <b>&minus;W,
&minus;&minus;mirror&minus;wizard</b> ] [ <b>&minus;g, &minus;&minus;mirror&minus;wizard</b> ] [ <b>&minus;g,
&minus;&minus;get&minus;files</b> ] [ <b>&minus;i, &minus;&minus;get&minus;files</b> ] [ <b>&minus;i,
@@ -69,6 +70,8 @@ url ]... [ &minus;filter ]... [ +filter ]... [ &minus;O,
&minus;&minus;max&minus;rate[=N]</b> ] [ <b>&minus;%cN, &minus;&minus;max&minus;rate[=N]</b> ] [ <b>&minus;%cN,
&minus;&minus;connection&minus;per&minus;second[=N]</b> ] [ &minus;&minus;connection&minus;per&minus;second[=N]</b> ] [
<b>&minus;GN, &minus;&minus;max&minus;pause[=N]</b> ] [ <b>&minus;GN, &minus;&minus;max&minus;pause[=N]</b> ] [
<b>&minus;%mN,
&minus;&minus;max&minus;mms&minus;time[=N]</b> ] [
<b>&minus;cN, &minus;&minus;sockets[=N]</b> ] [ <b>&minus;cN, &minus;&minus;sockets[=N]</b> ] [
<b>&minus;TN, &minus;&minus;timeout[=N]</b> ] [ <b>&minus;TN, &minus;&minus;timeout[=N]</b> ] [
<b>&minus;RN, &minus;&minus;retries[=N]</b> ] [ <b>&minus;RN, &minus;&minus;retries[=N]</b> ] [
@@ -108,9 +111,7 @@ url ]... [ &minus;filter ]... [ +filter ]... [ &minus;O,
&minus;&minus;referer</b> ] [ <b>&minus;%E, &minus;&minus;referer</b> ] [ <b>&minus;%E,
&minus;&minus;from</b> ] [ <b>&minus;%F, &minus;&minus;from</b> ] [ <b>&minus;%F,
&minus;&minus;footer</b> ] [ <b>&minus;%l, &minus;&minus;footer</b> ] [ <b>&minus;%l,
&minus;&minus;language</b> ] [ <b>&minus;%a, &minus;&minus;language</b> ] [ <b>&minus;C,
&minus;&minus;accept</b> ] [ <b>&minus;%X,
&minus;&minus;headers</b> ] [ <b>&minus;C,
&minus;&minus;cache[=N]</b> ] [ <b>&minus;k, &minus;&minus;cache[=N]</b> ] [ <b>&minus;k,
&minus;&minus;store&minus;all&minus;in&minus;cache</b> ] [ &minus;&minus;store&minus;all&minus;in&minus;cache</b> ] [
<b>&minus;%n, &minus;&minus;do&minus;not&minus;recatch</b> ] <b>&minus;%n, &minus;&minus;do&minus;not&minus;recatch</b> ]
@@ -143,7 +144,8 @@ url ]... [ &minus;filter ]... [ +filter ]... [ &minus;O,
<b>&minus;%!, <b>&minus;%!,
&minus;&minus;disable&minus;security&minus;limits</b> ] [ &minus;&minus;disable&minus;security&minus;limits</b> ] [
<b>&minus;V, &minus;&minus;userdef&minus;cmd</b> ] [ <b>&minus;V, &minus;&minus;userdef&minus;cmd</b> ] [
<b>&minus;%W, &minus;&minus;callback</b> ] [ <b>&minus;K, <b>&minus;%U, &minus;&minus;user</b> ] [ <b>&minus;%W,
&minus;&minus;callback</b> ] [ <b>&minus;K,
&minus;&minus;keep&minus;links[=N]</b> ] [</p> &minus;&minus;keep&minus;links[=N]</b> ] [</p>
<h2>DESCRIPTION <h2>DESCRIPTION
@@ -225,17 +227,29 @@ options:</b></p>
cellspacing="0" cellpadding="0"> cellspacing="0" cellpadding="0">
<tr valign="top" align="left"> <tr valign="top" align="left">
<td width="11%"></td> <td width="11%"></td>
<td width="3%"> <td width="4%">
<p>&minus;O</p></td> <p>&minus;O</p></td>
<td width="8%"></td> <td width="7%"></td>
<td width="78%"> <td width="78%">
<p>path for mirror/logfiles+cache (&minus;O path <p>path for mirror/logfiles+cache (&minus;O path
mirror[,path cache and logfiles]) (&minus;&minus;path mirror[,path cache and logfiles]) (&minus;&minus;path
&lt;param&gt;)</p> </td></tr> &lt;param&gt;)</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">
<p>&minus;%O</p></td>
<td width="7%"></td>
<td width="78%">
<p>chroot path to, must be r00t (&minus;%O root path)
(&minus;&minus;chroot &lt;param&gt;)</p></td></tr>
</table> </table>
<p style="margin-left:11%; margin-top: 1em"><b>Action <p style="margin-left:11%; margin-top: 1em"><b>Action
@@ -461,6 +475,19 @@ hour) (&minus;&minus;max&minus;time[=N])</p></td></tr>
<p>pause transfer if N bytes reached, and wait until lock <p>pause transfer if N bytes reached, and wait until lock
file is deleted (&minus;&minus;max&minus;pause[=N])</p></td></tr> file is deleted (&minus;&minus;max&minus;pause[=N])</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">
<p>&minus;%mN</p></td>
<td width="2%"></td>
<td width="78%">
<p>maximum mms stream download time in seconds (60=1
minute, 3600=1 hour)
(&minus;&minus;max&minus;mms&minus;time[=N])</p> </td></tr>
</table> </table>
<p style="margin-left:11%; margin-top: 1em"><b>Flow <p style="margin-left:11%; margin-top: 1em"><b>Flow
@@ -1022,32 +1049,6 @@ HTTP headers (&minus;F &quot;user&minus;agent name&quot;)
<p>preffered language (&minus;%l &quot;fr, en, jp, *&quot; <p>preffered language (&minus;%l &quot;fr, en, jp, *&quot;
(&minus;&minus;language &lt;param&gt;)</p></td></tr> (&minus;&minus;language &lt;param&gt;)</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">
<p>&minus;%a</p></td>
<td width="7%"></td>
<td width="78%">
<p>accepted formats (&minus;%l
&quot;text/html,image/png,image/jpeg,image/gif;q=0.9,*/*;q=0.1&quot;
(&minus;&minus;accept &lt;param&gt;)</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">
<p>&minus;%X</p></td>
<td width="7%"></td>
<td width="78%">
<p>additional HTTP header line (&minus;%X
&quot;X&minus;Magic: 42&quot; (&minus;&minus;headers
&lt;param&gt;)</p> </td></tr>
</table> </table>
<p style="margin-left:11%; margin-top: 1em"><b>Log, index, <p style="margin-left:11%; margin-top: 1em"><b>Log, index,
@@ -1631,6 +1632,18 @@ memory boundary checks)
<p>generate transfer rate statictics every minutes <p>generate transfer rate statictics every minutes
(&minus;&minus;debug&minus;ratestats)</p> </td></tr> (&minus;&minus;debug&minus;ratestats)</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="6%">
<p>&minus;#!</p></td>
<td width="5%"></td>
<td width="78%">
<p>execute a shell command (&minus;#! &quot;echo
hello&quot;) (&minus;&minus;exec &lt;param&gt;)</p></td></tr>
</table> </table>
<p style="margin-left:11%; margin-top: 1em"><b>Dangerous <p style="margin-left:11%; margin-top: 1em"><b>Dangerous
@@ -1694,13 +1707,25 @@ specific options:</b></p>
<p style="margin-top: 1em">execute system command after <p style="margin-top: 1em">execute system command after
each files ($0 is the filename: &minus;V &quot;rm \$0&quot;) each files ($0 is the filename: &minus;V &quot;rm &quot;)
(&minus;&minus;userdef&minus;cmd &lt;param&gt;)</p></td></tr> (&minus;&minus;userdef&minus;cmd &lt;param&gt;)</p></td></tr>
<tr valign="top" align="left"> <tr valign="top" align="left">
<td width="11%"></td> <td width="11%"></td>
<td width="4%"> <td width="4%">
<p>&minus;%U</p></td>
<td width="7%"></td>
<td width="78%">
<p>run the engine with another id when called as root
(&minus;%U smith) (&minus;&minus;user &lt;param&gt;)</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">
<p>&minus;%W</p></td> <p>&minus;%W</p></td>
<td width="7%"></td> <td width="7%"></td>
<td width="78%"> <td width="78%">
@@ -2286,7 +2311,7 @@ other information you deem necessary.</p>
<p style="margin-left:11%; margin-top: 1em">Copyright (C) <p style="margin-left:11%; margin-top: 1em">Copyright (C)
1998-2014 Xavier Roche and other contributors</p> 1998-2013 Xavier Roche and other contributors</p>
<p style="margin-left:11%; margin-top: 1em">This program is <p style="margin-left:11%; margin-top: 1em">This program is
free software: you can redistribute it and/or modify it free software: you can redistribute it and/or modify it

View File

@@ -1,7 +1,7 @@
HTTrack Website Copier License Agreement: HTTrack Website Copier License Agreement:
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,13 +1,15 @@
.\" Process this file with .\" Process this file with
.\" groff -man -Tascii httrack.1 .\" groff -man -Tascii httrack.1
.\" .\"
.TH httrack 1 "12 May 2014" "httrack website copier" .TH httrack 1 "HTTrack version 3.47-26 (compiled Sep 6 2013)" "httrack website copier"
.SH NAME .SH NAME
httrack \- offline browser : copy websites to a local directory httrack \- offline browser : copy websites to a local directory
.SH SYNOPSIS .SH SYNOPSIS
.B httrack [ url ]... [ \-filter ]... [ +filter ]... [ .B httrack [ url ]... [ \-filter ]... [ +filter ]... [
.B \-O, \-\-path .B \-O, \-\-path
] [ ] [
.B \-%O, \-\-chroot
] [
.B \-w, \-\-mirror .B \-w, \-\-mirror
] [ ] [
.B \-W, \-\-mirror\-wizard .B \-W, \-\-mirror\-wizard
@@ -40,6 +42,8 @@ httrack \- offline browser : copy websites to a local directory
] [ ] [
.B \-GN, \-\-max\-pause[=N] .B \-GN, \-\-max\-pause[=N]
] [ ] [
.B \-%mN, \-\-max\-mms\-time[=N]
] [
.B \-cN, \-\-sockets[=N] .B \-cN, \-\-sockets[=N]
] [ ] [
.B \-TN, \-\-timeout[=N] .B \-TN, \-\-timeout[=N]
@@ -118,10 +122,6 @@ httrack \- offline browser : copy websites to a local directory
] [ ] [
.B \-%l, \-\-language .B \-%l, \-\-language
] [ ] [
.B \-%a, \-\-accept
] [
.B \-%X, \-\-headers
] [
.B \-C, \-\-cache[=N] .B \-C, \-\-cache[=N]
] [ ] [
.B \-k, \-\-store\-all\-in\-cache .B \-k, \-\-store\-all\-in\-cache
@@ -174,6 +174,8 @@ httrack \- offline browser : copy websites to a local directory
] [ ] [
.B \-V, \-\-userdef\-cmd .B \-V, \-\-userdef\-cmd
] [ ] [
.B \-%U, \-\-user
] [
.B \-%W, \-\-callback .B \-%W, \-\-callback
] [ ] [
.B \-K, \-\-keep\-links[=N] .B \-K, \-\-keep\-links[=N]
@@ -212,6 +214,9 @@ mirror[,path
cache cache
and and
logfiles]) (\-\-path <param>) logfiles]) (\-\-path <param>)
.IP \-%O
chroot path to, must be r00t (\-%O root
path) (\-\-chroot <param>)
.SS Action options: .SS Action options:
.IP \-w .IP \-w
@@ -252,6 +257,8 @@ maximum transfer rate in bytes/seconds (1000=1KB/s max) (\-\-max\-rate[=N])
maximum number of connections/seconds (*%c10) (\-\-connection\-per\-second[=N]) maximum number of connections/seconds (*%c10) (\-\-connection\-per\-second[=N])
.IP \-GN .IP \-GN
pause transfer if N bytes reached, and wait until lock file is deleted (\-\-max\-pause[=N]) pause transfer if N bytes reached, and wait until lock file is deleted (\-\-max\-pause[=N])
.IP \-%mN
maximum mms stream download time in seconds (60=1 minute, 3600=1 hour) (\-\-max\-mms\-time[=N])
.SS Flow control: .SS Flow control:
.IP \-cN .IP \-cN
@@ -346,10 +353,6 @@ from email address sent in HTTP headers (\-\-from <param>)
footer string in Html code (\-%F "Mirrored [from host %s [file %s [at %s]]]" (\-\-footer <param>) footer string in Html code (\-%F "Mirrored [from host %s [file %s [at %s]]]" (\-\-footer <param>)
.IP \-%l .IP \-%l
preffered language (\-%l "fr, en, jp, *" (\-\-language <param>) preffered language (\-%l "fr, en, jp, *" (\-\-language <param>)
.IP \-%a
accepted formats (\-%l "text/html,image/png,image/jpeg,image/gif;q=0.9,*/*;q=0.1" (\-\-accept <param>)
.IP \-%X
additional HTTP header line (\-%X "X\-Magic: 42" (\-\-headers <param>)
.SS Log, index, cache .SS Log, index, cache
.IP \-C .IP \-C
@@ -452,6 +455,8 @@ generate transfer ops. log every minutes (\-\-debug\-xfrstats)
wait time (\-\-advanced\-wait) wait time (\-\-advanced\-wait)
.IP \-#Z .IP \-#Z
generate transfer rate statictics every minutes (\-\-debug\-ratestats) generate transfer rate statictics every minutes (\-\-debug\-ratestats)
.IP \-#!
execute a shell command (\-#! "echo hello") (\-\-exec <param>)
.SS Dangerous options: (do NOT use unless you exactly know what you are doing) .SS Dangerous options: (do NOT use unless you exactly know what you are doing)
.IP \-%! .IP \-%!
@@ -463,7 +468,9 @@ IT WITH EXTREME CARE
.SS Command\-line specific options: .SS Command\-line specific options:
.IP \-V .IP \-V
execute system command after each files ($0 is the filename: \-V "rm \\$0") (\-\-userdef\-cmd <param>) execute system command after each files ($0 is the filename: \-V "rm \$0") (\-\-userdef\-cmd <param>)
.IP \-%U
run the engine with another id when called as root (\-%U smith) (\-\-user <param>)
.IP \-%W .IP \-%W
use an external library function as a wrapper (\-%W myfoo.so[,myparameters]) (\-\-callback <param>) use an external library function as a wrapper (\-%W myfoo.so[,myparameters]) (\-\-callback <param>)
@@ -610,7 +617,7 @@ Please reports bugs to
.B <bugs@httrack.com>. .B <bugs@httrack.com>.
Include a complete, self-contained example that will allow the bug to be reproduced, and say which version of httrack you are using. Do not forget to detail options used, OS version, and any other information you deem necessary. Include a complete, self-contained example that will allow the bug to be reproduced, and say which version of httrack you are using. Do not forget to detail options used, OS version, and any other information you deem necessary.
.SH COPYRIGHT .SH COPYRIGHT
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -44,11 +44,11 @@ libhttrack_la_SOURCES = htscore.c htsparse.c htsback.c htscache.c \
htshelp.c htslib.c htscoremain.c \ htshelp.c htslib.c htscoremain.c \
htsname.c htsrobots.c htstools.c htswizard.c \ htsname.c htsrobots.c htstools.c htswizard.c \
htsalias.c htsthread.c htsindex.c htsbauth.c \ htsalias.c htsthread.c htsindex.c htsbauth.c \
htsmd5.c htszlib.c htswrap.c htsconcat.c \ htsmd5.c htszlib.c htswrap.c \
htsmodules.c htscharset.c punycode.c htsencoding.c \ htsmodules.c htscharset.c punycode.c htsencoding.c \
md5.c \ md5.c \
minizip/ioapi.c minizip/mztools.c minizip/unzip.c minizip/zip.c \ minizip/ioapi.c minizip/mztools.c minizip/unzip.c minizip/zip.c \
hts-indextmpl.h htsalias.h htsback.h htsbase.h htssafe.h \ hts-indextmpl.h htsalias.h htsback.h htsbase.h \
htsbasenet.h htsbauth.h htscache.h htscatchurl.h \ htsbasenet.h htsbauth.h htscache.h htscatchurl.h \
htsconfig.h htscore.h htsparse.h htscoremain.h htsdefines.h \ htsconfig.h htscore.h htsparse.h htscoremain.h htsdefines.h \
htsfilters.h htsftp.h htsglobal.h htshash.h htsinthash.h \ htsfilters.h htsftp.h htsglobal.h htshash.h htsinthash.h \
@@ -61,7 +61,6 @@ libhttrack_la_SOURCES = htscore.c htsparse.c htsback.c htscache.c \
md5.h murmurhash3.h \ md5.h murmurhash3.h \
minizip/crypt.h minizip/ioapi.h minizip/mztools.h minizip/unzip.h minizip/zip.h minizip/crypt.h minizip/ioapi.h minizip/mztools.h minizip/unzip.h minizip/zip.h
libhttrack_la_LIBADD = $(THREADS_LIBS) $(ZLIB_LIBS) $(OPENSSL_LIBS) $(DL_LIBS) $(SOCKET_LIBS) $(ICONV_LIBS) libhttrack_la_LIBADD = $(THREADS_LIBS) $(ZLIB_LIBS) $(OPENSSL_LIBS) $(DL_LIBS) $(SOCKET_LIBS) $(ICONV_LIBS)
libhttrack_la_CFLAGS = $(AM_CFLAGS) -DLIBHTTRACK_EXPORTS
libhttrack_la_LDFLAGS = -version-info $(VERSION_INFO) libhttrack_la_LDFLAGS = -version-info $(VERSION_INFO)
libhtsjava_la_SOURCES = htsjava.c htsjava.h libhtsjava_la_SOURCES = htsjava.c htsjava.h

View File

@@ -110,27 +110,17 @@ libhtsjava_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
libhttrack_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ libhttrack_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am_libhttrack_la_OBJECTS = libhttrack_la-htscore.lo \ am_libhttrack_la_OBJECTS = htscore.lo htsparse.lo htsback.lo \
libhttrack_la-htsparse.lo libhttrack_la-htsback.lo \ htscache.lo htscatchurl.lo htsfilters.lo htsftp.lo htshash.lo \
libhttrack_la-htscache.lo libhttrack_la-htscatchurl.lo \ htsinthash.lo htshelp.lo htslib.lo htscoremain.lo htsname.lo \
libhttrack_la-htsfilters.lo libhttrack_la-htsftp.lo \ htsrobots.lo htstools.lo htswizard.lo htsalias.lo htsthread.lo \
libhttrack_la-htshash.lo libhttrack_la-htsinthash.lo \ htsindex.lo htsbauth.lo htsmd5.lo htszlib.lo htswrap.lo \
libhttrack_la-htshelp.lo libhttrack_la-htslib.lo \ htsmodules.lo htscharset.lo punycode.lo htsencoding.lo md5.lo \
libhttrack_la-htscoremain.lo libhttrack_la-htsname.lo \ ioapi.lo mztools.lo unzip.lo zip.lo
libhttrack_la-htsrobots.lo libhttrack_la-htstools.lo \
libhttrack_la-htswizard.lo libhttrack_la-htsalias.lo \
libhttrack_la-htsthread.lo libhttrack_la-htsindex.lo \
libhttrack_la-htsbauth.lo libhttrack_la-htsmd5.lo \
libhttrack_la-htszlib.lo libhttrack_la-htswrap.lo \
libhttrack_la-htsconcat.lo libhttrack_la-htsmodules.lo \
libhttrack_la-htscharset.lo libhttrack_la-punycode.lo \
libhttrack_la-htsencoding.lo libhttrack_la-md5.lo \
libhttrack_la-ioapi.lo libhttrack_la-mztools.lo \
libhttrack_la-unzip.lo libhttrack_la-zip.lo
libhttrack_la_OBJECTS = $(am_libhttrack_la_OBJECTS) libhttrack_la_OBJECTS = $(am_libhttrack_la_OBJECTS)
libhttrack_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ libhttrack_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libhttrack_la_CFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(CFLAGS) $(libhttrack_la_LDFLAGS) $(LDFLAGS) -o $@ $(libhttrack_la_LDFLAGS) $(LDFLAGS) -o $@
PROGRAMS = $(bin_PROGRAMS) PROGRAMS = $(bin_PROGRAMS)
am_htsserver_OBJECTS = htsserver.$(OBJEXT) htsweb.$(OBJEXT) am_htsserver_OBJECTS = htsserver.$(OBJEXT) htsweb.$(OBJEXT)
htsserver_OBJECTS = $(am_htsserver_OBJECTS) htsserver_OBJECTS = $(am_htsserver_OBJECTS)
@@ -351,11 +341,11 @@ libhttrack_la_SOURCES = htscore.c htsparse.c htsback.c htscache.c \
htshelp.c htslib.c htscoremain.c \ htshelp.c htslib.c htscoremain.c \
htsname.c htsrobots.c htstools.c htswizard.c \ htsname.c htsrobots.c htstools.c htswizard.c \
htsalias.c htsthread.c htsindex.c htsbauth.c \ htsalias.c htsthread.c htsindex.c htsbauth.c \
htsmd5.c htszlib.c htswrap.c htsconcat.c \ htsmd5.c htszlib.c htswrap.c \
htsmodules.c htscharset.c punycode.c htsencoding.c \ htsmodules.c htscharset.c punycode.c htsencoding.c \
md5.c \ md5.c \
minizip/ioapi.c minizip/mztools.c minizip/unzip.c minizip/zip.c \ minizip/ioapi.c minizip/mztools.c minizip/unzip.c minizip/zip.c \
hts-indextmpl.h htsalias.h htsback.h htsbase.h htssafe.h \ hts-indextmpl.h htsalias.h htsback.h htsbase.h \
htsbasenet.h htsbauth.h htscache.h htscatchurl.h \ htsbasenet.h htsbauth.h htscache.h htscatchurl.h \
htsconfig.h htscore.h htsparse.h htscoremain.h htsdefines.h \ htsconfig.h htscore.h htsparse.h htscoremain.h htsdefines.h \
htsfilters.h htsftp.h htsglobal.h htshash.h htsinthash.h \ htsfilters.h htsftp.h htsglobal.h htshash.h htsinthash.h \
@@ -369,7 +359,6 @@ libhttrack_la_SOURCES = htscore.c htsparse.c htsback.c htscache.c \
minizip/crypt.h minizip/ioapi.h minizip/mztools.h minizip/unzip.h minizip/zip.h minizip/crypt.h minizip/ioapi.h minizip/mztools.h minizip/unzip.h minizip/zip.h
libhttrack_la_LIBADD = $(THREADS_LIBS) $(ZLIB_LIBS) $(OPENSSL_LIBS) $(DL_LIBS) $(SOCKET_LIBS) $(ICONV_LIBS) libhttrack_la_LIBADD = $(THREADS_LIBS) $(ZLIB_LIBS) $(OPENSSL_LIBS) $(DL_LIBS) $(SOCKET_LIBS) $(ICONV_LIBS)
libhttrack_la_CFLAGS = $(AM_CFLAGS) -DLIBHTTRACK_EXPORTS
libhttrack_la_LDFLAGS = -version-info $(VERSION_INFO) libhttrack_la_LDFLAGS = -version-info $(VERSION_INFO)
libhtsjava_la_SOURCES = htsjava.c htsjava.h libhtsjava_la_SOURCES = htsjava.c htsjava.h
libhtsjava_la_LIBADD = $(THREADS_LIBS) $(DL_LIBS) libhttrack.la libhtsjava_la_LIBADD = $(THREADS_LIBS) $(DL_LIBS) libhttrack.la
@@ -553,43 +542,39 @@ mostlyclean-compile:
distclean-compile: distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsalias.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsback.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsbauth.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htscache.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htscatchurl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htscharset.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htscore.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htscoremain.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsencoding.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsfilters.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsftp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htshash.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htshelp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsindex.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsinthash.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsjava.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsjava.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htslib.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsmd5.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsmodules.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsname.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsparse.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsrobots.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsserver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsserver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsthread.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htstools.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsweb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsweb.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htswizard.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htswrap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htszlib.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httrack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httrack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsalias.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioapi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsback.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsbauth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mztools.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htscache.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htscatchurl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htscharset.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsconcat.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htscore.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htscoremain.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsencoding.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsfilters.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsftp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htshash.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htshelp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsindex.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsinthash.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htslib.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsmd5.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsmodules.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsname.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsparse.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsrobots.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsthread.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htstools.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htswizard.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htswrap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htszlib.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-ioapi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-md5.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-mztools.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-punycode.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-unzip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-zip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-htsinthash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-htsinthash.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-htsmd5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-htsmd5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-ioapi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-ioapi.Po@am__quote@
@@ -600,6 +585,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-store.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-store.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-unzip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-unzip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-zip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-zip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/punycode.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unzip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zip.Plo@am__quote@
.c.o: .c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -622,236 +610,33 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
libhttrack_la-htscore.lo: htscore.c ioapi.lo: minizip/ioapi.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htscore.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htscore.Tpo -c -o libhttrack_la-htscore.lo `test -f 'htscore.c' || echo '$(srcdir)/'`htscore.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ioapi.lo -MD -MP -MF $(DEPDIR)/ioapi.Tpo -c -o ioapi.lo `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htscore.Tpo $(DEPDIR)/libhttrack_la-htscore.Plo @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ioapi.Tpo $(DEPDIR)/ioapi.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htscore.c' object='libhttrack_la-htscore.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/ioapi.c' object='ioapi.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htscore.lo `test -f 'htscore.c' || echo '$(srcdir)/'`htscore.c @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ioapi.lo `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
libhttrack_la-htsparse.lo: htsparse.c mztools.lo: minizip/mztools.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsparse.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsparse.Tpo -c -o libhttrack_la-htsparse.lo `test -f 'htsparse.c' || echo '$(srcdir)/'`htsparse.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mztools.lo -MD -MP -MF $(DEPDIR)/mztools.Tpo -c -o mztools.lo `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsparse.Tpo $(DEPDIR)/libhttrack_la-htsparse.Plo @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mztools.Tpo $(DEPDIR)/mztools.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsparse.c' object='libhttrack_la-htsparse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/mztools.c' object='mztools.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsparse.lo `test -f 'htsparse.c' || echo '$(srcdir)/'`htsparse.c @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mztools.lo `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
libhttrack_la-htsback.lo: htsback.c unzip.lo: minizip/unzip.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsback.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsback.Tpo -c -o libhttrack_la-htsback.lo `test -f 'htsback.c' || echo '$(srcdir)/'`htsback.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unzip.lo -MD -MP -MF $(DEPDIR)/unzip.Tpo -c -o unzip.lo `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsback.Tpo $(DEPDIR)/libhttrack_la-htsback.Plo @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/unzip.Tpo $(DEPDIR)/unzip.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsback.c' object='libhttrack_la-htsback.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/unzip.c' object='unzip.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsback.lo `test -f 'htsback.c' || echo '$(srcdir)/'`htsback.c @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unzip.lo `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
libhttrack_la-htscache.lo: htscache.c zip.lo: minizip/zip.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htscache.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htscache.Tpo -c -o libhttrack_la-htscache.lo `test -f 'htscache.c' || echo '$(srcdir)/'`htscache.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zip.lo -MD -MP -MF $(DEPDIR)/zip.Tpo -c -o zip.lo `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htscache.Tpo $(DEPDIR)/libhttrack_la-htscache.Plo @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/zip.Tpo $(DEPDIR)/zip.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htscache.c' object='libhttrack_la-htscache.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/zip.c' object='zip.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htscache.lo `test -f 'htscache.c' || echo '$(srcdir)/'`htscache.c @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zip.lo `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
libhttrack_la-htscatchurl.lo: htscatchurl.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htscatchurl.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htscatchurl.Tpo -c -o libhttrack_la-htscatchurl.lo `test -f 'htscatchurl.c' || echo '$(srcdir)/'`htscatchurl.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htscatchurl.Tpo $(DEPDIR)/libhttrack_la-htscatchurl.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htscatchurl.c' object='libhttrack_la-htscatchurl.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htscatchurl.lo `test -f 'htscatchurl.c' || echo '$(srcdir)/'`htscatchurl.c
libhttrack_la-htsfilters.lo: htsfilters.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsfilters.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsfilters.Tpo -c -o libhttrack_la-htsfilters.lo `test -f 'htsfilters.c' || echo '$(srcdir)/'`htsfilters.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsfilters.Tpo $(DEPDIR)/libhttrack_la-htsfilters.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsfilters.c' object='libhttrack_la-htsfilters.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsfilters.lo `test -f 'htsfilters.c' || echo '$(srcdir)/'`htsfilters.c
libhttrack_la-htsftp.lo: htsftp.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsftp.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsftp.Tpo -c -o libhttrack_la-htsftp.lo `test -f 'htsftp.c' || echo '$(srcdir)/'`htsftp.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsftp.Tpo $(DEPDIR)/libhttrack_la-htsftp.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsftp.c' object='libhttrack_la-htsftp.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsftp.lo `test -f 'htsftp.c' || echo '$(srcdir)/'`htsftp.c
libhttrack_la-htshash.lo: htshash.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htshash.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htshash.Tpo -c -o libhttrack_la-htshash.lo `test -f 'htshash.c' || echo '$(srcdir)/'`htshash.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htshash.Tpo $(DEPDIR)/libhttrack_la-htshash.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htshash.c' object='libhttrack_la-htshash.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htshash.lo `test -f 'htshash.c' || echo '$(srcdir)/'`htshash.c
libhttrack_la-htsinthash.lo: htsinthash.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsinthash.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsinthash.Tpo -c -o libhttrack_la-htsinthash.lo `test -f 'htsinthash.c' || echo '$(srcdir)/'`htsinthash.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsinthash.Tpo $(DEPDIR)/libhttrack_la-htsinthash.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsinthash.c' object='libhttrack_la-htsinthash.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsinthash.lo `test -f 'htsinthash.c' || echo '$(srcdir)/'`htsinthash.c
libhttrack_la-htshelp.lo: htshelp.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htshelp.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htshelp.Tpo -c -o libhttrack_la-htshelp.lo `test -f 'htshelp.c' || echo '$(srcdir)/'`htshelp.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htshelp.Tpo $(DEPDIR)/libhttrack_la-htshelp.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htshelp.c' object='libhttrack_la-htshelp.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htshelp.lo `test -f 'htshelp.c' || echo '$(srcdir)/'`htshelp.c
libhttrack_la-htslib.lo: htslib.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htslib.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htslib.Tpo -c -o libhttrack_la-htslib.lo `test -f 'htslib.c' || echo '$(srcdir)/'`htslib.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htslib.Tpo $(DEPDIR)/libhttrack_la-htslib.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htslib.c' object='libhttrack_la-htslib.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htslib.lo `test -f 'htslib.c' || echo '$(srcdir)/'`htslib.c
libhttrack_la-htscoremain.lo: htscoremain.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htscoremain.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htscoremain.Tpo -c -o libhttrack_la-htscoremain.lo `test -f 'htscoremain.c' || echo '$(srcdir)/'`htscoremain.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htscoremain.Tpo $(DEPDIR)/libhttrack_la-htscoremain.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htscoremain.c' object='libhttrack_la-htscoremain.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htscoremain.lo `test -f 'htscoremain.c' || echo '$(srcdir)/'`htscoremain.c
libhttrack_la-htsname.lo: htsname.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsname.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsname.Tpo -c -o libhttrack_la-htsname.lo `test -f 'htsname.c' || echo '$(srcdir)/'`htsname.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsname.Tpo $(DEPDIR)/libhttrack_la-htsname.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsname.c' object='libhttrack_la-htsname.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsname.lo `test -f 'htsname.c' || echo '$(srcdir)/'`htsname.c
libhttrack_la-htsrobots.lo: htsrobots.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsrobots.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsrobots.Tpo -c -o libhttrack_la-htsrobots.lo `test -f 'htsrobots.c' || echo '$(srcdir)/'`htsrobots.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsrobots.Tpo $(DEPDIR)/libhttrack_la-htsrobots.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsrobots.c' object='libhttrack_la-htsrobots.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsrobots.lo `test -f 'htsrobots.c' || echo '$(srcdir)/'`htsrobots.c
libhttrack_la-htstools.lo: htstools.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htstools.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htstools.Tpo -c -o libhttrack_la-htstools.lo `test -f 'htstools.c' || echo '$(srcdir)/'`htstools.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htstools.Tpo $(DEPDIR)/libhttrack_la-htstools.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htstools.c' object='libhttrack_la-htstools.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htstools.lo `test -f 'htstools.c' || echo '$(srcdir)/'`htstools.c
libhttrack_la-htswizard.lo: htswizard.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htswizard.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htswizard.Tpo -c -o libhttrack_la-htswizard.lo `test -f 'htswizard.c' || echo '$(srcdir)/'`htswizard.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htswizard.Tpo $(DEPDIR)/libhttrack_la-htswizard.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htswizard.c' object='libhttrack_la-htswizard.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htswizard.lo `test -f 'htswizard.c' || echo '$(srcdir)/'`htswizard.c
libhttrack_la-htsalias.lo: htsalias.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsalias.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsalias.Tpo -c -o libhttrack_la-htsalias.lo `test -f 'htsalias.c' || echo '$(srcdir)/'`htsalias.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsalias.Tpo $(DEPDIR)/libhttrack_la-htsalias.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsalias.c' object='libhttrack_la-htsalias.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsalias.lo `test -f 'htsalias.c' || echo '$(srcdir)/'`htsalias.c
libhttrack_la-htsthread.lo: htsthread.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsthread.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsthread.Tpo -c -o libhttrack_la-htsthread.lo `test -f 'htsthread.c' || echo '$(srcdir)/'`htsthread.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsthread.Tpo $(DEPDIR)/libhttrack_la-htsthread.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsthread.c' object='libhttrack_la-htsthread.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsthread.lo `test -f 'htsthread.c' || echo '$(srcdir)/'`htsthread.c
libhttrack_la-htsindex.lo: htsindex.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsindex.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsindex.Tpo -c -o libhttrack_la-htsindex.lo `test -f 'htsindex.c' || echo '$(srcdir)/'`htsindex.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsindex.Tpo $(DEPDIR)/libhttrack_la-htsindex.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsindex.c' object='libhttrack_la-htsindex.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsindex.lo `test -f 'htsindex.c' || echo '$(srcdir)/'`htsindex.c
libhttrack_la-htsbauth.lo: htsbauth.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsbauth.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsbauth.Tpo -c -o libhttrack_la-htsbauth.lo `test -f 'htsbauth.c' || echo '$(srcdir)/'`htsbauth.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsbauth.Tpo $(DEPDIR)/libhttrack_la-htsbauth.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsbauth.c' object='libhttrack_la-htsbauth.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsbauth.lo `test -f 'htsbauth.c' || echo '$(srcdir)/'`htsbauth.c
libhttrack_la-htsmd5.lo: htsmd5.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsmd5.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsmd5.Tpo -c -o libhttrack_la-htsmd5.lo `test -f 'htsmd5.c' || echo '$(srcdir)/'`htsmd5.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsmd5.Tpo $(DEPDIR)/libhttrack_la-htsmd5.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsmd5.c' object='libhttrack_la-htsmd5.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsmd5.lo `test -f 'htsmd5.c' || echo '$(srcdir)/'`htsmd5.c
libhttrack_la-htszlib.lo: htszlib.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htszlib.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htszlib.Tpo -c -o libhttrack_la-htszlib.lo `test -f 'htszlib.c' || echo '$(srcdir)/'`htszlib.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htszlib.Tpo $(DEPDIR)/libhttrack_la-htszlib.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htszlib.c' object='libhttrack_la-htszlib.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htszlib.lo `test -f 'htszlib.c' || echo '$(srcdir)/'`htszlib.c
libhttrack_la-htswrap.lo: htswrap.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htswrap.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htswrap.Tpo -c -o libhttrack_la-htswrap.lo `test -f 'htswrap.c' || echo '$(srcdir)/'`htswrap.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htswrap.Tpo $(DEPDIR)/libhttrack_la-htswrap.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htswrap.c' object='libhttrack_la-htswrap.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htswrap.lo `test -f 'htswrap.c' || echo '$(srcdir)/'`htswrap.c
libhttrack_la-htsconcat.lo: htsconcat.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsconcat.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsconcat.Tpo -c -o libhttrack_la-htsconcat.lo `test -f 'htsconcat.c' || echo '$(srcdir)/'`htsconcat.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsconcat.Tpo $(DEPDIR)/libhttrack_la-htsconcat.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsconcat.c' object='libhttrack_la-htsconcat.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsconcat.lo `test -f 'htsconcat.c' || echo '$(srcdir)/'`htsconcat.c
libhttrack_la-htsmodules.lo: htsmodules.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsmodules.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsmodules.Tpo -c -o libhttrack_la-htsmodules.lo `test -f 'htsmodules.c' || echo '$(srcdir)/'`htsmodules.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsmodules.Tpo $(DEPDIR)/libhttrack_la-htsmodules.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsmodules.c' object='libhttrack_la-htsmodules.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsmodules.lo `test -f 'htsmodules.c' || echo '$(srcdir)/'`htsmodules.c
libhttrack_la-htscharset.lo: htscharset.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htscharset.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htscharset.Tpo -c -o libhttrack_la-htscharset.lo `test -f 'htscharset.c' || echo '$(srcdir)/'`htscharset.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htscharset.Tpo $(DEPDIR)/libhttrack_la-htscharset.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htscharset.c' object='libhttrack_la-htscharset.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htscharset.lo `test -f 'htscharset.c' || echo '$(srcdir)/'`htscharset.c
libhttrack_la-punycode.lo: punycode.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-punycode.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-punycode.Tpo -c -o libhttrack_la-punycode.lo `test -f 'punycode.c' || echo '$(srcdir)/'`punycode.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-punycode.Tpo $(DEPDIR)/libhttrack_la-punycode.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='punycode.c' object='libhttrack_la-punycode.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-punycode.lo `test -f 'punycode.c' || echo '$(srcdir)/'`punycode.c
libhttrack_la-htsencoding.lo: htsencoding.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsencoding.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsencoding.Tpo -c -o libhttrack_la-htsencoding.lo `test -f 'htsencoding.c' || echo '$(srcdir)/'`htsencoding.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsencoding.Tpo $(DEPDIR)/libhttrack_la-htsencoding.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsencoding.c' object='libhttrack_la-htsencoding.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsencoding.lo `test -f 'htsencoding.c' || echo '$(srcdir)/'`htsencoding.c
libhttrack_la-md5.lo: md5.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-md5.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-md5.Tpo -c -o libhttrack_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-md5.Tpo $(DEPDIR)/libhttrack_la-md5.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5.c' object='libhttrack_la-md5.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
libhttrack_la-ioapi.lo: minizip/ioapi.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-ioapi.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-ioapi.Tpo -c -o libhttrack_la-ioapi.lo `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-ioapi.Tpo $(DEPDIR)/libhttrack_la-ioapi.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/ioapi.c' object='libhttrack_la-ioapi.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-ioapi.lo `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
libhttrack_la-mztools.lo: minizip/mztools.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-mztools.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-mztools.Tpo -c -o libhttrack_la-mztools.lo `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-mztools.Tpo $(DEPDIR)/libhttrack_la-mztools.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/mztools.c' object='libhttrack_la-mztools.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-mztools.lo `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
libhttrack_la-unzip.lo: minizip/unzip.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-unzip.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-unzip.Tpo -c -o libhttrack_la-unzip.lo `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-unzip.Tpo $(DEPDIR)/libhttrack_la-unzip.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/unzip.c' object='libhttrack_la-unzip.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-unzip.lo `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
libhttrack_la-zip.lo: minizip/zip.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-zip.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-zip.Tpo -c -o libhttrack_la-zip.lo `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-zip.Tpo $(DEPDIR)/libhttrack_la-zip.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/zip.c' object='libhttrack_la-zip.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-zip.lo `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
proxytrack-main.o: proxy/main.c proxytrack-main.o: proxy/main.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-main.o -MD -MP -MF $(DEPDIR)/proxytrack-main.Tpo -c -o proxytrack-main.o `test -f 'proxy/main.c' || echo '$(srcdir)/'`proxy/main.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-main.o -MD -MP -MF $(DEPDIR)/proxytrack-main.Tpo -c -o proxytrack-main.o `test -f 'proxy/main.c' || echo '$(srcdir)/'`proxy/main.c

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -168,7 +168,7 @@ regen:
" <BR>"LF\ " <BR>"LF\
" <BR>"LF\ " <BR>"LF\
" <H6 ALIGN=\"RIGHT\">"LF\ " <H6 ALIGN=\"RIGHT\">"LF\
" <I>Mirror and index made by HTTrack Website Copier [XR&amp;CO'2014]</I>"LF\ " <I>Mirror and index made by HTTrack Website Copier [XR&amp;CO'2013]</I>"LF\
" </H6>"LF\ " </H6>"LF\
" %s"LF\ " %s"LF\
" <!-- Thanks for using HTTrack Website Copier! -->"LF\ " <!-- Thanks for using HTTrack Website Copier! -->"LF\
@@ -186,7 +186,7 @@ regen:
""LF\ ""LF\
"<table width=\"76%%\" border=\"0\" align=\"center\" valign=\"bottom\" cellspacing=\"0\" cellpadding=\"0\">"LF\ "<table width=\"76%%\" border=\"0\" align=\"center\" valign=\"bottom\" cellspacing=\"0\" cellpadding=\"0\">"LF\
" <tr>"LF\ " <tr>"LF\
" <td id=\"footer\"><small>&copy; 2014 Xavier Roche & other contributors - Web Design: Kauler Leto.</small></td>"LF\ " <td id=\"footer\"><small>&copy; 2013 Xavier Roche & other contributors - Web Design: Kauler Leto.</small></td>"LF\
" </tr>"LF\ " </tr>"LF\
"</table>"LF\ "</table>"LF\
""LF\ ""LF\
@@ -317,7 +317,7 @@ regen:
" </TABLE>"LF\ " </TABLE>"LF\
" <BR>"LF\ " <BR>"LF\
" <H6 ALIGN=\"RIGHT\">"LF\ " <H6 ALIGN=\"RIGHT\">"LF\
" <I>Mirror and index made by HTTrack Website Copier [XR&CO'2014]</I>"LF\ " <I>Mirror and index made by HTTrack Website Copier [XR&CO'2013]</I>"LF\
" </H6>"LF\ " </H6>"LF\
" %s"LF\ " %s"LF\
" <!-- Thanks for using HTTrack Website Copier! -->"LF\ " <!-- Thanks for using HTTrack Website Copier! -->"LF\
@@ -335,7 +335,7 @@ regen:
""LF\ ""LF\
"<table width=\"76%%\" border=\"0\" align=\"center\" valign=\"bottom\" cellspacing=\"0\" cellpadding=\"0\">"LF\ "<table width=\"76%%\" border=\"0\" align=\"center\" valign=\"bottom\" cellspacing=\"0\" cellpadding=\"0\">"LF\
" <tr>"LF\ " <tr>"LF\
" <td id=\"footer\"><small>&copy; 2014 Xavier Roche & other contributors - Web Design: Kauler Leto.</small></td>"LF\ " <td id=\"footer\"><small>&copy; 2013 Xavier Roche & other contributors - Web Design: Kauler Leto.</small></td>"LF\
" </tr>"LF\ " </tr>"LF\
"</table>"LF\ "</table>"LF\
""LF\ ""LF\
@@ -475,7 +475,7 @@ regen:
""LF\ ""LF\
"<table width=\"76%%\" height=\"100%%\" border=\"0\" align=\"center\" valign=\"bottom\" cellspacing=\"0\" cellpadding=\"0\">"LF\ "<table width=\"76%%\" height=\"100%%\" border=\"0\" align=\"center\" valign=\"bottom\" cellspacing=\"0\" cellpadding=\"0\">"LF\
" <tr>"LF\ " <tr>"LF\
" <td id=\"footer\"><small>&copy; 2014 Xavier Roche & other contributors - Web Design: Kauler Leto.</small></td>"LF\ " <td id=\"footer\"><small>&copy; 2013 Xavier Roche & other contributors - Web Design: Kauler Leto.</small></td>"LF\
" </tr>"LF\ " </tr>"LF\
"</table>"LF\ "</table>"LF\
""LF\ ""LF\
@@ -612,7 +612,7 @@ regen:
""LF\ ""LF\
"<table width=\"76%%\" height=\"100%%\" border=\"0\" align=\"center\" valign=\"bottom\" cellspacing=\"0\" cellpadding=\"0\">"LF\ "<table width=\"76%%\" height=\"100%%\" border=\"0\" align=\"center\" valign=\"bottom\" cellspacing=\"0\" cellpadding=\"0\">"LF\
" <tr>"LF\ " <tr>"LF\
" <td id=\"footer\"><small>&copy; 2014 Xavier Roche & other contributors - Web Design: Kauler Leto.</small></td>"LF\ " <td id=\"footer\"><small>&copy; 2013 Xavier Roche & other contributors - Web Design: Kauler Leto.</small></td>"LF\
" </tr>"LF\ " </tr>"LF\
"</table>"LF\ "</table>"LF\
""LF\ ""LF\

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -37,9 +37,20 @@ Please visit our Website: http://www.httrack.com
#include "htsbase.h" #include "htsbase.h"
#include "htsalias.h" #include "htsalias.h"
#include "htsglobal.h" #include "htsglobal.h"
#include "htslib.h"
void linput(FILE * fp, char *s, int max);
void hts_lowcase(char *s);
#define _NOT_NULL(a) ( (a!=NULL) ? (a) : "" ) #define _NOT_NULL(a) ( (a!=NULL) ? (a) : "" )
// #define is_realspace(c) (strchr(" \x0d\x0a\x09\x0b\x0c",(c))!=NULL)
#define is_realspace(c) ( \
(c) == ' ' \
|| (c) == '\x09' \
|| (c) == '\x0a' \
|| (c) == '\x0b' \
|| (c) == '\x0c' \
|| (c) == '\x0d' \
)
// COPY OF cmdl_ins in htsmain.c // COPY OF cmdl_ins in htsmain.c
// Insert a command in the argc/argv // Insert a command in the argc/argv

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -67,15 +67,13 @@ static int slot_can_be_cached_on_disk(const lien_back * back);
static int slot_can_be_cleaned(const lien_back * back); static int slot_can_be_cleaned(const lien_back * back);
static int slot_can_be_finalized(httrackp * opt, const lien_back * back); static int slot_can_be_finalized(httrackp * opt, const lien_back * back);
struct_back *back_new(httrackp *opt, int back_max) { struct_back *back_new(int back_max) {
int i; int i;
struct_back *sback = calloct(1, sizeof(struct_back)); struct_back *sback = calloct(1, sizeof(struct_back));
sback->count = back_max; sback->count = back_max;
sback->lnk = (lien_back *) calloct((back_max + 1), sizeof(lien_back)); sback->lnk = (lien_back *) calloct((back_max + 1), sizeof(lien_back));
sback->ready = inthash_new(0); sback->ready = inthash_new(0);
hts_set_hash_handler(sback->ready, opt);
inthash_set_name(sback->ready, "back_new");
sback->ready_size_bytes = 0; sback->ready_size_bytes = 0;
inthash_value_is_malloc(sback->ready, 1); inthash_value_is_malloc(sback->ready, 1);
// init // init
@@ -197,7 +195,7 @@ static int back_index_ready(httrackp * opt, struct_back * sback, char *adr,
char *fileback = (char *) ptr; char *fileback = (char *) ptr;
char catbuff[CATBUFF_SIZE]; char catbuff[CATBUFF_SIZE];
if ((fp = FOPEN(fconv(catbuff, sizeof(catbuff), fileback), "rb")) != NULL) { if ((fp = FOPEN(fconv(catbuff, fileback), "rb")) != NULL) {
if (back_unserialize(fp, &itemback) != 0) { if (back_unserialize(fp, &itemback) != 0) {
if (itemback != NULL) { if (itemback != NULL) {
back_clear_entry(itemback); back_clear_entry(itemback);
@@ -528,7 +526,7 @@ int back_finalize(httrackp * opt, cache_back * cache, struct_back * sback,
if (!back[p].r.is_write) { if (!back[p].r.is_write) {
// do not use tempnam() but a regular filename // do not use tempnam() but a regular filename
if (create_back_tmpfile(opt, &back[p]) == 0) { if (create_back_tmpfile(opt, &back[p]) == 0) {
assertf(back[p].tmpfile != NULL); assert(back[p].tmpfile != NULL);
/* note: tmpfile is utf-8 */ /* note: tmpfile is utf-8 */
back[p].r.out = FOPEN(back[p].tmpfile, "wb"); back[p].r.out = FOPEN(back[p].tmpfile, "wb");
if (back[p].r.out) { if (back[p].r.out) {
@@ -642,7 +640,7 @@ int back_finalize(httrackp * opt, cache_back * cache, struct_back * sback,
fclose(fp); fclose(fp);
fp = NULL; fp = NULL;
// remove (temporary) file! // remove (temporary) file!
UNLINK(fconv(catbuff, sizeof(catbuff), back[p].url_sav)); UNLINK(fconv(catbuff, back[p].url_sav));
} }
if (fp) if (fp)
fclose(fp); fclose(fp);
@@ -666,7 +664,7 @@ int back_finalize(httrackp * opt, cache_back * cache, struct_back * sback,
if (A == NULL) { if (A == NULL) {
int localtime_returned_null = 0; int localtime_returned_null = 0;
assertf(localtime_returned_null); assert(localtime_returned_null);
} }
strftime(s, 250, "%H:%M:%S", A); strftime(s, 250, "%H:%M:%S", A);
@@ -767,27 +765,27 @@ int back_finalize(httrackp * opt, cache_back * cache, struct_back * sback,
} }
} }
if (cache->txt) { if (cache->txt) {
#undef ESC_URL
#define ESC_URL(S) escape_check_url_addr(S, OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt))
fprintf(cache->txt, fprintf(cache->txt,
"%d\t" "%s ('%s')\t" "%s\t" "%s%s\t" "%s%s%s\t%s\t" "%d\t" "%s ('%s')\t" "%s\t" "%s%s\t" "%s%s%s\t%s\t"
"(from %s%s%s)" LF, back[p].r.statuscode, state, "(from %s%s%s)" LF, back[p].r.statuscode, state,
ESC_URL(back[p].r.msg), escape_check_url_addr(OPT_GET_BUFF(opt), back[p].r.msg),
ESC_URL(back[p].r.contenttype), escape_check_url_addr(OPT_GET_BUFF(opt),
((back[p].r.etag[0]) ? "etag:" : ((back[p].r. back[p].r.contenttype),
((back[p].r.
etag[0]) ? "etag:" : ((back[p].r.
lastmodified[0]) ? "date:" : "")), lastmodified[0]) ? "date:" : "")),
ESC_URL((back[p].r.etag[0]) ? back[p].r. escape_check_url_addr(OPT_GET_BUFF(opt),
(back[p].r.etag[0]) ? back[p].r.
etag : (back[p].r.lastmodified)), etag : (back[p].r.lastmodified)),
(link_has_authority(back[p].url_adr) ? "" : "http://"), (link_has_authority(back[p].url_adr) ? "" : "http://"),
ESC_URL(back[p].url_adr), escape_check_url_addr(OPT_GET_BUFF(opt), back[p].url_adr),
ESC_URL(back[p].url_fil), escape_check_url_addr(OPT_GET_BUFF(opt), back[p].url_fil),
ESC_URL(back[p].url_sav), escape_check_url_addr(OPT_GET_BUFF(opt), back[p].url_sav),
(link_has_authority(back[p].referer_adr) (link_has_authority(back[p].referer_adr)
|| !back[p].referer_adr[0]) ? "" : "http://", || !back[p].referer_adr[0]) ? "" : "http://",
ESC_URL(back[p].referer_adr), escape_check_url_addr(OPT_GET_BUFF(opt), back[p].referer_adr),
ESC_URL(back[p].referer_fil) escape_check_url_addr(OPT_GET_BUFF(opt), back[p].referer_fil)
); );
#undef ESC_URL
if (opt->flush) if (opt->flush)
fflush(cache->txt); fflush(cache->txt);
} }
@@ -987,11 +985,11 @@ int back_serialize_ref(httrackp * opt, const lien_back * src) {
if (fp == NULL) { if (fp == NULL) {
#ifdef _WIN32 #ifdef _WIN32
if (mkdir if (mkdir
(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), CACHE_REFNAME)) (fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), CACHE_REFNAME))
== 0) == 0)
#else #else
if (mkdir if (mkdir
(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), CACHE_REFNAME), (fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), CACHE_REFNAME),
S_IRWXU | S_IRWXG | S_IRWXO) == 0) S_IRWXU | S_IRWXG | S_IRWXO) == 0)
#endif #endif
{ {
@@ -1060,7 +1058,7 @@ int back_maydelete(httrackp * opt, cache_back * cache, struct_back * sback,
strcpybuff(back[p].url_adr, tmp.url_adr); strcpybuff(back[p].url_adr, tmp.url_adr);
back[p].ka_time_start = tmp.ka_time_start; back[p].ka_time_start = tmp.ka_time_start;
back[p].status = STATUS_ALIVE; // alive & waiting back[p].status = STATUS_ALIVE; // alive & waiting
assertf(back[p].ka_time_start != 0); assert(back[p].ka_time_start != 0);
hts_log_print(opt, LOG_DEBUG, hts_log_print(opt, LOG_DEBUG,
"(Keep-Alive): successfully saved #%d (%s)", "(Keep-Alive): successfully saved #%d (%s)",
back[p].r.debugid, back[p].url_adr); back[p].r.debugid, back[p].url_adr);
@@ -1114,7 +1112,7 @@ void back_maydeletehttp(httrackp * opt, cache_back * cache, struct_back * sback,
strcpybuff(back[q].url_adr, tmp.url_adr); // address strcpybuff(back[q].url_adr, tmp.url_adr); // address
back[q].ka_time_start = tmp.ka_time_start; back[q].ka_time_start = tmp.ka_time_start;
back[q].status = STATUS_ALIVE; // alive & waiting back[q].status = STATUS_ALIVE; // alive & waiting
assertf(back[q].ka_time_start != 0); assert(back[q].ka_time_start != 0);
hts_log_print(opt, LOG_DEBUG, hts_log_print(opt, LOG_DEBUG,
"(Keep-Alive): successfully preserved #%d (%s)", "(Keep-Alive): successfully preserved #%d (%s)",
back[q].r.debugid, back[q].url_adr); back[q].r.debugid, back[q].url_adr);
@@ -1506,8 +1504,7 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, char *adr,
if (cache->cached_tests != NULL) { if (cache->cached_tests != NULL) {
intptr_t ptr = 0; intptr_t ptr = 0;
if (inthash_read(cache->cached_tests, if (inthash_read(cache->cached_tests, concat(OPT_GET_BUFF(opt), adr, fil), &ptr)) { // gotcha
concat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), adr, fil), &ptr)) { // gotcha
if (ptr != 0) { if (ptr != 0) {
char *text = (char *) ptr; char *text = (char *) ptr;
char *lf = strchr(text, '\n'); char *lf = strchr(text, '\n');
@@ -1574,7 +1571,7 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, char *adr,
if (pos < 0) { // pas de mise en cache data, vérifier existence if (pos < 0) { // pas de mise en cache data, vérifier existence
#endif #endif
/* note: no check with IS_DELAYED_EXT() enabled - postcheck by client please! */ /* note: no check with IS_DELAYED_EXT() enabled - postcheck by client please! */
if (save[0] != '\0' && !IS_DELAYED_EXT(save) && fsize_utf8(fconv(catbuff, sizeof(catbuff), save)) <= 0) { // fichier final n'existe pas ou est vide! if (save[0] != '\0' && !IS_DELAYED_EXT(save) && fsize_utf8(fconv(catbuff, save)) <= 0) { // fichier final n'existe pas ou est vide!
int found = 0; int found = 0;
/* It is possible that the file has been moved due to changes in build structure */ /* It is possible that the file has been moved due to changes in build structure */
@@ -1592,10 +1589,10 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, char *adr,
if (r.is_write && previous_save[0] != '\0') { if (r.is_write && previous_save[0] != '\0') {
/* Exists, but with another (old) filename: rename (almost) silently */ /* Exists, but with another (old) filename: rename (almost) silently */
if (strcmp(previous_save, save) != 0 if (strcmp(previous_save, save) != 0
&& fexist_utf8(fconv(catbuff, sizeof(catbuff), previous_save))) { && fexist_utf8(fconv(catbuff, previous_save))) {
rename(fconv(catbuff, sizeof(catbuff), previous_save), rename(fconv(catbuff, previous_save),
fconv(catbuff2, sizeof(catbuff2), save)); fconv(catbuff2, save));
if (fexist_utf8(fconv(catbuff, sizeof(catbuff), save))) { if (fexist_utf8(fconv(catbuff, save))) {
found = 1; found = 1;
hts_log_print(opt, LOG_DEBUG, hts_log_print(opt, LOG_DEBUG,
"File '%s' has been renamed since last mirror to '%s' ; applying changes", "File '%s' has been renamed since last mirror to '%s' ; applying changes",
@@ -1621,8 +1618,8 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, char *adr,
// sinon, le fichier est ok à priori, mais on renverra un if-modified-since pour // sinon, le fichier est ok à priori, mais on renverra un if-modified-since pour
// en être sûr // en être sûr
if (opt->norecatch) { // tester norecatch if (opt->norecatch) { // tester norecatch
if (!fexist_utf8(fconv(catbuff, sizeof(catbuff), save))) { // fichier existe pas mais déclaré: on l'a effacé if (!fexist_utf8(fconv(catbuff, save))) { // fichier existe pas mais déclaré: on l'a effacé
FILE *fp = FOPEN(fconv(catbuff, sizeof(catbuff), save), "wb"); FILE *fp = FOPEN(fconv(catbuff, save), "wb");
if (fp) if (fp)
fclose(fp); fclose(fp);
@@ -2263,7 +2260,7 @@ void back_clean(httrackp * opt, cache_back * cache, struct_back * sback) {
} else if (back[i].r.keep_alive_max < 1) { } else if (back[i].r.keep_alive_max < 1) {
reason = "keep-alive-max reached"; reason = "keep-alive-max reached";
} else if (time_local() >= back[i].ka_time_start + back[i].r.keep_alive_t) { } else if (time_local() >= back[i].ka_time_start + back[i].r.keep_alive_t) {
assertf(back[i].ka_time_start != 0); assert(back[i].ka_time_start != 0);
snprintf(buffer, sizeof(buffer), "keep-alive timeout = %ds)", snprintf(buffer, sizeof(buffer), "keep-alive timeout = %ds)",
(int) back[i].r.keep_alive_t); (int) back[i].r.keep_alive_t);
reason = buffer; reason = buffer;
@@ -2458,7 +2455,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
#if HTS_WIDE_DEBUG #if HTS_WIDE_DEBUG
DEBUG_W("select\n"); DEBUG_W("select\n");
#endif #endif
select((int) nfds, &fds, &fds_c, &fds_e, &tv); select(nfds, &fds, &fds_c, &fds_e, &tv);
#if HTS_WIDE_DEBUG #if HTS_WIDE_DEBUG
DEBUG_W("select done\n"); DEBUG_W("select done\n");
#endif #endif
@@ -2536,7 +2533,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
back[i].r.ssl_con = SSL_new(openssl_ctx); back[i].r.ssl_con = SSL_new(openssl_ctx);
if (back[i].r.ssl_con) { if (back[i].r.ssl_con) {
SSL_clear(back[i].r.ssl_con); SSL_clear(back[i].r.ssl_con);
if (SSL_set_fd(back[i].r.ssl_con, (int) back[i].r.soc) == 1) { if (SSL_set_fd(back[i].r.ssl_con, back[i].r.soc) == 1) {
SSL_set_connect_state(back[i].r.ssl_con); SSL_set_connect_state(back[i].r.ssl_con);
back[i].status = STATUS_SSL_WAIT_HANDSHAKE; /* handshake wait */ back[i].status = STATUS_SSL_WAIT_HANDSHAKE; /* handshake wait */
} else } else
@@ -2781,10 +2778,10 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
if (back[i].r.compressed && if (back[i].r.compressed &&
/* .gz are *NOT* depacked!! */ /* .gz are *NOT* depacked!! */
(strfield (strfield
(get_ext(catbuff, sizeof(catbuff), back[i].url_sav), "gz") == 0) (get_ext(catbuff, back[i].url_sav), "gz") == 0)
) { ) {
if (create_back_tmpfile(opt, &back[i]) == 0) { if (create_back_tmpfile(opt, &back[i]) == 0) {
assertf(back[i].tmpfile != NULL); assert(back[i].tmpfile != NULL);
/* note: tmpfile is utf-8 */ /* note: tmpfile is utf-8 */
if ((back[i].r.out = if ((back[i].r.out =
FOPEN(back[i].tmpfile, "wb")) == NULL) { FOPEN(back[i].tmpfile, "wb")) == NULL) {
@@ -3659,7 +3656,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
file_notify(opt, back[i].url_adr, back[i].url_fil, file_notify(opt, back[i].url_adr, back[i].url_fil,
back[i].url_sav, 0, 1, back[i].url_sav, 0, 1,
back[i].r.notmodified); back[i].r.notmodified);
back[i].r.out = FOPEN(fconv(catbuff, sizeof(catbuff), back[i].url_sav), "ab"); // append back[i].r.out = FOPEN(fconv(catbuff, back[i].url_sav), "ab"); // append
if (back[i].r.out && opt->cache != 0) { if (back[i].r.out && opt->cache != 0) {
back[i].r.is_write = 1; // écrire back[i].r.is_write = 1; // écrire
back[i].r.size = sz; // déja écrit back[i].r.size = sz; // déja écrit
@@ -3685,7 +3682,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
} }
} else { // mémoire } else { // mémoire
FILE *fp = FILE *fp =
FOPEN(fconv(catbuff, sizeof(catbuff), back[i].url_sav), "rb"); FOPEN(fconv(catbuff, back[i].url_sav), "rb");
if (fp) { if (fp) {
LLint alloc_mem = sz + 1; LLint alloc_mem = sz + 1;

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -68,7 +68,7 @@ typedef struct htsblk htsblk;
#ifdef HTS_INTERNAL_BYTECODE #ifdef HTS_INTERNAL_BYTECODE
// create/destroy // create/destroy
struct_back *back_new(httrackp *opt, int back_max); struct_back *back_new(int back_max);
void back_free(struct_back ** sback); void back_free(struct_back ** sback);
// backing // backing

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -40,7 +40,6 @@ extern "C" {
#include "htsglobal.h" #include "htsglobal.h"
#include "htsstrings.h" #include "htsstrings.h"
#include "htssafe.h"
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
@@ -107,6 +106,230 @@ extern "C" {
#define DynamicGet(handle, sym) dlsym(handle, sym) #define DynamicGet(handle, sym) dlsym(handle, sym)
#endif #endif
// emergency log
typedef void (*t_abortLog) (char *msg, char *file, int line);
extern HTSEXT_API t_abortLog abortLog__;
#define abortLog(a) abortLog__(a, __FILE__, __LINE__)
#define _ ,
#define abortLogFmt(a) do { \
FILE* fp = fopen("CRASH.TXT", "wb"); \
if (!fp) fp = fopen("/tmp/CRASH.TXT", "wb"); \
if (!fp) fp = fopen("C:\\CRASH.TXT", "wb"); \
if (!fp) fp = fopen("\\Temp\\CRASH.TXT", "wb"); \
if (!fp) fp = fopen("\\CRASH.TXT", "wb"); \
if (!fp) fp = fopen("CRASH.TXT", "wb"); \
if (fp) { \
fprintf(fp, "HTTrack " HTTRACK_VERSIONID " closed at '" __FILE__ "', line %d\r\n", __LINE__); \
fprintf(fp, "Reason:\r\n"); \
fprintf(fp, a); \
fprintf(fp, "\r\n"); \
fflush(fp); \
fclose(fp); \
} \
} while(0)
#define assertf(exp) do { \
if (! ( exp ) ) { \
abortLog("assert failed: " #exp); \
if (htsCallbackErr != NULL) { \
htsCallbackErr("assert failed: " #exp, __FILE__ , __LINE__ ); \
} \
abort(); \
} \
} while(0)
/* non-fatal assert */
#define assertnf(exp) do { \
if (! ( exp ) ) { \
abortLog("assert failed: " #exp); \
if (htsCallbackErr != NULL) { \
htsCallbackErr("assert failed: " #exp, __FILE__ , __LINE__ ); \
} \
} \
} while(0)
/* regular malloc's() */
#ifndef HTS_TRACE_MALLOC
#define malloct(A) malloc(A)
#define calloct(A,B) calloc((A), (B))
#define freet(A) do { assertnf((A) != NULL); if ((A) != NULL) { free(A); (A) = NULL; } } while(0)
#define strdupt(A) strdup(A)
#define realloct(A,B) ( ((A) != NULL) ? realloc((A), (B)) : malloc(B) )
#define memcpybuff(A, B, N) memcpy((A), (B), (N))
#else
/* debug version */
#define malloct(A) hts_malloc(A)
#define calloct(A,B) hts_calloc(A,B)
#define strdupt(A) hts_strdup(A)
#define freet(A) do { hts_free(A); (A) = NULL; } while(0)
#define realloct(A,B) hts_realloc(A,B)
void hts_freeall();
void *hts_malloc(size_t);
void *hts_calloc(size_t, size_t);
char *hts_strdup(char *);
void *hts_xmalloc(size_t, size_t);
void hts_free(void *);
void *hts_realloc(void *, size_t);
mlink *hts_find(char *adr);
/* protected memcpy */
#define memcpybuff(A, B, N) do { \
mlink* lnk = hts_find((void*)(A)); \
if (lnk != NULL) { \
assertf(lnk != NULL); \
assertf( * ( (t_htsboundary*) ( ((char*) lnk->adr) - sizeof(htsboundary) ) ) == htsboundary ); \
assertf( * ( (t_htsboundary*) ( ((char*) lnk->adr) + lnk->len ) ) == htsboundary ); \
assertf( ( ((char*)(A)) + (N)) < (char*) (lnk->adr + lnk->len) ); \
} \
memcpy(A, B, N); \
} while(0)
#endif
typedef void (*htsErrorCallback) (char *msg, char *file, int line);
extern HTSEXT_API htsErrorCallback htsCallbackErr;
extern HTSEXT_API int htsMemoryFastXfr;
/*
*/
#define stringdup()
#ifdef STRDEBUG
/* protected strcat, strncat and strcpy - definitely useful */
#define strcatbuff(A, B) do { \
assertf( (A) != NULL ); \
assertf( (B) != NULL ); \
if (htsMemoryFastXfr) { \
if (sizeof(A) != sizeof(char*)) { \
(A)[sizeof(A) - 1] = '\0'; \
} \
strcat(A, B); \
if (sizeof(A) != sizeof(char*)) { \
assertf((A)[sizeof(A) - 1] == '\0'); \
} \
} else { \
unsigned int sz = (unsigned int) strlen(A); \
unsigned int szf = (unsigned int) strlen(B); \
if (sizeof(A) != sizeof(char*)) { \
assertf(sz + szf + 1 < sizeof(A)); \
if (szf > 0) { \
if (sz + szf + 1 < sizeof(A)) { \
memcpy((A) + sz, (B), szf + 1); \
} \
} \
} else if (szf > 0) { \
memcpybuff((A) + sz, (B), szf + 1); \
} \
} \
} while(0)
#define strncatbuff(A, B, N) do { \
assertf( (A) != NULL ); \
assertf( (B) != NULL ); \
if (htsMemoryFastXfr) { \
if (sizeof(A) != sizeof(char*)) { \
(A)[sizeof(A) - 1] = '\0'; \
} \
strncat(A, B, N); \
if (sizeof(A) != sizeof(char*)) { \
assertf((A)[sizeof(A) - 1] == '\0'); \
} \
} else { \
unsigned int sz = (unsigned int) strlen(A); \
unsigned int szf = (unsigned int) strlen(B); \
if (szf > (unsigned int) (N)) szf = (unsigned int) (N); \
if (sizeof(A) != sizeof(char*)) { \
assertf(sz + szf + 1 < sizeof(A)); \
if (szf > 0) { \
if (sz + szf + 1 < sizeof(A)) { \
memcpy((A) + sz, (B), szf); \
* ( (A) + sz + szf) = '\0'; \
} \
} \
} else if (szf > 0) { \
memcpybuff((A) + sz, (B), szf); \
* ( (A) + sz + szf) = '\0'; \
} \
} \
} while(0)
#define strcpybuff(A, B) do { \
assertf( (A) != NULL ); \
assertf( (const char*) (B) != NULL ); \
if (htsMemoryFastXfr) { \
if (sizeof(A) != sizeof(char*)) { \
(A)[sizeof(A) - 1] = '\0'; \
} \
strcpy(A, B); \
if (sizeof(A) != sizeof(char*)) { \
assertf((A)[sizeof(A) - 1] == '\0'); \
} \
} else { \
unsigned int szf = (unsigned int) strlen(B); \
if (sizeof(A) != sizeof(char*)) { \
assertf(szf + 1 < sizeof(A)); \
if (szf > 0) { \
if (szf + 1 < sizeof(A)) { \
memcpy((A), (B), szf + 1); \
} else { \
* (A) = '\0'; \
} \
} else { \
* (A) = '\0'; \
} \
} else { \
memcpybuff((A), (B), szf + 1); \
} \
} \
} while(0)
#else
#ifdef STRDEBUGFAST
/* protected strcat, strncat and strcpy - definitely useful */
#define strcatbuff(A, B) do { \
assertf( (A) != NULL ); \
assertf( (B) != NULL ); \
if (sizeof(A) != sizeof(char*)) { \
(A)[sizeof(A) - 1] = '\0'; \
} \
strcat(A, B); \
if (sizeof(A) != sizeof(char*)) { \
assertf((A)[sizeof(A) - 1] == '\0'); \
} \
} while(0)
#define strncatbuff(A, B, N) do { \
assertf( (A) != NULL ); \
assertf( (B) != NULL ); \
if (sizeof(A) != sizeof(char*)) { \
(A)[sizeof(A) - 1] = '\0'; \
} \
strncat(A, B, N); \
if (sizeof(A) != sizeof(char*)) { \
assertf((A)[sizeof(A) - 1] == '\0'); \
} \
} while(0)
#define strcpybuff(A, B) do { \
assertf( (A) != NULL ); \
assertf( (B) != NULL ); \
if (sizeof(A) != sizeof(char*)) { \
(A)[sizeof(A) - 1] = '\0'; \
} \
strcpy(A, B); \
if (sizeof(A) != sizeof(char*)) { \
assertf((A)[sizeof(A) - 1] == '\0'); \
} \
} while(0)
#else
#define strcatbuff strcat
#define strncatbuff strncat
#define strcpybuff strcpy
#endif
#endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,6 +1,6 @@
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -129,10 +129,10 @@ int cookie_del(t_cookie * cookie, char *cook_name, char *domain, char *path) {
// chk_dom: the domain stored in the cookie (potentially wildcard). // chk_dom: the domain stored in the cookie (potentially wildcard).
// domain: query domain // domain: query domain
static int cookie_cmp_wildcard_domain(char *chk_dom, char *domain) { static int cookie_cmp_wildcard_domain(char *chk_dom, char *domain) {
const size_t n = strlen(chk_dom); int n = strlen(chk_dom);
const size_t m = strlen(domain); int m = strlen(domain);
const size_t l = n < m ? n : m; int l = n < m ? n : m;
size_t i; int i;
for (i = l - 1; i >= 0; i--) { for (i = l - 1; i >= 0; i--) {
if (chk_dom[n - i - 1] != domain[m - i - 1]) { if (chk_dom[n - i - 1] != domain[m - i - 1]) {
return 1; return 1;
@@ -222,7 +222,7 @@ int cookie_load(t_cookie * cookie, const char *fpath, const char *name) {
do { do {
if (!(find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) if (!(find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
if (!(find.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) { if (!(find.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) {
FILE *fp = fopen(fconcat(catbuff, sizeof(catbuff), fpath, find.cFileName), "rb"); FILE *fp = fopen(fconcat(catbuff, fpath, find.cFileName), "rb");
if (fp) { if (fp) {
char cook_name[256]; char cook_name[256];
@@ -264,7 +264,7 @@ int cookie_load(t_cookie * cookie, const char *fpath, const char *name) {
} }
fclose(fp); fclose(fp);
if (cookie_merged) if (cookie_merged)
remove(fconcat(catbuff, sizeof(catbuff), fpath, find.cFileName)); remove(fconcat(catbuff, fpath, find.cFileName));
} // if fp } // if fp
} }
} while(FindNextFileA(h, &find)); } while(FindNextFileA(h, &find));
@@ -275,7 +275,7 @@ int cookie_load(t_cookie * cookie, const char *fpath, const char *name) {
// Ensuite, cookies.txt // Ensuite, cookies.txt
{ {
FILE *fp = fopen(fconcat(catbuff, sizeof(catbuff), fpath, name), "rb"); FILE *fp = fopen(fconcat(catbuff, fpath, name), "rb");
if (fp) { if (fp) {
char BIGSTK line[8192]; char BIGSTK line[8192];
@@ -316,7 +316,7 @@ int cookie_save(t_cookie * cookie, char *name) {
if (strnotempty(cookie->data)) { if (strnotempty(cookie->data)) {
char BIGSTK line[8192]; char BIGSTK line[8192];
FILE *fp = fopen(fconv(catbuff, sizeof(catbuff), name), "wb"); FILE *fp = fopen(fconv(catbuff, name), "wb");
if (fp) { if (fp) {
char *a = cookie->data; char *a = cookie->data;

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -147,7 +147,7 @@ void cache_mayadd(httrackp * opt, cache_back * cache, htsblk * r,
// cached "fast" header doesn't yet exists // cached "fast" header doesn't yet exists
if (inthash_read if (inthash_read
(cache->cached_tests, (cache->cached_tests,
concat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), url_adr, url_fil), NULL) == 0) { concat(OPT_GET_BUFF(opt), url_adr, url_fil), NULL) == 0) {
char BIGSTK tempo[HTS_URLMAXSIZE * 2]; char BIGSTK tempo[HTS_URLMAXSIZE * 2];
sprintf(tempo, "%d", (int) r->statuscode); sprintf(tempo, "%d", (int) r->statuscode);
@@ -159,7 +159,7 @@ void cache_mayadd(httrackp * opt, cache_back * cache, htsblk * r,
"Cached fast-header response: %s%s is %d", "Cached fast-header response: %s%s is %d",
url_adr, url_fil, (int) r->statuscode); url_adr, url_fil, (int) r->statuscode);
inthash_add(cache->cached_tests, inthash_add(cache->cached_tests,
concat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), url_adr, url_fil), concat(OPT_GET_BUFF(opt), url_adr, url_fil),
(intptr_t) strdupt(tempo)); (intptr_t) strdupt(tempo));
} }
} }
@@ -366,10 +366,10 @@ void cache_add(httrackp * opt, cache_back * cache, const htsblk * r,
FILE *fp; FILE *fp;
// On recopie le fichier->. // On recopie le fichier->.
off_t file_size = fsize_utf8(fconv(catbuff, sizeof(catbuff), url_save)); off_t file_size = fsize_utf8(fconv(catbuff, url_save));
if (file_size >= 0) { if (file_size >= 0) {
fp = FOPEN(fconv(catbuff, sizeof(catbuff), url_save), "rb"); fp = FOPEN(fconv(catbuff, url_save), "rb");
if (fp != NULL) { if (fp != NULL) {
char BIGSTK buff[32768]; char BIGSTK buff[32768];
size_t nl; size_t nl;
@@ -751,7 +751,7 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
/* Ensure the file is present, because returning a reference to a missing file is useless! */ /* Ensure the file is present, because returning a reference to a missing file is useless! */
if (!dataincache) { /* Data are supposed to be on disk */ if (!dataincache) { /* Data are supposed to be on disk */
if (!fexist_utf8(fconv(catbuff, sizeof(catbuff), previous_save))) { // un fichier existe déja if (!fexist_utf8(fconv(catbuff, previous_save))) { // un fichier existe déja
if (!opt->norecatch) { if (!opt->norecatch) {
hts_log_print(opt, LOG_DEBUG, "Cache: could not find %s", hts_log_print(opt, LOG_DEBUG, "Cache: could not find %s",
previous_save); previous_save);
@@ -775,10 +775,10 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
r.msg[0] = '\0'; r.msg[0] = '\0';
// File exists on disk with declared cache name (this is expected!) // File exists on disk with declared cache name (this is expected!)
if (fexist_utf8(fconv(catbuff, sizeof(catbuff), previous_save))) { // un fichier existe déja if (fexist_utf8(fconv(catbuff, previous_save))) { // un fichier existe déja
// Expected size ? // Expected size ?
const size_t fsize = const size_t fsize =
fsize_utf8(fconv(catbuff, sizeof(catbuff), previous_save)); fsize_utf8(fconv(catbuff, previous_save));
if (fsize == r.size) { if (fsize == r.size) {
// Target name is the previous name, and the file looks good: nothing to do! // Target name is the previous name, and the file looks good: nothing to do!
if (strcmp(previous_save, target_save) == 0) { if (strcmp(previous_save, target_save) == 0) {
@@ -790,8 +790,8 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
char catbuff2[CATBUFF_SIZE]; char catbuff2[CATBUFF_SIZE];
if (RENAME if (RENAME
(fconv(catbuff, sizeof(catbuff), previous_save), (fconv(catbuff, previous_save),
fconv(catbuff2, sizeof(catbuff2), target_save)) == 0) { fconv(catbuff2, target_save)) == 0) {
// So far so good // So far so good
ok = 1; // plus rien à faire ok = 1; // plus rien à faire
@@ -812,9 +812,9 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
} }
// File exists with the target name and not previous one ? // File exists with the target name and not previous one ?
// Suppose a broken mirror, with a file being renamed: OK // Suppose a broken mirror, with a file being renamed: OK
else if (fexist_utf8(fconv(catbuff, sizeof(catbuff), target_save))) { else if (fexist_utf8(fconv(catbuff, target_save))) {
// Expected size ? // Expected size ?
const size_t fsize = fsize_utf8(fconv(catbuff, sizeof(catbuff), target_save)); const size_t fsize = fsize_utf8(fconv(catbuff, target_save));
if (fsize == r.size) { if (fsize == r.size) {
// So far so good // So far so good
@@ -927,7 +927,7 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
"Previous cache file not found (empty filename)"); "Previous cache file not found (empty filename)");
} }
} else { /* Read in memory from disk */ } else { /* Read in memory from disk */
FILE *const fp = FOPEN(fconv(catbuff, sizeof(catbuff), previous_save), "rb"); FILE *const fp = FOPEN(fconv(catbuff, previous_save), "rb");
if (fp != NULL) { if (fp != NULL) {
r.adr = (char *) malloct((int) r.size + 4); r.adr = (char *) malloct((int) r.size + 4);
@@ -1159,7 +1159,7 @@ static htsblk cache_readex_old(httrackp * opt, cache_back * cache,
int ok = 0; int ok = 0;
r.is_write = 1; // écrire r.is_write = 1; // écrire
if (fexist_utf8(fconv(catbuff, sizeof(catbuff), save))) { // un fichier existe déja if (fexist_utf8(fconv(catbuff, save))) { // un fichier existe déja
//if (fsize_utf8(fconv(save))==r.size) { // même taille -- NON tant pis (taille mal declaree) //if (fsize_utf8(fconv(save))==r.size) { // même taille -- NON tant pis (taille mal declaree)
ok = 1; // plus rien à faire ok = 1; // plus rien à faire
filenote(&opt->state.strc, save, NULL); // noter comme connu filenote(&opt->state.strc, save, NULL); // noter comme connu
@@ -1229,7 +1229,7 @@ static htsblk cache_readex_old(httrackp * opt, cache_back * cache,
strcpybuff(r.msg, "Previous cache file not found (2)"); strcpybuff(r.msg, "Previous cache file not found (2)");
} else { /* Read in memory from cache */ } else { /* Read in memory from cache */
if (strnotempty(return_save) && fexist_utf8(return_save)) { if (strnotempty(return_save) && fexist_utf8(return_save)) {
FILE *fp = FOPEN(fconv(catbuff, sizeof(catbuff), return_save), "rb"); FILE *fp = FOPEN(fconv(catbuff, return_save), "rb");
if (fp != NULL) { if (fp != NULL) {
r.adr = (char *) malloct((size_t) r.size + 4); r.adr = (char *) malloct((size_t) r.size + 4);
@@ -1397,7 +1397,7 @@ void cache_init(cache_back * cache, httrackp * opt) {
// --- // ---
// utilisation du cache: renommer ancien éventuel et charger index // utilisation du cache: renommer ancien éventuel et charger index
hts_log_print(opt, LOG_DEBUG, "Cache: enabled=%d, base=%s, ro=%d", hts_log_print(opt, LOG_DEBUG, "Cache: enabled=%d, base=%s, ro=%d",
(int) opt->cache, fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (int) opt->cache, fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/"), (int) cache->ro); "hts-cache/"), (int) cache->ro);
if (opt->cache) { if (opt->cache) {
@@ -1406,40 +1406,40 @@ void cache_init(cache_back * cache, httrackp * opt) {
#endif #endif
if (!cache->ro) { if (!cache->ro) {
#ifdef _WIN32 #ifdef _WIN32
mkdir(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache")); mkdir(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache"));
#else #else
mkdir(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache"), mkdir(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache"),
HTS_PROTECT_FOLDER); HTS_PROTECT_FOLDER);
#endif #endif
if ((fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.zip")))) { // il existe déja un cache précédent.. renommer if ((fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/new.zip")))) { // il existe déja un cache précédent.. renommer
/* Previous cache from the previous cache version */ /* Previous cache from the previous cache version */
#if 0 #if 0
/* No.. reuse with old httrack releases! */ /* No.. reuse with old httrack releases! */
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat"))) "hts-cache/old.dat")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat")); "hts-cache/old.dat"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx"))) "hts-cache/old.ndx")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx")); "hts-cache/old.ndx"));
#endif #endif
/* Previous cache version */ /* Previous cache version */
if ((fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.dat"))) && (fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.ndx")))) { // il existe déja un cache précédent.. renommer if ((fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/new.dat"))) && (fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/new.ndx")))) { // il existe déja un cache précédent.. renommer
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/new.dat"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/old.dat")); "hts-cache/old.dat"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/new.ndx"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/old.ndx")); "hts-cache/old.ndx"));
} }
@@ -1447,11 +1447,11 @@ void cache_init(cache_back * cache, httrackp * opt) {
/* Remove OLD cache */ /* Remove OLD cache */
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip"))) { "hts-cache/old.zip"))) {
if (remove if (remove
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip")) != 0) { "hts-cache/old.zip")) != 0) {
hts_log_print(opt, LOG_WARNING | LOG_ERRNO, hts_log_print(opt, LOG_WARNING | LOG_ERRNO,
"Cache: error while moving previous cache"); "Cache: error while moving previous cache");
@@ -1461,8 +1461,8 @@ void cache_init(cache_back * cache, httrackp * opt) {
/* Rename */ /* Rename */
if (hts_rename if (hts_rename
(opt, (opt,
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/new.zip"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/old.zip")) != 0) { "hts-cache/old.zip")) != 0) {
hts_log_print(opt, LOG_WARNING | LOG_ERRNO, hts_log_print(opt, LOG_WARNING | LOG_ERRNO,
@@ -1470,33 +1470,33 @@ void cache_init(cache_back * cache, httrackp * opt) {
} else { } else {
hts_log_print(opt, LOG_DEBUG, "Cache: successfully renamed"); hts_log_print(opt, LOG_DEBUG, "Cache: successfully renamed");
} }
} else if ((fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.dat"))) && (fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.ndx")))) { // il existe déja un cache précédent.. renommer } else if ((fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/new.dat"))) && (fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/new.ndx")))) { // il existe déja un cache précédent.. renommer
#if DEBUGCA #if DEBUGCA
printf("work with former cache\n"); printf("work with former cache\n");
#endif #endif
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat"))) "hts-cache/old.dat")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat")); "hts-cache/old.dat"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx"))) "hts-cache/old.ndx")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx")); "hts-cache/old.ndx"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/new.dat"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/old.dat")); "hts-cache/old.dat"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/new.ndx"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/old.ndx")); "hts-cache/old.ndx"));
} else { // un des deux (ou les deux) fichiers cache absents: effacer l'autre éventuel } else { // un des deux (ou les deux) fichiers cache absents: effacer l'autre éventuel
@@ -1505,17 +1505,17 @@ void cache_init(cache_back * cache, httrackp * opt) {
#endif #endif
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat"))) "hts-cache/new.dat")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat")); "hts-cache/new.dat"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx"))) "hts-cache/new.ndx")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx")); "hts-cache/new.ndx"));
} }
} else { } else {
@@ -1524,30 +1524,30 @@ void cache_init(cache_back * cache, httrackp * opt) {
hts_log_print(opt, LOG_DEBUG, "Cache: size %d", hts_log_print(opt, LOG_DEBUG, "Cache: size %d",
(int) (int)
fsize(fconcat fsize(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip"))); "hts-cache/old.zip")));
// charger index cache précédent // charger index cache précédent
if ((!cache->ro if ((!cache->ro
&& &&
fsize(fconcat fsize(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip")) > 0) "hts-cache/old.zip")) > 0)
|| (cache->ro || (cache->ro
&& &&
fsize(fconcat fsize(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip")) > 0) "hts-cache/new.zip")) > 0)
) { ) {
if (!cache->ro) { if (!cache->ro) {
cache->zipInput = cache->zipInput =
unzOpen(fconcat unzOpen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip")); "hts-cache/old.zip"));
} else { } else {
cache->zipInput = cache->zipInput =
unzOpen(fconcat unzOpen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip")); "hts-cache/new.zip"));
} }
@@ -1559,25 +1559,25 @@ void cache_init(cache_back * cache, httrackp * opt) {
if (!cache->ro) { if (!cache->ro) {
name = name =
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip"); "hts-cache/old.zip");
} else { } else {
name = name =
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip"); "hts-cache/new.zip");
} }
hts_log_print(opt, LOG_WARNING, hts_log_print(opt, LOG_WARNING,
"Cache: damaged cache, trying to repair"); "Cache: damaged cache, trying to repair");
if (unzRepair if (unzRepair
(name, (name,
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/repair.zip"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/repair.zip"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/repair.tmp"), "hts-cache/repair.tmp"),
&repaired, &repairedBytes) == Z_OK) { &repaired, &repairedBytes) == Z_OK) {
unlink(name); unlink(name);
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/repair.zip"), name); "hts-cache/repair.zip"), name);
cache->zipInput = unzOpen(name); cache->zipInput = unzOpen(name);
hts_log_print(opt, LOG_WARNING, hts_log_print(opt, LOG_WARNING,
@@ -1679,20 +1679,20 @@ void cache_init(cache_back * cache, httrackp * opt) {
if ((!cache->ro if ((!cache->ro
&& &&
fsize(fconcat fsize(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat")) >= 0 "hts-cache/old.dat")) >= 0
&& &&
fsize(fconcat fsize(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx")) > 0) "hts-cache/old.ndx")) > 0)
|| (cache->ro || (cache->ro
&& &&
fsize(fconcat fsize(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat")) >= 0 "hts-cache/new.dat")) >= 0
&& &&
fsize(fconcat fsize(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx")) > 0) "hts-cache/new.ndx")) > 0)
) { ) {
FILE *oldndx = NULL; FILE *oldndx = NULL;
@@ -1703,20 +1703,20 @@ void cache_init(cache_back * cache, httrackp * opt) {
if (!cache->ro) { if (!cache->ro) {
cache->olddat = cache->olddat =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat"), "rb"); "hts-cache/old.dat"), "rb");
oldndx = oldndx =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx"), "rb"); "hts-cache/old.ndx"), "rb");
} else { } else {
cache->olddat = cache->olddat =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat"), "rb"); "hts-cache/new.dat"), "rb");
oldndx = oldndx =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx"), "rb"); "hts-cache/new.ndx"), "rb");
} }
// les deux doivent être ouvrables // les deux doivent être ouvrables
@@ -1738,20 +1738,20 @@ void cache_init(cache_back * cache, httrackp * opt) {
if (!cache->ro) { if (!cache->ro) {
buffl = buffl =
fsize(fconcat fsize(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx")); "hts-cache/old.ndx"));
cache->use = cache->use =
readfile(fconcat readfile(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx")); "hts-cache/old.ndx"));
} else { } else {
buffl = buffl =
fsize(fconcat fsize(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx")); "hts-cache/new.ndx"));
cache->use = cache->use =
readfile(fconcat readfile(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx")); "hts-cache/new.ndx"));
} }
if (cache->use != NULL) { if (cache->use != NULL) {
@@ -1822,7 +1822,7 @@ void cache_init(cache_back * cache, httrackp * opt) {
} }
} else { } else {
hts_log_print(opt, LOG_DEBUG, "Cache: no cache found in %s", hts_log_print(opt, LOG_DEBUG, "Cache: no cache found in %s",
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/")); "hts-cache/"));
} }
@@ -1832,39 +1832,39 @@ void cache_init(cache_back * cache, httrackp * opt) {
if (!cache->ro) { if (!cache->ro) {
// ouvrir caches actuels // ouvrir caches actuels
structcheck(fconcat structcheck(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/")); (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/"));
if (1) { if (1) {
/* Create ZIP file cache */ /* Create ZIP file cache */
cache->zipOutput = cache->zipOutput =
(void *) (void *)
zipOpen(fconcat zipOpen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip"), 0); "hts-cache/new.zip"), 0);
if (cache->zipOutput != NULL) { if (cache->zipOutput != NULL) {
// supprimer old.lst // supprimer old.lst
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.lst"))) "hts-cache/old.lst")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.lst")); "hts-cache/old.lst"));
// renommer // renommer
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.lst"))) "hts-cache/new.lst")))
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.lst"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/new.lst"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/old.lst")); "hts-cache/old.lst"));
// ouvrir // ouvrir
cache->lst = cache->lst =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.lst"), "wb"); "hts-cache/new.lst"), "wb");
strcpybuff(opt->state.strc.path, StringBuff(opt->path_html)); strcpybuff(opt->state.strc.path, StringBuff(opt->path_html));
opt->state.strc.lst = cache->lst; opt->state.strc.lst = cache->lst;
@@ -1878,25 +1878,25 @@ void cache_init(cache_back * cache, httrackp * opt) {
// supprimer old.txt // supprimer old.txt
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.txt"))) "hts-cache/old.txt")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.txt")); "hts-cache/old.txt"));
// renommer // renommer
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.txt"))) "hts-cache/new.txt")))
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.txt"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/new.txt"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/old.txt")); "hts-cache/old.txt"));
// ouvrir // ouvrir
cache->txt = cache->txt =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.txt"), "wb"); "hts-cache/new.txt"), "wb");
if (cache->txt) { if (cache->txt) {
fprintf(cache->txt, fprintf(cache->txt,
@@ -1909,11 +1909,11 @@ void cache_init(cache_back * cache, httrackp * opt) {
} else { } else {
cache->dat = cache->dat =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat"), "wb"); "hts-cache/new.dat"), "wb");
cache->ndx = cache->ndx =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx"), "wb"); "hts-cache/new.ndx"), "wb");
// les deux doivent être ouvrables // les deux doivent être ouvrables
if ((cache->dat == NULL) && (cache->ndx != NULL)) { if ((cache->dat == NULL) && (cache->ndx != NULL)) {
@@ -1940,25 +1940,25 @@ void cache_init(cache_back * cache, httrackp * opt) {
// supprimer old.lst // supprimer old.lst
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.lst"))) "hts-cache/old.lst")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.lst")); "hts-cache/old.lst"));
// renommer // renommer
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.lst"))) "hts-cache/new.lst")))
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.lst"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/new.lst"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/old.lst")); "hts-cache/old.lst"));
// ouvrir // ouvrir
cache->lst = cache->lst =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.lst"), "wb"); "hts-cache/new.lst"), "wb");
strcpybuff(opt->state.strc.path, StringBuff(opt->path_html)); strcpybuff(opt->state.strc.path, StringBuff(opt->path_html));
opt->state.strc.lst = cache->lst; opt->state.strc.lst = cache->lst;
@@ -1972,25 +1972,25 @@ void cache_init(cache_back * cache, httrackp * opt) {
// supprimer old.txt // supprimer old.txt
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.txt"))) "hts-cache/old.txt")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.txt")); "hts-cache/old.txt"));
// renommer // renommer
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.txt"))) "hts-cache/new.txt")))
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.txt"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/new.txt"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/old.txt")); "hts-cache/old.txt"));
// ouvrir // ouvrir
cache->txt = cache->txt =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.txt"), "wb"); "hts-cache/new.txt"), "wb");
if (cache->txt) { if (cache->txt) {
fprintf(cache->txt, fprintf(cache->txt,
@@ -2030,7 +2030,7 @@ char *readfile2(char *fil, LLint * size) {
if (len >= 0) { // exists if (len >= 0) { // exists
FILE *fp; FILE *fp;
fp = fopen(fconv(catbuff, sizeof(catbuff), fil), "rb"); fp = fopen(fconv(catbuff, fil), "rb");
if (fp != NULL) { // n'existe pas (!) if (fp != NULL) { // n'existe pas (!)
adr = (char *) malloct(len + 1); adr = (char *) malloct(len + 1);
if (size != NULL) if (size != NULL)
@@ -2055,7 +2055,7 @@ char *readfile_utf8(char *fil) {
const off_t len = fsize_utf8(fil); const off_t len = fsize_utf8(fil);
if (len >= 0) { // exists if (len >= 0) { // exists
FILE *const fp = FOPEN(fconv(catbuff, sizeof(catbuff), fil), "rb"); FILE *const fp = FOPEN(fconv(catbuff, fil), "rb");
if (fp != NULL) { // n'existe pas (!) if (fp != NULL) { // n'existe pas (!)
adr = (char *) malloct(len + 1); adr = (char *) malloct(len + 1);
@@ -2080,7 +2080,7 @@ char *readfile_or(char *fil, char *defaultdata) {
char catbuff[CATBUFF_SIZE]; char catbuff[CATBUFF_SIZE];
if (!fexist(fil)) if (!fexist(fil))
realfile = fconcat(catbuff, sizeof(catbuff), hts_rootdir(NULL), fil); realfile = fconcat(catbuff, hts_rootdir(NULL), fil);
ret = readfile(realfile); ret = readfile(realfile);
if (ret) if (ret)
return ret; return ret;

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -43,6 +43,12 @@ Please visit our Website: http://www.httrack.com
// Fonctions // Fonctions
void socinput(T_SOC soc, char *s, int max); void socinput(T_SOC soc, char *s, int max);
#ifndef HTTRACK_DEFLIB
HTSEXT_API T_SOC catch_url_init_std(int *port_prox, char *adr_prox);
HTSEXT_API T_SOC catch_url_init(int *port, char *adr);
HTSEXT_API int catch_url(T_SOC soc, char *url, char *method, char *data);
#endif
#define CATCH_RESPONSE \ #define CATCH_RESPONSE \
"HTTP/1.0 200 OK\r\n"\ "HTTP/1.0 200 OK\r\n"\
"Content-type: text/html\r\n"\ "Content-type: text/html\r\n"\

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -33,7 +33,8 @@ Please visit our Website: http://www.httrack.com
#include "htscharset.h" #include "htscharset.h"
#include "htsbase.h" #include "htsbase.h"
#include "punycode.h" #include "punycode.h"
#include "htssafe.h"
#include <assert.h>
int hts_isStringAscii(const char *s, size_t size) { int hts_isStringAscii(const char *s, size_t size) {
size_t i; size_t i;
@@ -414,7 +415,7 @@ static char* hts_codepageToUTF8(const char *codepage, const char *s) {
if (dest != NULL) { if (dest != NULL) {
const size_t len = hts_writeUTF8(uc, &dest[k], MAX_UTF); const size_t len = hts_writeUTF8(uc, &dest[k], MAX_UTF);
k += len; k += len;
assertf(k < capa); assert(k < capa);
} }
} }
dest[k] = '\0'; dest[k] = '\0';
@@ -725,9 +726,9 @@ static unsigned int nlz8(unsigned char x) {
*/ */
#define ADD_SEQ(UC, BITS, EMITTER) do { \ #define ADD_SEQ(UC, BITS, EMITTER) do { \
/* number of data bits in first octet */ \ /* number of data bits in first octet */ \
const unsigned int bits = BITS % 6; \ const int bits = BITS % 6; \
/* shift for first octet */ \ /* shift for first octet */ \
const unsigned int shift0 = BITS - bits; \ const int shift0 = BITS - bits; \
/* first octet */ \ /* first octet */ \
const unsigned char lead = \ const unsigned char lead = \
/* leading bits */ \ /* leading bits */ \
@@ -981,7 +982,7 @@ char *hts_convertStringUTF8ToIDNA(const char *s, size_t size) {
#undef WR #undef WR
/* copy character */ /* copy character */
assertf(segOutputSize < segSize); assert(segOutputSize < segSize);
segInt[segOutputSize++] = uc; segInt[segOutputSize++] = uc;
/* not anymore in sequence */ /* not anymore in sequence */
@@ -990,7 +991,7 @@ char *hts_convertStringUTF8ToIDNA(const char *s, size_t size) {
/* ascii ? */ /* ascii ? */
if (c < 0x80) { if (c < 0x80) {
assertf(segOutputSize < segSize); assert(segOutputSize < segSize);
segInt[segOutputSize] = c; segInt[segOutputSize] = c;
if (c != 0) { if (c != 0) {
segOutputSize++; segOutputSize++;

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,128 +0,0 @@
/* ------------------------------------------------------------ */
/*
HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Important notes:
- We hereby ask people using this source NOT to use it in purpose of grabbing
emails addresses, or collecting any other private information on persons.
This would disgrace our work, and spoil the many hours we spent on it.
Please visit our Website: http://www.httrack.com
*/
/* ------------------------------------------------------------ */
/* File: Subroutines */
/* Author: Xavier Roche */
/* ------------------------------------------------------------ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "httrack.h"
#include "httrack-library.h"
// concat, concatène deux chaines et renvoi le résultat
// permet d'alléger grandement le code
#undef concat
HTSEXT_API char *concat(char *catbuff, size_t size, const char *a, const char *b) {
size_t max = 0;
RUNTIME_TIME_CHECK_SIZE(size);
catbuff[0] = '\0';
if (a != NULL && a[0] != '\0') {
max += strlen(a);
if (max + 1 >= size) {
return catbuff;
}
strcat(catbuff, a);
}
if (b != NULL && b[0] != '\0') {
max += strlen(b);
if (max + 1 >= size) {
return catbuff;
}
strcat(catbuff, b);
}
return catbuff;
}
// conversion fichier / -> antislash
static char *__fconv(char *a) {
#if HTS_DOSNAME
int i;
for(i = 0; a[i] != 0; i++)
if (a[i] == '/') // Unix-to-DOS style
a[i] = '\\';
#endif
return a;
}
#undef fconcat
#undef concat
HTSEXT_API char *fconcat(char *catbuff, size_t size, const char *a, const char *b) {
RUNTIME_TIME_CHECK_SIZE(size);
return __fconv(concat(catbuff, size, a, b));
}
#undef fconv
HTSEXT_API char *fconv(char *catbuff, size_t size, const char *a) {
RUNTIME_TIME_CHECK_SIZE(size);
return __fconv(concat(catbuff, size, a, ""));
}
/* / et \\ en / */
static char *__fslash(char *a) {
int i;
for(i = 0; a[i] != 0; i++)
if (a[i] == '\\') // convertir
a[i] = '/';
return a;
}
#undef fslash
char *fslash(char *catbuff, size_t size, const char *a) {
RUNTIME_TIME_CHECK_SIZE(size);
return __fslash(concat(catbuff, size, a, NULL));
}
// extension : html,gif..
HTSEXT_API char *get_ext(char *catbuff, size_t size, const char *fil) {
size_t i, last;
RUNTIME_TIME_CHECK_SIZE(size);
for(i = 0, last = 0 ; fil[i] != '\0' && fil[i] != '?' ; i++) {
if (fil[i] == '.') {
last = i + 1;
}
}
if (last != 0 && i > last) {
const size_t len = i - last;
if (len < size) {
catbuff[0] = '\0';
strncat(catbuff, &fil[last], size);
return catbuff;
}
}
return "";
}

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -162,7 +162,7 @@ RUN_CALLBACK0(opt, end); \
if (opt->log != NULL) fflush(opt->log); \ if (opt->log != NULL) fflush(opt->log); \
if (makestat_fp) { fclose(makestat_fp); makestat_fp=NULL; } \ if (makestat_fp) { fclose(makestat_fp); makestat_fp=NULL; } \
if (maketrack_fp){ fclose(maketrack_fp); maketrack_fp=NULL; } \ if (maketrack_fp){ fclose(maketrack_fp); maketrack_fp=NULL; } \
if (opt->accept_cookie) cookie_save(opt->cookie,fconcat(OPT_GET_BUFF(opt),OPT_GET_BUFF_SIZE(opt),StringBuff(opt->path_log),"cookies.txt")); \ if (opt->accept_cookie) cookie_save(opt->cookie,fconcat(OPT_GET_BUFF(opt),StringBuff(opt->path_log),"cookies.txt")); \
if (makeindex_fp) { fclose(makeindex_fp); makeindex_fp=NULL; } \ if (makeindex_fp) { fclose(makeindex_fp); makeindex_fp=NULL; } \
if (cache_hashtable) { inthash_delete(&cache_hashtable); } \ if (cache_hashtable) { inthash_delete(&cache_hashtable); } \
if (cache_tests) { inthash_delete(&cache_tests); } \ if (cache_tests) { inthash_delete(&cache_tests); } \
@@ -236,7 +236,8 @@ if (makeindex_fp) { \
char BIGSTK tempo[1024]; \ char BIGSTK tempo[1024]; \
if (makeindex_links == 1) { \ if (makeindex_links == 1) { \
char BIGSTK link_escaped[HTS_URLMAXSIZE*2]; \ char BIGSTK link_escaped[HTS_URLMAXSIZE*2]; \
escape_uri_utf(makeindex_firstlink, link_escaped, sizeof(link_escaped)); \ strcpybuff(link_escaped, makeindex_firstlink); \
escape_uri_utf(link_escaped); \
sprintf(tempo,"<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=%s\">"CRLF, link_escaped); \ sprintf(tempo,"<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=%s\">"CRLF, link_escaped); \
} else \ } else \
tempo[0]='\0'; \ tempo[0]='\0'; \
@@ -247,7 +248,7 @@ if (makeindex_fp) { \
fflush(makeindex_fp); \ fflush(makeindex_fp); \
fclose(makeindex_fp); /* à ne pas oublier sinon on passe une nuit blanche */ \ fclose(makeindex_fp); /* à ne pas oublier sinon on passe une nuit blanche */ \
makeindex_fp=NULL; \ makeindex_fp=NULL; \
usercommand(opt,0,NULL,fconcat(OPT_GET_BUFF(opt),OPT_GET_BUFF_SIZE(opt),StringBuff(opt->path_html_utf8),"index.html"),"",""); \ usercommand(opt,0,NULL,fconcat(OPT_GET_BUFF(opt),StringBuff(opt->path_html_utf8),"index.html"),"",""); \
} \ } \
} \ } \
makeindex_done=1; /* ok c'est fait */ \ makeindex_done=1; /* ok c'est fait */ \
@@ -368,15 +369,15 @@ int httpmirror(char *url1, httrackp * opt) {
// et templates html // et templates html
template_header = template_header =
readfile_or(fconcat readfile_or(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_bin), (OPT_GET_BUFF(opt), StringBuff(opt->path_bin),
"templates/index-header.html"), HTS_INDEX_HEADER); "templates/index-header.html"), HTS_INDEX_HEADER);
template_body = template_body =
readfile_or(fconcat readfile_or(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_bin), (OPT_GET_BUFF(opt), StringBuff(opt->path_bin),
"templates/index-body.html"), HTS_INDEX_BODY); "templates/index-body.html"), HTS_INDEX_BODY);
template_footer = template_footer =
readfile_or(fconcat readfile_or(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_bin), (OPT_GET_BUFF(opt), StringBuff(opt->path_bin),
"templates/index-footer.html"), HTS_INDEX_FOOTER); "templates/index-footer.html"), HTS_INDEX_FOOTER);
// initialiser mimedefs // initialiser mimedefs
@@ -401,10 +402,6 @@ int httpmirror(char *url1, httrackp * opt) {
XH_extuninit; XH_extuninit;
return 0; return 0;
} }
hts_set_hash_handler(cache_hashtable, opt);
hts_set_hash_handler(cache_tests, opt);
inthash_set_name(cache_hashtable, "cache_hashtable");
inthash_set_name(cache_tests, "cache_tests");
inthash_value_is_malloc(cache_tests, 1); /* malloc */ inthash_value_is_malloc(cache_tests, 1); /* malloc */
cache.hashtable = (void *) cache_hashtable; /* copy backcache hash */ cache.hashtable = (void *) cache_hashtable; /* copy backcache hash */
cache.cached_tests = (void *) cache_tests; /* copy of cache_tests */ cache.cached_tests = (void *) cache_tests; /* copy of cache_tests */
@@ -449,7 +446,7 @@ int httpmirror(char *url1, httrackp * opt) {
lien_tot = 0; lien_tot = 0;
// initialiser hachage // initialiser hachage
hash_init(opt, &hash, opt->urlhack); hash_init(&hash, opt->urlhack);
// note: we need a cast because of the const // note: we need a cast because of the const
hash.liens = (const lien_url **) liens; hash.liens = (const lien_url **) liens;
@@ -631,8 +628,8 @@ int httpmirror(char *url1, httrackp * opt) {
// lien primaire // lien primaire
liens_record("primary", "/primary", liens_record("primary", "/primary",
fslash(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), fslash(OPT_GET_BUFF(opt),
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_html_utf8), "index.html")), StringBuff(opt->path_html_utf8), "index.html")),
"", "", opt->urlhack); "", "", opt->urlhack);
if (liens[lien_tot] == NULL) { // erreur, pas de place réservée if (liens[lien_tot] == NULL) { // erreur, pas de place réservée
@@ -654,11 +651,15 @@ int httpmirror(char *url1, httrackp * opt) {
// Initialiser cache // Initialiser cache
{ {
int backupXFR = htsMemoryFastXfr;
opt->state._hts_in_html_parsing = 4; opt->state._hts_in_html_parsing = 4;
if (!RUN_CALLBACK7(opt, loop, NULL, 0, 0, 0, lien_tot, 0, NULL)) { if (!RUN_CALLBACK7(opt, loop, NULL, 0, 0, 0, lien_tot, 0, NULL)) {
opt->state.exit_xh = 1; // exit requested opt->state.exit_xh = 1; // exit requested
} }
htsMemoryFastXfr = 1; /* fast load */
cache_init(&cache, opt); cache_init(&cache, opt);
htsMemoryFastXfr = backupXFR;
opt->state._hts_in_html_parsing = 0; opt->state._hts_in_html_parsing = 0;
} }
@@ -687,7 +688,7 @@ int httpmirror(char *url1, httrackp * opt) {
// On prévoit large: les fichiers HTML ne prennent que peu de place en mémoire, et les // On prévoit large: les fichiers HTML ne prennent que peu de place en mémoire, et les
// fichiers non html sont sauvés en direct sur disque. // fichiers non html sont sauvés en direct sur disque.
// --> 1024 entrées + 32 entrées par socket en supplément // --> 1024 entrées + 32 entrées par socket en supplément
sback = back_new(opt, opt->maxsoc * 32 + 1024); sback = back_new(opt->maxsoc * 32 + 1024);
if (sback == NULL) { if (sback == NULL) {
hts_log_print(opt, LOG_PANIC, hts_log_print(opt, LOG_PANIC,
"Not enough memory, can not allocate %d bytes", "Not enough memory, can not allocate %d bytes",
@@ -699,7 +700,7 @@ int httpmirror(char *url1, httrackp * opt) {
if (opt->makestat) { if (opt->makestat) {
makestat_fp = makestat_fp =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-stats.txt"), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-stats.txt"),
"wb"); "wb");
if (makestat_fp != NULL) { if (makestat_fp != NULL) {
fprintf(makestat_fp, "HTTrack statistics report, every minutes" LF LF); fprintf(makestat_fp, "HTTrack statistics report, every minutes" LF LF);
@@ -710,7 +711,7 @@ int httpmirror(char *url1, httrackp * opt) {
if (opt->maketrack) { if (opt->maketrack) {
maketrack_fp = maketrack_fp =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-track.txt"), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-track.txt"),
"wb"); "wb");
if (maketrack_fp != NULL) { if (maketrack_fp != NULL) {
fprintf(maketrack_fp, "HTTrack tracking report, every minutes" LF LF); fprintf(maketrack_fp, "HTTrack tracking report, every minutes" LF LF);
@@ -1451,7 +1452,7 @@ int httpmirror(char *url1, httrackp * opt) {
/* Remove file if being processed */ /* Remove file if being processed */
if (is_loaded_from_file) { if (is_loaded_from_file) {
(void) unlink(fconv(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), savename)); (void) unlink(fconv(OPT_GET_BUFF(opt), savename));
is_loaded_from_file = 0; is_loaded_from_file = 0;
} }
@@ -1782,7 +1783,7 @@ int httpmirror(char *url1, httrackp * opt) {
#ifndef _WIN32 #ifndef _WIN32
chmod(tempo, HTS_ACCESS_FILE); chmod(tempo, HTS_ACCESS_FILE);
#endif #endif
usercommand(opt, 0, NULL, fconv(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), tempo), "", usercommand(opt, 0, NULL, fconv(OPT_GET_BUFF(opt), tempo), "",
""); "");
} }
@@ -1978,42 +1979,42 @@ int httpmirror(char *url1, httrackp * opt) {
XH_uninit; XH_uninit;
if ((fexist if ((fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/old.dat"))) (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/old.dat")))
&& &&
(fexist (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx")))) { "hts-cache/old.ndx")))) {
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat")); "hts-cache/new.dat"));
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx")); "hts-cache/new.ndx"));
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.lst")); "hts-cache/new.lst"));
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.txt")); "hts-cache/new.txt"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/old.dat"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/new.dat")); "hts-cache/new.dat"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/old.ndx"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/new.ndx")); "hts-cache/new.ndx"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.lst"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/old.lst"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/new.lst")); "hts-cache/new.lst"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.txt"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/old.txt"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/new.txt")); "hts-cache/new.txt"));
} }
@@ -2037,16 +2038,16 @@ int httpmirror(char *url1, httrackp * opt) {
// //
old_lst = old_lst =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.lst"), "rb"); "hts-cache/old.lst"), "rb");
if (old_lst) { if (old_lst) {
off_t sz = off_t sz =
fsize(fconcat fsize(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.lst")); "hts-cache/new.lst"));
new_lst = new_lst =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.lst"), "rb"); "hts-cache/new.lst"), "rb");
if ((new_lst) && (sz > 0)) { if ((new_lst) && (sz > 0)) {
char *adr = (char *) malloct(sz); char *adr = (char *) malloct(sz);
@@ -2848,10 +2849,10 @@ int filenote(filenote_strc * strc, const char *s, filecreate_params * params) {
char BIGSTK savelst[HTS_URLMAXSIZE * 2]; char BIGSTK savelst[HTS_URLMAXSIZE * 2];
char catbuff[CATBUFF_SIZE]; char catbuff[CATBUFF_SIZE];
strcpybuff(savelst, fslash(catbuff, sizeof(catbuff), s)); strcpybuff(savelst, fslash(catbuff, s));
// couper chemin? // couper chemin?
if (strnotempty(strc->path)) { if (strnotempty(strc->path)) {
if (strncmp(fslash(catbuff, sizeof(catbuff), strc->path), savelst, strlen(strc->path)) == 0) { // couper if (strncmp(fslash(catbuff, strc->path), savelst, strlen(strc->path)) == 0) { // couper
strcpybuff(savelst, s + strlen(strc->path)); strcpybuff(savelst, s + strlen(strc->path));
} }
} }
@@ -2937,9 +2938,8 @@ static void postprocess_file(httrackp * opt, const char *save, const char *adr,
if (rsc_fil == NULL) if (rsc_fil == NULL)
rsc_fil = fil; rsc_fil = fil;
if (strncmp if (strncmp
(fslash(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), save), (fslash(OPT_GET_BUFF(opt), save),
fslash(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), fslash(OPT_GET_BUFF(opt), StringBuff(opt->path_html_utf8)), (n =
StringBuff(opt->path_html_utf8)), (n =
(int) (int)
strlen strlen
(StringBuff (StringBuff
@@ -2953,15 +2953,13 @@ static void postprocess_file(httrackp * opt, const char *save, const char *adr,
//first = 1; //first = 1;
opt->state.mimefp = opt->state.mimefp =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_html), "index.mht"),
StringBuff(opt->path_html), "index.mht"),
"wb"); "wb");
(void) unlink(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (void) unlink(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_html),
StringBuff(opt->path_html),
"index.eml")); "index.eml"));
#ifndef _WIN32 #ifndef _WIN32
if (symlink("index.mht", if (symlink("index.mht",
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_html), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_html),
"index.eml")) != 0) { "index.eml")) != 0) {
if (errno != EPERM) { if (errno != EPERM) {
hts_log_print(opt, LOG_WARNING | LOG_ERRNO, hts_log_print(opt, LOG_WARNING | LOG_ERRNO,
@@ -3007,7 +3005,17 @@ static void postprocess_file(httrackp * opt, const char *save, const char *adr,
mimebuff[0] = '\0'; mimebuff[0] = '\0';
/* CID */ /* CID */
make_content_id(adr, fil, cid, sizeof(cid)); strcpybuff(cid, adr);
strcatbuff(cid, fil);
escape_in_url(cid);
{
char *a = cid;
while((a = strchr(a, '%'))) {
*a = 'X';
a++;
}
}
guess_httptype(opt, mimebuff, save); guess_httptype(opt, mimebuff, save);
fprintf(opt->state.mimefp, "--%s\r\n", fprintf(opt->state.mimefp, "--%s\r\n",
@@ -3066,7 +3074,7 @@ int fspc(httrackp * opt, FILE * fp, const char *type) {
if (A == NULL) { if (A == NULL) {
int localtime_returned_null = 0; int localtime_returned_null = 0;
assertf(localtime_returned_null); assert(localtime_returned_null);
} }
strftime(s, 250, "%H:%M:%S", A); strftime(s, 250, "%H:%M:%S", A);
if (strnotempty(type)) if (strnotempty(type))
@@ -3315,7 +3323,7 @@ int check_sockerror(T_SOC s) {
FD_SET((T_SOC) s, &fds); FD_SET((T_SOC) s, &fds);
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = 0; tv.tv_usec = 0;
select((int) s + 1, NULL, NULL, &fds, &tv); select(s + 1, NULL, NULL, &fds, &tv);
return FD_ISSET(s, &fds); return FD_ISSET(s, &fds);
} }
@@ -3328,7 +3336,7 @@ int check_sockdata(T_SOC s) {
FD_SET((T_SOC) s, &fds); FD_SET((T_SOC) s, &fds);
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = 0; tv.tv_usec = 0;
select((int) s + 1, &fds, NULL, NULL, &tv); select(s + 1, &fds, NULL, NULL, &tv);
return FD_ISSET(s, &fds); return FD_ISSET(s, &fds);
} }
@@ -3850,5 +3858,5 @@ void voidf(void) {
(void) a; (void) a;
} }
// HTTrack Website Copier Copyright (C) 1998-2014 Xavier Roche and other contributors // HTTrack Website Copier Copyright (C) 1998-2013 Xavier Roche and other contributors
// //

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -298,6 +298,26 @@ HTS_STATIC int cache_readable(cache_back * cache) {
/* Library internal definictions */ /* Library internal definictions */
#ifdef HTS_INTERNAL_BYTECODE #ifdef HTS_INTERNAL_BYTECODE
//
#ifndef HTTRACK_DEFLIB
HTSEXT_API int hts_is_parsing(httrackp * opt, int flag);
HTSEXT_API int hts_is_testing(httrackp * opt);
HTSEXT_API int hts_addurl(httrackp * opt, char **url);
HTSEXT_API int hts_resetaddurl(httrackp * opt);
HTSEXT_API int copy_htsopt(const httrackp * from, httrackp * to);
HTSEXT_API char *hts_errmsg(httrackp * opt);
HTSEXT_API int hts_setpause(httrackp * opt, int);
//
HTSEXT_API int hts_is_exiting(httrackp * opt);
HTSEXT_API int hts_request_stop(httrackp * opt, int force);
//
HTSEXT_API int hts_cancel_file_push(httrackp * opt, const char *url);
HTSEXT_API void hts_cancel_test(httrackp * opt);
HTSEXT_API void hts_cancel_parsing(httrackp * opt);
#endif
char *hts_cancel_file_pop(httrackp * opt); char *hts_cancel_file_pop(httrackp * opt);
#endif #endif
@@ -325,6 +345,11 @@ void usercommand(httrackp * opt, int exe, const char *cmd, const char *file,
void usercommand_exe(const char *cmd, const char *file); void usercommand_exe(const char *cmd, const char *file);
int filters_init(char ***ptrfilters, int maxfilter, int filterinc); int filters_init(char ***ptrfilters, int maxfilter, int filterinc);
#ifndef HTTRACK_DEFLIB
HTSEXT_API int structcheck(const char *path);
HTSEXT_API int structcheck_utf8(const char *path);
HTSEXT_API int dir_exists(const char *path);
#endif
int fspc(httrackp * opt, FILE * fp, const char *type); int fspc(httrackp * opt, FILE * fp, const char *type);
char *next_token(char *p, int flag); char *next_token(char *p, int flag);
@@ -352,6 +377,13 @@ int backlinks_done(struct_back * sback, lien_url ** liens, int lien_tot,
int back_fillmax(struct_back * sback, httrackp * opt, cache_back * cache, int back_fillmax(struct_back * sback, httrackp * opt, cache_back * cache,
lien_url ** liens, int ptr, int numero_passe, int lien_tot); lien_url ** liens, int ptr, int numero_passe, int lien_tot);
// cancel file
#ifndef HTTRACK_DEFLIB
HTSEXT_API int hts_cancel_file_push(httrackp * opt, const char *url);
HTSEXT_API void hts_cancel_test(httrackp * opt);
HTSEXT_API void hts_cancel_parsing(httrackp * opt);
#endif
int ask_continue(httrackp * opt); int ask_continue(httrackp * opt);
int nombre_digit(int n); int nombre_digit(int n);

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -180,7 +180,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
#ifndef HTS_HTTRACKDIR #ifndef HTS_HTTRACKDIR
{ {
char catbuff[CATBUFF_SIZE]; char catbuff[CATBUFF_SIZE];
char *path = fslash(catbuff, sizeof(catbuff), argv[0]); char *path = fslash(catbuff, argv[0]);
char *a; char *a;
if ((a = strrchr(path, '/'))) { if ((a = strrchr(path, '/'))) {
@@ -451,18 +451,15 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
else { else {
if ((!fexist if ((!fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-cache/doit.log"))) || (argv_url > 0)) { "hts-cache/doit.log"))) || (argv_url > 0)) {
if (!optinclude_file if (!optinclude_file
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), HTS_HTTRACKRC),
StringBuff(opt->path_log), HTS_HTTRACKRC),
&argc, argv, x_argvblk, &x_ptr)) &argc, argv, x_argvblk, &x_ptr))
if (!optinclude_file(HTS_HTTRACKRC, &argc, argv, x_argvblk, &x_ptr)) { if (!optinclude_file(HTS_HTTRACKRC, &argc, argv, x_argvblk, &x_ptr)) {
if (!optinclude_file if (!optinclude_file
(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (fconcat(OPT_GET_BUFF(opt), hts_gethome(), "/" HTS_HTTRACKRC),
hts_gethome(), "/" HTS_HTTRACKRC),
&argc, argv, x_argvblk, &x_ptr)) { &argc, argv, x_argvblk, &x_ptr)) {
#ifdef HTS_HTTRACKCNF #ifdef HTS_HTTRACKCNF
optinclude_file(HTS_HTTRACKCNF, &argc, argv, x_argvblk, &x_ptr); optinclude_file(HTS_HTTRACKCNF, &argc, argv, x_argvblk, &x_ptr);
@@ -481,13 +478,11 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
/* load doit.log and insert in current command line */ /* load doit.log and insert in current command line */
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/doit.log"))
StringBuff(opt->path_log), "hts-cache/doit.log"))
&& (argv_url <= 0)) { && (argv_url <= 0)) {
FILE *fp = FILE *fp =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-cache/doit.log"), "rb"); "hts-cache/doit.log"), "rb");
if (fp) { if (fp) {
int insert_after = 1; /* insérer après nom au début */ int insert_after = 1; /* insérer après nom au début */
@@ -534,58 +529,48 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
#endif #endif
if (!fexist if (!fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/new.zip"))) {
StringBuff(opt->path_log), "hts-cache/new.zip"))) {
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/old.zip"))) {
StringBuff(opt->path_log), "hts-cache/old.zip"))) {
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log), "hts-cache/old.zip"), fconcat(OPT_GET_BUFF(opt),
"hts-cache/old.zip"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/new.zip")); "hts-cache/new.zip"));
} }
} else } else
if ((!fexist if ((!fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/new.dat")))
StringBuff(opt->path_log), "hts-cache/new.dat")))
|| ||
(!fexist (!fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-cache/new.ndx")))) { "hts-cache/new.ndx")))) {
if ((fexist if ((fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/old.dat")))
StringBuff(opt->path_log), "hts-cache/old.dat")))
&& &&
(fexist (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-cache/old.ndx")))) { "hts-cache/old.ndx")))) {
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-cache/new.dat")); "hts-cache/new.dat"));
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-cache/new.ndx")); "hts-cache/new.ndx"));
//remove(fconcat(StringBuff(opt->path_log),"hts-cache/new.lst")); //remove(fconcat(StringBuff(opt->path_log),"hts-cache/new.lst"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log), "hts-cache/old.dat"), fconcat(OPT_GET_BUFF(opt),
"hts-cache/old.dat"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/new.dat")); "hts-cache/new.dat"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/old.ndx"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/new.ndx")); "hts-cache/new.ndx"));
//rename(fconcat(StringBuff(opt->path_log),"hts-cache/old.lst"),fconcat(StringBuff(opt->path_log),"hts-cache/new.lst")); //rename(fconcat(StringBuff(opt->path_log),"hts-cache/old.lst"),fconcat(StringBuff(opt->path_log),"hts-cache/new.lst"));
@@ -596,20 +581,17 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
if (!opt->quiet) { if (!opt->quiet) {
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-in_progress.lock"))) { "hts-in_progress.lock"))) {
/* Old cache */ /* Old cache */
if ((fexist if ((fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-cache/old.dat"))) "hts-cache/old.dat")))
&& &&
(fexist (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-cache/old.ndx")))) { "hts-cache/old.ndx")))) {
if (opt->log != NULL) { if (opt->log != NULL) {
fprintf(opt->log, "Warning!\n"); fprintf(opt->log, "Warning!\n");
@@ -641,109 +623,109 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
strcpybuff(argv[i] + 1, ""); strcpybuff(argv[i] + 1, "");
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-log.txt"))) (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-log.txt")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-log.txt")); "hts-log.txt"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-err.txt"))) (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-err.txt")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-err.txt")); "hts-err.txt"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_html), "index.html"))) (OPT_GET_BUFF(opt), StringBuff(opt->path_html), "index.html")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_html), (OPT_GET_BUFF(opt), StringBuff(opt->path_html),
"index.html")); "index.html"));
/* */ /* */
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip"))) "hts-cache/new.zip")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip")); "hts-cache/new.zip"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip"))) "hts-cache/old.zip")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip")); "hts-cache/old.zip"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat"))) "hts-cache/new.dat")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat")); "hts-cache/new.dat"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx"))) "hts-cache/new.ndx")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx")); "hts-cache/new.ndx"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat"))) "hts-cache/old.dat")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat")); "hts-cache/old.dat"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx"))) "hts-cache/old.ndx")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx")); "hts-cache/old.ndx"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.lst"))) "hts-cache/new.lst")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.lst")); "hts-cache/new.lst"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.lst"))) "hts-cache/old.lst")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.lst")); "hts-cache/old.lst"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.txt"))) "hts-cache/new.txt")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.txt")); "hts-cache/new.txt"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.txt"))) "hts-cache/old.txt")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.txt")); "hts-cache/old.txt"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/doit.log"))) "hts-cache/doit.log")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/doit.log")); "hts-cache/doit.log"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-in_progress.lock"))) "hts-in_progress.lock")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-in_progress.lock")); "hts-in_progress.lock"));
rmdir(fconcat rmdir(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache")); (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache"));
// //
} else if (strfield2(argv[i] + 2, "catchurl")) { // capture d'URL via proxy temporaire! } else if (strfield2(argv[i] + 2, "catchurl")) { // capture d'URL via proxy temporaire!
argv_url = 1; // forcer a passer les parametres argv_url = 1; // forcer a passer les parametres
@@ -897,27 +879,22 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
// Présence d'un cache, que faire?.. // Présence d'un cache, que faire?..
if ((fexist if ((fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/new.zip")))
StringBuff(opt->path_log), "hts-cache/new.zip")))
|| ||
(fexist (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/new.dat"))
StringBuff(opt->path_log), "hts-cache/new.dat"))
&& &&
fexist(fconcat fexist(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-cache/new.ndx"))) "hts-cache/new.ndx")))
) { // il existe déja un cache précédent.. renommer ) { // il existe déja un cache précédent.. renommer
if (fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), if (fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache/doit.log"))) { // un cache est présent
StringBuff(opt->path_log), "hts-cache/doit.log"))) { // un cache est présent
if (x_argvblk != NULL) { if (x_argvblk != NULL) {
int m; int m;
// établir mode - mode cache: 1 (cache valide) 2 (cache à vérifier) // établir mode - mode cache: 1 (cache valide) 2 (cache à vérifier)
if (fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), if (fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-in_progress.lock"))) { // cache prioritaire
StringBuff(opt->path_log), "hts-in_progress.lock"))) { // cache prioritaire
m = 1; m = 1;
} else { } else {
m = 2; m = 2;
@@ -975,24 +952,23 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
} }
} else { // plus de 2 paramètres } else { // plus de 2 paramètres
// un fichier log existe? // un fichier log existe?
if (fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), if (fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-in_progress.lock"))) { // fichier lock?
StringBuff(opt->path_log), "hts-in_progress.lock"))) { // fichier lock?
//char s[32]; //char s[32];
opt->cache = 1; // cache prioritaire opt->cache = 1; // cache prioritaire
if (opt->quiet == 0) { if (opt->quiet == 0) {
if ((fexist if ((fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip"))) "hts-cache/new.zip")))
|| ||
(fexist (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat")) "hts-cache/new.dat"))
&& &&
fexist(fconcat fexist(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx"))) "hts-cache/new.ndx")))
) { ) {
HT_REQUEST_START; HT_REQUEST_START;
@@ -1011,22 +987,22 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
} else } else
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_html), "index.html"))) { (OPT_GET_BUFF(opt), StringBuff(opt->path_html), "index.html"))) {
//char s[32]; //char s[32];
opt->cache = 2; // cache vient après test de validité opt->cache = 2; // cache vient après test de validité
if (opt->quiet == 0) { if (opt->quiet == 0) {
if ((fexist if ((fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip"))) "hts-cache/new.zip")))
|| ||
(fexist (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat")) "hts-cache/new.dat"))
&& &&
fexist(fconcat fexist(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx"))) "hts-cache/new.ndx")))
) { ) {
HT_REQUEST_START; HT_REQUEST_START;
@@ -1984,6 +1960,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
char *filter = NULL; char *filter = NULL;
cache_back cache; cache_back cache;
inthash cache_hashtable = inthash_new(0); inthash cache_hashtable = inthash_new(0);
int backupXFR = htsMemoryFastXfr;
int sendb = 0; int sendb = 0;
if (isdigit((unsigned char) *(com + 1))) { if (isdigit((unsigned char) *(com + 1))) {
@@ -1997,6 +1974,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
hasFilter = 1; hasFilter = 1;
filter = argv[na]; filter = argv[na];
} }
htsMemoryFastXfr = 1; /* fast load */
memset(&cache, 0, sizeof(cache_back)); memset(&cache, 0, sizeof(cache_back));
cache.type = 1; // cache? cache.type = 1; // cache?
@@ -2013,7 +1991,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
int pos; int pos;
char *cacheNdx = char *cacheNdx =
readfile(fconcat readfile(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx")); "hts-cache/new.ndx"));
cache_init(&cache, opt); /* load cache */ cache_init(&cache, opt); /* load cache */
if (cacheNdx != NULL) { if (cacheNdx != NULL) {
@@ -2148,6 +2126,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
(hasFilter) ? " for '" : "", (hasFilter) ? " for '" : "",
(hasFilter) ? filter : "", (hasFilter) ? "'" : ""); (hasFilter) ? filter : "", (hasFilter) ? "'" : "");
} }
htsMemoryFastXfr = backupXFR;
return 0; return 0;
} }
break; break;
@@ -2160,8 +2139,13 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
return 0; return 0;
break; break;
case 'X': case 'X':
fprintf(stderr, "warning: option has no effect\n"); #ifndef STRDEBUG
fprintf(stderr,
"warning: no string debugging support built, option has no effect\n");
#endif
htsMemoryFastXfr = 1;
if (*(com + 1) == '0') { if (*(com + 1) == '0') {
htsMemoryFastXfr = 0;
com++; com++;
} }
break; break;
@@ -2173,22 +2157,22 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip"))) { "hts-cache/new.zip"))) {
name = name =
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip"); "hts-cache/new.zip");
} else } else
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip"))) { "hts-cache/old.zip"))) {
name = name =
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip"); "hts-cache/old.zip");
} else { } else {
fprintf(stderr, "* error: no cache found in %s\n", fprintf(stderr, "* error: no cache found in %s\n",
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/new.zip")); "hts-cache/new.zip"));
return 1; return 1;
@@ -2196,14 +2180,14 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
fprintf(stderr, "Cache: trying to repair %s\n", name); fprintf(stderr, "Cache: trying to repair %s\n", name);
if (unzRepair if (unzRepair
(name, (name,
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/repair.zip"), "hts-cache/repair.zip"),
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/repair.tmp"), &repaired, "hts-cache/repair.tmp"), &repaired,
&repairedBytes) == Z_OK) { &repairedBytes) == Z_OK) {
unlink(name); unlink(name);
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/repair.zip"), name); "hts-cache/repair.zip"), name);
fprintf(stderr, fprintf(stderr,
"Cache: %d bytes successfully recovered in %d entries\n", "Cache: %d bytes successfully recovered in %d entries\n",
@@ -2503,7 +2487,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
} else { } else {
capa <<= 1; capa <<= 1;
} }
strings = (const char **) realloc((void*) strings, capa*sizeof(char*)); strings = realloc(strings, capa*sizeof(char*));
} }
strings[count++] = &buff[last]; strings[count++] = &buff[last];
last = i + 1; last = i + 1;
@@ -2526,11 +2510,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
FMT(); FMT();
if (bench[loop].type == DO_ADD if (bench[loop].type == DO_ADD
|| bench[loop].type == DO_DRY_ADD) { || bench[loop].type == DO_DRY_ADD) {
size_t k;
result = inthash_write(hashtable, name, (uintptr_t) expected); result = inthash_write(hashtable, name, (uintptr_t) expected);
for(k = 0 ; k < /* stash_size*2 */ 32 ; k++) {
(void) inthash_write(hashtable, name, (uintptr_t) expected);
}
/* revert logic */ /* revert logic */
if (bench[loop].type == DO_DRY_ADD) { if (bench[loop].type == DO_DRY_ADD) {
result = result ? 0 : 1; result = result ? 0 : 1;
@@ -2538,11 +2518,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
} }
else if (bench[loop].type == DO_DEL else if (bench[loop].type == DO_DEL
|| bench[loop].type == DO_DRY_DEL) { || bench[loop].type == DO_DRY_DEL) {
size_t k;
result = inthash_remove(hashtable, name); result = inthash_remove(hashtable, name);
for(k = 0 ; k < /* stash_size*2 */ 32 ; k++) {
(void) inthash_remove(hashtable, name);
}
/* revert logic */ /* revert logic */
if (bench[loop].type == DO_DRY_DEL) { if (bench[loop].type == DO_DRY_DEL) {
result = result ? 0 : 1; result = result ? 0 : 1;
@@ -2577,7 +2553,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
inthash_delete(&hashtable); inthash_delete(&hashtable);
fprintf(stderr, "all hashtable tests were successful!\n"); fprintf(stderr, "all hashtable tests were successful!\n");
} else { } else {
fprintf(stderr, "Malformed number\n"); fprintf(stderr, "Malformed number");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#undef FMT #undef FMT
@@ -2708,6 +2684,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
} else { // URL/filters } else { // URL/filters
char catbuff[CATBUFF_SIZE]; char catbuff[CATBUFF_SIZE];
char BIGSTK tempo[CATBUFF_SIZE];
const int urlSize = (int) strlen(argv[na]); const int urlSize = (int) strlen(argv[na]);
const int capa = (int) (strlen(url) + urlSize + 32); const int capa = (int) (strlen(url) + urlSize + 32);
@@ -2716,7 +2693,9 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
ensureUrlCapacity(url, url_sz, capa); ensureUrlCapacity(url, url_sz, capa);
if (strnotempty(url)) if (strnotempty(url))
strcatbuff(url, " "); // espace de séparation strcatbuff(url, " "); // espace de séparation
append_escape_spc_url(unescape_http_unharm(catbuff, sizeof(catbuff), argv[na], 1), url, url_sz); strcpybuff(tempo, unescape_http_unharm(catbuff, argv[na], 1));
escape_spc_url(tempo);
strcatbuff(url, tempo);
} }
} // if argv=- etc. } // if argv=- etc.
@@ -2758,37 +2737,37 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
// en cas de présence des deux versions, garder la version la plus avancée, // en cas de présence des deux versions, garder la version la plus avancée,
// cad la version contenant le plus de fichiers // cad la version contenant le plus de fichiers
if (opt->cache) { if (opt->cache) {
if (fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-in_progress.lock"))) { // problemes.. if (fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-in_progress.lock"))) { // problemes..
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat"))) { "hts-cache/new.dat"))) {
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip"))) { "hts-cache/old.zip"))) {
if (fsize if (fsize
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip")) < 32768) { "hts-cache/new.zip")) < 32768) {
if (fsize if (fsize
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip")) > 65536) { "hts-cache/old.zip")) > 65536) {
if (fsize if (fsize
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip")) > fsize(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/old.zip")) > fsize(fconcat(OPT_GET_BUFF(opt),
StringBuff(opt-> StringBuff(opt->
path_log), path_log),
"hts-cache/new.zip"))) "hts-cache/new.zip")))
{ {
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.zip")); "hts-cache/new.zip"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.zip"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/old.zip"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/new.zip")); "hts-cache/new.zip"));
} }
@@ -2798,53 +2777,53 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
} else } else
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat")) "hts-cache/new.dat"))
&& &&
fexist(fconcat fexist(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx"))) { "hts-cache/new.ndx"))) {
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat")) "hts-cache/old.dat"))
&& &&
fexist(fconcat fexist(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx"))) { "hts-cache/old.ndx"))) {
// switcher si new<32Ko et old>65Ko (tailles arbitraires) ? // switcher si new<32Ko et old>65Ko (tailles arbitraires) ?
// ce cas est peut être une erreur ou un crash d'un miroir ancien, prendre // ce cas est peut être une erreur ou un crash d'un miroir ancien, prendre
// alors l'ancien cache // alors l'ancien cache
if (fsize if (fsize
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat")) < 32768) { "hts-cache/new.dat")) < 32768) {
if (fsize if (fsize
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat")) > 65536) { "hts-cache/old.dat")) > 65536) {
if (fsize if (fsize
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat")) > fsize(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/old.dat")) > fsize(fconcat(OPT_GET_BUFF(opt),
StringBuff(opt-> StringBuff(opt->
path_log), path_log),
"hts-cache/new.dat"))) "hts-cache/new.dat")))
{ {
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.dat")); "hts-cache/new.dat"));
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/new.ndx")); "hts-cache/new.ndx"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.dat"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/old.dat"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/new.dat")); "hts-cache/new.dat"));
rename(fconcat rename(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/old.ndx"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), "hts-cache/old.ndx"), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_log), StringBuff(opt->path_log),
"hts-cache/new.ndx")); "hts-cache/new.ndx"));
//} else { // ne rien faire //} else { // ne rien faire
@@ -2861,7 +2840,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
if (_DEBUG_HEAD) { if (_DEBUG_HEAD) {
ioinfo = ioinfo =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-ioinfo.txt"), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-ioinfo.txt"),
"wb"); "wb");
} }
@@ -2878,26 +2857,26 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
structcheck(StringBuff(opt->path_log)); structcheck(StringBuff(opt->path_log));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-log.txt"))) (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-log.txt")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-log.txt")); (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-log.txt"));
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-err.txt"))) (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-err.txt")))
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-err.txt")); (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-err.txt"));
/* Check FS directory structure created */ /* Check FS directory structure created */
structcheck(StringBuff(opt->path_log)); structcheck(StringBuff(opt->path_log));
opt->log = opt->log =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-log.txt"), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-log.txt"),
"w"); "w");
if (httrack_logmode == 2) if (httrack_logmode == 2)
opt->errlog = opt->errlog =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-err.txt"), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-err.txt"),
"w"); "w");
else else
opt->errlog = opt->log; opt->errlog = opt->log;
@@ -2905,7 +2884,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
char s[HTS_CDLMAXSIZE + 256]; char s[HTS_CDLMAXSIZE + 256];
sprintf(s, "Unable to create log file %s", sprintf(s, "Unable to create log file %s",
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-log.txt")); "hts-log.txt"));
HTS_PANIC_PRINTF(s); HTS_PANIC_PRINTF(s);
htsmain_free(); htsmain_free();
@@ -2914,7 +2893,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
char s[HTS_CDLMAXSIZE + 256]; char s[HTS_CDLMAXSIZE + 256];
sprintf(s, "Unable to create log file %s", sprintf(s, "Unable to create log file %s",
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-err.txt")); "hts-err.txt"));
HTS_PANIC_PRINTF(s); HTS_PANIC_PRINTF(s);
htsmain_free(); htsmain_free();
@@ -2939,7 +2918,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
{ {
FILE *fp = FILE *fp =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/readme.txt"), "wb"); "hts-cache/readme.txt"), "wb");
if (fp) { if (fp) {
fprintf(fp, "What's in this folder?" LF); fprintf(fp, "What's in this folder?" LF);
@@ -2964,7 +2943,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
} }
strcpy(n_lock, strcpy(n_lock,
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-in_progress.lock")); "hts-in_progress.lock"));
//sprintf(n_lock,fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),"hts-in_progress.lock"),n); //sprintf(n_lock,fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),"hts-in_progress.lock"),n);
/*do { /*do {
@@ -2981,8 +2960,8 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
} */ } */
// vérifier existence de la structure // vérifier existence de la structure
structcheck(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_html), "/")); structcheck(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_html), "/"));
structcheck(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "/")); structcheck(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "/"));
// reprise/update // reprise/update
if (opt->cache) { if (opt->cache) {
@@ -2991,15 +2970,15 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
#ifdef _WIN32 #ifdef _WIN32
mkdir(fconcat mkdir(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache")); (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache"));
#else #else
mkdir(fconcat mkdir(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache"), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-cache"),
HTS_PROTECT_FOLDER); HTS_PROTECT_FOLDER);
#endif #endif
fp = fp =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-cache/doit.log"), "wb"); "hts-cache/doit.log"), "wb");
if (fp) { if (fp) {
for(i = 0 + 1; i < argc; i++) { for(i = 0 + 1; i < argc; i++) {
@@ -3210,7 +3189,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
for(dir = for(dir =
opendir(fconcat opendir(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
CACHE_REFNAME)); CACHE_REFNAME));
dir != NULL && (entry = readdir(dir)) != NULL;) { dir != NULL && (entry = readdir(dir)) != NULL;) {
if (entry->d_name[0] != '\0' && entry->d_name[0] != '.') { if (entry->d_name[0] != '\0' && entry->d_name[0] != '.') {
@@ -3218,7 +3197,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
sprintf(f, "%s/%s", CACHE_REFNAME, entry->d_name); sprintf(f, "%s/%s", CACHE_REFNAME, entry->d_name);
(void) (void)
unlink(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), f)); unlink(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), f));
} }
} }
if (dir != NULL) { if (dir != NULL) {
@@ -3226,7 +3205,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
} }
(void) (void)
rmdir(fconcat rmdir(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), CACHE_REFNAME)); (OPT_GET_BUFF(opt), StringBuff(opt->path_log), CACHE_REFNAME));
} }
/* Info for wrappers */ /* Info for wrappers */

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -43,6 +43,11 @@ Please visit our Website: http://www.httrack.com
/* Library internal definictions */ /* Library internal definictions */
#ifdef HTS_INTERNAL_BYTECODE #ifdef HTS_INTERNAL_BYTECODE
// Main, récupère les paramètres et appelle le robot
#ifndef HTTRACK_DEFLIB
HTSEXT_API int hts_main(int argc, char **argv);
HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt);
#endif
int cmdl_opt(char *s); int cmdl_opt(char *s);
int check_path(String * s, char *defaultname); int check_path(String * s, char *defaultname);

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -30,9 +30,10 @@ Please visit our Website: http://www.httrack.com
/* Author: Xavier Roche */ /* Author: Xavier Roche */
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
#include <assert.h>
#include "htscharset.h" #include "htscharset.h"
#include "htsencoding.h" #include "htsencoding.h"
#include "htssafe.h"
/* static int decode_entity(const unsigned int hash, const size_t len); /* static int decode_entity(const unsigned int hash, const size_t len);
*/ */
@@ -66,7 +67,7 @@ int hts_unescapeEntitiesWithCharset(const char *src, char *dest, const size_t ma
int hex; int hex;
unsigned int hash; unsigned int hash;
assertf(max != 0); assert(max != 0);
for(i = 0, j = 0, ampStart = (size_t) -1, ampStartDest = 0, for(i = 0, j = 0, ampStart = (size_t) -1, ampStartDest = 0,
uc = -1, hex = 0, hash = 0 ; src[i] != '\0' ; i++) { uc = -1, hex = 0, hash = 0 ; src[i] != '\0' ; i++) {
/* start of entity */ /* start of entity */
@@ -208,8 +209,8 @@ int hts_unescapeUrlSpecial(const char *src, char *dest, const size_t max,
int seenQuery = 0; int seenQuery = 0;
char utfBuffer[32]; char utfBuffer[32];
assertf(src != dest); assert(src != dest);
assertf(max != 0); assert(max != 0);
for(i = 0, j = 0, k = 0, utfBufferJ = 0, utfBufferSize = 0, for(i = 0, j = 0, k = 0, utfBufferJ = 0, utfBufferSize = 0,
lastI = (size_t) -1, lastJ = (size_t) -1 lastI = (size_t) -1, lastJ = (size_t) -1

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -86,7 +86,8 @@ extern int hts_unescapeUrl(const char *src, char *dest, const size_t max);
* Note: source and destination MUST NOT be the same. * Note: source and destination MUST NOT be the same.
* Returns 0 upon success, -1 upon overflow or error. * Returns 0 upon success, -1 upon overflow or error.
**/ **/
extern int hts_unescapeUrlSpecial(const char *src, char *dest, const size_t max, extern int hts_unescapeUrlSpecial(const char *src,
const int flags); char *dest, const size_t max,
int flags);
#endif #endif

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -217,7 +217,7 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
ftp_filename = a; ftp_filename = a;
if (strnotempty(a)) { if (strnotempty(a)) {
char catbuff[CATBUFF_SIZE]; char catbuff[CATBUFF_SIZE];
char *ua = unescape_http(catbuff, sizeof(catbuff), a); char *ua = unescape_http(catbuff, a);
int len_a = (int) strlen(ua); int len_a = (int) strlen(ua);
if (len_a > 0 && ua[len_a - 1] == '/') { /* obviously a directory listing */ if (len_a > 0 && ua[len_a - 1] == '/') { /* obviously a directory listing */
@@ -528,7 +528,7 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
if (back->r.statuscode != -1) { if (back->r.statuscode != -1) {
if (!transfer_list) { if (!transfer_list) {
char catbuff[CATBUFF_SIZE]; char catbuff[CATBUFF_SIZE];
char *ua = unescape_http(catbuff, sizeof(catbuff), ftp_filename); char *ua = unescape_http(catbuff, ftp_filename);
if ((strchr(ua, ' ')) if ((strchr(ua, ' '))
|| (strchr(ua, '\"')) || (strchr(ua, '\"'))

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -36,8 +36,8 @@ Please visit our Website: http://www.httrack.com
#define HTTRACK_GLOBAL_DEFH #define HTTRACK_GLOBAL_DEFH
// Version (also check external version information) // Version (also check external version information)
#define HTTRACK_VERSION "3.48-6" #define HTTRACK_VERSION "3.48-3"
#define HTTRACK_VERSIONID "3.48.6" #define HTTRACK_VERSIONID "3.48.3"
#define HTTRACK_AFF_VERSION "3.x" #define HTTRACK_AFF_VERSION "3.x"
#define HTTRACK_LIB_VERSION "2.0" #define HTTRACK_LIB_VERSION "2.0"
@@ -57,19 +57,6 @@ Please visit our Website: http://www.httrack.com
#endif #endif
#endif #endif
/* GCC extension */
#ifndef HTS_UNUSED
#ifdef __GNUC__
#define HTS_UNUSED __attribute__ ((unused))
#define HTS_STATIC static __attribute__ ((unused))
#define HTS_PRINTF_FUN(fmt, arg) __attribute__ ((format (printf, fmt, arg)))
#else
#define HTS_UNUSED
#define HTS_STATIC static
#define HTS_PRINTF_FUN(fmt, arg)
#endif
#endif
// config.h // config.h
#ifdef _WIN32 #ifdef _WIN32
@@ -218,8 +205,8 @@ Please visit our Website: http://www.httrack.com
#define HTS_CDLMAXSIZE 1024 #define HTS_CDLMAXSIZE 1024
#endif #endif
/* Copyright (C) 1998-2014 Xavier Roche and other contributors */ /* Copyright (C) 1998-2013 Xavier Roche and other contributors */
#define HTTRACK_AFF_AUTHORS "[XR&CO'2014]" #define HTTRACK_AFF_AUTHORS "[XR&CO'2013]"
#define HTS_DEFAULT_FOOTER "<!-- Mirrored from %s%s by HTTrack Website Copier/"HTTRACK_AFF_VERSION" "HTTRACK_AFF_AUTHORS", %s -->" #define HTS_DEFAULT_FOOTER "<!-- Mirrored from %s%s by HTTrack Website Copier/"HTTRACK_AFF_VERSION" "HTTRACK_AFF_AUTHORS", %s -->"
#define HTTRACK_WEB "http://www.httrack.com" #define HTTRACK_WEB "http://www.httrack.com"
#define HTS_UPDATE_WEBSITE "http://www.httrack.com/update.php3?Product=HTTrack&Version="HTTRACK_VERSIONID"&VersionStr="HTTRACK_VERSION"&Platform=%d&Language=%s" #define HTS_UPDATE_WEBSITE "http://www.httrack.com/update.php3?Product=HTTrack&Version="HTTRACK_VERSIONID"&VersionStr="HTTRACK_VERSION"&Platform=%d&Language=%s"

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -34,11 +34,11 @@ Please visit our Website: http://www.httrack.com
/* Internal engine bytecode */ /* Internal engine bytecode */
#define HTS_INTERNAL_BYTECODE #define HTS_INTERNAL_BYTECODE
#include "htsopt.h"
#include "htshash.h" #include "htshash.h"
/* specific definitions */ /* specific definitions */
#include "htsbase.h" #include "htsbase.h"
#include "htsopt.h"
#include "htsglobal.h" #include "htsglobal.h"
#include "htsmd5.h" #include "htsmd5.h"
#include "htscore.h" #include "htscore.h"
@@ -171,20 +171,12 @@ static int key_former_adrfil_equals(void *arg, const char *a, const char *b) {
return key_adrfil_equals_generic(arg, a, b, 1); return key_adrfil_equals_generic(arg, a, b, 1);
} }
void hash_init(httrackp *opt, hash_struct * hash, int normalized) { void hash_init(hash_struct * hash, int normalized) {
hash->sav = inthash_new(0); hash->sav = inthash_new(0);
hash->adrfil = inthash_new(0); hash->adrfil = inthash_new(0);
hash->former_adrfil = inthash_new(0); hash->former_adrfil = inthash_new(0);
hash->normalized = normalized; hash->normalized = normalized;
hts_set_hash_handler(hash->sav, opt);
hts_set_hash_handler(hash->adrfil, opt);
hts_set_hash_handler(hash->former_adrfil, opt);
inthash_set_name(hash->sav, "hash->sav");
inthash_set_name(hash->adrfil, "hash->adrfil");
inthash_set_name(hash->former_adrfil, "hash->former_adrfil");
/* Case-insensitive comparison ; keys are direct char* filenames */ /* Case-insensitive comparison ; keys are direct char* filenames */
inthash_value_set_key_handler(hash->sav, inthash_value_set_key_handler(hash->sav,
key_duphandler, key_duphandler,

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@ typedef enum hash_struct_type {
} hash_struct_type; } hash_struct_type;
// tables de hachage // tables de hachage
void hash_init(httrackp *opt, hash_struct *hash, int normalized); void hash_init(hash_struct *hash, int normalized);
void hash_free(hash_struct *hash); void hash_free(hash_struct *hash);
int hash_read(const hash_struct * hash, const char *nom1, const char *nom2, int hash_read(const hash_struct * hash, const char *nom1, const char *nom2,
hash_struct_type type); hash_struct_type type);

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -116,51 +116,16 @@ void infomsg(char *msg) {
} }
} }
} }
typedef struct help_wizard_buffers {
char urls[HTS_URLMAXSIZE * 2];
char mainpath[256];
char projname[256];
char stropt[2048]; // options
char stropt2[2048]; // options longues
char strwild[2048]; // wildcards
char cmd[4096];
char str[256];
char *argv[256];
} help_wizard_buffers;
void help_wizard(httrackp * opt) { void help_wizard(httrackp * opt) {
help_wizard_buffers *buffers = malloct(sizeof(help_wizard_buffers)); char *urls = (char *) malloct(HTS_URLMAXSIZE * 2);
char *mainpath = (char *) malloct(256);
#undef urls char *projname = (char *) malloct(256);
#undef mainpath char *stropt = (char *) malloct(2048); // options
#undef projname char *stropt2 = (char *) malloct(2048); // options longues
#undef stropt char *strwild = (char *) malloct(2048); // wildcards
#undef stropt2 char *cmd = (char *) malloct(4096);
#undef strwild char *str = (char *) malloct(256);
#undef cmd char **argv = (char **) malloct(256 * sizeof(char *));
#undef str
#undef argv
#define urls (buffers->urls)
#define mainpath (buffers->mainpath)
#define projname (buffers->projname)
#define stropt (buffers->stropt)
#define stropt2 (buffers->stropt2)
#define strwild (buffers->strwild)
#define cmd (buffers->cmd)
#define str (buffers->str)
#define argv (buffers->argv)
//char *urls = (char *) malloct(HTS_URLMAXSIZE * 2);
//char *mainpath = (char *) malloct(256);
//char *projname = (char *) malloct(256);
//char *stropt = (char *) malloct(2048); // options
//char *stropt2 = (char *) malloct(2048); // options longues
//char *strwild = (char *) malloct(2048); // wildcards
//char *cmd = (char *) malloct(4096);
//char *str = (char *) malloct(256);
//char **argv = (char **) malloct(256 * sizeof(char *));
// //
char *a; char *a;
@@ -182,7 +147,7 @@ void help_wizard(httrackp * opt) {
printf("\n"); printf("\n");
printf("Welcome to HTTrack Website Copier (Offline Browser) " HTTRACK_VERSION printf("Welcome to HTTrack Website Copier (Offline Browser) " HTTRACK_VERSION
"%s\n", hts_get_version_info(opt)); "%s\n", hts_get_version_info(opt));
printf("Copyright (C) 1998-2014 Xavier Roche and other contributors\n"); printf("Copyright (C) 1998-2013 Xavier Roche and other contributors\n");
#ifdef _WIN32 #ifdef _WIN32
printf("Note: You are running the commandline version,\n"); printf("Note: You are running the commandline version,\n");
printf("run 'WinHTTrack.exe' to get the GUI version.\n"); printf("run 'WinHTTrack.exe' to get the GUI version.\n");
@@ -353,16 +318,14 @@ void help_wizard(httrackp * opt) {
} }
/* Free buffers */ /* Free buffers */
free(buffers); freet(urls);
#undef urls freet(mainpath);
#undef mainpath freet(projname);
#undef projname freet(stropt);
#undef stropt freet(stropt2);
#undef stropt2 freet(strwild);
#undef strwild freet(cmd);
#undef cmd freet(str);
#undef str
#undef argv
} }
int help_query(char *list, int def) { int help_query(char *list, int def) {
char s[256]; char s[256];
@@ -438,7 +401,7 @@ void help_catchurl(const char *dest_path) {
{ {
char BIGSTK finalurl[HTS_URLMAXSIZE * 2]; char BIGSTK finalurl[HTS_URLMAXSIZE * 2];
inplace_escape_check_url(dest, sizeof(dest)); escape_check_url(dest);
sprintf(finalurl, "%s" POSTTOK "file:%s", url, dest); sprintf(finalurl, "%s" POSTTOK "file:%s", url, dest);
printf("\nThe URL is: \"%s\"\n", finalurl); printf("\nThe URL is: \"%s\"\n", finalurl);
printf("You can capture it through: httrack \"%s\"\n", finalurl); printf("You can capture it through: httrack \"%s\"\n", finalurl);
@@ -481,7 +444,7 @@ void help(char *app, int more) {
infomsg("1"); infomsg("1");
if (more != 2) { if (more != 2) {
sprintf(info, sprintf(info,
"HTTrack version " HTTRACK_VERSION "%s", "HTTrack version " HTTRACK_VERSION "%s (compiled " __DATE__ ")",
hts_is_available()); hts_is_available());
infomsg(info); infomsg(info);
#ifdef HTTRACK_AFF_WARNING #ifdef HTTRACK_AFF_WARNING
@@ -792,10 +755,10 @@ void help(char *app, int more) {
infomsg("example: httrack --continue"); infomsg("example: httrack --continue");
infomsg("continues a mirror in the current folder"); infomsg("continues a mirror in the current folder");
infomsg(""); infomsg("");
sprintf(info, "HTTrack version " HTTRACK_VERSION "%s", sprintf(info, "HTTrack version " HTTRACK_VERSION "%s (compiled " __DATE__ ")",
hts_is_available()); hts_is_available());
infomsg(info); infomsg(info);
infomsg("Copyright (C) 1998-2014 Xavier Roche and other contributors"); infomsg("Copyright (C) 1998-2013 Xavier Roche and other contributors");
#ifdef HTS_PLATFORM_NAME #ifdef HTS_PLATFORM_NAME
infomsg("[compiled: " HTS_PLATFORM_NAME "]"); infomsg("[compiled: " HTS_PLATFORM_NAME "]");
#endif #endif

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -161,8 +161,8 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
// Init ? // Init ?
if (hts_index_init) { if (hts_index_init) {
UNLINK(concat(catbuff, sizeof(catbuff), indexpath, "index.txt")); UNLINK(concat(catbuff, indexpath, "index.txt"));
UNLINK(concat(catbuff, sizeof(catbuff), indexpath, "sindex.html")); UNLINK(concat(catbuff, indexpath, "sindex.html"));
hts_index_init = 0; hts_index_init = 0;
} }
// Check MIME type // Check MIME type
@@ -291,7 +291,7 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
e++; /* 0 means "once" */ e++; /* 0 means "once" */
if (strncmp((const char *) fslash(catbuff, sizeof(catbuff), (char *) indexpath), filename, strlen(indexpath)) == 0) // couper if (strncmp((const char *) fslash(catbuff, (char *) indexpath), filename, strlen(indexpath)) == 0) // couper
strcpybuff(savelst, filename + strlen(indexpath)); strcpybuff(savelst, filename + strlen(indexpath));
else else
strcpybuff(savelst, filename); strcpybuff(savelst, filename);
@@ -358,9 +358,9 @@ void index_finish(const char *indexpath, int mode) {
// Write new file // Write new file
if (mode == 1) // TEXT if (mode == 1) // TEXT
fp = fopen(concat(catbuff, sizeof(catbuff), indexpath, "index.txt"), "wb"); fp = fopen(concat(catbuff, indexpath, "index.txt"), "wb");
else // HTML else // HTML
fp = fopen(concat(catbuff, sizeof(catbuff), indexpath, "sindex.html"), "wb"); fp = fopen(concat(catbuff, indexpath, "sindex.html"), "wb");
if (fp) { if (fp) {
char current_word[KEYW_LEN + 32]; char current_word[KEYW_LEN + 32];
char word[KEYW_LEN + 32]; char word[KEYW_LEN + 32];

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -26,7 +26,8 @@ Please visit our Website: http://www.httrack.com
*/ */
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* File: hash tables */ /* File: httrack.c subroutines: */
/* hash tables */
/* Author: Xavier Roche */ /* Author: Xavier Roche */
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
@@ -82,7 +83,7 @@ Please visit our Website: http://www.httrack.com
#define STASH_SIZE 16 #define STASH_SIZE 16
/** Minimum value for lg_size. **/ /** Minimum value for lg_size. **/
#define MIN_LG_SIZE 4 #define MIN_LG_SIZE 8
/** Minimum value for pool.capacity. **/ /** Minimum value for pool.capacity. **/
#define MIN_POOL_CAPACITY 256 #define MIN_POOL_CAPACITY 256
@@ -175,68 +176,40 @@ struct struct_inthash {
/** opaque argument **/ /** opaque argument **/
void *arg; void *arg;
} key; } key;
/** How to handle fatal assertions (might be NULL). **/
struct {
/** logging **/
t_inthash_loghandler log;
/** abort() **/
t_inthash_asserthandler fatal;
/** opaque argument **/
void *arg;
/** hashtable name for logging **/
const char *name;
} error;
} custom; } custom;
}; };
/* Assertion check. */ /* Using httrack code */
#define inthash_assert(HASHTABLE, EXP) \ #ifdef LIBHTTRACK_EXPORTS
(void)( (EXP) || (inthash_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) ) #include "htsbase.h"
#define inthash_assert assertf
/* Compiler-specific. */
#ifdef __GNUC__
#define INTHASH_PRINTF_FUN(fmt, arg) __attribute__ ((format (printf, fmt, arg)))
#define INTHASH_INLINE __inline__
#elif (defined(_MSC_VER))
#define INTHASH_PRINTF_FUN(FMT, ARGS)
#define INTHASH_INLINE __inline
#else #else
#define INTHASH_PRINTF_FUN(FMT, ARGS) static void inthash_fail(const char* exp, const char* file, int line) {
#define INTHASH_INLINE fprintf(stderr, "assertion '%s' failed at %s:%d\n", exp, file, line);
abort();
}
#define inthash_assert(EXP) (void)( (EXP) || (inthash_fail(#EXP, __FILE__, __LINE__), 0) )
#define HTS_PRINTF_FUN(FMT, ARGS)
#define HTS_INLINE
#endif #endif
/* Logging level. */ /* Logging level. */
static void inthash_log(const inthash hashtable, inthash_loglevel level,
const char *format, va_list args);
#define DECLARE_LOG_FUNCTION(NAME, LEVEL) \
static void NAME(const inthash hashtable, const char *format, ...) \
INTHASH_PRINTF_FUN(2, 3); \
static void NAME(const inthash hashtable, const char *format, ...) { \
va_list args; \
va_start(args, format); \
inthash_log(hashtable, LEVEL, format, args); \
va_end(args); \
}
#if 0 #if 0
/* Verbose. */ /* Verbose. */
DECLARE_LOG_FUNCTION(inthash_crit, inthash_log_critical) #define inthash_crit inthash_log
DECLARE_LOG_FUNCTION(inthash_warning, inthash_log_warning) #define inthash_info inthash_log
DECLARE_LOG_FUNCTION(inthash_info, inthash_log_info) #define inthash_debug inthash_log
DECLARE_LOG_FUNCTION(inthash_debug, inthash_log_debug) #define inthash_trace inthash_log
DECLARE_LOG_FUNCTION(inthash_trace, inthash_log_trace)
#elif 0 #elif 0
/* Info. */ /* Info. */
DECLARE_LOG_FUNCTION(inthash_crit, inthash_log_critical) #define inthash_crit inthash_log
DECLARE_LOG_FUNCTION(inthash_warning, inthash_log_warning) #define inthash_info inthash_log
DECLARE_LOG_FUNCTION(inthash_info, inthash_log_info)
#define inthash_debug inthash_log #define inthash_debug inthash_log
#define inthash_trace inthash_nolog #define inthash_trace inthash_nolog
#else #else
/* No logging except stats and critical. */ /* No logging except stats and critical. */
DECLARE_LOG_FUNCTION(inthash_crit, inthash_log_critical) #define inthash_crit inthash_log
DECLARE_LOG_FUNCTION(inthash_warning, inthash_log_warning) #define inthash_info inthash_log
DECLARE_LOG_FUNCTION(inthash_info, inthash_log_info)
#define inthash_debug inthash_nolog #define inthash_debug inthash_nolog
#define inthash_trace inthash_nolog #define inthash_trace inthash_nolog
#endif #endif
@@ -247,99 +220,21 @@ DECLARE_LOG_FUNCTION(inthash_info, inthash_log_info)
/* the empty string for the string pool */ /* the empty string for the string pool */
static char the_empty_string[1] = { 0 }; static char the_empty_string[1] = { 0 };
/* global assertion handler */
static t_inthash_asserthandler global_assert_handler = NULL;
/* global assertion handler */
static t_inthash_loghandler global_log_handler = NULL;
/* default assertion handler, if neither hashtable one nor global one
were defined */
static void inthash_fail(const char* exp, const char* file, int line) {
fprintf(stderr, "assertion '%s' failed at %s:%d\n", exp, file, line);
abort();
}
/* assert failed handler. */
static void inthash_assert_failed(const inthash hashtable, const char* exp, const char* file, int line) {
const char *name = inthash_get_name(hashtable);
inthash_crit(hashtable, "hashtable %s: %s failed at %s:%d",
name != NULL ? name : "<unknown>", exp, file, line);
if (hashtable != NULL && hashtable->custom.error.fatal != NULL) {
hashtable->custom.error.fatal(hashtable->custom.error.arg, exp, file, line);
} else if (global_assert_handler != NULL) {
global_assert_handler(hashtable, exp, file, line);
} else {
inthash_fail(exp, file, line);
}
abort();
}
/* Logging */ /* Logging */
static void inthash_log(const inthash hashtable, inthash_loglevel level, static void inthash_log(const inthash hashtable, const char *format, ...)
const char *format, va_list args) { HTS_PRINTF_FUN(2, 3) {
inthash_assert(hashtable, format != NULL); va_list args;
if (hashtable != NULL && hashtable->custom.error.log != NULL) { inthash_assert(format != NULL);
hashtable->custom.error.log(hashtable->custom.error.arg, level, format, args); fprintf(stderr, "[%p] ", (void*) hashtable);
} else if (global_log_handler != NULL) { va_start(args, format);
global_log_handler(hashtable, level, format, args); (void) vfprintf(stderr, format, args);
} else { va_end(args);
fprintf(stderr, "[%p] ", (void*) hashtable); putc('\n', stderr);
(void) vfprintf(stderr, format, args);
putc('\n', stderr);
}
} }
/* No logging (should be dropped by the compiler) */ /* No logging (should be dropped by the compiler) */
static void inthash_nolog(const inthash hashtable, const char *format, ...) static void inthash_nolog(const inthash hashtable, const char *format, ...)
INTHASH_PRINTF_FUN(2, 3); HTS_PRINTF_FUN(2, 3) {
static void inthash_nolog(const inthash hashtable, const char *format, ...) {
}
const char* inthash_get_name(inthash hashtable) {
return hashtable->custom.error.name;
}
static void inthash_log_stats(inthash hashtable) {
const char *name = inthash_get_name(hashtable);
inthash_info(hashtable, "hashtable %s%s%ssummary: "
"size=%"UINT_64_FORMAT" (lg2=%"UINT_64_FORMAT") "
"used=%"UINT_64_FORMAT" "
"stash-size=%"UINT_64_FORMAT" "
"pool-size=%"UINT_64_FORMAT" "
"pool-capacity=%"UINT_64_FORMAT" "
"pool-used=%"UINT_64_FORMAT" "
"writes=%"UINT_64_FORMAT" "
"(new=%"UINT_64_FORMAT") "
"moved=%"UINT_64_FORMAT " "
"stashed=%"UINT_64_FORMAT" "
"max-stash-size=%"UINT_64_FORMAT" "
"avg-moved=%g "
"rehash=%"UINT_64_FORMAT" "
"pool-compact=%"UINT_64_FORMAT" "
"pool-realloc=%"UINT_64_FORMAT" "
"memory=%"UINT_64_FORMAT,
name != NULL ? "\"" : "",
name != NULL ? name : "",
name != NULL ? "\" " : "",
(uint64_t) POW2(hashtable->lg_size),
(uint64_t) hashtable->lg_size,
(uint64_t) hashtable->used,
(uint64_t) hashtable->stash.size,
(uint64_t) hashtable->pool.size,
(uint64_t) hashtable->pool.capacity,
(uint64_t) hashtable->pool.used,
(uint64_t) hashtable->stats.write_count,
(uint64_t) hashtable->stats.add_count,
(uint64_t) hashtable->stats.cuckoo_moved,
(uint64_t) hashtable->stats.stash_added,
(uint64_t) hashtable->stats.max_stash_size,
(double) hashtable->stats.cuckoo_moved / (double) hashtable->stats.add_count,
(uint64_t) hashtable->stats.rehash_count,
(uint64_t) hashtable->stats.pool_compact_count,
(uint64_t) hashtable->stats.pool_realloc_count,
(uint64_t) inthash_memory_size(hashtable)
);
} }
inthash_keys inthash_hash_value(const char *value) { inthash_keys inthash_hash_value(const char *value) {
@@ -423,39 +318,39 @@ inthash_keys inthash_hash_value(const char *value) {
#endif #endif
} }
static INTHASH_INLINE inthash_keys inthash_calc_hashes(inthash hashtable, static HTS_INLINE inthash_keys inthash_calc_hashes(inthash hashtable,
const char *value) { const char *value) {
return hashtable->custom.key.hash == NULL return hashtable->custom.key.hash == NULL
? inthash_hash_value(value) ? inthash_hash_value(value)
: hashtable->custom.key.hash(hashtable->custom.key.arg, value); : hashtable->custom.key.hash(hashtable->custom.key.arg, value);
} }
/* position 'pos' is free ? */ /* position 'pos' is free ? */
static INTHASH_INLINE int inthash_is_free(const inthash hashtable, size_t pos) { static HTS_INLINE int inthash_is_free(const inthash hashtable, size_t pos) {
return hashtable->items[pos].name == NULL; return hashtable->items[pos].name == NULL;
} }
/* compare two keys ; by default using strcmp() */ /* compare two keys ; by default using strcmp() */
static INTHASH_INLINE int inthash_equals(inthash hashtable, static HTS_INLINE int inthash_equals(inthash hashtable,
const char *a, const char *b) { const char *a, const char *b) {
return hashtable->custom.key.equals == NULL return hashtable->custom.key.equals == NULL
? strcmp(a, b) == 0 ? strcmp(a, b) == 0
: hashtable->custom.key.equals(hashtable->custom.key.arg, a, b); : hashtable->custom.key.equals(hashtable->custom.key.arg, a, b);
} }
static INTHASH_INLINE int inthash_matches_(inthash hashtable, static HTS_INLINE int inthash_matches_(inthash hashtable,
const inthash_item *const item, const inthash_item *const item,
const char *name, const char *name,
const inthash_keys *hashes) { const inthash_keys *hashes) {
return item->name != NULL return item->name != NULL
&& item->hashes.hash1 == hashes->hash1 && item->hashes.hash1 == hashes->hash1
&& item->hashes.hash2 == hashes->hash2 && item->hashes.hash2 == hashes->hash2
&& inthash_equals(hashtable, item->name, name); && inthash_equals(hashtable, item->name, name);
} }
static INTHASH_INLINE int inthash_matches(inthash hashtable, size_t pos, static HTS_INLINE int inthash_matches(inthash hashtable, size_t pos,
const char *name, const char *name,
const inthash_keys *hashes) { const inthash_keys *hashes) {
const inthash_item *const item = &hashtable->items[pos]; const inthash_item *const item = &hashtable->items[pos];
return inthash_matches_(hashtable, item, name, hashes); return inthash_matches_(hashtable, item, name, hashes);
} }
@@ -469,7 +364,7 @@ static void inthash_compact_pool(inthash hashtable, size_t capacity) {
size_t count = 0; size_t count = 0;
/* we manage the string pool */ /* we manage the string pool */
inthash_assert(hashtable, hashtable->custom.key.dup == NULL); assert(hashtable->custom.key.dup == NULL);
/* statistics */ /* statistics */
hashtable->stats.pool_compact_count++; hashtable->stats.pool_compact_count++;
@@ -488,7 +383,7 @@ static void inthash_compact_pool(inthash hashtable, size_t capacity) {
"** hashtable string pool compaction error: could not allocate " "** hashtable string pool compaction error: could not allocate "
"%"UINT_64_FORMAT" bytes", "%"UINT_64_FORMAT" bytes",
(uint64_t) hashtable->pool.capacity); (uint64_t) hashtable->pool.capacity);
inthash_assert(hashtable, ! "hashtable string pool compaction error"); inthash_assert(! "hashtable string pool compaction error");
} }
/* relocate a string on a different pool */ /* relocate a string on a different pool */
@@ -501,18 +396,17 @@ static void inthash_compact_pool(inthash hashtable, size_t capacity) {
char *const max_dest = \ char *const max_dest = \
&hashtable->pool.buffer[capacity]; \ &hashtable->pool.buffer[capacity]; \
/* copy string */ \ /* copy string */ \
inthash_assert(hashtable, dest < max_dest); \ inthash_assert(dest < max_dest); \
dest[0] = src[0]; \ dest[0] = src[0]; \
{ \ { \
size_t i; \ size_t i; \
for(i = 1 ; src[i - 1] != '\0' ; i++) { \ for(i = 1 ; src[i - 1] != '\0' ; i++) { \
inthash_assert(hashtable, &dest[i] < max_dest); \ inthash_assert(&dest[i] < max_dest); \
dest[i] = src[i]; \ dest[i] = src[i]; \
} \ } \
/* update pool size */ \ /* update pool size */ \
hashtable->pool.size += i; \ hashtable->pool.size += i; \
inthash_assert(hashtable, \ assert(hashtable->pool.size <= capacity); \
hashtable->pool.size <= capacity); \
} \ } \
/* update source */ \ /* update source */ \
S = dest; \ S = dest; \
@@ -551,7 +445,7 @@ static void inthash_realloc_pool(inthash hashtable, size_t capacity) {
size_t count = 0; size_t count = 0;
/* we manage the string pool */ /* we manage the string pool */
inthash_assert(hashtable, hashtable->custom.key.dup == NULL); assert(hashtable->custom.key.dup == NULL);
/* compact instead ? */ /* compact instead ? */
if (hashtable->pool.used < ( hashtable->pool.size*3 ) / 4) { if (hashtable->pool.used < ( hashtable->pool.size*3 ) / 4) {
@@ -573,17 +467,17 @@ static void inthash_realloc_pool(inthash hashtable, size_t capacity) {
"** hashtable string pool allocation error: could not allocate " "** hashtable string pool allocation error: could not allocate "
"%"UINT_64_FORMAT" bytes", "%"UINT_64_FORMAT" bytes",
(uint64_t) hashtable->pool.capacity); (uint64_t) hashtable->pool.capacity);
inthash_assert(hashtable, ! "hashtable string pool allocation error"); inthash_assert(! "hashtable string pool allocation error");
} }
/* recompute string address */ /* recompute string address */
#define RECOMPUTE_STRING(S) do { \ #define RECOMPUTE_STRING(S) do { \
if (S != NULL && S != the_empty_string) { \ if (S != NULL && S != the_empty_string) { \
const size_t offset = (S) - oldbase; \ const size_t offset = (S) - oldbase; \
inthash_assert(hashtable, offset < hashtable->pool.capacity); \ assert(offset < hashtable->pool.capacity); \
S = &hashtable->pool.buffer[offset]; \ S = &hashtable->pool.buffer[offset]; \
count++; \ count++; \
} \ } \
} while(0) } while(0)
/* recompute */ /* recompute */
@@ -608,22 +502,22 @@ static char* inthash_dup_name_internal(inthash hashtable, const char *name) {
/* the pool does not allow empty strings for safety purpose ; handhe that /* the pool does not allow empty strings for safety purpose ; handhe that
(keys are being emptied when free'd to detect duplicate free) */ (keys are being emptied when free'd to detect duplicate free) */
if (len == 1) { if (len == 1) {
inthash_assert(hashtable, the_empty_string[0] == '\0'); assert(the_empty_string[0] == '\0');
return the_empty_string; return the_empty_string;
} }
/* expand pool capacity */ /* expand pool capacity */
inthash_assert(hashtable, hashtable->pool.size <= hashtable->pool.capacity); assert(hashtable->pool.size <= hashtable->pool.capacity);
if (hashtable->pool.capacity - hashtable->pool.size < len) { if (hashtable->pool.capacity - hashtable->pool.size < len) {
size_t capacity; size_t capacity;
for(capacity = MIN_POOL_CAPACITY ; capacity < hashtable->pool.size + len for(capacity = MIN_POOL_CAPACITY ; capacity < hashtable->pool.size + len
; capacity <<= 1) ; ; capacity <<= 1) ;
inthash_assert(hashtable, hashtable->pool.size < capacity); assert(hashtable->pool.size < capacity);
inthash_realloc_pool(hashtable, capacity); inthash_realloc_pool(hashtable, capacity);
} }
/* copy */ /* copy */
inthash_assert(hashtable, len + hashtable->pool.size <= hashtable->pool.capacity); assert(len + hashtable->pool.size <= hashtable->pool.capacity);
s = &hashtable->pool.buffer[hashtable->pool.size]; s = &hashtable->pool.buffer[hashtable->pool.size];
memcpy(s, name, len); memcpy(s, name, len);
hashtable->pool.size += len; hashtable->pool.size += len;
@@ -633,7 +527,7 @@ static char* inthash_dup_name_internal(inthash hashtable, const char *name) {
} }
/* duplicate a key. default is to use the internal pool. */ /* duplicate a key. default is to use the internal pool. */
static INTHASH_INLINE char* inthash_dup_name(inthash hashtable, const char *name) { static HTS_INLINE char* inthash_dup_name(inthash hashtable, const char *name) {
return hashtable->custom.key.dup == NULL return hashtable->custom.key.dup == NULL
? inthash_dup_name_internal(hashtable, name) ? inthash_dup_name_internal(hashtable, name)
: hashtable->custom.key.dup(hashtable->custom.key.arg, name); : hashtable->custom.key.dup(hashtable->custom.key.arg, name);
@@ -646,11 +540,11 @@ static void inthash_free_key_internal(inthash hashtable, char *name) {
/* see inthash_dup_name_internal() handling */ /* see inthash_dup_name_internal() handling */
if (len == 1 && name == the_empty_string) { if (len == 1 && name == the_empty_string) {
inthash_assert(hashtable, the_empty_string[0] == '\0'); assert(the_empty_string[0] == '\0');
return ; return ;
} }
inthash_assert(hashtable, *name != '\0' || !"duplicate or bad string pool release"); assert(*name != '\0' || !"duplicate or bad string pool release");
hashtable->pool.used -= len; hashtable->pool.used -= len;
*name = '\0'; /* the string is now invalidated */ *name = '\0'; /* the string is now invalidated */
@@ -661,7 +555,7 @@ static void inthash_free_key_internal(inthash hashtable, char *name) {
if (hashtable->pool.used < capacity / 4) { if (hashtable->pool.used < capacity / 4) {
capacity /= 2; capacity /= 2;
} }
inthash_assert(hashtable, hashtable->pool.used < capacity); assert(hashtable->pool.used < capacity);
inthash_compact_pool(hashtable, capacity); inthash_compact_pool(hashtable, capacity);
} }
} }
@@ -676,14 +570,14 @@ static void inthash_free_key(inthash hashtable, char *name) {
} }
} }
static INTHASH_INLINE size_t inthash_hash_to_pos_(size_t lg_size, static HTS_INLINE size_t inthash_hash_to_pos_(size_t lg_size,
inthash_key hash) { inthash_key hash) {
const inthash_key mask = POW2(lg_size) - 1; const inthash_key mask = POW2(lg_size) - 1;
return hash & mask; return hash & mask;
} }
static INTHASH_INLINE size_t inthash_hash_to_pos(const inthash hashtable, static HTS_INLINE size_t inthash_hash_to_pos(const inthash hashtable,
inthash_key hash) { inthash_key hash) {
return inthash_hash_to_pos_(hashtable->lg_size, hash); return inthash_hash_to_pos_(hashtable->lg_size, hash);
} }
@@ -864,7 +758,7 @@ static int inthash_add_item_(inthash hashtable, inthash_item item) {
cuckoo_hash = item.hashes.hash1; cuckoo_hash = item.hashes.hash1;
} }
else { else {
inthash_assert(hashtable, ! "hashtable internal error: unexpected position"); inthash_assert(! "hashtable internal error: unexpected position");
} }
/* we are looping (back to same hash) */ /* we are looping (back to same hash) */
@@ -891,8 +785,7 @@ static int inthash_add_item_(inthash hashtable, inthash_item item) {
} else { } else {
/* we are doomed. hopefully the probability is lower than being killed /* we are doomed. hopefully the probability is lower than being killed
by a wandering radioactive monkey */ by a wandering radioactive monkey */
inthash_log_stats(hashtable); inthash_assert(! "hashtable internal error: cuckoo/stash collision");
inthash_assert(hashtable, ! "hashtable internal error: cuckoo/stash collision");
/* not reachable code */ /* not reachable code */
return -1; return -1;
} }
@@ -908,15 +801,11 @@ int inthash_write_value(inthash hashtable, const char *name,
/* size of half of the table */ /* size of half of the table */
const size_t half_size = POW2(hashtable->lg_size - 1); const size_t half_size = POW2(hashtable->lg_size - 1);
/* size of half of the stash */
const size_t half_stash_size = STASH_SIZE / 2;
/* item was added: increase count */ /* item was added: increase count */
hashtable->used++; hashtable->used++;
/* table is more than half-full, or stash is more than half-full */ /* table is more than half-full */
if (hashtable->used >= half_size if (hashtable->used >= half_size) {
|| hashtable->stash.size >= half_stash_size) {
size_t i; size_t i;
/* size before */ /* size before */
@@ -927,16 +816,6 @@ int inthash_write_value(inthash hashtable, const char *name,
/* size after doubling it */ /* size after doubling it */
const size_t alloc_size = prev_alloc_size * 2; const size_t alloc_size = prev_alloc_size * 2;
/* log stash issues */
if (hashtable->stash.size >= half_stash_size
&& half_size > POW2(16)
&& hashtable->used < half_size / 4) {
inthash_warning(hashtable,
"stash size still full despite %"UINT_64_FORMAT
" elements used out of %"UINT_64_FORMAT,
hashtable->used, half_size*2);
}
/* statistics */ /* statistics */
hashtable->stats.rehash_count++; hashtable->stats.rehash_count++;
@@ -949,7 +828,7 @@ int inthash_write_value(inthash hashtable, const char *name,
"** hashtable allocation error: " "** hashtable allocation error: "
"could not allocate %"UINT_64_FORMAT" bytes", "could not allocate %"UINT_64_FORMAT" bytes",
(uint64_t) alloc_size); (uint64_t) alloc_size);
inthash_assert(hashtable, ! "hashtable allocation error"); inthash_assert(! "hashtable allocation error");
} }
/* clear upper half */ /* clear upper half */
@@ -965,7 +844,7 @@ int inthash_write_value(inthash hashtable, const char *name,
const size_t pos = inthash_hash_to_pos(hashtable, hashes->hash1); const size_t pos = inthash_hash_to_pos(hashtable, hashes->hash1);
/* no more the expected position */ /* no more the expected position */
if (pos != i) { if (pos != i) {
inthash_assert(hashtable, pos >= prev_size); inthash_assert(pos >= prev_size);
hashtable->items[pos] = hashtable->items[i]; hashtable->items[pos] = hashtable->items[i];
memset(&hashtable->items[i], 0, sizeof(hashtable->items[i])); memset(&hashtable->items[i], 0, sizeof(hashtable->items[i]));
} }
@@ -974,13 +853,13 @@ int inthash_write_value(inthash hashtable, const char *name,
const size_t pos = inthash_hash_to_pos(hashtable, hashes->hash2); const size_t pos = inthash_hash_to_pos(hashtable, hashes->hash2);
/* no more the expected position */ /* no more the expected position */
if (pos != i) { if (pos != i) {
inthash_assert(hashtable, pos >= prev_size); inthash_assert(pos >= prev_size);
hashtable->items[pos] = hashtable->items[i]; hashtable->items[pos] = hashtable->items[i];
memset(&hashtable->items[i], 0, sizeof(hashtable->items[i])); memset(&hashtable->items[i], 0, sizeof(hashtable->items[i]));
} }
} }
else { else {
inthash_assert(hashtable, ! "hashtable unexpected internal error (bad position)"); inthash_assert(! "hashtable unexpected internal error (bad position)");
} }
} }
} }
@@ -1003,12 +882,12 @@ int inthash_write_value(inthash hashtable, const char *name,
for(i = 0 ; i < old_size ; i++) { for(i = 0 ; i < old_size ; i++) {
const int ret = inthash_add_item_(hashtable, stash[i]); const int ret = inthash_add_item_(hashtable, stash[i]);
if (ret == 0) { if (ret == 0) {
inthash_assert(hashtable, ! "hashtable duplicate key when merging the stash"); inthash_assert(! "hashtable duplicate key when merging the stash");
} }
} }
/* logging */ /* logging */
inthash_assert(hashtable, hashtable->stash.size <= old_size); inthash_assert(hashtable->stash.size <= old_size);
if (hashtable->stash.size < old_size) { if (hashtable->stash.size < old_size) {
inthash_debug(hashtable, "reduced stash size from %"UINT_64_FORMAT" " inthash_debug(hashtable, "reduced stash size from %"UINT_64_FORMAT" "
"to %"UINT_64_FORMAT, "to %"UINT_64_FORMAT,
@@ -1095,7 +974,7 @@ static size_t inthash_inc_(inthash hashtable, const char *name,
} else { } else {
/* create a new value */ /* create a new value */
const int ret = inthash_write(hashtable, name, inc); const int ret = inthash_write(hashtable, name, inc);
inthash_assert(hashtable, ret); inthash_assert(ret);
return inc; return inc;
} }
} }
@@ -1162,7 +1041,7 @@ int inthash_remove(inthash hashtable, const char *name) {
if (ret) { if (ret) {
/* item was removed: decrease count */ /* item was removed: decrease count */
inthash_assert(hashtable, hashtable->used != 0); inthash_assert(hashtable->used != 0);
hashtable->used--; hashtable->used--;
/* can we place stash entry back to the table ? */ /* can we place stash entry back to the table ? */
@@ -1235,9 +1114,6 @@ inthash inthash_new(size_t initial_size) {
hashtable->custom.key.hash = NULL; hashtable->custom.key.hash = NULL;
hashtable->custom.key.equals = NULL; hashtable->custom.key.equals = NULL;
hashtable->custom.key.arg = NULL; hashtable->custom.key.arg = NULL;
hashtable->custom.error.fatal = NULL;
hashtable->custom.error.name = NULL;
hashtable->custom.error.arg = NULL;
} }
return hashtable; return hashtable;
} }
@@ -1258,10 +1134,6 @@ void inthash_value_is_malloc(inthash hashtable, int flag) {
} }
} }
void inthash_set_name(inthash hashtable, const char *name) {
hashtable->custom.error.name = name;
}
void inthash_value_set_value_handler(inthash hashtable, void inthash_value_set_value_handler(inthash hashtable,
t_inthash_freehandler free, t_inthash_freehandler free,
void *arg) { void *arg) {
@@ -1276,7 +1148,7 @@ void inthash_value_set_key_handler(inthash hashtable,
t_inthash_cmphandler equals, t_inthash_cmphandler equals,
void *arg) { void *arg) {
/* dup and free must be consistent */ /* dup and free must be consistent */
inthash_assert(hashtable, ( dup == NULL ) == ( free == NULL ) ); assert( ( dup == NULL ) == ( free == NULL ) );
hashtable->custom.key.dup = dup; hashtable->custom.key.dup = dup;
hashtable->custom.key.free = free; hashtable->custom.key.free = free;
hashtable->custom.key.hash = hash; hashtable->custom.key.hash = hash;
@@ -1284,16 +1156,6 @@ void inthash_value_set_key_handler(inthash hashtable,
hashtable->custom.key.arg = arg; hashtable->custom.key.arg = arg;
} }
void inthash_set_assert_handler(inthash hashtable,
t_inthash_loghandler log,
t_inthash_asserthandler fatal,
void *arg) {
inthash_assert(hashtable, fatal != NULL);
hashtable->custom.error.log = log;
hashtable->custom.error.fatal = fatal;
hashtable->custom.error.arg = arg;
}
size_t inthash_nitems(inthash hashtable) { size_t inthash_nitems(inthash hashtable) {
if (hashtable != NULL) if (hashtable != NULL)
return hashtable->used; return hashtable->used;
@@ -1307,6 +1169,31 @@ size_t inthash_memory_size(inthash hashtable) {
return size_struct + hash_size + pool_size; return size_struct + hash_size + pool_size;
} }
static void inthash_log_stats(inthash hashtable) {
inthash_info(hashtable, "freeing table ; "
"writes=%"UINT_64_FORMAT" "
"(new=%"UINT_64_FORMAT") "
"moved=%"UINT_64_FORMAT " "
"stashed=%"UINT_64_FORMAT" "
"max-stash-size=%"UINT_64_FORMAT" "
"avg-moved=%g "
"rehash=%"UINT_64_FORMAT" "
"pool-compact=%"UINT_64_FORMAT" "
"pool-realloc=%"UINT_64_FORMAT" "
"memory=%"UINT_64_FORMAT,
(uint64_t) hashtable->stats.write_count,
(uint64_t) hashtable->stats.add_count,
(uint64_t) hashtable->stats.cuckoo_moved,
(uint64_t) hashtable->stats.stash_added,
(uint64_t) hashtable->stats.max_stash_size,
(double) hashtable->stats.cuckoo_moved / (double) hashtable->stats.add_count,
(uint64_t) hashtable->stats.rehash_count,
(uint64_t) hashtable->stats.pool_compact_count,
(uint64_t) hashtable->stats.pool_realloc_count,
(uint64_t) inthash_memory_size(hashtable)
);
}
void inthash_delete(inthash *phashtable) { void inthash_delete(inthash *phashtable) {
if (phashtable != NULL) { if (phashtable != NULL) {
inthash hashtable = *phashtable; inthash hashtable = *phashtable;
@@ -1374,9 +1261,3 @@ inthash_item *inthash_enum_next(struct_inthash_enum * e) {
return NULL; return NULL;
} }
} }
void inthash_set_global_assert_handler(t_inthash_loghandler log,
t_inthash_asserthandler fatal) {
global_log_handler = log;
global_assert_handler = fatal;
}

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -26,7 +26,8 @@ Please visit our Website: http://www.httrack.com
*/ */
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* File: hash table system (fast index) */ /* File: httrack.c subroutines: */
/* hash table system (fast index) */
/* Author: Xavier Roche */ /* Author: Xavier Roche */
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
@@ -112,34 +113,18 @@ struct inthash_item {
inthash_keys hashes; inthash_keys hashes;
}; };
/** Log level. **/
typedef enum inthash_loglevel {
inthash_log_critical,
inthash_log_warning,
inthash_log_info,
inthash_log_debug,
inthash_log_trace
} inthash_loglevel;
/** Alias for legacy code. **/ /** Alias for legacy code. **/
typedef inthash_item inthash_chain; typedef inthash_item inthash_chain;
/** Value free handler **/ /** Value free handler **/
typedef void (*t_inthash_freehandler)(void *arg, void *value); typedef void (*t_inthash_freehandler) (void *arg, void *value);
/** Name dup handler. **/ /** Name dup handler. **/
typedef char* (*t_inthash_duphandler)(void *arg, const char *name); typedef char* (*t_inthash_duphandler) (void *arg, const char *name);
/** Hash computation handler. **/ /** Hash computation handler. **/
typedef inthash_keys (*t_inthash_hasheshandler)(void *arg, const char *value); typedef inthash_keys (*t_inthash_hasheshandler)(void *arg, const char *value);
/** Hashtable logging handler. **/
typedef void (*t_inthash_loghandler)(void *arg, inthash_loglevel level,
const char* format, va_list args);
/** Hashtable fatal assertion failure. **/
typedef void (*t_inthash_asserthandler)(void *arg, const char* exp, const char* file, int line);
/** /**
* Value comparison handler (returns non-zero value if strings are equal). * Value comparison handler (returns non-zero value if strings are equal).
**/ **/
@@ -230,28 +215,6 @@ void inthash_value_set_key_handler(inthash hashtable,
t_inthash_cmphandler equals, t_inthash_cmphandler equals,
void *arg); void *arg);
/**
* Set assertion failure handler.
* log: handler called upon serious programming error
* fatal: handler called upon serious programming error
**/
void inthash_set_assert_handler(inthash hashtable,
t_inthash_loghandler log,
t_inthash_asserthandler fatal,
void *arg);
/**
* Set the hashtable name, for degugging purpose.
* name: the hashtable name (ASCII or UTF-8)
*/
void inthash_set_name(inthash hashtable, const char *name);
/**
* Get the hashtable name, for degugging purpose.
* Return NULL if no name was defined.
**/
const char* inthash_get_name(inthash hashtable);
/** /**
* Read an integer entry from the hashtable. * Read an integer entry from the hashtable.
* Return non-zero value upon success and sets intvalue. * Return non-zero value upon success and sets intvalue.
@@ -346,18 +309,6 @@ inthash_item *inthash_enum_next(struct_inthash_enum * e);
**/ **/
inthash_keys inthash_hash_value(const char *value); inthash_keys inthash_hash_value(const char *value);
/**
* Set default global assertion failure handler.
* The handler will be used if no specific handler was defined in the
* hashtable itself.
* log: handler called upon serious error log (opaque argument
* is the hashtable itself)
* fatal: handler called upon serious programming error (opaque argument
* is the hashtable itself)
**/
void inthash_set_global_assert_handler(t_inthash_loghandler log,
t_inthash_asserthandler fatal);
#endif #endif
#endif #endif

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -172,7 +172,7 @@ static int hts_parse_java(t_hts_callbackarg * carg, httrackp * opt,
#if JAVADEBUG #if JAVADEBUG
printf("fopen\n"); printf("fopen\n");
#endif #endif
if ((fpout = FOPEN(fconv(catbuff, sizeof(catbuff), file), "r+b")) == NULL) { if ((fpout = FOPEN(fconv(catbuff, file), "r+b")) == NULL) {
//fprintf(stderr, "Cannot open input file.\n"); //fprintf(stderr, "Cannot open input file.\n");
sprintf(str->err_msg, "Unable to open file %s", file); sprintf(str->err_msg, "Unable to open file %s", file);
return 0; // une erreur.. return 0; // une erreur..
@@ -477,7 +477,7 @@ static int tris(httrackp * opt, char *buffer) {
if (strnotempty(type)) // type reconnu! if (strnotempty(type)) // type reconnu!
return 1; return 1;
// ajout RX 05/2001 // ajout RX 05/2001
else if (is_dyntype(get_ext(catbuff, sizeof(catbuff), buffer))) // asp,cgi... else if (is_dyntype(get_ext(catbuff, buffer))) // asp,cgi...
return 1; return 1;
} }
return 0; return 0;

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -35,8 +35,6 @@ Please visit our Website: http://www.httrack.com
#ifndef HTS_DEFH #ifndef HTS_DEFH
#define HTS_DEFH #define HTS_DEFH
#include "httrack-library.h"
/* Forward definitions */ /* Forward definitions */
#ifndef HTS_DEF_FWSTRUCT_htsrequest #ifndef HTS_DEF_FWSTRUCT_htsrequest
#define HTS_DEF_FWSTRUCT_htsrequest #define HTS_DEF_FWSTRUCT_htsrequest
@@ -94,8 +92,7 @@ MSVC2003INLINEBUG HTS_STATIC char *getHtsOptBuff_(httrackp * opt) {
} }
#undef MSVC2003INLINEBUG #undef MSVC2003INLINEBUG
#define OPT_GET_BUFF(OPT) ( getHtsOptBuff_(OPT) ) #define OPT_GET_BUFF(OPT) ( getHtsOptBuff_(OPT) )
#define OPT_GET_BUFF_SIZE(OPT) ( sizeof(opt->state.concat.buff[0]) )
// structure pour paramètres supplémentaires lors de la requête // structure pour paramètres supplémentaires lors de la requête
#ifndef HTS_DEF_FWSTRUCT_htsrequest_proxy #ifndef HTS_DEF_FWSTRUCT_htsrequest_proxy
@@ -234,9 +231,6 @@ struct t_dnscache {
// initialize an htsblk structure // initialize an htsblk structure
void hts_init_htsblk(htsblk * r); void hts_init_htsblk(htsblk * r);
// attach specific project log to hachtable logger
void hts_set_hash_handler(inthash hashtable, httrackp *opt);
// version // version
HTSEXT_API const char* hts_version(void); HTSEXT_API const char* hts_version(void);
@@ -246,7 +240,24 @@ int hts_read(htsblk * r, char *buff, int size);
//int HTS_TOTAL_RECV_CHECK(int var); //int HTS_TOTAL_RECV_CHECK(int var);
LLint check_downloadable_bytes(int rate); LLint check_downloadable_bytes(int rate);
#ifndef HTTRACK_DEFLIB
HTSEXT_API int hts_init(void);
HTSEXT_API int hts_uninit(void);
HTSEXT_API int hts_uninit_module(void); HTSEXT_API int hts_uninit_module(void);
HTSEXT_API int hts_resetvar(void); /* dummy */
HTSEXT_API void hts_debug(int level);
HTSEXT_API httrackp *hts_create_opt(void);
HTSEXT_API void hts_free_opt(httrackp * opt);
HTSEXT_API const hts_stat_struct* hts_get_stats(httrackp * opt);
HTSEXT_API void set_wrappers(httrackp * opt); /* LEGACY */
HTSEXT_API int plug_wrapper(httrackp * opt, const char *moduleName,
const char *argv);
HTSEXT_API char *hts_strdup(const char *string);
HTSEXT_API void *hts_malloc(size_t size);
HTSEXT_API void *hts_realloc(void *data, size_t size);
HTSEXT_API void hts_free(void *data);
#endif
// fonctions principales // fonctions principales
T_SOC http_fopen(httrackp * opt, char *adr, char *fil, htsblk * retour); T_SOC http_fopen(httrackp * opt, char *adr, char *fil, htsblk * retour);
@@ -271,28 +282,39 @@ void treathead(t_cookie * cookie, char *adr, char *fil, htsblk * retour,
char *rcvd); char *rcvd);
void treatfirstline(htsblk * retour, char *rcvd); void treatfirstline(htsblk * retour, char *rcvd);
#ifndef HTTRACK_DEFLIB
HTSEXT_API void infostatuscode(char *msg, int statuscode);
#endif
// sous-fonctions // sous-fonctions
LLint http_xfread1(htsblk * r, int bufl); LLint http_xfread1(htsblk * r, int bufl);
HTS_INLINE t_hostent *hts_gethostbyname2(httrackp * opt, const char *iadr, HTS_INLINE t_hostent *hts_gethostbyname2(httrackp * opt, const char *iadr,
void *v_buffer, const char **error); void *v_buffer, const char **error);
HTS_INLINE t_hostent *hts_gethostbyname(httrackp * opt, const char *iadr, HTS_INLINE t_hostent *hts_gethostbyname(httrackp * opt, const char *iadr,
void *v_buffer); void *v_buffer);
HTSEXT_API t_hostent *vxgethostbyname2(const char *const hostname, void *v_buffer, const char **error); #ifndef HTTRACK_DEFLIB
HTSEXT_API t_hostent *vxgethostbyname(const char *const hostname, void *v_buffer); HTSEXT_API t_hostent *vxgethostbyname2(char *hostname, void *v_buffer, const char **error);
HTSEXT_API int check_hostname_dns(const char *const hostname); HTSEXT_API t_hostent *vxgethostbyname(char *hostname, void *v_buffer);
HTSEXT_API int check_hostname_dns(char *hostname);
#endif
int ftp_available(void); int ftp_available(void);
#if HTS_DNSCACHE #if HTS_DNSCACHE
void hts_cache_free(t_dnscache *const cache); void hts_cache_free(t_dnscache * cache);
t_dnscache *_hts_cache(httrackp * opt); t_dnscache *_hts_cache(httrackp * opt);
#endif #endif
// outils divers // outils divers
HTS_INLINE TStamp time_local(void); HTS_INLINE TStamp time_local(void);
#ifndef HTTRACK_DEFLIB
HTSEXT_API HTS_INLINE TStamp mtime_local(void);
#endif
void sec2str(char *s, TStamp t); void sec2str(char *s, TStamp t);
#ifndef HTTRACK_DEFLIB
HTSEXT_API void qsec2str(char *st, TStamp t);
#endif
void time_gmt_rfc822(char *s); void time_gmt_rfc822(char *s);
void time_local_rfc822(char *s); void time_local_rfc822(char *s);
struct tm *convert_time_rfc822(struct tm *buffer, const char *s); struct tm *convert_time_rfc822(struct tm *buffer, const char *s);
@@ -302,6 +324,12 @@ int get_filetime_rfc822(const char *file, char *date);
HTS_INLINE void time_rfc822(char *s, struct tm *A); HTS_INLINE void time_rfc822(char *s, struct tm *A);
HTS_INLINE void time_rfc822_local(char *s, struct tm *A); HTS_INLINE void time_rfc822_local(char *s, struct tm *A);
#ifndef HTTRACK_DEFLIB
HTSEXT_API char *int2char(strc_int2bytes2 * strc, int n);
HTSEXT_API char *int2bytes(strc_int2bytes2 * strc, LLint n);
HTSEXT_API char *int2bytessec(strc_int2bytes2 * strc, long int n);
HTSEXT_API char **int2bytes2(strc_int2bytes2 * strc, LLint n);
#endif
HTS_INLINE int sendc(htsblk * r, const char *s); HTS_INLINE int sendc(htsblk * r, const char *s);
int finput(int fd, char *s, int max); int finput(int fd, char *s, int max);
int binput(char *buff, char *s, int max); int binput(char *buff, char *s, int max);
@@ -314,7 +342,7 @@ void rawlinput(FILE * fp, char *s, int max);
char *strstrcase(char *s, char *o); char *strstrcase(char *s, char *o);
int ident_url_absolute(const char *url, char *adr, char *fil); int ident_url_absolute(const char *url, char *adr, char *fil);
void fil_simplifie(char *f); void fil_simplifie(char *f);
int is_unicode_utf8(const char *buffer, const size_t size); int is_unicode_utf8(const char *buffer, size_t size);
void map_characters(unsigned char *buffer, unsigned int size, void map_characters(unsigned char *buffer, unsigned int size,
unsigned int *map); unsigned int *map);
int ishtml(httrackp * opt, const char *urlfil); int ishtml(httrackp * opt, const char *urlfil);
@@ -322,73 +350,125 @@ int ishtml_ext(const char *a);
int ishttperror(int err); int ishttperror(int err);
void guess_httptype(httrackp * opt, char *s, const char *fil); void guess_httptype(httrackp * opt, char *s, const char *fil);
#ifndef HTTRACK_DEFLIB
HTSEXT_API void get_httptype(httrackp * opt, char *s, const char *fil,
int flag);
#endif
int get_userhttptype(httrackp * opt, char *s, const char *fil); int get_userhttptype(httrackp * opt, char *s, const char *fil);
void give_mimext(char *s, const char *st); void give_mimext(char *s, const char *st);
#ifndef HTTRACK_DEFLIB
HTSEXT_API int is_knowntype(httrackp * opt, const char *fil);
HTSEXT_API int is_userknowntype(httrackp * opt, const char *fil);
HTSEXT_API int is_dyntype(const char *fil);
HTSEXT_API char *get_ext(char *catbuff, const char *fil);
#endif
int may_unknown(httrackp * opt, const char *st); int may_unknown(httrackp * opt, const char *st);
int may_bogus_multiple(httrackp * opt, const char *mime, const char *filename); int may_bogus_multiple(httrackp * opt, const char *mime, const char *filename);
int may_unknown2(httrackp * opt, const char *mime, const char *filename); int may_unknown2(httrackp * opt, const char *mime, const char *filename);
#ifndef HTTRACK_DEFLIB
HTSEXT_API char *jump_identification(const char *);
HTSEXT_API char *jump_normalized(const char *);
HTSEXT_API char *jump_toport(const char *);
HTSEXT_API char *fil_normalized(const char *source, char *dest);
HTSEXT_API char *adr_normalized(const char *source, char *dest);
#endif
char *strrchr_limit(const char *s, char c, const char *limit); char *strrchr_limit(const char *s, char c, const char *limit);
char *strstr_limit(const char *s, const char *sub, const char *limit); char *strstr_limit(const char *s, const char *sub, const char *limit);
HTS_INLINE char *jump_protocol(const char *source); HTS_INLINE char *jump_protocol(const char *source);
void code64(unsigned char *a, int size_a, unsigned char *b, int crlf); void code64(unsigned char *a, int size_a, unsigned char *b, int crlf);
#ifndef HTTRACK_DEFLIB
HTSEXT_API void unescape_amp(char *s);
HTSEXT_API void escape_spc_url(char *s);
HTSEXT_API void escape_in_url(char *s);
HTSEXT_API void escape_uri(char *s);
HTSEXT_API void escape_uri_utf(char *s);
HTSEXT_API void escape_check_url(char *s);
HTSEXT_API char *escape_check_url_addr(char *catbuff, const char *s);
HTSEXT_API void x_escape_http(char *s, int mode);
HTSEXT_API void x_escape_html(char *s);
HTSEXT_API void escape_remove_control(char *s);
HTSEXT_API void escape_for_html_print(char *s, char *d);
HTSEXT_API void escape_for_html_print_full(char *s, char *d);
#endif
#ifndef HTTRACK_DEFLIB
HTSEXT_API char *unescape_http(char *catbuff, const char *s);
HTSEXT_API char *unescape_http_unharm(char *catbuff, const char *s,
int no_high);
HTSEXT_API char *antislash_unescaped(char *catbuff, const char *s);
HTSEXT_API char *concat(char *catbuff, const char *a, const char *b);
HTSEXT_API char *fconcat(char *catbuff, const char *a, const char *b);
HTSEXT_API char *fconv(char *catbuff, const char *a);
#endif
#define copychar(catbuff,a) concat(catbuff,(a),NULL) #define copychar(catbuff,a) concat(catbuff,(a),NULL)
char *fslash(char *catbuff, const char *a);
char *convtolower(char *catbuff, const char *a); #ifndef HTTRACK_DEFLIB
void hts_lowcase(char *s); HTSEXT_API int hts_log(httrackp * opt, const char *prefix, const char *msg);
void hts_replace(char *s, char from, char to); HTSEXT_API void hts_log_print(httrackp * opt, int type, const char *format,
int multipleStringMatch(const char *s, const char *match); ...) HTS_PRINTF_FUN(3, 4);
#endif
void fprintfio(FILE * fp, char *buff, char *prefix); char *convtolower(char *catbuff, const char *a);
void hts_lowcase(char *s);
void hts_replace(char *s, char from, char to);
int multipleStringMatch(const char *s, const char *match);
void fprintfio(FILE * fp, char *buff, char *prefix);
#ifdef _WIN32 #ifdef _WIN32
#else #else
int sig_ignore_flag(int setflag); // flag ignore int sig_ignore_flag(int setflag); // flag ignore
#endif #endif
void cut_path(char *fullpath, char *path, char *pname); void cut_path(char *fullpath, char *path, char *pname);
int fexist(const char *s); int fexist(const char *s);
int fexist_utf8(const char *s); int fexist_utf8(const char *s);
/*LLint fsize(const char* s); */ /*LLint fsize(const char* s); */
off_t fpsize(FILE * fp); off_t fpsize(FILE * fp);
off_t fsize(const char *s); off_t fsize(const char *s);
off_t fsize_utf8(const char *s); off_t fsize_utf8(const char *s);
/* root dir */
#ifndef HTTRACK_DEFLIB
HTSEXT_API char *hts_rootdir(char *file);
#endif
// Threads // Threads
typedef void *(*beginthread_type) (void *); typedef void *(*beginthread_type) (void *);
/*unsigned long _beginthread( beginthread_type start_address, unsigned stack_size, void *arglist );*/ /*unsigned long _beginthread( beginthread_type start_address, unsigned stack_size, void *arglist );*/
/* variables globales */ /* variables globales */
extern HTSEXT_API hts_stat_struct HTS_STAT; extern HTSEXT_API hts_stat_struct HTS_STAT;
extern int _DEBUG_HEAD; extern int _DEBUG_HEAD;
extern FILE *ioinfo; extern FILE *ioinfo;
/* constantes */ /* constantes */
extern const char *hts_mime_keep[]; extern const char *hts_mime_keep[];
extern const char *hts_mime[][2]; extern const char *hts_mime[][2];
extern const char *hts_main_mime[]; extern const char *hts_main_mime[];
extern const char *hts_detect[]; extern const char *hts_detect[];
extern const char *hts_detectbeg[]; extern const char *hts_detectbeg[];
extern const char *hts_nodetect[]; extern const char *hts_nodetect[];
extern const char *hts_detectURL[]; extern const char *hts_detectURL[];
extern const char *hts_detectandleave[]; extern const char *hts_detectandleave[];
extern const char *hts_detect_js[]; extern const char *hts_detect_js[];
// htsmodule.c definitions // htsmodule.c definitions
extern void *openFunctionLib(const char *file_); extern void *openFunctionLib(const char *file_);
extern void *getFunctionPtr(void *handle, const char *fncname); extern void *getFunctionPtr(void *handle, const char *fncname);
extern void closeFunctionLib(void *handle); extern void closeFunctionLib(void *handle);
extern void clearCallbacks(htscallbacks * chain); extern void clearCallbacks(htscallbacks * chain);
extern size_t hts_get_callback_offs(const char *name); extern size_t hts_get_callback_offs(const char *name);
int hts_set_callback(t_hts_htmlcheck_callbacks * callbacks, int hts_set_callback(t_hts_htmlcheck_callbacks * callbacks,
const char *name, void *function); const char *name, void *function);
void *hts_get_callback(t_hts_htmlcheck_callbacks * callbacks, void *hts_get_callback(t_hts_htmlcheck_callbacks * callbacks,
const char *name); const char *name);
#define CBSTRUCT(OPT) ((t_hts_htmlcheck_callbacks*) ((OPT)->callbacks_fun)) #define CBSTRUCT(OPT) ((t_hts_htmlcheck_callbacks*) ((OPT)->callbacks_fun))
#define GET_USERCALLBACK(OPT, NAME) ( CBSTRUCT(OPT)-> NAME .fun ) #define GET_USERCALLBACK(OPT, NAME) ( CBSTRUCT(OPT)-> NAME .fun )
@@ -501,7 +581,7 @@ void *hts_get_callback(t_hts_htmlcheck_callbacks * callbacks,
// compare le début de f avec s et retourne la position de la fin // compare le début de f avec s et retourne la position de la fin
// 'A=a' (case insensitive) // 'A=a' (case insensitive)
HTS_STATIC int strfield(const char *f, const char *s) { HTS_STATIC int strfield(const char *f, const char *s) {
int r = 0; int r = 0;
while(streql(*f, *s) && ((*f) != 0) && ((*s) != 0)) { while(streql(*f, *s) && ((*f) != 0) && ((*s) != 0)) {
@@ -513,8 +593,7 @@ HTS_STATIC int strfield(const char *f, const char *s) {
return r; return r;
else else
return 0; return 0;
} }
HTS_STATIC int strcmpnocase(char *a, char *b) { HTS_STATIC int strcmpnocase(char *a, char *b) {
while(*a) { while(*a) {
int cmp = hichar(*a) - hichar(*b); int cmp = hichar(*a) - hichar(*b);

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -89,6 +89,30 @@ HTSEXT_API const char *hts_get_version_info(httrackp * opt) {
return opt->state.HTbuff; return opt->state.HTbuff;
} }
/* memory checks */
HTSEXT_API htsErrorCallback htsCallbackErr = NULL;
HTSEXT_API int htsMemoryFastXfr = 1; /* fast xfr by default */
void abortLog__fnc(char *msg, char *file, int line);
void abortLog__fnc(char *msg, char *file, int line) {
FILE *fp = fopen("CRASH.TXT", "wb");
if (!fp)
fp = fopen("/tmp/CRASH.TXT", "wb");
if (!fp)
fp = fopen("C:\\CRASH.TXT", "wb");
if (!fp)
fp = fopen("CRASH.TXT", "wb");
if (fp) {
fprintf(fp, "HTTrack " HTTRACK_VERSIONID " closed at '%s', line %d\r\n",
file, line);
fprintf(fp, "Reason:\r\n%s\r\n", msg);
fflush(fp);
fclose(fp);
}
}
HTSEXT_API t_abortLog abortLog__ = abortLog__fnc; /* avoid VC++ inlining */
static void htspe_log(htsmoduleStruct * str, const char *msg); static void htspe_log(htsmoduleStruct * str, const char *msg);
int hts_parse_externals(htsmoduleStruct * str) { int hts_parse_externals(htsmoduleStruct * str) {

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -328,8 +328,8 @@ int url_savename(char *adr_complete, char *fil_complete, char *save,
is_html = ishtml(opt, fil); is_html = ishtml(opt, fil);
switch (is_html) { /* .html,.shtml,.. */ switch (is_html) { /* .html,.shtml,.. */
case 1: case 1:
if ((strfield2(get_ext(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), fil), "html") == 0) if ((strfield2(get_ext(OPT_GET_BUFF(opt), fil), "html") == 0)
&& (strfield2(get_ext(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), fil), "htm") == 0) && (strfield2(get_ext(OPT_GET_BUFF(opt), fil), "htm") == 0)
) { ) {
strcpybuff(ext, "html"); strcpybuff(ext, "html");
ext_chg = 1; ext_chg = 1;
@@ -845,7 +845,7 @@ int url_savename(char *adr_complete, char *fil_complete, char *save,
*d++ = *c++; *d++ = *c++;
} }
*d = '\0'; *d = '\0';
d = unescape_http(catbuff, sizeof(catbuff), name[0]); d = unescape_http(catbuff, name[0]);
if (d && *d) { if (d && *d) {
strcpybuff(b, d); /* value */ strcpybuff(b, d); /* value */
b += strlen(b); b += strlen(b);
@@ -1714,8 +1714,7 @@ char *url_savename_refname_fullpath(httrackp * opt, const char *adr,
char digest_filename[64]; char digest_filename[64];
url_savename_refname(adr, fil, digest_filename); url_savename_refname(adr, fil, digest_filename);
return fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), return fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), digest_filename);
StringBuff(opt->path_log), digest_filename);
} }
/* remove refname if any */ /* remove refname if any */

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -77,14 +77,12 @@ Please visit our Website: http://www.httrack.com
// version optimisée, qui permet de ne pas toucher aux html non modifiés (update) // version optimisée, qui permet de ne pas toucher aux html non modifiés (update)
#define REALLOC_SIZE 8192 #define REALLOC_SIZE 8192
#define HT_ADD_CHK(A) if (((int) (A)+ht_len+1) >= ht_size) { \ #define HT_ADD_CHK(A) if (((int) (A)+ht_len+1) >= ht_size) { \
char message[256]; \
ht_size=(A)+ht_len+REALLOC_SIZE; \ ht_size=(A)+ht_len+REALLOC_SIZE; \
ht_buff=(char*) realloct(ht_buff,ht_size); \ ht_buff=(char*) realloct(ht_buff,ht_size); \
if (ht_buff==NULL) { \ if (ht_buff==NULL) { \
printf("PANIC! : Not enough memory [%d]\n", __LINE__); \ printf("PANIC! : Not enough memory [%d]\n", __LINE__); \
XH_uninit; \ XH_uninit; \
snprintf(message, sizeof(message), "not enough memory for current html document in HT_ADD_CHK : realloct("LLintP") failed", (LLint) ht_size); \ abortLogFmt("not enough memory for current html document in HT_ADD_CHK : realloct("LLintP") failed" _ (LLint) ht_size); \
abortLog(message); \
abort(); \ abort(); \
} \ } \
} \ } \
@@ -108,7 +106,7 @@ Please visit our Website: http://www.httrack.com
if ((opt->getmode & 1) && (ptr>0)) { \ if ((opt->getmode & 1) && (ptr>0)) { \
size_t i_, j_; \ size_t i_, j_; \
char BIGSTK tempo_[HTS_URLMAXSIZE*2]; \ char BIGSTK tempo_[HTS_URLMAXSIZE*2]; \
escape_for_html_print(A, tempo_, sizeof(tempo_)); \ escape_for_html_print(A, tempo_); \
i_=strlen(tempo_); \ i_=strlen(tempo_); \
j_=ht_len; \ j_=ht_len; \
if (i_) { \ if (i_) { \
@@ -120,7 +118,7 @@ Please visit our Website: http://www.httrack.com
if ((opt->getmode & 1) && (ptr>0)) { \ if ((opt->getmode & 1) && (ptr>0)) { \
size_t i_, j_; \ size_t i_, j_; \
char BIGSTK tempo_[HTS_URLMAXSIZE*2]; \ char BIGSTK tempo_[HTS_URLMAXSIZE*2]; \
escape_for_html_print_full(A, tempo_, sizeof(tempo_)); \ escape_for_html_print_full(A, tempo_); \
i_=strlen(tempo_); \ i_=strlen(tempo_); \
j_=ht_len; \ j_=ht_len; \
if (i_) { \ if (i_) { \
@@ -129,7 +127,6 @@ Please visit our Website: http://www.httrack.com
ht_buff[j_+i_]='\0'; \ ht_buff[j_+i_]='\0'; \
} } } }
#define HT_ADD_START \ #define HT_ADD_START \
char message[256]; \
size_t ht_size=(size_t)(r->size*5)/4+REALLOC_SIZE; \ size_t ht_size=(size_t)(r->size*5)/4+REALLOC_SIZE; \
size_t ht_len=0; \ size_t ht_len=0; \
char* ht_buff=NULL; \ char* ht_buff=NULL; \
@@ -138,8 +135,7 @@ Please visit our Website: http://www.httrack.com
if (ht_buff==NULL) { \ if (ht_buff==NULL) { \
printf("PANIC! : Not enough memory [%d]\n",__LINE__); \ printf("PANIC! : Not enough memory [%d]\n",__LINE__); \
XH_uninit; \ XH_uninit; \
snprintf(message, sizeof(message), "not enough memory for current html document in HT_ADD_START : malloct("LLintP") failed", (LLint) ht_size); \ abortLogFmt("not enough memory for current html document in HT_ADD_START : malloct("LLintP") failed" _ (LLint) ht_size); \
abortLog(message); \
abort(); \ abort(); \
} \ } \
ht_buff[0]='\0'; \ ht_buff[0]='\0'; \
@@ -148,7 +144,7 @@ Please visit our Website: http://www.httrack.com
int ok=0;\ int ok=0;\
if (ht_buff) { \ if (ht_buff) { \
char digest[32+2];\ char digest[32+2];\
off_t fsize_old = fsize(fconv(OPT_GET_BUFF(opt),OPT_GET_BUFF_SIZE(opt),savename));\ off_t fsize_old = fsize(fconv(OPT_GET_BUFF(opt),savename));\
digest[0]='\0';\ digest[0]='\0';\
domd5mem(ht_buff,ht_len,digest,1);\ domd5mem(ht_buff,ht_len,digest,1);\
if (fsize_old==ht_len) { \ if (fsize_old==ht_len) { \
@@ -214,7 +210,8 @@ Please visit our Website: http://www.httrack.com
char BIGSTK tempo[1024]; \ char BIGSTK tempo[1024]; \
if (makeindex_links == 1) { \ if (makeindex_links == 1) { \
char BIGSTK link_escaped[HTS_URLMAXSIZE*2]; \ char BIGSTK link_escaped[HTS_URLMAXSIZE*2]; \
escape_uri_utf(makeindex_firstlink, link_escaped, sizeof(link_escaped)); \ strcpybuff(link_escaped, makeindex_firstlink); \
escape_uri_utf(link_escaped); \
sprintf(tempo,"<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=%s\">"CRLF,link_escaped); \ sprintf(tempo,"<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=%s\">"CRLF,link_escaped); \
} else \ } else \
tempo[0]='\0'; \ tempo[0]='\0'; \
@@ -225,7 +222,7 @@ Please visit our Website: http://www.httrack.com
fflush(makeindex_fp); \ fflush(makeindex_fp); \
fclose(makeindex_fp); /* à ne pas oublier sinon on passe une nuit blanche */ \ fclose(makeindex_fp); /* à ne pas oublier sinon on passe une nuit blanche */ \
makeindex_fp=NULL; \ makeindex_fp=NULL; \
usercommand(opt,0,NULL,fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_html_utf8),"index.html"),"primary","primary"); \ usercommand(opt,0,NULL,fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_html_utf8),"index.html"),"primary","primary"); \
} \ } \
} \ } \
makeindex_done=1; /* ok c'est fait */ \ makeindex_done=1; /* ok c'est fait */ \
@@ -657,13 +654,13 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (p) { // ok center if (p) { // ok center
if (makeindex_fp == NULL) { if (makeindex_fp == NULL) {
file_notify(opt, "", "", file_notify(opt, "", "",
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_html_utf8), StringBuff(opt->path_html_utf8),
"index.html"), 1, 1, 0); "index.html"), 1, 1, 0);
verif_backblue(opt, StringBuff(opt->path_html_utf8)); // générer gif verif_backblue(opt, StringBuff(opt->path_html_utf8)); // générer gif
makeindex_fp = makeindex_fp =
filecreate(&opt->state.strc, filecreate(&opt->state.strc,
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt->path_html_utf8), StringBuff(opt->path_html_utf8),
"index.html")); "index.html"));
if (makeindex_fp != NULL) { if (makeindex_fp != NULL) {
@@ -695,7 +692,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
} }
if (lienrelatif if (lienrelatif
(tempo, liens[ptr]->sav, (tempo, liens[ptr]->sav,
concat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), concat(OPT_GET_BUFF(opt),
StringBuff(opt->path_html_utf8), StringBuff(opt->path_html_utf8),
"index.html")) == 0) { "index.html")) == 0) {
detect_title = 1; // ok détecté pour cette page! detect_title = 1; // ok détecté pour cette page!
@@ -732,7 +729,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
} }
// Body // Body
inplace_escape_uri_utf(tempo, sizeof(tempo)); escape_uri_utf(tempo);
fprintf(makeindex_fp, template_body, tempo, s); fprintf(makeindex_fp, template_body, tempo, s);
} }
} }
@@ -1723,7 +1720,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
get_httptype(opt, type, tempo, 0); get_httptype(opt, type, tempo, 0);
if (strnotempty(type)) // type reconnu! if (strnotempty(type)) // type reconnu!
url_ok = 1; url_ok = 1;
else if (is_dyntype(get_ext(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), tempo))) // reconnu php,cgi,asp.. else if (is_dyntype(get_ext(OPT_GET_BUFF(opt), tempo))) // reconnu php,cgi,asp..
url_ok = 1; url_ok = 1;
// MAIS pas les foobar@aol.com !! // MAIS pas les foobar@aol.com !!
if (strchr(tempo, '@')) if (strchr(tempo, '@'))
@@ -2110,8 +2107,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
} }
// Unescape %XX, but not yet high-chars (supposedly encoded with UTF-8) // Unescape %XX, but not yet high-chars (supposedly encoded with UTF-8)
strcpybuff(lien, strcpybuff(lien, unescape_http_unharm(catbuff, lien, 1 | 2)); /* note: '%' is still escaped */
unescape_http_unharm(catbuff, sizeof(catbuff), lien, 1 | 2)); /* note: '%' is still escaped */
// Force to encode non-printable chars (should never happend) // Force to encode non-printable chars (should never happend)
escape_remove_control(lien); escape_remove_control(lien);
@@ -2159,8 +2155,10 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
// we need to encode query string non-ascii chars, // we need to encode query string non-ascii chars,
// leaving the encoding as-is (unlike the file part) // leaving the encoding as-is (unlike the file part)
// and copy back query escape_check_url(query);
append_escape_check_url(query, lien, sizeof(lien));
// copy back query
strcatbuff(lien, query); /* restore */
} }
// convertir les éventuels \ en des / pour éviter des problèmes de reconnaissance! // convertir les éventuels \ en des / pour éviter des problèmes de reconnaissance!
@@ -2780,7 +2778,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (lienrelatif(tempo, save, relativesavename) == if (lienrelatif(tempo, save, relativesavename) ==
0) { 0) {
/* Never escape high-chars (we don't know the encoding!!) */ /* Never escape high-chars (we don't know the encoding!!) */
inplace_escape_uri_utf(tempo, sizeof(tempo)); // escape with %xx escape_uri_utf(tempo); // escape with %xx
//if (!no_esc_utf) //if (!no_esc_utf)
// escape_uri(tempo); // escape with %xx // escape_uri(tempo); // escape with %xx
//else //else
@@ -2827,7 +2825,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (verif_external(opt, cat_nb, 1)) { if (verif_external(opt, cat_nb, 1)) {
FILE *fp = FILE *fp =
filecreate(&opt->state.strc, filecreate(&opt->state.strc,
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt-> StringBuff(opt->
path_html_utf8), path_html_utf8),
cat_name)); cat_name));
@@ -2846,7 +2844,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
} }
fclose(fp); fclose(fp);
usercommand(opt, 0, NULL, usercommand(opt, 0, NULL,
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), fconcat(OPT_GET_BUFF(opt),
StringBuff(opt-> StringBuff(opt->
path_html_utf8), path_html_utf8),
cat_name), "", ""); cat_name), "", "");
@@ -2945,11 +2943,21 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
} }
*/ */
else if (opt->mimehtml) { else if (opt->mimehtml) {
char BIGSTK cid[HTS_URLMAXSIZE * 3]; char BIGSTK buff[HTS_URLMAXSIZE * 3];
HT_ADD("cid:"); HT_ADD("cid:");
make_content_id(adr, fil, cid, sizeof(cid)); strcpybuff(buff, adr);
HT_ADD_HTMLESCAPED(cid); strcatbuff(buff, fil);
escape_in_url(buff);
{
char *a = buff;
while((a = strchr(a, '%'))) {
*a = 'X';
a++;
}
}
HT_ADD_HTMLESCAPED(buff);
lastsaved = eadr - 1; // dernier écrit+1 (enfin euh apres on fait un ++ alors hein) lastsaved = eadr - 1; // dernier écrit+1 (enfin euh apres on fait un ++ alors hein)
} else if (opt->urlmode == 3) { // URI absolue / } else if (opt->urlmode == 3) { // URI absolue /
if ((opt->getmode & 1) && (ptr > 0)) { // ecrire les html if ((opt->getmode & 1) && (ptr > 0)) { // ecrire les html
@@ -3012,7 +3020,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (lienrelatif(tempo, save, relativesavename) == 0) { if (lienrelatif(tempo, save, relativesavename) == 0) {
if (!in_media) { // In media (such as real audio): don't patch if (!in_media) { // In media (such as real audio): don't patch
/* Never escape high-chars (we don't know the encoding!!) */ /* Never escape high-chars (we don't know the encoding!!) */
inplace_escape_uri_utf(tempo, sizeof(tempo)); escape_uri_utf(tempo);
//if (!no_esc_utf) //if (!no_esc_utf)
// escape_uri(tempo); // escape with %xx // escape_uri(tempo); // escape with %xx
@@ -3527,6 +3535,8 @@ int hts_mirror_check_moved(htsmoduleStruct * str,
if (HTTP_IS_REDIRECT(r->statuscode)) { if (HTTP_IS_REDIRECT(r->statuscode)) {
//if (r->adr!=NULL) { // adr==null si fichier direct. [catch: davename normalement si cgi] //if (r->adr!=NULL) { // adr==null si fichier direct. [catch: davename normalement si cgi]
//int i=0; //int i=0;
char *rn = NULL;
// char* p; // char* p;
hts_log_print(opt, LOG_WARNING, "%s for %s%s", r->msg, urladr, urlfil); hts_log_print(opt, LOG_WARNING, "%s for %s%s", r->msg, urladr, urlfil);
@@ -3666,35 +3676,50 @@ int hts_mirror_check_moved(htsmoduleStruct * str,
} // ident_url_xx } // ident_url_xx
if (get_it == 0) { // adresse vraiment différente et potentiellement en html (pas de possibilité de bouger la page tel quel à cause des <img src..> et cie) if (get_it == 0) { // adresse vraiment différente et potentiellement en html (pas de possibilité de bouger la page tel quel à cause des <img src..> et cie)
const size_t rn_size = 8192; rn = (char *) calloct(8192, 1);
char *const rn = (char *) malloct(rn_size);
if (rn != NULL) { if (rn != NULL) {
hts_log_print(opt, LOG_WARNING, "File has moved from %s%s to %s", hts_log_print(opt, LOG_WARNING, "File has moved from %s%s to %s",
urladr, urlfil, mov_url); urladr, urlfil, mov_url);
if (!opt->mimehtml) { if (!opt->mimehtml) {
inplace_escape_uri(mov_url, sizeof(mov_url)); escape_uri(mov_url);
} else { } else {
char BIGSTK cid[HTS_URLMAXSIZE * 3]; char BIGSTK buff[HTS_URLMAXSIZE * 3];
make_content_id(mov_adr, mov_fil, cid, sizeof(cid));
strcpybuff(buff, mov_adr);
strcatbuff(buff, mov_fil);
escape_in_url(buff);
{
char *a = buff;
while((a = strchr(a, '%'))) {
*a = 'X';
a++;
}
}
strcpybuff(mov_url, "cid:"); strcpybuff(mov_url, "cid:");
strcatbuff(mov_url, cid); strcatbuff(mov_url, buff);
} }
// On prépare une page qui sautera immédiatement sur la bonne URL // On prépare une page qui sautera immédiatement sur la bonne URL
// Le scanner re-changera, ensuite, cette URL, pour la mirrorer! // Le scanner re-changera, ensuite, cette URL, pour la mirrorer!
snprintf(rn, rn_size, strcpybuff(rn, "<HTML>" CRLF);
"<HTML>" CRLF strcatbuff(rn,
"<!-- Created by HTTrack Website Copier/" HTTRACK_VERSION " " HTTRACK_AFF_AUTHORS " -->" CRLF "<!-- Created by HTTrack Website Copier/" HTTRACK_VERSION
"<HEAD>" CRLF " " HTTRACK_AFF_AUTHORS " -->" CRLF);
"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;charset=UTF-8\">" strcatbuff(rn,
"<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=%s\">" "<HEAD>" CRLF "<TITLE>Page has moved</TITLE>" CRLF
"<TITLE>Page has moved</TITLE>" CRLF "</HEAD>" CRLF "<BODY>" CRLF);
"</HEAD>" CRLF strcatbuff(rn, "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=");
"<BODY>" CRLF strcatbuff(rn, mov_url); // URL
"<A HREF=\"%s\"><h3>Click here...</h3></A>" CRLF strcatbuff(rn, "\">" CRLF);
"</BODY>" CRLF strcatbuff(rn, "<A HREF=\"");
"<!-- Created by HTTrack Website Copier/" HTTRACK_VERSION " " HTTRACK_AFF_AUTHORS " -->" CRLF strcatbuff(rn, mov_url);
"</HTML>" CRLF, strcatbuff(rn, "\">");
mov_url, mov_url); strcatbuff(rn, "<B>Click here...</B></A>" CRLF);
strcatbuff(rn, "</BODY>" CRLF);
strcatbuff(rn,
"<!-- Created by HTTrack Website Copier/" HTTRACK_VERSION
" " HTTRACK_AFF_AUTHORS " -->" CRLF);
strcatbuff(rn, "</HTML>" CRLF);
// changer la page // changer la page
if (r->adr) { if (r->adr) {
@@ -3943,16 +3968,13 @@ void hts_mirror_process_user_interaction(htsmoduleStruct * str,
// user pause lockfile : create hts-paused.lock --> HTTrack will be paused // user pause lockfile : create hts-paused.lock --> HTTrack will be paused
if (fexist if (fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-stop.lock"))) {
StringBuff(opt->path_log), "hts-stop.lock"))) {
// remove lockfile // remove lockfile
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-stop.lock"));
StringBuff(opt->path_log), "hts-stop.lock"));
if (!fexist if (!fexist
(fconcat (fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-stop.lock"))) {
StringBuff(opt->path_log), "hts-stop.lock"))) {
do_pause = 1; do_pause = 1;
} }
} }
@@ -4000,8 +4022,7 @@ void hts_mirror_process_user_interaction(htsmoduleStruct * str,
{ {
FILE *fp = FILE *fp =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-paused.lock"), "wb"); "hts-paused.lock"), "wb");
if (fp) { if (fp) {
fspc(NULL, fp, "info"); // dater fspc(NULL, fp, "info"); // dater
@@ -4015,10 +4036,10 @@ void hts_mirror_process_user_interaction(htsmoduleStruct * str,
stat_fragment = HTS_STAT.stat_bytes; stat_fragment = HTS_STAT.stat_bytes;
/* Info for wrappers */ /* Info for wrappers */
hts_log_print(opt, LOG_INFO, "engine: pause: %s", hts_log_print(opt, LOG_INFO, "engine: pause: %s",
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-paused.lock")); "hts-paused.lock"));
RUN_CALLBACK1(opt, pause, RUN_CALLBACK1(opt, pause,
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log),
"hts-paused.lock")); "hts-paused.lock"));
} }
// //
@@ -4354,17 +4375,15 @@ int hts_mirror_wait_for_next_file(htsmoduleStruct * str,
int a = 0; int a = 0;
*stre->last_info_shell_ = tl; *stre->last_info_shell_ = tl;
if (fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-autopsy"))) { // débuggage: teste si le robot est vivant if (fexist(fconcat(OPT_GET_BUFF(opt), StringBuff(opt->path_log), "hts-autopsy"))) { // débuggage: teste si le robot est vivant
// (oui je sais un robot vivant.. mais bon.. il a le droit de vivre lui aussi) // (oui je sais un robot vivant.. mais bon.. il a le droit de vivre lui aussi)
// (libérons les robots esclaves de l'internet!) // (libérons les robots esclaves de l'internet!)
remove(fconcat remove(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-autopsy")); "hts-autopsy"));
fp = fp =
fopen(fconcat fopen(fconcat
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), (OPT_GET_BUFF(opt), StringBuff(opt->path_log),
StringBuff(opt->path_log),
"hts-isalive"), "wb"); "hts-isalive"), "wb");
a = 1; a = 1;
} }
@@ -4767,7 +4786,7 @@ int hts_wait_delayed(htsmoduleStruct * str, char *adr, char *fil, char *save,
strcpybuff(mov_url, back[b].r.location); // copier URL strcpybuff(mov_url, back[b].r.location); // copier URL
/* Remove (temporarily created) file if it was created */ /* Remove (temporarily created) file if it was created */
UNLINK(fconv(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), back[b].url_sav)); UNLINK(fconv(OPT_GET_BUFF(opt), back[b].url_sav));
/* Remove slot! */ /* Remove slot! */
if (back[b].status == STATUS_READY) { if (back[b].status == STATUS_READY) {

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,173 +0,0 @@
/* ------------------------------------------------------------ */
/*
HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Important notes:
- We hereby ask people using this source NOT to use it in purpose of grabbing
emails addresses, or collecting any other private information on persons.
This would disgrace our work, and spoil the many hours we spent on it.
Please visit our Website: http://www.httrack.com
*/
/* ------------------------------------------------------------ */
/* File: htssafe.h safe strings operations, and asserts */
/* Author: Xavier Roche */
/* ------------------------------------------------------------ */
#ifndef HTSSAFE_DEFH
#define HTSSAFE_DEFH
#include "htsglobal.h"
/**
* Optional user-defined callback upon fatal error.
*/
typedef void (*htsErrorCallback) (const char *msg, const char *file, int line);
/**
* Emergency logging.
*/
#ifndef HTSSAFE_ABORT_FUNCTION
HTSEXT_API htsErrorCallback htsCallbackErr;
#define HTSSAFE_ABORT_FUNCTION(A,B,C) do { if (htsCallbackErr != NULL) { htsCallbackErr(A,B,C); } } while(0)
#endif
/**
* Log an abort condition, and calls abort().
*/
#define abortLog(a) abortf_(a, __FILE__, __LINE__)
/**
* Fatal assertion check.
*/
#define assertf__(exp, sexp, file, line) (void) ( (exp) || (abortf_(sexp, file, line), 0) )
/**
* Fatal assertion check.
*/
#define assertf_(exp, file, line) assertf__(exp, #exp, __FILE__, __LINE__)
/**
* Fatal assertion check.
*/
#define assertf(exp) assertf_(exp, __FILE__, __LINE__)
static HTS_UNUSED void log_abort_(const char *msg, const char *file, int line) {
fprintf(stderr, "%s failed at %s:%d\n", msg, file, line);
fflush(stderr);
}
static HTS_UNUSED void abortf_(const char *exp, const char *file, int line) {
HTSSAFE_ABORT_FUNCTION(exp, file, line);
log_abort_(exp, file, line);
abort();
}
/**
* Check wether 'VAR' is of type char[].
*/
#ifdef __GNUC__
/* Note: char[] and const char[] are compatible */
#define HTS_IS_CHAR_BUFFER(VAR) ( __builtin_types_compatible_p ( typeof (VAR), char[] ) )
#else
/* Note: a bit lame as char[8] won't be seen. */
#define HTS_IS_CHAR_BUFFER(VAR) ( sizeof(VAR) != sizeof(char*) )
#endif
#define HTS_IS_NOT_CHAR_BUFFER(VAR) ( ! HTS_IS_CHAR_BUFFER(VAR) )
/**
* Append at most N characters from "B" to "A".
* If "A" is a char[] variable whose size is not sizeof(char*), then the size
* is assumed to be the capacity of this array.
*/
#define strncatbuff(A, B, N) \
( HTS_IS_NOT_CHAR_BUFFER(A) \
? strncat(A, B, N) \
: strncat_safe_(A, sizeof(A), B, \
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), N, \
"overflow while appending '" #B "' to '"#A"'", __FILE__, __LINE__) )
/**
* Copy characters from "B" to "A".
* If "A" is a char[] variable whose size is not sizeof(char*), then the size
* is assumed to be the capacity of this array.
*/
#define strcpybuff(A, B) \
( HTS_IS_NOT_CHAR_BUFFER(A) \
? strcpy(A, B) \
: strcpy_safe_(A, sizeof(A), B, \
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), \
"overflow while copying '" #B "' to '"#A"'", __FILE__, __LINE__) )
/* note: "size_t is an unsigned integral type" */
/**
* Append characters of "B" to "A".
* If "A" is a char[] variable whose size is not sizeof(char*), then the size
* is assumed to be the capacity of this array.
*/
#define strcatbuff(A, B) strncatbuff(A, B, (size_t) -1)
/**
* Append characters of "B" to "A", "A" having a maximum capacity of "S".
*/
#define strlcatbuff(A, B, S) \
strncat_safe_(A, S, B, \
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), (size_t) -1, \
"overflow while copying '" #B "' to '"#A"'", __FILE__, __LINE__)
static HTS_INLINE HTS_UNUSED size_t strlen_safe_(const char *source, const size_t sizeof_source,
const char *file, int line) {
size_t size;
assertf_( source != NULL, file, line );
size = strnlen(source, sizeof_source);
assertf_( size < sizeof_source, file, line );
return size;
}
static HTS_INLINE HTS_UNUSED char* strncat_safe_(char *const dest, const size_t sizeof_dest,
const char *const source, const size_t sizeof_source,
const size_t n,
const char *exp, const char *file, int line) {
const size_t source_len = strlen_safe_(source, sizeof_source, file, line);
const size_t dest_len = strlen_safe_(dest, sizeof_dest, file, line);
const size_t source_copy = source_len <= n ? source_len : n;
const size_t dest_final_len = dest_len + source_copy;
assertf__(dest_final_len < sizeof_dest, exp, file, line);
memcpy(dest + dest_len, source, source_copy);
dest[dest_final_len] = '\0';
return dest;
}
static HTS_INLINE HTS_UNUSED char* strcpy_safe_(char *const dest, const size_t sizeof_dest,
const char *const source, const size_t sizeof_source,
const char *exp, const char *file, int line) {
assertf_(sizeof_dest != 0, file, line);
dest[0] = '\0';
return strncat_safe_(dest, sizeof_dest, source, sizeof_source, (size_t) -1, exp, file, line);
}
#define malloct(A) malloc(A)
#define calloct(A,B) calloc((A), (B))
#define freet(A) do { if ((A) != NULL) { free(A); (A) = NULL; } } while(0)
#define strdupt(A) strdup(A)
#define realloct(A,B) realloc(A, B)
#define memcpybuff(A, B, N) memcpy((A), (B), (N))
#endif

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -381,7 +381,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
initStrElt initStr[] = { initStrElt initStr[] = {
{"user", "Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)"}, {"user", "Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)"},
{"footer", {"footer",
"<!-- Mirrored from %s%s by HTTrack Website Copier/3.x [XR&CO'2014], %s -->"}, "<!-- Mirrored from %s%s by HTTrack Website Copier/3.x [XR&CO'2013], %s -->"},
{"url2", "+*.png +*.gif +*.jpg +*.jpeg +*.css +*.js -ad.doubleclick.net/*"}, {"url2", "+*.png +*.gif +*.jpg +*.jpeg +*.css +*.js -ad.doubleclick.net/*"},
{NULL, NULL} {NULL, NULL}
}; };
@@ -964,7 +964,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
if (pos2 != NULL) { if (pos2 != NULL) {
*pos2 = '\0'; *pos2 = '\0';
if (strstr(name, "..") == NULL) { if (strstr(name, "..") == NULL) {
if (fexist(fconcat(catbuff, sizeof(catbuff), path, name))) { if (fexist(fconcat(catbuff, path, name))) {
langstr = pos2 + 1; langstr = pos2 + 1;
} }
} }
@@ -994,20 +994,20 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
} }
} else if (strcmp(name, "if-file-exists") == 0) { } else if (strcmp(name, "if-file-exists") == 0) {
if (strstr(pos2, "..") == NULL) { if (strstr(pos2, "..") == NULL) {
if (!fexist(fconcat(catbuff, sizeof(catbuff), path, pos2))) { if (!fexist(fconcat(catbuff, path, pos2))) {
outputmode = -1; outputmode = -1;
} }
} }
} else if (strcmp(name, "if-project-file-exists") == 0) { } else if (strcmp(name, "if-project-file-exists") == 0) {
if (strstr(pos2, "..") == NULL) { if (strstr(pos2, "..") == NULL) {
if (!fexist if (!fexist
(fconcat(catbuff, sizeof(catbuff), StringBuff(fspath), pos2))) { (fconcat(catbuff, StringBuff(fspath), pos2))) {
outputmode = -1; outputmode = -1;
} }
} }
} else if (strcmp(name, "if-file-do-not-exists") == 0) { } else if (strcmp(name, "if-file-do-not-exists") == 0) {
if (strstr(pos2, "..") == NULL) { if (strstr(pos2, "..") == NULL) {
if (fexist(fconcat(catbuff, sizeof(catbuff), path, pos2))) { if (fexist(fconcat(catbuff, path, pos2))) {
outputmode = -1; outputmode = -1;
} }
} }
@@ -1443,7 +1443,6 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
int htslang_init(void) { int htslang_init(void) {
if (NewLangList == NULL) { if (NewLangList == NULL) {
NewLangList = inthash_new(0); NewLangList = inthash_new(0);
inthash_set_name(NewLangList, "NewLangList");
if (NewLangList == NULL) { if (NewLangList == NULL) {
abortLog("Error in lang.h: not enough memory"); abortLog("Error in lang.h: not enough memory");
} else { } else {
@@ -1488,8 +1487,6 @@ static int htslang_load(char *limit_to, char *path) {
LANG_DELETE(); LANG_DELETE();
NewLangStr = inthash_new(0); NewLangStr = inthash_new(0);
NewLangStrKeys = inthash_new(0); NewLangStrKeys = inthash_new(0);
inthash_set_name(NewLangStr, "NewLangStr");
inthash_set_name(NewLangStrKeys, "NewLangStrKeys");
if ((NewLangStr == NULL) || (NewLangStrKeys == NULL)) { if ((NewLangStr == NULL) || (NewLangStrKeys == NULL)) {
abortLog("Error in lang.h: not enough memory"); abortLog("Error in lang.h: not enough memory");
} else { } else {
@@ -1501,7 +1498,7 @@ static int htslang_load(char *limit_to, char *path) {
/* Load master file (list of keys and internal keys) */ /* Load master file (list of keys and internal keys) */
if (!limit_to) { if (!limit_to) {
char *mname = "lang.def"; char *mname = "lang.def";
FILE *fp = fopen(fconcat(catbuff, sizeof(catbuff), path, mname), "rb"); FILE *fp = fopen(fconcat(catbuff, path, mname), "rb");
if (fp) { if (fp) {
char intkey[8192]; char intkey[8192];
@@ -1582,7 +1579,7 @@ static int htslang_load(char *limit_to, char *path) {
hashname = LANGINTKEY(name); hashname = LANGINTKEY(name);
} }
sprintf(lbasename, "lang/%s.txt", hashname); sprintf(lbasename, "lang/%s.txt", hashname);
fp = fopen(fconcat(catbuff, sizeof(catbuff), path, lbasename), "rb"); fp = fopen(fconcat(catbuff, path, lbasename), "rb");
if (fp) { if (fp) {
char extkey[8192]; char extkey[8192];
char value[8192]; char value[8192];

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -36,7 +36,6 @@ Please visit our Website: http://www.httrack.com
#include "htsglobal.h" #include "htsglobal.h"
#include "htsbase.h" #include "htsbase.h"
#include "htsthread.h" #include "htsthread.h"
#include "httrack-library.h"
#if USE_BEGINTHREAD #if USE_BEGINTHREAD
#ifdef _WIN32 #ifdef _WIN32
@@ -197,7 +196,7 @@ HTSEXT_API void hts_mutexlock(htsmutex * mutex) {
} }
assertf(*mutex != NULL); assertf(*mutex != NULL);
#ifdef _WIN32 #ifdef _WIN32
assertf((*mutex)->handle != NULL); assert((*mutex)->handle != NULL);
WaitForSingleObject((*mutex)->handle, INFINITE); WaitForSingleObject((*mutex)->handle, INFINITE);
#else #else
pthread_mutex_lock(&(*mutex)->handle); pthread_mutex_lock(&(*mutex)->handle);
@@ -207,7 +206,7 @@ HTSEXT_API void hts_mutexlock(htsmutex * mutex) {
HTSEXT_API void hts_mutexrelease(htsmutex * mutex) { HTSEXT_API void hts_mutexrelease(htsmutex * mutex) {
assertf(mutex != NULL && *mutex != NULL); assertf(mutex != NULL && *mutex != NULL);
#ifdef _WIN32 #ifdef _WIN32
assertf((*mutex)->handle != NULL); assert((*mutex)->handle != NULL);
ReleaseMutex((*mutex)->handle); ReleaseMutex((*mutex)->handle);
#else #else
pthread_mutex_unlock(&(*mutex)->handle); pthread_mutex_unlock(&(*mutex)->handle);

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -64,6 +64,9 @@ struct htsmutex_s {
/* Library internal definictions */ /* Library internal definictions */
HTSEXT_API int hts_newthread(void (*fun) (void *arg), void *arg); HTSEXT_API int hts_newthread(void (*fun) (void *arg), void *arg);
#ifndef HTTRACK_DEFLIB
HTSEXT_API void htsthread_wait(void);
#endif
HTSEXT_API void htsthread_wait_n(int n_wait); HTSEXT_API void htsthread_wait_n(int n_wait);
/* Locking functions */ /* Locking functions */

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -68,16 +68,16 @@ struct find_handle_struct {
char path[2048]; char path[2048];
}; };
#endif #endif
//#ifndef HTS_DEF_FWSTRUCT_topindex_chain #ifndef HTS_DEF_FWSTRUCT_topindex_chain
//#define HTS_DEF_FWSTRUCT_topindex_chain #define HTS_DEF_FWSTRUCT_topindex_chain
//typedef struct topindex_chain topindex_chain; typedef struct topindex_chain topindex_chain;
//#endif #endif
//struct topindex_chain { struct topindex_chain {
// int level; /* sort level */ int level; /* sort level */
// char *category; /* category */ char *category; /* category */
// char name[2048]; /* path */ char name[2048]; /* path */
// struct topindex_chain *next; /* next element */ struct topindex_chain *next; /* next element */
//}; };
/* Tools */ /* Tools */
@@ -541,11 +541,11 @@ int verif_backblue(httrackp * opt, const char *base) {
return 0; return 0;
} }
if ((!*done) if ((!*done)
|| (fsize_utf8(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), base, "backblue.gif")) != || (fsize_utf8(fconcat(OPT_GET_BUFF(opt), base, "backblue.gif")) !=
HTS_DATA_BACK_GIF_LEN)) { HTS_DATA_BACK_GIF_LEN)) {
FILE *fp = FILE *fp =
filecreate(&opt->state.strc, filecreate(&opt->state.strc,
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), base, "backblue.gif")); fconcat(OPT_GET_BUFF(opt), base, "backblue.gif"));
*done = 1; *done = 1;
if (fp) { if (fp) {
if (fwrite(HTS_DATA_BACK_GIF, HTS_DATA_BACK_GIF_LEN, 1, fp) != if (fwrite(HTS_DATA_BACK_GIF, HTS_DATA_BACK_GIF_LEN, 1, fp) !=
@@ -553,19 +553,19 @@ int verif_backblue(httrackp * opt, const char *base) {
ret = 1; ret = 1;
fclose(fp); fclose(fp);
usercommand(opt, 0, NULL, usercommand(opt, 0, NULL,
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), base, "backblue.gif"), "", ""); fconcat(OPT_GET_BUFF(opt), base, "backblue.gif"), "", "");
} else } else
ret = 1; ret = 1;
// //
fp = fp =
filecreate(&opt->state.strc, filecreate(&opt->state.strc,
fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), base, "fade.gif")); fconcat(OPT_GET_BUFF(opt), base, "fade.gif"));
if (fp) { if (fp) {
if (fwrite(HTS_DATA_FADE_GIF, HTS_DATA_FADE_GIF_LEN, 1, fp) != if (fwrite(HTS_DATA_FADE_GIF, HTS_DATA_FADE_GIF_LEN, 1, fp) !=
HTS_DATA_FADE_GIF_LEN) HTS_DATA_FADE_GIF_LEN)
ret = 1; ret = 1;
fclose(fp); fclose(fp);
usercommand(opt, 0, NULL, fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), base, "fade.gif"), usercommand(opt, 0, NULL, fconcat(OPT_GET_BUFF(opt), base, "fade.gif"),
"", ""); "", "");
} else } else
ret = 1; ret = 1;
@@ -758,7 +758,7 @@ static int sortTopIndexFnc(const void *a_, const void *b_) {
return cmp; return cmp;
} }
//HTSEXT_API char *hts_getcategory(const char *filename); HTSEXT_API char *hts_getcategory(const char *filename);
/* Note: NOT utf-8 */ /* Note: NOT utf-8 */
HTSEXT_API int hts_buildtopindex(httrackp * opt, const char *path, HTSEXT_API int hts_buildtopindex(httrackp * opt, const char *path,
@@ -772,16 +772,16 @@ HTSEXT_API int hts_buildtopindex(httrackp * opt, const char *path,
// et templates html // et templates html
toptemplate_header = toptemplate_header =
readfile_or(fconcat(catbuff, sizeof(catbuff), binpath, "templates/topindex-header.html"), readfile_or(fconcat(catbuff, binpath, "templates/topindex-header.html"),
HTS_INDEX_HEADER); HTS_INDEX_HEADER);
toptemplate_body = toptemplate_body =
readfile_or(fconcat(catbuff, sizeof(catbuff), binpath, "templates/topindex-body.html"), readfile_or(fconcat(catbuff, binpath, "templates/topindex-body.html"),
HTS_INDEX_BODY); HTS_INDEX_BODY);
toptemplate_bodycat = toptemplate_bodycat =
readfile_or(fconcat(catbuff, sizeof(catbuff), binpath, "templates/topindex-bodycat.html"), readfile_or(fconcat(catbuff, binpath, "templates/topindex-bodycat.html"),
HTS_INDEX_BODYCAT); HTS_INDEX_BODYCAT);
toptemplate_footer = toptemplate_footer =
readfile_or(fconcat(catbuff, sizeof(catbuff), binpath, "templates/topindex-footer.html"), readfile_or(fconcat(catbuff, binpath, "templates/topindex-footer.html"),
HTS_INDEX_FOOTER); HTS_INDEX_FOOTER);
if (toptemplate_header && toptemplate_body && toptemplate_footer if (toptemplate_header && toptemplate_body && toptemplate_footer
@@ -793,11 +793,11 @@ HTSEXT_API int hts_buildtopindex(httrackp * opt, const char *path,
rpath[strlen(rpath) - 1] = '\0'; rpath[strlen(rpath) - 1] = '\0';
} }
fpo = fopen(fconcat(catbuff, sizeof(catbuff), rpath, "/index.html"), "wb"); fpo = fopen(fconcat(catbuff, rpath, "/index.html"), "wb");
if (fpo) { if (fpo) {
find_handle h; find_handle h;
verif_backblue(opt, concat(catbuff, sizeof(catbuff), rpath, "/")); // générer gif verif_backblue(opt, concat(catbuff, rpath, "/")); // générer gif
// Header // Header
fprintf(fpo, toptemplate_header, fprintf(fpo, toptemplate_header,
"<!-- Mirror and index made by HTTrack Website Copier/" "<!-- Mirror and index made by HTTrack Website Copier/"
@@ -887,7 +887,8 @@ HTSEXT_API int hts_buildtopindex(httrackp * opt, const char *path,
for(i = 0; i < chainSize; i++) { for(i = 0; i < chainSize; i++) {
char BIGSTK hname[HTS_URLMAXSIZE * 2]; char BIGSTK hname[HTS_URLMAXSIZE * 2];
escape_uri_utf(sortedElts[i]->name, hname, sizeof(hname)); strcpybuff(hname, sortedElts[i]->name);
escape_uri_utf(hname);
/* Changed category */ /* Changed category */
if (strcmp(category, sortedElts[i]->category) != 0) { if (strcmp(category, sortedElts[i]->category) != 0) {
@@ -980,7 +981,6 @@ HTSEXT_API char *hts_getcategories(char *path, int type) {
if (type == 1) { if (type == 1) {
hashCateg = inthash_new(0); hashCateg = inthash_new(0);
inthash_set_name(hashCateg, "hashCateg");
StringCat(categ, "Test category 1"); StringCat(categ, "Test category 1");
StringCat(categ, "\r\nTest category 2"); StringCat(categ, "\r\nTest category 2");
} }
@@ -1111,7 +1111,7 @@ HTSEXT_API int hts_findnext(find_handle find) {
if ((find->dirp = readdir(find->hdir))) if ((find->dirp = readdir(find->hdir)))
if (find->dirp->d_name) if (find->dirp->d_name)
if (!STAT if (!STAT
(concat(catbuff, sizeof(catbuff), find->path, find->dirp->d_name), &find->filestat)) (concat(catbuff, find->path, find->dirp->d_name), &find->filestat))
return 1; return 1;
#endif #endif
} }

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -106,6 +106,11 @@ HTSEXT_API int hts_findisdir(find_handle find);
HTSEXT_API int hts_findisfile(find_handle find); HTSEXT_API int hts_findisfile(find_handle find);
HTSEXT_API int hts_findissystem(find_handle find); HTSEXT_API int hts_findissystem(find_handle find);
#ifndef HTTRACK_DEFLIB
HTSEXT_API char *hts_getcategory(const char *filename);
HTSEXT_API char *hts_getcategories(char *path, int type);
#endif
#endif #endif
#endif #endif

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -61,6 +61,7 @@ Please visit our Website: http://www.httrack.com
#include "htsinthash.c" #include "htsinthash.c"
#include "htsmd5.c" #include "htsmd5.c"
#include "md5.c" #include "md5.c"
#undef HTS_PRINTF_FUN
#include "htsserver.h" #include "htsserver.h"
#include "htsweb.h" #include "htsweb.h"

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -49,8 +49,8 @@ typedef struct httrackp httrackp;
HTSEXT_API int htswrap_init(void); // LEGACY HTSEXT_API int htswrap_init(void); // LEGACY
HTSEXT_API int htswrap_free(void); // LEGACY HTSEXT_API int htswrap_free(void); // LEGACY
//HTSEXT_API int htswrap_add(httrackp * opt, const char *name, void *fct); HTSEXT_API int htswrap_add(httrackp * opt, const char *name, void *fct);
//HTSEXT_API uintptr_t htswrap_read(httrackp * opt, const char *name); HTSEXT_API uintptr_t htswrap_read(httrackp * opt, const char *name);
#endif #endif

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -57,13 +57,13 @@ int hts_zunpack(char *filename, char *newfile) {
if (filename != NULL && newfile != NULL) { if (filename != NULL && newfile != NULL) {
if (filename[0] && newfile[0]) { if (filename[0] && newfile[0]) {
char catbuff[CATBUFF_SIZE]; char catbuff[CATBUFF_SIZE];
FILE *const in = FOPEN(fconv(catbuff, sizeof(catbuff), filename), "rb"); FILE *const in = FOPEN(fconv(catbuff, filename), "rb");
const int fd = in != NULL ? fileno(in) : -1; const int fd = in != NULL ? fileno(in) : -1;
// Note: we must dup to be able to flose cleanly. // Note: we must dup to be able to flose cleanly.
gzFile gz = fd != -1 ? gzdopen(dup(fd), "rb") : NULL; gzFile gz = fd != -1 ? gzdopen(dup(fd), "rb") : NULL;
if (gz) { if (gz) {
FILE *const fpout = FOPEN(fconv(catbuff, sizeof(catbuff), newfile), "wb"); FILE *const fpout = FOPEN(fconv(catbuff, newfile), "wb");
int size = 0; int size = 0;
if (fpout) { if (fpout) {
@@ -95,8 +95,8 @@ int hts_zunpack(char *filename, char *newfile) {
int hts_extract_meta(const char *path) { int hts_extract_meta(const char *path) {
char catbuff[CATBUFF_SIZE]; char catbuff[CATBUFF_SIZE];
unzFile zFile = unzOpen(fconcat(catbuff, sizeof(catbuff), path, "hts-cache/new.zip")); unzFile zFile = unzOpen(fconcat(catbuff, path, "hts-cache/new.zip"));
zipFile zFileOut = zipOpen(fconcat(catbuff, sizeof(catbuff), path, "hts-cache/meta.zip"), 0); zipFile zFileOut = zipOpen(fconcat(catbuff, path, "hts-cache/meta.zip"), 0);
if (zFile != NULL && zFileOut != NULL) { if (zFile != NULL && zFileOut != NULL) {
if (unzGoToFirstFile(zFile) == Z_OK) { if (unzGoToFirstFile(zFile) == Z_OK) {

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -35,10 +35,6 @@ Please visit our Website: http://www.httrack.com
#include "htsglobal.h" #include "htsglobal.h"
#ifndef _WIN32
#include <inttypes.h>
#endif
#ifndef HTS_DEF_FWSTRUCT_httrackp #ifndef HTS_DEF_FWSTRUCT_httrackp
#define HTS_DEF_FWSTRUCT_httrackp #define HTS_DEF_FWSTRUCT_httrackp
typedef struct httrackp httrackp; typedef struct httrackp httrackp;
@@ -107,17 +103,14 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt);
/* Options handling */ /* Options handling */
HTSEXT_API httrackp *hts_create_opt(void); HTSEXT_API httrackp *hts_create_opt(void);
HTSEXT_API void hts_free_opt(httrackp * opt); HTSEXT_API void hts_free_opt(httrackp * opt);
HTSEXT_API const hts_stat_struct* hts_get_stats(httrackp * opt); HTSEXT_API void set_wrappers(httrackp * opt); // DEPRECATED - DUMMY FUNCTION
HTSEXT_API void set_wrappers(httrackp * opt); /* LEGACY */
HTSEXT_API int plug_wrapper(httrackp * opt, const char *moduleName, HTSEXT_API int plug_wrapper(httrackp * opt, const char *moduleName,
const char *argv); const char *argv);
/* Logging */ /* Logging */
HTSEXT_API int hts_log(httrackp * opt, const char *prefix, const char *msg); HTSEXT_API int hts_log(httrackp * opt, const char *prefix, const char *msg);
HTSEXT_API void hts_log_print(httrackp * opt, int type, const char *format, HTSEXT_API void hts_log_print(httrackp * opt, int type, const char *format,
...) HTS_PRINTF_FUN(3, 4); ...);
HTSEXT_API void hts_log_vprint(httrackp * opt, int type, const char *format,
va_list args);
/* Infos */ /* Infos */
HTSEXT_API const char *hts_get_version_info(httrackp * opt); HTSEXT_API const char *hts_get_version_info(httrackp * opt);
@@ -129,22 +122,22 @@ HTSEXT_API const hts_stat_struct* hts_get_stats(httrackp * opt);
HTSEXT_API int htswrap_init(void); // DEPRECATED - DUMMY FUNCTION HTSEXT_API int htswrap_init(void); // DEPRECATED - DUMMY FUNCTION
HTSEXT_API int htswrap_free(void); // DEPRECATED - DUMMY FUNCTION HTSEXT_API int htswrap_free(void); // DEPRECATED - DUMMY FUNCTION
HTSEXT_API int htswrap_add(httrackp * opt, const char *name, void *fct); HTSEXT_API int htswrap_add(httrackp * opt, const char *name, void *fct);
HTSEXT_API uintptr_t htswrap_read(httrackp * opt, const char *name); HTSEXT_API unsigned long int htswrap_read(httrackp * opt, const char *name);
HTSEXT_API int htswrap_set_userdef(httrackp * opt, void *userdef); HTSEXT_API int htswrap_set_userdef(httrackp * opt, void *userdef);
HTSEXT_API void *htswrap_get_userdef(httrackp * opt); HTSEXT_API void *htswrap_get_userdef(httrackp * opt);
/* Internal library allocators, if a different libc is being used by the client */ /* Internal library allocators, if a different libc is being used by the client */
HTSEXT_API char *hts_strdup(const char *string); HTSEXT_API char *hts_strdup(const char *string);
HTSEXT_API void *hts_malloc(size_t size); HTSEXT_API void *hts_malloc(size_t size);
HTSEXT_API void *hts_realloc(void *const data, const size_t size); HTSEXT_API void *hts_realloc(void *data, size_t size);
HTSEXT_API void hts_free(void *data); HTSEXT_API void hts_free(void *data);
/* Other functions */ /* Other functions */
HTSEXT_API int hts_resetvar(void); // DEPRECATED - DUMMY FUNCTION HTSEXT_API int hts_resetvar(void); // DEPRECATED - DUMMY FUNCTION
HTSEXT_API int hts_buildtopindex(httrackp * opt, const char *path, HTSEXT_API int hts_buildtopindex(httrackp * opt, const char *path,
const char *binpath); const char *binpath);
HTSEXT_API char *hts_getcategories(char *path, int type); HTSEXT_API const char *hts_getcategories(const char *path, int type);
HTSEXT_API char *hts_getcategory(const char *filename); HTSEXT_API const char *hts_getcategory(const char *filename);
/* Catch-URL */ /* Catch-URL */
HTSEXT_API T_SOC catch_url_init_std(int *port_prox, char *adr_prox); HTSEXT_API T_SOC catch_url_init_std(int *port_prox, char *adr_prox);
@@ -157,12 +150,11 @@ HTSEXT_API int hts_is_testing(httrackp * opt);
HTSEXT_API int hts_is_exiting(httrackp * opt); HTSEXT_API int hts_is_exiting(httrackp * opt);
/*HTSEXT_API int hts_setopt(httrackp* opt); DEPRECATED ; see copy_htsopt() */ /*HTSEXT_API int hts_setopt(httrackp* opt); DEPRECATED ; see copy_htsopt() */
HTSEXT_API int hts_addurl(httrackp * opt, char **url); HTSEXT_API int hts_addurl(httrackp * opt, char **url);
HTSEXT_API int hts_resetaddurl(httrackp * opt); HTSEXT_API int hts_resetaddurl(httrackp * opt);
HTSEXT_API int copy_htsopt(const httrackp * from, httrackp * to); HTSEXT_API int copy_htsopt(httrackp * from, httrackp * to);
HTSEXT_API char *hts_errmsg(httrackp * opt); HTSEXT_API char *hts_errmsg(httrackp * opt);
HTSEXT_API int hts_setpause(httrackp * opt, int); HTSEXT_API int hts_setpause(httrackp * opt, int); // pause transfer
HTSEXT_API int hts_request_stop(httrackp * opt, int force); HTSEXT_API int hts_request_stop(httrackp * opt, int force);
HTSEXT_API int hts_cancel_file_push(httrackp * opt, const char *url); HTSEXT_API int hts_cancel_file_push(httrackp * opt, const char *url);
HTSEXT_API void hts_cancel_test(httrackp * opt); HTSEXT_API void hts_cancel_test(httrackp * opt);
@@ -172,68 +164,46 @@ HTSEXT_API void hts_cancel_parsing(httrackp * opt);
/* Tools */ /* Tools */
HTSEXT_API int structcheck(const char *path); HTSEXT_API int structcheck(const char *path);
HTSEXT_API int structcheck_utf8(const char *path);
HTSEXT_API int dir_exists(const char *path); HTSEXT_API int dir_exists(const char *path);
HTSEXT_API void infostatuscode(char *msg, int statuscode); HTSEXT_API void infostatuscode(char *msg, int statuscode);
HTSEXT_API TStamp mtime_local(void); HTSEXT_API HTS_INLINE TStamp mtime_local(void);
HTSEXT_API void qsec2str(char *st, TStamp t); HTSEXT_API void qsec2str(char *st, TStamp t);
HTSEXT_API char *int2char(strc_int2bytes2 * strc, int n); HTSEXT_API char *int2char(strc_int2bytes2 * strc, int n);
HTSEXT_API char *int2bytes(strc_int2bytes2 * strc, LLint n); HTSEXT_API char *int2bytes(strc_int2bytes2 * strc, LLint n);
HTSEXT_API char *int2bytessec(strc_int2bytes2 * strc, long int n); HTSEXT_API char *int2bytessec(strc_int2bytes2 * strc, long int n);
HTSEXT_API char **int2bytes2(strc_int2bytes2 * strc, LLint n); HTSEXT_API char **int2bytes2(strc_int2bytes2 * strc, LLint n);
HTSEXT_API char *jump_identification(const char *); HTSEXT_API char *jump_identification(char *);
HTSEXT_API char *jump_normalized(const char *); HTSEXT_API char *jump_normalized(char *);
HTSEXT_API char *jump_toport(const char *); HTSEXT_API char *jump_toport(char *);
HTSEXT_API char *fil_normalized(const char *source, char *dest); HTSEXT_API char *fil_normalized(char *source, char *dest);
HTSEXT_API char *adr_normalized(const char *source, char *dest); HTSEXT_API char *adr_normalized(char *source, char *dest);
HTSEXT_API char *hts_rootdir(char *file); HTSEXT_API char *hts_rootdir(char *file);
/* Escaping URLs */ /* Escaping URLs */
HTSEXT_API void unescape_amp(char *s); HTSEXT_API void unescape_amp(char *s);
HTSEXT_API void escape_spc_url(char *s);
HTSEXT_API size_t escape_spc_url(const char *const src, char *const dest, const size_t size); HTSEXT_API void escape_in_url(char *s);
HTSEXT_API size_t escape_in_url(const char *const src, char *const dest, const size_t size); HTSEXT_API void escape_uri(char *s);
HTSEXT_API size_t escape_uri(const char *const src, char *const dest, const size_t size); HTSEXT_API void escape_uri_utf(char *s);
HTSEXT_API size_t escape_uri_utf(const char *const src, char *const dest, const size_t size); HTSEXT_API void escape_check_url(char *s);
HTSEXT_API size_t escape_check_url(const char *const src, char *const dest, const size_t size); HTSEXT_API char *escape_check_url_addr(char *s);
HTSEXT_API void x_escape_http(char *s, int mode);
HTSEXT_API size_t append_escape_spc_url(const char *const src, char *const dest, const size_t size); HTSEXT_API char *unescape_http(char *catbuff, const char *s);
HTSEXT_API size_t append_escape_in_url(const char *const src, char *const dest, const size_t size); HTSEXT_API char *unescape_http_unharm(char *catbuff, const char *s,
HTSEXT_API size_t append_escape_uri(const char *const src, char *const dest, const size_t size); int no_high);
HTSEXT_API size_t append_escape_uri_utf(const char *const src, char *const dest, const size_t size);
HTSEXT_API size_t append_escape_check_url(const char *const src, char *const dest, const size_t size);
HTSEXT_API size_t inplace_escape_spc_url(char *const dest, const size_t size);
HTSEXT_API size_t inplace_escape_in_url(char *const dest, const size_t size);
HTSEXT_API size_t inplace_escape_uri(char *const dest, const size_t size);
HTSEXT_API size_t inplace_escape_uri_utf(char *const dest, const size_t size);
HTSEXT_API size_t inplace_escape_check_url(char *const dest, const size_t size);
HTSEXT_API char *escape_check_url_addr(const char *const src, char *const dest, const size_t size);
HTSEXT_API size_t make_content_id(const char *const adr, const char *const fil, char *const dest, const size_t size);
HTSEXT_API size_t x_escape_http(const char *const s, char *const dest, const size_t max_size, const int mode);
HTSEXT_API void escape_remove_control(char *const s);
HTSEXT_API size_t escape_for_html_print(const char *const s, char *const dest, const size_t size);
HTSEXT_API size_t escape_for_html_print_full(const char *const s, char *const dest, const size_t size);
HTSEXT_API char *unescape_http(char *const catbuff, const size_t size, const char *const s);
HTSEXT_API char *unescape_http_unharm(char *const catbuff, const size_t size, const char *s, const int no_high);
HTSEXT_API char *antislash_unescaped(char *catbuff, const char *s); HTSEXT_API char *antislash_unescaped(char *catbuff, const char *s);
HTSEXT_API void escape_remove_control(char *s); HTSEXT_API void escape_remove_control(char *s);
HTSEXT_API void get_httptype(httrackp * opt, char *s, const char *fil, HTSEXT_API void get_httptype(httrackp * opt, char *s, const char *fil,
int flag); int flag);
HTSEXT_API int is_knowntype(httrackp * opt, const char *fil); HTSEXT_API int is_knowntype(httrackp * opt, const char *fil);
HTSEXT_API int is_userknowntype(httrackp * opt, const char *fil); HTSEXT_API int is_userknowntype(httrackp * opt, const char *fil);
HTSEXT_API int is_dyntype(const char *fil); HTSEXT_API int is_dyntype(const char *fil);
HTSEXT_API char *get_ext(char *catbuff, size_t size, const char *fil); HTSEXT_API char *get_ext(char *catbuff, const char *fil);
/* Ugly string tools */ /* Ugly string tools */
HTSEXT_API char *concat(char *catbuff, size_t size, const char *a, const char *b); HTSEXT_API char *concat(char *catbuff, const char *a, const char *b);
HTSEXT_API char *fconcat(char *catbuff, size_t size, const char *a, const char *b); HTSEXT_API char *fconcat(char *catbuff, const char *a, const char *b);
HTSEXT_API char *fconv(char *catbuff, size_t size, const char *a); HTSEXT_API char *fconv(char *catbuff, const char *a);
HTSEXT_API char *fslash(char *catbuff, size_t size, const char *a);
/* Debugging */ /* Debugging */
HTSEXT_API void hts_debug(int level); HTSEXT_API void hts_debug(int level);
@@ -303,19 +273,4 @@ typedef struct utimbuf STRUCT_UTIMBUF;
#define HTS_DEF_FILEAPI #define HTS_DEF_FILEAPI
#endif #endif
/** Macro aimed to break at build-time if a size is not a sizeof() strictly
* greater than sizeof(char*). **/
#undef COMPILE_TIME_CHECK_SIZE
#define COMPILE_TIME_CHECK_SIZE(A) (void) ((void (*)(char[A - sizeof(char*) - 1])) NULL)
/** Macro aimed to break at compile-time if a size is not a sizeof() strictly
* greater than sizeof(char*). **/
#undef RUNTIME_TIME_CHECK_SIZE
#define RUNTIME_TIME_CHECK_SIZE(A) assertf((A) != sizeof(void*))
#define fconv(A,B,C) (COMPILE_TIME_CHECK_SIZE(B), fconv(A,B,C))
#define concat(A,B,C,D) (COMPILE_TIME_CHECK_SIZE(B), concat(A,B,C,D))
#define fconcat(A,B,C,D) (COMPILE_TIME_CHECK_SIZE(B), fconcat(A,B,C,D))
#define fslash(A,B,C) (COMPILE_TIME_CHECK_SIZE(B), fslash(A,B,C))
#endif #endif

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -35,7 +35,6 @@ Please visit our Website: http://www.httrack.com
#include "htsglobal.h" #include "htsglobal.h"
#include "htscore.h" #include "htscore.h"
#include "htssafe.h"
#ifndef HTS_DEF_FWSTRUCT_t_StatsBuffer #ifndef HTS_DEF_FWSTRUCT_t_StatsBuffer
#define HTS_DEF_FWSTRUCT_t_StatsBuffer #define HTS_DEF_FWSTRUCT_t_StatsBuffer
@@ -84,6 +83,164 @@ struct t_InpInfo {
int main(int argc, char **argv); int main(int argc, char **argv);
#endif #endif
/* */
// Engine internal variables
typedef void (*htsErrorCallback) (char *msg, char *file, int line);
extern HTSEXT_API htsErrorCallback htsCallbackErr;
extern HTSEXT_API int htsMemoryFastXfr;
/* */
extern HTSEXT_API hts_stat_struct HTS_STAT; extern HTSEXT_API hts_stat_struct HTS_STAT;
extern int _DEBUG_HEAD; extern int _DEBUG_HEAD;
extern FILE *ioinfo; extern FILE *ioinfo;
// from htsbase.h
/* protected strcat, strncat and strcpy - definitely useful */
#define strcatbuff(A, B) do { \
assertf( (A) != NULL ); \
assertf( (B) != NULL ); \
if (htsMemoryFastXfr) { \
if (sizeof(A) != sizeof(char*)) { \
(A)[sizeof(A) - 1] = '\0'; \
} \
strcat(A, B); \
if (sizeof(A) != sizeof(char*)) { \
assertf((A)[sizeof(A) - 1] == '\0'); \
} \
} else { \
unsigned int sz = (unsigned int) strlen(A); \
unsigned int szf = (unsigned int) strlen(B); \
if (sizeof(A) != sizeof(char*)) { \
assertf(sz + szf + 1 < sizeof(A)); \
if (szf > 0) { \
if (sz + szf + 1 < sizeof(A)) { \
memcpy((A) + sz, (B), szf + 1); \
} \
} \
} else if (szf > 0) { \
memcpybuff((A) + sz, (B), szf + 1); \
} \
} \
} while(0)
#define strncatbuff(A, B, N) do { \
assertf( (A) != NULL ); \
assertf( (B) != NULL ); \
if (htsMemoryFastXfr) { \
if (sizeof(A) != sizeof(char*)) { \
(A)[sizeof(A) - 1] = '\0'; \
} \
strncat(A, B, N); \
if (sizeof(A) != sizeof(char*)) { \
assertf((A)[sizeof(A) - 1] == '\0'); \
} \
} else { \
unsigned int sz = (unsigned int) strlen(A); \
unsigned int szf = (unsigned int) strlen(B); \
if (szf > (unsigned int) (N)) szf = (unsigned int) (N); \
if (sizeof(A) != sizeof(char*)) { \
assertf(sz + szf + 1 < sizeof(A)); \
if (szf > 0) { \
if (sz + szf + 1 < sizeof(A)) { \
memcpy((A) + sz, (B), szf); \
* ( (A) + sz + szf) = '\0'; \
} \
} \
} else if (szf > 0) { \
memcpybuff((A) + sz, (B), szf); \
* ( (A) + sz + szf) = '\0'; \
} \
} \
} while(0)
#define strcpybuff(A, B) do { \
assertf( (A) != NULL ); \
assertf( (const char*) (B) != NULL ); \
if (htsMemoryFastXfr) { \
if (sizeof(A) != sizeof(char*)) { \
(A)[sizeof(A) - 1] = '\0'; \
} \
strcpy(A, B); \
if (sizeof(A) != sizeof(char*)) { \
assertf((A)[sizeof(A) - 1] == '\0'); \
} \
} else { \
unsigned int szf = (unsigned int) strlen(B); \
if (sizeof(A) != sizeof(char*)) { \
assertf(szf + 1 < sizeof(A)); \
if (szf > 0) { \
if (szf + 1 < sizeof(A)) { \
memcpy((A), (B), szf + 1); \
} else { \
* (A) = '\0'; \
} \
} else { \
* (A) = '\0'; \
} \
} else { \
memcpybuff((A), (B), szf + 1); \
} \
} \
} while(0)
// emergency log
typedef void (*t_abortLog) (char *msg, char *file, int line);
extern HTSEXT_API t_abortLog abortLog__;
#define abortLog(a) abortLog__(a, __FILE__, __LINE__)
#define abortLogFmt(a) do { \
FILE* fp = fopen("CRASH.TXT", "wb"); \
if (!fp) fp = fopen("/tmp/CRASH.TXT", "wb"); \
if (!fp) fp = fopen("C:\\CRASH.TXT", "wb"); \
if (fp) { \
fprintf(fp, "HTTrack " HTTRACK_VERSIONID " closed at '" __FILE__ "', line %d\r\n", __LINE__); \
fprintf(fp, "Reason:\r\n"); \
fprintf(fp, a); \
fprintf(fp, "\r\n"); \
fflush(fp); \
fclose(fp); \
} \
} while(0)
#define _ ,
#define abortLogFmt(a) do { \
FILE* fp = fopen("CRASH.TXT", "wb"); \
if (!fp) fp = fopen("/tmp/CRASH.TXT", "wb"); \
if (!fp) fp = fopen("C:\\CRASH.TXT", "wb"); \
if (fp) { \
fprintf(fp, "HTTrack " HTTRACK_VERSIONID " closed at '" __FILE__ "', line %d\r\n", __LINE__); \
fprintf(fp, "Reason:\r\n"); \
fprintf(fp, a); \
fprintf(fp, "\r\n"); \
fflush(fp); \
fclose(fp); \
} \
} while(0)
#define assertf(exp) do { \
if (! ( exp ) ) { \
abortLog("assert failed: " #exp); \
if (htsCallbackErr != NULL) { \
htsCallbackErr("assert failed: " #exp, __FILE__ , __LINE__ ); \
} \
assert(exp); \
abort(); \
} \
} while(0)
/* non-fatal assert */
#define assertnf(exp) do { \
if (! ( exp ) ) { \
abortLog("assert failed: " #exp); \
if (htsCallbackErr != NULL) { \
htsCallbackErr("assert failed: " #exp, __FILE__ , __LINE__ ); \
} \
} \
} while(0)
//
#define malloct(A) malloc(A)
#define calloct(A,B) calloc((A), (B))
#define freet(A) do { assertnf((A) != NULL); if ((A) != NULL) { free(A); (A) = NULL; } } while(0)
#define strdupt(A) strdup(A)
#define realloct(A,B) ( ((A) != NULL) ? realloc((A), (B)) : malloc(B) )
#define memcpybuff(A, B, N) memcpy((A), (B), (N))

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -90,7 +90,7 @@ int main(int argc, char *argv[]) {
/* Args */ /* Args */
printf("ProxyTrack %s, build proxies upon HTTrack Website Copier Archives\n", printf("ProxyTrack %s, build proxies upon HTTrack Website Copier Archives\n",
PROXYTRACK_VERSION); PROXYTRACK_VERSION);
printf("Copyright (C) 1998-2014 Xavier Roche and other contributors\n"); printf("Copyright (C) 1998-2013 Xavier Roche and other contributors\n");
printf("\n"); printf("\n");
printf("This program is free software: you can redistribute it and/or modify\n"); printf("This program is free software: you can redistribute it and/or modify\n");
printf("it under the terms of the GNU General Public License as published by\n"); printf("it under the terms of the GNU General Public License as published by\n");

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -85,21 +85,35 @@ HTS_UNUSED static void escapexml(const char *s, String * tempo) {
} }
} }
HTS_UNUSED static char* file_convert(char *dest, size_t size, const char *src) { HTS_UNUSED static char *concat(char *catbuff, const char *a, const char *b) {
size_t i; if (a != NULL && a[0] != '\0') {
for(i = 0 ; src[i] != '\0' && i + 1 < size ; i++) { strcpy(catbuff, a);
#ifdef _WIN32 } else {
if (src[i] == '/') { catbuff[0] = '\0';
dest[i] = '\\';
} else {
#endif
dest[i] = src[i];
#ifdef _WIN32
}
#endif
} }
dest[i] = '\0'; if (b != NULL && b[0] != '\0') {
return dest; strcat(catbuff, b);
}
return catbuff;
}
HTS_UNUSED static char *__fconv(char *a) {
#ifdef WIN32
int i;
for(i = 0; a[i] != 0; i++)
if (a[i] == '/') // Unix-to-DOS style
a[i] = '\\';
#endif
return a;
}
HTS_UNUSED static char *fconcat(char *catbuff, const char *a, const char *b) {
return __fconv(concat(catbuff, a, b));
}
HTS_UNUSED static char *fconv(char *catbuff, const char *a) {
return __fconv(concat(catbuff, a, ""));
} }
#endif #endif

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -103,7 +103,6 @@ Remark: If no cache newer than the added one is found, all entries can be added
*/ */
/* HTTrack definitions */ /* HTTrack definitions */
#define HTSSAFE_ABORT_FUNCTION(A,B,C)
#include "htsbase.h" #include "htsbase.h"
#include "htsnet.h" #include "htsnet.h"
#include "htslib.h" #include "htslib.h"
@@ -146,6 +145,8 @@ Remark: If no cache newer than the added one is found, all entries can be added
#endif #endif
/* External references */ /* External references */
// htsErrorCallback htsCallbackErr = NULL;
int htsMemoryFastXfr = 1; /* fast xfr by default */
void abortLog__fnc(char *msg, char *file, int line); void abortLog__fnc(char *msg, char *file, int line);
void abortLog__fnc(char *msg, char *file, int line) { void abortLog__fnc(char *msg, char *file, int line) {
FILE *fp = fopen("CRASH.TXT", "wb"); FILE *fp = fopen("CRASH.TXT", "wb");
@@ -165,6 +166,7 @@ void abortLog__fnc(char *msg, char *file, int line) {
} }
} }
// HTSEXT_API t_abortLog abortLog__ = abortLog__fnc; /* avoid VC++ inlining */
#define webhttrack_lock(A) do{}while(0) #define webhttrack_lock(A) do{}while(0)
/* Static definitions */ /* Static definitions */

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -91,7 +91,7 @@ HTS_UNUSED static void proxytrack_print_log(const char *severity, const char *fo
/* Header for generated pages */ /* Header for generated pages */
#define PROXYTRACK_COMMENT_HEADER \ #define PROXYTRACK_COMMENT_HEADER \
"<!-- Generated by ProxyTrack " PROXYTRACK_VERSION " -->\r\n" \ "<!-- Generated by ProxyTrack " PROXYTRACK_VERSION " build " __DATE__ " -->\r\n" \
"<!-- This is an add-on for HTTrack " HTTRACK_VERSIONID " -->\r\n" "<!-- This is an add-on for HTTrack " HTTRACK_VERSIONID " -->\r\n"
/* See IE "feature" (MSKB Q294807) */ /* See IE "feature" (MSKB Q294807) */

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -41,7 +41,6 @@ static long int timezone = 0;
#include <pthread.h> #include <pthread.h>
#endif #endif
#define HTSSAFE_ABORT_FUNCTION(A,B,C)
#include "htsglobal.h" #include "htsglobal.h"
#define HTS_INTERNAL_BYTECODE #define HTS_INTERNAL_BYTECODE
@@ -238,7 +237,6 @@ PT_Indexes PT_New(void) {
PT_Indexes index = (PT_Indexes) calloc(sizeof(_PT_Indexes), 1); PT_Indexes index = (PT_Indexes) calloc(sizeof(_PT_Indexes), 1);
index->cil = inthash_new(0); index->cil = inthash_new(0);
inthash_set_name(index->cil, "index->cil");
index->index_size = 0; index->index_size = 0;
index->index = NULL; index->index = NULL;
return index; return index;
@@ -255,6 +253,8 @@ int PT_RemoveIndex(PT_Indexes index, int indexId) {
return 0; return 0;
} }
#define assertf(exp)
static int binput(char *buff, char *s, int max) { static int binput(char *buff, char *s, int max) {
int count = 0; int count = 0;
int destCount = 0; int destCount = 0;
@@ -433,10 +433,8 @@ char **PT_Enumerate(PT_Indexes indexes, const char *url, int subtree) {
inthash_chain *chain; inthash_chain *chain;
inthash hdupes = NULL; inthash hdupes = NULL;
if (!subtree) { if (!subtree)
hdupes = inthash_new(0); hdupes = inthash_new(0);
inthash_set_name(hdupes, "hdupes");
}
StringClear(list); StringClear(list);
StringClear(listindexes); StringClear(listindexes);
StringClear(subitem); StringClear(subitem);
@@ -554,7 +552,6 @@ PT_Index PT_LoadCache(const char *filename) {
index->slots.common.timestamp = (time_t) time(NULL); index->slots.common.timestamp = (time_t) time(NULL);
index->slots.common.startUrl[0] = '\0'; index->slots.common.startUrl[0] = '\0';
index->slots.common.hash = inthash_new(0); index->slots.common.hash = inthash_new(0);
inthash_set_name(index->slots.common.hash, "index->slots.common.hash");
if (!_IndexFuncts[type].PT_LoadCache(index, filename)) { if (!_IndexFuncts[type].PT_LoadCache(index, filename)) {
proxytrack_print_log(DEBUG, proxytrack_print_log(DEBUG,
"reading httrack cache (format #%d) %s : error", "reading httrack cache (format #%d) %s : error",
@@ -1160,7 +1157,7 @@ static PT_Element PT_ReadCache__New_u(PT_Index index_, const char *url,
/* Read in memory from cache */ /* Read in memory from cache */
if (flags & FETCH_BODY) { if (flags & FETCH_BODY) {
if (strnotempty(previous_save)) { if (strnotempty(previous_save)) {
FILE *fp = fopen(file_convert(catbuff, sizeof(catbuff), previous_save), "rb"); FILE *fp = fopen(fconv(catbuff, previous_save), "rb");
if (fp != NULL) { if (fp != NULL) {
r->adr = (char *) malloc(r->size + 4); r->adr = (char *) malloc(r->size + 4);
@@ -1182,7 +1179,7 @@ static PT_Element PT_ReadCache__New_u(PT_Index index_, const char *url,
} else { } else {
r->statuscode = STATUSCODE_INVALID; r->statuscode = STATUSCODE_INVALID;
sprintf(r->msg, "Read error (can't open '%s') from cache", sprintf(r->msg, "Read error (can't open '%s') from cache",
file_convert(catbuff, sizeof(catbuff), previous_save)); fconv(catbuff, previous_save));
} }
} else { } else {
r->statuscode = STATUSCODE_INVALID; r->statuscode = STATUSCODE_INVALID;

View File

@@ -1,7 +1,7 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* /*
HTTrack Website Copier, Offline Browser for Windows and Unix HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors Copyright (C) 1998-2013 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@@ -1,10 +0,0 @@
#!/bin/bash
#
bash check-network.sh || ! echo "skipping online unit tests" || exit 77
# http://code.google.com/p/httrack/issues/detail?id=42&can=1
# we expect 2 errors only because other links are too longs (to be modified if suitable)
bash crawl-test.sh --errors 2 --files 1 \
--found ut.httrack.com/overflow/longquerywithaccents.html \
httrack http://ut.httrack.com/overflow/longquerywithaccents.php

View File

@@ -8,6 +8,6 @@ TESTS_ENVIRONMENT += ONLINE_UNIT_TESTS=$(ONLINE_UNIT_TESTS)
TESTS_ENVIRONMENT += HTTPS_SUPPORT=$(HTTPS_SUPPORT) TESTS_ENVIRONMENT += HTTPS_SUPPORT=$(HTTPS_SUPPORT)
TEST_EXTENSIONS = .test TEST_EXTENSIONS = .test
TESTS = 00_runnable.test 01_engine-charset.test 01_engine-entities.test 01_engine-hashtable.test 01_engine-idna.test 01_engine-simplify.test 10_crawl-simple.test 11_crawl-cookies.test 11_crawl-idna.test 11_crawl-international.test 11_crawl-longurl.test 11_crawl-parsing.test 12_crawl_https.test TESTS = 00_runnable.test 01_engine-charset.test 01_engine-entities.test 01_engine-hashtable.test 01_engine-idna.test 01_engine-simplify.test 10_crawl-simple.test 11_crawl-cookies.test 11_crawl-idna.test 11_crawl-international.test 11_crawl-parsing.test 12_crawl_https.test
CLEANFILES = check-network_sh.cache CLEANFILES = check-network_sh.cache

View File

@@ -214,7 +214,7 @@ TESTS_ENVIRONMENT = PATH=$(top_builddir)/src$(PATH_SEPARATOR)$$PATH \
ONLINE_UNIT_TESTS=$(ONLINE_UNIT_TESTS) \ ONLINE_UNIT_TESTS=$(ONLINE_UNIT_TESTS) \
HTTPS_SUPPORT=$(HTTPS_SUPPORT) HTTPS_SUPPORT=$(HTTPS_SUPPORT)
TEST_EXTENSIONS = .test TEST_EXTENSIONS = .test
TESTS = 00_runnable.test 01_engine-charset.test 01_engine-entities.test 01_engine-hashtable.test 01_engine-idna.test 01_engine-simplify.test 10_crawl-simple.test 11_crawl-cookies.test 11_crawl-idna.test 11_crawl-international.test 11_crawl-longurl.test 11_crawl-parsing.test 12_crawl_https.test TESTS = 00_runnable.test 01_engine-charset.test 01_engine-entities.test 01_engine-hashtable.test 01_engine-idna.test 01_engine-simplify.test 10_crawl-simple.test 11_crawl-cookies.test 11_crawl-idna.test 11_crawl-international.test 11_crawl-parsing.test 12_crawl_https.test
CLEANFILES = check-network_sh.cache CLEANFILES = check-network_sh.cache
all: all-am all: all-am