summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aclocal.m42
-rwxr-xr-xconfigure2
-rw-r--r--configure.in2
-rw-r--r--greetings.txt13
-rw-r--r--history.txt24
-rw-r--r--html/faq.html79
-rw-r--r--html/httrack.man.html2
-rw-r--r--html/server/div/WebHTTrack-Websites.desktop1
-rw-r--r--html/server/div/WebHTTrack.desktop1
-rwxr-xr-xlang/Portugues-Brasil.txt7
-rw-r--r--ltmain.sh2
-rw-r--r--man/httrack.12
-rw-r--r--src/htsback.c36
-rw-r--r--src/htsbasenet.h10
-rw-r--r--src/htscatchurl.c4
-rw-r--r--src/htscoremain.c12
-rw-r--r--src/htsftp.c4
-rw-r--r--src/htsglobal.h6
-rw-r--r--src/htsindex.c2
-rw-r--r--src/htslib.c22
-rw-r--r--src/htslib.h9
-rw-r--r--src/htsmodules.c47
-rw-r--r--src/htsparse.c7
-rw-r--r--src/htsserver.c7
-rwxr-xr-xsrc/httrack.vcproj600
-rw-r--r--src/minizip/mztools.c572
-rw-r--r--src/proxy/proxytrack.c5
-rwxr-xr-xsrc/webhttrack21
28 files changed, 499 insertions, 1002 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 958c52c..239eeee 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -900,7 +900,7 @@ AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-# serial 52 Debian 1.5.26-4+lenny1 AC_PROG_LIBTOOL
+# serial 52 Debian 1.5.26-4 AC_PROG_LIBTOOL
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
diff --git a/configure b/configure
index 3d41c45..1502643 100755
--- a/configure
+++ b/configure
@@ -2218,7 +2218,7 @@ fi
# Define the identity of the package.
PACKAGE=httrack
- VERSION=3.43.12
+ VERSION=3.43.5
cat >>confdefs.h <<_ACEOF
diff --git a/configure.in b/configure.in
index 00131c1..56d6d36 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
AC_INIT(src/httrack.c)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(httrack, 3.43.12)
+AM_INIT_AUTOMAKE(httrack, 3.43.5)
VERSION_INFO="2:43:0"
AM_MAINTAINER_MODE
diff --git a/greetings.txt b/greetings.txt
index 9d4258a..d505f62 100644
--- a/greetings.txt
+++ b/greetings.txt
@@ -1,4 +1,4 @@
-Informations on this project:
+Informations on this project:
This project has been developed by:
Xavier Roche (xroche at httrack.com)
@@ -13,11 +13,6 @@ Leto Kauler (molotov at tasmail.com)
http://kauler.com/
Christian Marillat (marillat.christian at wanadoo.fr)
for autoconf compliance and .deb package
-Fred Cohen (fc at all.net)
- for HTTrack user's guide
- http://all.net/
-
-And the help of the following third party developers:
Nicolas Benoit (nbenoit at tuxfamily.org), SDP Multimedia and Major MMS
for the mms plugin core routines (MMSRIP)
http://nbenoit.tuxfamily.org/
@@ -27,9 +22,9 @@ Jean-loup Gailly from gzip.org
Eric A. Young (eay at cryptsoft.com)
for SSL cryptographic material (OpenSSL)
http://www.openssl.org/
-Jordan Russell
- for the Windows setup tool (Inno Setup)
- http://www.jrsoftware.org/isinfo.php
+Fred Cohen (fc at all.net)
+ for HTTrack user's guide
+ http://all.net/
Translations written by:
David Lawrie (dalawrie at lineone.net)
diff --git a/history.txt b/history.txt
index e363b03..29e824f 100644
--- a/history.txt
+++ b/history.txt
@@ -4,30 +4,6 @@ HTTrack Website Copier release history:
This file lists all changes and fixes that have been made for HTTrack.
-3.43-12
-+ Fixed: buffer overflow while repairing httrack cache if a damaged cache is found from a previous mirror (closes:#607704)
-
-3.43-11
-+ Fixed: webhttrack fixes for icecat (closes:#605140)
-
-3.43-10
-+ Fixed: capture URL not working properly when IPv6 is installed (John Bostelman)
-
-3.43-9
-+ Fixed: application/xhtml+xml not seen as "html" (Peter Fritzsche)
-+ Fixed: various linux fixes for desktop files (closes:#563691)
-
-3.43-8
-+ Fixed: URL encoding bugs with filenames containing '%' characters (sandboxie32)
-+ Fixed: MacPorts Darwin/Mac fixes to webhttrack (Ross Williams)
-+ Fixed: Flash link extraction has been improved (Vincent/suei8423)
-
-3.43-7
-+ Fixed: "Open error when decompressing" errors due to temporary file generation problems (Scott Mueller)
-
-3.43-6
-+ Shell: WIN32 setup cosmetic fixes: do not probe the proxy on non-local network, do not force *.whtt registration
-
3.43-5
+ Fixed: code tag handling bug in certain cases leading to produce invalid links (Tom-tmh13 and William Roeder)
diff --git a/html/faq.html b/html/faq.html
index 19e5b3a..3b4a051 100644
--- a/html/faq.html
+++ b/html/faq.html
@@ -125,21 +125,19 @@ clear language!
<br>
<h3>General questions:<br></h3>
-<li><a href="#QG0">Is there any 'spyware' or 'adware' in this program? Can you prove that there isn't any?</a><br></li>
-
-<li><a href="#QG0c">This software is 'free', but I bought it from an authorized reseller. What's going on?</a><br></li>
+<li><a href="#QG0">Is there any 'spyware' or 'adware' in this program? Can you prove that there isn't any?</a><br></li>
+
+<li><a href="#QG0c">This software is 'free', but I bought it from an authorized reseller. What's going on?</a><br></li>
<li><a href="#QG0b">Is there any risks of viruses with this software?</a><br></li>
-<li><a href="#QG1">The install is not working on Windows without administrator rights!</a><br></li>
+<li><a href="#QG1">The install is not working on NT without administrator rights!</a><br></li>
<li><a href="#QG2">Where can I find French/other languages documentation?</a><br></li>
-<li><a href="#QG3b">Is HTTrack working on Windows Vista or Windows Seven?</a><br></li>
-
<li><a href="#QG3">Is HTTrack working on NT/2000?</a><br></li>
-<li><a href="#QG4">What's the difference between HTTrack, WinHTTrack and WebHTTrack?</a><br></li>
+<li><a href="#QG4">What's the difference between HTTrack and WinHTTrack?</a><br></li>
<li><a href="#QG5">Is HTTrack Mac compatible?</a><br></li>
@@ -267,8 +265,8 @@ clear language!
<li><a href="#QM10">What's this hts-cache directory? Can I remove it?</a><br></li>
-<li><a href="#QM10b">What is the meaning of the <tt>Links scanned: 12/34 (+5)</tt> line in WinHTTrack/WebHTTrack?</a><br></li>
-
+<li><a href="#QM10b">What is the meaning of the <tt>Links scanned: 12/34 (+5)</tt> line in WinHTTrack/WebHTTrack?</a><br></li>
+
<li><a href="#QM11">Can I start a mirror from my bookmarks?</a><br></li>
<li><a href="#QM11c">Can I convert a local website (file:// links) to a standard website?</a><br></li>
@@ -352,16 +350,16 @@ More detailed information can be found <a href="filters.html">here</a>!<br>
<a NAME="QG0">Q: <strong>Is there any 'spyware' or 'adware' in this program? Can you prove that there isn't any?</strong></a><br>
A: <em>No ads (banners), and absolutely no 'spy' features inside the program.<br>
The best proof is the software status: all sources are released, and everybody can check them. Open source is the best protection against privacy problems - HTTrack is an open source project, free of charge and free of any spy 'features'.</em>
-
-<br><br><a NAME="QG0c">Q: <strong>This software is 'free', but I bought it from an authorized reseller . What's going on?</strong></a><br>
-A: <em>
-HTTrack is free (free as in 'freedom') as it is covered by the <a href="http://www.gnu.org/licenses/gpl.txt" target="_new">GNU General Public License (GPL)</a>.
-You can freely download it, without paying any fees, copy it to your friends, and modify it if you respect the license.
-There are NO official/authorized resellers, because HTTrack is <b>NOT</b> a commercial product.
-But you can be charged for duplication fees, or any other services (example: software CDroms or shareware collections, or fees for maintenance),
-but you should have been informed that the software was free software/GPL, and you <b><u>MUST</u></b> have received a copy of the GNU General Public License.
-Otherwise this is dishonnest and unfair.
-</em>
+
+<br><br><a NAME="QG0c">Q: <strong>This software is 'free', but I bought it from an authorized reseller . What's going on?</strong></a><br>
+A: <em>
+HTTrack is free (free as in 'freedom') as it is covered by the <a href="http://www.gnu.org/licenses/gpl.txt" target="_new">GNU General Public License (GPL)</a>.
+You can freely download it, without paying any fees, copy it to your friends, and modify it if you respect the license.
+There are NO official/authorized resellers, because HTTrack is <b>NOT</b> a commercial product.
+But you can be charged for duplication fees, or any other services (example: software CDroms or shareware collections, or fees for maintenance),
+but you should have been informed that the software was free software/GPL, and you <b><u>MUST</u></b> have received a copy of the GNU General Public License.
+Otherwise this is dishonnest and unfair.
+</em>
<br><br><a NAME="QG0b">Q: <strong>Are there any risks of viruses with this software?</strong></a><br>
A: <em>For the software itself:
@@ -369,23 +367,28 @@ All official releases (at httrack.com) are checked against all known viruses, an
For files you are downloading on the WWW using HTTrack: You may encounter websites which were corrupted by viruses, and downloading data on these websites might be dangerous (as dangerous as if using a regular Browser). Always ensure that websites you are crawling are safe.
(Note: remember that using an antivirus software is a good idea once you are connected to the Internet)</em>
-<br><br><a NAME="QG1">Q: <strong>The install is not working on Windows without administrator rights!</strong></a><br>
+<br><br><a NAME="QG1">Q: <strong>The install is not working on NT without administrator rights!</strong></a><br>
A: <em>That's right. You can, however, install WinHTTrack on your own machine, and then copy your <tt>WinHTTrack</tt> folder from your <tt>Program Files</tt> folder to another machine, in a temporary directory (e.g. <tt>C:\temp\</tt>)</em>
<br><br><a NAME="QG2">Q: <strong>Where can I find French/other languages documentation?</strong></a><br>
A: <em>Windows interface is available on several languages, but not yet the documentation!</em>
-<br><br><a NAME="QG3b">Q: <strong>Is HTTrack working on Windows Vista or Windows Seven?</strong></a><br>
-A: <em>Yes, it does</em>
-
<br><br><a NAME="QG3">Q: <strong>Is HTTrack working on NT/2000?</strong></a><br>
A: <em>Yes, it does</em>
-<br><br><a NAME="QG4">Q: <strong>What's the difference between HTTrack, WinHTTrack and WebHTTrack?</strong></a><br>
-A: <em>WinHTTrack is the Windows GUI release of HTTrack (with a native graphic shell) and WebHTTrack is the Linux/Posix release of HTTrack (with an html graphic shell)</em>
+<br><br><a NAME="QG4">Q: <strong>What's the difference between HTTrack and WinHTTrack?</strong></a><br>
+A: <em>WinHTTrack is the Windows release of HTTrack (with a graphic shell)</em>
<br><br><a NAME="QG5">Q: <strong>Is HTTrack Mac compatible?</strong></a><br>
-A: <em>Yes, using the original sources, or with MacPorts.
+A: <em>Yes, using the original sources:
+
+<pre>
+tar xvfz httrack-*.tar.gz
+cd httrack-*
+./configure --prefix=/usr/local && make && make install
+/usr/local/bin/httrack
+</pre>
+But there are no official binaries, because of a lack of time</em>
<br><br><a NAME="QG6">Q: <strong>Can HTTrack be compiled on all Un*x?</strong></a><br>
A: <em>It should. The <tt>Makefile</tt> may be modified in some cases, however</em>
@@ -393,16 +396,16 @@ A: <em>It should. The <tt>Makefile</tt> may be modified in some cases, however</
<br><br><a NAME="QG7">Q: <strong>I use HTTrack for professional purpose. What about restrictions/license fee?</strong></a><br>
A: <em>HTTrack is covered by the GNU General Public License (GPL). There is no restrictions using HTTrack for professional purpose,
except if you develop a software which uses HTTrack components (parts of the source, or any other component).
-See the <tt>license.txt</tt> file for more information</em>. See also the next question regarding copyright issues when reditributing downloaded material.
+See the <tt>license.txt</tt> file for more information</em>
<br><br><a NAME="QG7b">Q: <strong>Is there any license royalties for distributing a mirror made with HTTrack?</strong></a><br>
-A: <em>On the HTTrack side, no. However, sharing, publishing or reusing copyrighted material downloaded from a site requires the authorization of the copyright holders, and possibly paying royalty fees. Always ask the authorization before creating a mirror of a site, even if the site appears to be royalty-free and/or without copyright notice.</em>
+A: <em>No.</em>
<br><br><a NAME="QG8">Q: <strong>Is a DLL/library version available?</strong></a><br>
A: <em>Yes. The default distribution includes a DLL (Windows) or a .so (Un*X), used by the program</em>
-<br><br><a NAME="QG9">Q: <strong>Is there a GUI version available for Linux and Un*x?</strong></a><br>
-A: <em>Yes. It is called WebHTTrack. See the download section at <a href="http://www.httrack.com">www.httrack.com!</a></em>
+<br><br><a NAME="QG9">Q: <strong>Is there a X11/KDE shell available for Linux and Un*x?</strong></a><br>
+A: <em>Yes. See the download/contribution section at <a href="http://www.httrack.com">www.httrack.com!</a></em>
<br><br>
<u><strong>Troubleshooting:<br>
@@ -461,10 +464,10 @@ A: <em>Yes, but .ra/.rm associated file should be captured together - except if
<br><br><a NAME="QT6">Q: <strong>Using user:password@address is not working!</a></strong></a></br>
A: <em>Again, first check the <tt>hts-log.txt</tt> and <tt>hts-err.txt</tt> error log files - this can give you precious information<br>
The site may have a different authentication scheme - form based authentication, for example.
-In this case, use the URL capture features of HTTrack, it might work.
-<br>Note: If your username and/or password contains a '<tt>@</tt>' character, you may have to replace all '<tt>@</tt>'
-occurences by '<tt>%40</tt>' so that it can work, such as in <tt>user%40domain.com:foobar@www.foo.com/auth/.
-You may have to do the same for all "special" characters like spaces (%20), quotes (%22)..</tt>
+In this case, use the URL capture features of HTTrack, it might work.
+<br>Note: If your username and/or password contains a '<tt>@</tt>' character, you may have to replace all '<tt>@</tt>'
+occurences by '<tt>%40</tt>' so that it can work, such as in <tt>user%40domain.com:foobar@www.foo.com/auth/.
+You may have to do the same for all "special" characters like spaces (%20), quotes (%22)..</tt>
</em>
<br><br>
@@ -841,10 +844,10 @@ A: <em>Not yet!</em>
<br><br><a NAME="QM10">Q: <strong>What's this hts-cache directory? Can I remove it?</strong></a><br>
A: <em>NO if you want to update the site, because this directory is used by HTTrack for this purpose.
If you remove it, options and URLs will not be available for updating the site</em>
-
-<br><br><a NAME="QM10b">Q: <strong>What is the meaning of the <tt>Links scanned: 12/34 (+5)</tt> line in WinHTTrack/WebHTTrack?</strong></a><br>
-A: <em>12 is the number of links scanned and stored, 34 the total number of links detected to be parsed, and 5 the number of files downloaded in background.
-In this example, 17 links were downloaded out of a (temporary) total of 34 links.</em>
+
+<br><br><a NAME="QM10b">Q: <strong>What is the meaning of the <tt>Links scanned: 12/34 (+5)</tt> line in WinHTTrack/WebHTTrack?</strong></a><br>
+A: <em>12 is the number of links scanned and stored, 34 the total number of links detected to be parsed, and 5 the number of files downloaded in background.
+In this example, 17 links were downloaded out of a (temporary) total of 34 links.</em>
<br><br><a NAME="QM11">Q: <strong>Can I start a mirror from my bookmarks?</strong></a><br>
A: <em>Yes. Drag&Drop your bookmark.html file to the WinHTTrack window (or use file://filename for command-line release) and select
diff --git a/html/httrack.man.html b/html/httrack.man.html
index 6427bef..f887383 100644
--- a/html/httrack.man.html
+++ b/html/httrack.man.html
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.18.1 -->
-<!-- CreationDate: Tue Dec 21 11:30:04 2010 -->
+<!-- CreationDate: Wed May 20 19:13:56 2009 -->
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
diff --git a/html/server/div/WebHTTrack-Websites.desktop b/html/server/div/WebHTTrack-Websites.desktop
index 92688ed..3ddb987 100644
--- a/html/server/div/WebHTTrack-Websites.desktop
+++ b/html/server/div/WebHTTrack-Websites.desktop
@@ -1,4 +1,5 @@
[Desktop Entry]
+Encoding=UTF-8
Version=1.0
Type=Application
Categories=Network;
diff --git a/html/server/div/WebHTTrack.desktop b/html/server/div/WebHTTrack.desktop
index b6d75ef..8a2f8af 100644
--- a/html/server/div/WebHTTrack.desktop
+++ b/html/server/div/WebHTTrack.desktop
@@ -1,4 +1,5 @@
[Desktop Entry]
+Encoding=UTF-8
Version=1.0
Type=Application
Categories=Network;
diff --git a/lang/Portugues-Brasil.txt b/lang/Portugues-Brasil.txt
index 55b0d8b..7537069 100755
--- a/lang/Portugues-Brasil.txt
+++ b/lang/Portugues-Brasil.txt
@@ -186,8 +186,6 @@ scanning
analizando
Waiting for scheduled time..
Aguardando horário programado para iniciar...
-Transferring data..
-Transferindo dados..
Connecting to provider
Conectando ao provedor
[%d seconds] to go before start of operation
@@ -231,7 +229,7 @@ Caminho do arquivo de relatório
Path
Caminho
- Links List Mode -\n\nUse URL box to enter address(es) of page(s) containing links to mirror
-- Método da lista de links -\n\nUtilize a caixa URL's para digitar o(s) endereço(s) da(s) página(s) contendo links para recebimento.
+Método da lista de links -\n\nUtilize a caixa URL's para digitar o(s) endereço(s) da(s) página(s) contendo links para recebimento.
New project / Import?
Novo projeto / Importar?
Choose criterion
@@ -637,7 +635,7 @@ Desconectar ao finalizar
Disconnect modem on completion
Desconectar o modem ao finalizar
\r\n(Please notify us of any bug or problem)\r\n\r\nDevelopment:\r\nInterface (Windows): Xavier Roche\r\nSpider: Xavier Roche\r\nJavaParserClasses: Yann Philippot\r\n\r\n(C)1998-2003 Xavier Roche and other contributors\r\nMANY THANKS for translation tips to:\r\nRobert Lagadec (rlagadec@yahoo.fr)
-\r\n(por favor nos comunique sobre erros ou problemas)\r\n\r\nDesenvolvimento:\r\nInterface (Windows): Xavier Roche\r\nMotor: Xavier Roche\r\nJavaParserClasses: Yann Philippot\r\n\r\n(C)1998-2003 Xavier Roche e outros colaboradores\r\nTraduzido para o Português-Brasil por :\r\nPaulo Neto (layoutbr@lexxa.com.br)
+\r\n(por favor nos comunique sobre erros ou problemas)\r\n\r\nDesenvolvimento:\r\nInterface (Windows): Xavier Roche\r\nMotor: Xavier Roche\r\nJavaParserClasses: Yann Philippot\r\n\r\n(C)1998-2003 Xavier Roche e outros colaboradores\r\nTraduzido para o Português-Brasil por :\r\nPaulo Neto (Layout do Brasil, company@layout.com.br)
About WinHTTrack Website Copier
Sobre o WinHTTrack Website Copier
Please visit our Web page
@@ -930,3 +928,4 @@ Server terminated
Servidor finalizado
A fatal error has occured during this mirror
Um erro fatal ocorreu durante este espelho
+
diff --git a/ltmain.sh b/ltmain.sh
index 1ad8ef4..0bf3848 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -43,7 +43,7 @@ EXIT_FAILURE=1
PROGRAM=ltmain.sh
PACKAGE=libtool
-VERSION="1.5.26 Debian 1.5.26-4+lenny1"
+VERSION="1.5.26 Debian 1.5.26-4"
TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
diff --git a/man/httrack.1 b/man/httrack.1
index 076ff19..7c7c8cd 100644
--- a/man/httrack.1
+++ b/man/httrack.1
@@ -1,7 +1,7 @@
.\" Process this file with
.\" groff -man -Tascii httrack.1
.\"
-.TH httrack 1 "HTTrack version 3.43-9 (compiled Jan 4 2010)" "httrack website copier"
+.TH httrack 1 "Mar 2009" "httrack website copier"
.SH NAME
httrack \- offline browser : copy websites to a local directory
.SH SYNOPSIS
diff --git a/src/htsback.c b/src/htsback.c
index 723ad60..280dba0 100644
--- a/src/htsback.c
+++ b/src/htsback.c
@@ -479,23 +479,8 @@ int back_finalize(httrackp* opt,cache_back* cache,struct_back* sback,int p) {
back[p].compressed_size=back[p].r.size;
// en mémoire -> passage sur disque
if (!back[p].r.is_write) {
-#if 1
-#ifdef _WIN32
-#undef tempnam
-#define tempnam _tempnam
-#endif
- char *const tmp = tempnam(NULL, "httrack_temporaryGzipFile_");
- if (tmp != NULL) {
- strcpybuff(back[p].tmpfile_buffer, tmp);
- free(tmp);
- back[p].tmpfile = back[p].tmpfile_buffer;
- } else {
- back[p].tmpfile = NULL;
- }
-#else
back[p].tmpfile_buffer[0]='\0';
- back[p].tmpfile=tmpnam(back[p].tmpfile_buffer);
-#endif
+ back[p].tmpfile=tmpnam(back[p].tmpfile_buffer);
if (back[p].tmpfile != NULL && back[p].tmpfile[0] != '\0') {
back[p].r.out=fopen(back[p].tmpfile,"wb");
if (back[p].r.out) {
@@ -512,7 +497,7 @@ int back_finalize(httrackp* opt,cache_back* cache,struct_back* sback,int p) {
} else {
back[p].tmpfile[0]='\0';
back[p].r.statuscode=STATUSCODE_INVALID;
- strcpybuff(back[p].r.msg,"Open error when decompressing (can not create a temporary file)");
+ strcpybuff(back[p].r.msg,"Open error when decompressing");
}
}
}
@@ -2734,23 +2719,8 @@ void back_wait(struct_back* sback,httrackp* opt,cache_back* cache,TStamp stat_ti
/* .gz are *NOT* depacked!! */
(strfield(get_ext(catbuff,back[i].url_sav),"gz") == 0)
) {
-#if 1
-#ifdef _WIN32
-#undef tempnam
-#define tempnam _tempnam
-#endif
- char *const tmp = tempnam(NULL, "httrack_temporaryGzipFile_");
- if (tmp != NULL) {
- strcpybuff(back[i].tmpfile_buffer, tmp);
- free(tmp);
- back[i].tmpfile = back[i].tmpfile_buffer;
- } else {
- back[i].tmpfile = NULL;
- }
-#else
back[i].tmpfile_buffer[0]='\0';
- back[i].tmpfile=tmpnam(back[p].tmpfile_buffer);
-#endif
+ back[i].tmpfile=tmpnam(back[i].tmpfile_buffer);
if (back[i].tmpfile != NULL && back[i].tmpfile[0]) {
if ((back[i].r.out=fopen(back[i].tmpfile,"wb")) == NULL) {
last_errno = errno;
diff --git a/src/htsbasenet.h b/src/htsbasenet.h
index d717654..26f1392 100644
--- a/src/htsbasenet.h
+++ b/src/htsbasenet.h
@@ -47,15 +47,9 @@ Please visit our Website: http://www.httrack.com
#ifndef _WIN32_WCE
#undef HTS_USESCOPEID
#define WIN32_LEAN_AND_MEAN
-// KB955045 (http://support.microsoft.com/kb/955045)
-// To execute an application using this function on earlier versions of Windows
-// (Windows 2000, Windows NT, and Windows Me/98/95), then it is mandatary to #include Ws2tcpip.h
-// and also Wspiapi.h. When the Wspiapi.h header file is included, the 'getaddrinfo' function is
-// #defined to the 'WspiapiGetAddrInfo' inline function in Wspiapi.h.
+#include <winsock2.h>
#include <ws2tcpip.h>
-#include <Wspiapi.h>
-//#include <winsock2.h>
-//#include <tpipv6.h>
+#include <tpipv6.h>
#else
#include <winsock2.h>
#include <socket.h>
diff --git a/src/htscatchurl.c b/src/htscatchurl.c
index 2cb10f0..74a2439 100644
--- a/src/htscatchurl.c
+++ b/src/htscatchurl.c
@@ -160,7 +160,9 @@ HTSEXT_API int catch_url(T_SOC soc,char* url,char* method,char* data) {
// connexion (accept)
if (soc != INVALID_SOCKET) {
T_SOC soc2;
- while ( (soc2 = (T_SOC) accept(soc, NULL, NULL)) == INVALID_SOCKET);
+ struct sockaddr dummyaddr;
+ int dummylen = sizeof(struct sockaddr);
+ while ( (soc2 = (T_SOC) accept(soc,&dummyaddr,&dummylen)) == INVALID_SOCKET);
/*
#ifdef _WIN32
closesocket(soc);
diff --git a/src/htscoremain.c b/src/htscoremain.c
index bfaebaf..634bf86 100644
--- a/src/htscoremain.c
+++ b/src/htscoremain.c
@@ -1605,13 +1605,11 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp *opt) {
return 0;
break;
case '~': /* internal lib test */
- //Disabled because choke on GCC 4.3 (toni from links2linux.de)
- //{
- // char thisIsATestYouShouldSeeAnError[12];
- // const char *const bufferOverflowTest = "0123456789012345678901234567890123456789";
- // strcpybuff(thisIsATestYouShouldSeeAnError, bufferOverflowTest);
- // return 0;
- //}
+ {
+ char thisIsATestYouShouldSeeAnError[12];
+ strcpybuff(thisIsATestYouShouldSeeAnError, "0123456789012345678901234567890123456789");
+ return 0;
+ }
break;
case 'f': opt->flush=1; break;
case 'h':
diff --git a/src/htsftp.c b/src/htsftp.c
index f6df65e..e8797ca 100644
--- a/src/htsftp.c
+++ b/src/htsftp.c
@@ -653,7 +653,9 @@ int run_launch_ftp(FTPDownloadStruct *pStruct) {
_CHECK_HALT_FTP;
if (line[0]=='1') {
//T_SOC soc_dat;
- if ( (soc_dat=accept(soc_servdat, NULL, NULL)) == INVALID_SOCKET) {
+ struct sockaddr dummyaddr;
+ int dummylen = sizeof(struct sockaddr);
+ if ( (soc_dat=accept(soc_servdat,&dummyaddr,&dummylen)) == INVALID_SOCKET) {
strcpybuff(back->r.msg,"Unable to accept connection");
// back->status=STATUS_FTP_READY; // fini
back->r.statuscode=STATUSCODE_INVALID;
diff --git a/src/htsglobal.h b/src/htsglobal.h
index be06e5d..f20f7c1 100644
--- a/src/htsglobal.h
+++ b/src/htsglobal.h
@@ -40,8 +40,8 @@ Please visit our Website: http://www.httrack.com
#define HTTRACK_GLOBAL_DEFH
// Version (also check external version information)
-#define HTTRACK_VERSION "3.43-12"
-#define HTTRACK_VERSIONID "3.43.12"
+#define HTTRACK_VERSION "3.43-5"
+#define HTTRACK_VERSIONID "3.43.5"
#define HTTRACK_AFF_VERSION "3.x"
#define HTTRACK_LIB_VERSION "2.0"
@@ -266,7 +266,7 @@ Please visit our Website: http://www.httrack.com
#endif
/* Copyright (C) Xavier Roche and other contributors */
-#define HTTRACK_AFF_AUTHORS "[XR&CO'2010]"
+#define HTTRACK_AFF_AUTHORS "[XR&CO'2008]"
#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 HTS_UPDATE_WEBSITE "http://www.httrack.com/update.php3?Product=HTTrack&Version="HTTRACK_VERSIONID"&VersionStr="HTTRACK_VERSION"&Platform=%d&Language=%s"
diff --git a/src/htsindex.c b/src/htsindex.c
index 4ab69d0..4a7bd67 100644
--- a/src/htsindex.c
+++ b/src/htsindex.c
@@ -172,7 +172,7 @@ int index_keyword(const char* html_data,LLint size,const char* mime,const char*
}
// Check MIME type
- if (is_html_mime_type(mime)) {
+ if (strfield2(mime,"text/html")) {
inscript=0;
}
// FIXME - temporary fix for image/svg+xml (svg)
diff --git a/src/htslib.c b/src/htslib.c
index ff41d4f..e691902 100644
--- a/src/htslib.c
+++ b/src/htslib.c
@@ -3105,7 +3105,7 @@ int ishtml(httrackp *opt,const char* fil) {
*a = '\0';
}
if (get_userhttptype(opt, mime, fil_noquery)) {
- if (is_html_mime_type(mime)) {
+ if (strfield2(mime, "text/html")) {
return 1;
} else {
return 0;
@@ -3702,15 +3702,15 @@ HTSEXT_API char* unescape_http(char *catbuff, const char* s) {
}
// unescape in URL/URI ONLY what has to be escaped, to form a standard URL/URI
-// DOES NOT DECODE %25 (part of CHAR_DELIM)
+// DOES NOT DECODE %25
HTSEXT_API char* unescape_http_unharm(char *catbuff, const char* s, int no_high) {
int i,j=0;
for (i=0;i<(int) strlen(s);i++) {
if (s[i]=='%') {
int nchar=(char) ehex(s+i+1);
- int test = ( ( CHAR_RESERVED(nchar) && nchar != '+' ) /* %2B => + (not in query!) */
- || CHAR_DELIM(nchar)
+ int test = ( CHAR_RESERVED(nchar)
+ || ( nchar != '%' && CHAR_DELIM(nchar) )
|| CHAR_UNWISE(nchar)
|| CHAR_LOW(nchar) /* CHAR_SPECIAL */
|| CHAR_XXAVOID(nchar)
@@ -3822,13 +3822,9 @@ HTSEXT_API void x_escape_http(char* s,int mode) {
|| CHAR_XXAVOID(*s) );
}
else if (mode==30) { // échapper que ce qui est nécessaire
- test =
- ( *s != '/' && CHAR_RESERVED(*s) )
- || CHAR_DELIM(*s)
- || CHAR_UNWISE(*s)
- || CHAR_SPECIAL(*s)
- || CHAR_XXAVOID(*s)
- ;
+ test = (
+ CHAR_LOW(*s)
+ || CHAR_XXAVOID(*s) );
}
if (test) {
@@ -4159,7 +4155,7 @@ HTSEXT_API int is_knowntype(httrackp *opt,const char *fil) {
ext = get_ext(catbuff, fil);
while(strnotempty(hts_mime[j][1])) {
if (strfield2(hts_mime[j][1], ext)) {
- if (is_html_mime_type(hts_mime[j][0]))
+ if (strfield2(hts_mime[j][0], "text/html"))
return 2;
else
return 1;
@@ -4205,7 +4201,7 @@ HTSEXT_API int is_userknowntype(httrackp *opt,const char *fil) {
get_userhttptype(opt, mime, fil);
if (!strnotempty(mime))
return 0;
- else if (is_html_mime_type(mime))
+ else if (strfield2(mime,"text/html"))
return 2;
else
return 1;
diff --git a/src/htslib.h b/src/htslib.h
index 19d7adc..504d436 100644
--- a/src/htslib.h
+++ b/src/htslib.h
@@ -554,14 +554,8 @@ HTS_STATIC int strcmpnocase(char* a,char* b) {
#else
#define OPT_MMS(a) (0)
#endif
-
-#define is_html_mime_type(a) \
- ( (strfield2((a),"text/html")!=0)\
- || (strfield2((a),"application/xhtml+xml")!=0) \
- )
#define is_hypertext_mime__(a) \
- ( \
- is_html_mime_type(a)\
+ ( (strfield2((a),"text/html")!=0)\
|| (strfield2((a),"application/x-javascript")!=0) \
|| (strfield2((a),"text/css")!=0) \
/*|| (strfield2((a),"text/vnd.wap.wml")!=0)*/ \
@@ -578,6 +572,7 @@ HTS_STATIC int strcmpnocase(char* a,char* b) {
|| OPT_MMS(a) \
)
+
/* Library internal definictions */
#ifdef HTS_INTERNAL_BYTECODE
diff --git a/src/htsmodules.c b/src/htsmodules.c
index 07291bd..8f7facc 100644
--- a/src/htsmodules.c
+++ b/src/htsmodules.c
@@ -263,35 +263,30 @@ void htspe_init(void) {
handle = LoadLibraryA((char*)"ssleay32");
#else
/* We are compatible with 0.9.6/7/8/8b and potentially above */
- static const char *const libs[] = {
- "libssl.so.1.0",
- "libssl.so.1",
- "libssl.so.1.0.0",
- /* */
- "libssl.so.0",
- "libssl.so.0.9",
- "libssl.so.0.9.8p",
- "libssl.so.0.9.8o",
- "libssl.so.0.9.8n",
- "libssl.so.0.9.8m",
- "libssl.so.0.9.8l",
- "libssl.so.0.9.8k", /* (Debarshi Ray) */
- "libssl.so.0.9.8j", /* (Debarshi Ray) */
- "libssl.so.0.9.8g", /* Added 8g release too (Debarshi Ray) */
- "libssl.so.0.9.8b",
- "libssl.so.0.9.8",
- "libssl.so.0.9.7",
- "libssl.so.0.9.6",
- "libssl.so", /* Try harder with devel link */
- NULL
- };
- int i;
- for(i = 0, handle = NULL ; handle == NULL && libs[i] != NULL ; i++) {
- handle = dlopen(libs[i], RTLD_LAZY);
+ handle = dlopen("libssl.so.0.9.8g", RTLD_LAZY); /* added 8g release too (Debarshi Ray) */
+ if (handle == NULL) {
+ handle = dlopen("libssl.so.0.9.8b", RTLD_LAZY);
+ }
+ if (handle == NULL) {
+ handle = dlopen("libssl.so.0.9.8", RTLD_LAZY);
+ }
+ if (handle == NULL) {
+ handle = dlopen("libssl.so.0.9.7", RTLD_LAZY);
+ }
+ if (handle == NULL) {
+ handle = dlopen("libssl.so.0.9.6", RTLD_LAZY);
+ }
+ if (handle == NULL) {
+ /* Try harder with .0 if any */
+ handle = dlopen("libssl.so.0", RTLD_LAZY);
+ }
+ if (handle == NULL) {
+ /* Try harder with devel link */
+ handle = dlopen("libssl.so", RTLD_LAZY);
}
#endif
ssl_handle = handle;
- if (handle != NULL) {
+ if (handle) {
SSL_shutdown = (t_SSL_shutdown) DynamicGet(handle, (char*)"SSL_shutdown");
SSL_free = (t_SSL_free) DynamicGet(handle, (char*)"SSL_free");
SSL_new = (t_SSL_new) DynamicGet(handle, (char*)"SSL_new");
diff --git a/src/htsparse.c b/src/htsparse.c
index 34ef831..e2f955a 100644
--- a/src/htsparse.c
+++ b/src/htsparse.c
@@ -1953,12 +1953,12 @@ int htsparse(htsmoduleStruct* str, htsmoduleStructExtended* stre) {
unescape_amp(lien);
unescape_amp(query);
// décoder l'inutile (%2E par exemple) et coder espaces
- // Bad: strcpybuff(lien,unescape_http(lien));
- // Bad: strcpybuff(lien,unescape_http_unharm(lien, (no_esc_utf)?0:1));
+ // XXXXXXXXXXXXXXXXX strcpybuff(lien,unescape_http(lien));
+ //strcpybuff(lien,unescape_http_unharm(lien, (no_esc_utf)?0:1));
/* Never unescape high-chars (we don't know the encoding!!) */
strcpybuff(lien,unescape_http_unharm(catbuff,lien, 1)); /* note: '%' is still escaped */
escape_remove_control(lien);
- // ???? No! escape_spc_url(lien);
+ escape_spc_url(lien);
strcatbuff(lien,query); /* restore */
}
@@ -2752,7 +2752,6 @@ int htsparse(htsmoduleStruct* str, htsmoduleStructExtended* stre) {
if (!in_media) { // In media (such as real audio): don't patch
/* Never escape high-chars (we don't know the encoding!!) */
escape_uri_utf(tempo);
-
//if (!no_esc_utf)
// escape_uri(tempo); // escape with %xx
//else {
diff --git a/src/htsserver.c b/src/htsserver.c
index 855db75..abcd1be 100644
--- a/src/htsserver.c
+++ b/src/htsserver.c
@@ -302,7 +302,7 @@ int smallserver(T_SOC soc,char* url,char* method,char* data, char* path) {
};
initStrElt initStr[] = {
{ "user", "Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)" },
- { "footer", "<!-- Mirrored from %s%s by HTTrack Website Copier/3.x [XR&CO'2008], %s -->" },
+ { "footer", "<!-- Mirrored from %s%s by HTTrack Website Copier/3.x [XR&CO'2006], %s -->" },
{ "url2", "+*.png +*.gif +*.jpg +*.css +*.js -ad.doubleclick.net/*" },
{ NULL, NULL }
};
@@ -332,6 +332,8 @@ int smallserver(T_SOC soc,char* url,char* method,char* data, char* path) {
char line[8192];
char line2[1024];
T_SOC soc_c;
+ struct sockaddr dummyaddr;
+ int dummylen = sizeof(struct sockaddr);
LLint length = 0;
char* error_redirect = NULL;
@@ -347,6 +349,7 @@ int smallserver(T_SOC soc,char* url,char* method,char* data, char* path) {
StringCat(tmpbuff, "");
StringCat(tmpbuff2, "");
StringCat(fspath, "");
+ memset(&dummyaddr, 0, sizeof(dummyaddr));
/* UnLock */
webhttrack_release();
@@ -357,7 +360,7 @@ int smallserver(T_SOC soc,char* url,char* method,char* data, char* path) {
#endif
/* Accept */
- while ( (soc_c = (T_SOC) accept(soc, NULL, NULL)) == INVALID_SOCKET);
+ while ( (soc_c = (T_SOC) accept(soc, &dummyaddr, &dummylen)) == INVALID_SOCKET);
/* Lock */
webhttrack_lock();
diff --git a/src/httrack.vcproj b/src/httrack.vcproj
index 95b63ae..144b464 100755
--- a/src/httrack.vcproj
+++ b/src/httrack.vcproj
@@ -1,62 +1,36 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="9,00"
+ Version="7.10"
Name="httrack"
ProjectGUID="{D0E894E7-F64C-4722-9807-9ABB1054D43A}"
- RootNamespace="httrack"
- TargetFrameworkVersion="131072"
- >
+ SccProjectName=""
+ SccLocalPath="">
<Platforms>
<Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
+ Name="Win32"/>
</Platforms>
- <ToolFiles>
- </ToolFiles>
<Configurations>
<Configuration
Name="Release avec debug|Win32"
OutputDirectory=".\Release_avec_debug"
IntermediateDirectory="c:\temp\vcpp"
ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Release_avec_debug/httrack.tlb"
- HeaderFileName=""
- />
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/Zm200 "
Optimization="4"
InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
+ EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1"
- OmitFramePointers="true"
- AdditionalIncludeDirectories="&quot;C:\Dev\zlib-1.2.3\&quot;;C:\Dev\openssl\include;C:\Dev\Winhttrack"
- PreprocessorDefinitions="WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories="C:\Dev\IPv6Kit\inc\,C:\Dev\zlib-1.2.3\,C:\Dev\openssl\include,C:\Dev\Winhttrack"
+ PreprocessorDefinitions="WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE"
RuntimeLibrary="2"
- UsePrecompiledHeader="0"
+ UsePrecompiledHeader="2"
PrecompiledHeaderFile="c:\temp\vcpp/httrack.pch"
AssemblerOutput="2"
AssemblerListingLocation="c:\temp\vcpp/"
@@ -64,193 +38,65 @@
ProgramDataBaseFileName="c:\temp\vcpp/"
BrowseInformation="1"
WarningLevel="3"
- SuppressStartupBanner="true"
- Detect64BitPortabilityProblems="true"
+ SuppressStartupBanner="TRUE"
+ Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"
- CompileAs="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"
- />
+ CompileAs="0"/>
<Tool
- Name="VCPreLinkEventTool"
- />
+ Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Ws2_32.lib libhttrack.lib"
OutputFile="O:\HTTrack\httrack\httrack.exe"
LinkIncremental="1"
- SuppressStartupBanner="true"
+ SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="C:\Dev\openssl\lib,C:\Dev\zlib\dll32,C:\Dev\openssl\lib\out32dll"
- GenerateDebugInformation="true"
+ GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Release_avec_debug/httrack.pdb"
SubSystem="1"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release avec debug|x64"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
+ TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
- TargetEnvironment="3"
TypeLibraryName=".\Release_avec_debug/httrack.tlb"
- HeaderFileName=""
- />
+ HeaderFileName=""/>
<Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/Zm200 "
- Optimization="4"
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="1"
- OmitFramePointers="true"
- AdditionalIncludeDirectories="&quot;C:\Dev\zlib-1.2.3\&quot;;C:\Dev\openssl\include;C:\Dev\Winhttrack"
- PreprocessorDefinitions="WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- PrecompiledHeaderFile="c:\temp\vcpp/httrack.pch"
- AssemblerOutput="2"
- AssemblerListingLocation="c:\temp\vcpp/"
- ObjectFile="c:\temp\vcpp/"
- ProgramDataBaseFileName="c:\temp\vcpp/"
- BrowseInformation="1"
- WarningLevel="3"
- SuppressStartupBanner="true"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- CompileAs="0"
- />
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
<Tool
- Name="VCManagedResourceCompilerTool"
- />
+ Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
- Culture="1033"
- />
+ Culture="1033"/>
<Tool
- Name="VCPreLinkEventTool"
- />
+ Name="VCWebServiceProxyGeneratorTool"/>
<Tool
- Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib libhttrack.lib"
- OutputFile="O:\HTTrack\httrack\httrack.exe"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories="C:\Dev\openssl\lib,C:\Dev\zlib\dll32,C:\Dev\openssl\lib\out32dll"
- GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Release_avec_debug/httrack.pdb"
- SubSystem="1"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
+ Name="VCXMLDataGeneratorTool"/>
<Tool
- Name="VCFxCopTool"
- />
+ Name="VCWebDeploymentTool"/>
<Tool
- Name="VCAppVerifierTool"
- />
+ Name="VCManagedWrapperGeneratorTool"/>
<Tool
- Name="VCPostBuildEventTool"
- />
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory="C:\temp\httrackcmd\Debug"
IntermediateDirectory="C:\temp\httrackcmd\Debug"
ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Debug/httrack.tlb"
- HeaderFileName=""
- />
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/Zm200 "
Optimization="0"
- AdditionalIncludeDirectories="&quot;C:\Dev\zlib-1.2.3\&quot;;C:\Dev\openssl\include;C:\Dev\Winhttrack"
- PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+ AdditionalIncludeDirectories="C:\Dev\IPv6Kit\inc\,C:\Dev\zlib-1.2.3\,C:\Dev\openssl\include,C:\Dev\Winhttrack"
+ PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE"
RuntimeLibrary="3"
- BufferSecurityCheck="true"
- RuntimeTypeInfo="true"
+ BufferSecurityCheck="TRUE"
+ RuntimeTypeInfo="TRUE"
PrecompiledHeaderFile="c:\temp\vcpp/httrack.pch"
AssemblerOutput="2"
AssemblerListingLocation="c:\temp\vcpp/"
@@ -259,415 +105,147 @@
BrowseInformation="1"
BrowseInformationFile="c:\temp\vcpp/"
WarningLevel="3"
- SuppressStartupBanner="true"
- Detect64BitPortabilityProblems="true"
+ SuppressStartupBanner="TRUE"
+ Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"
- CompileAs="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"
- />
+ CompileAs="0"/>
<Tool
- Name="VCPreLinkEventTool"
- />
+ Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Ws2_32.lib libhttrack.lib"
- OutputFile="C:\temp\httrack\httrack.exe"
+ OutputFile="C:\temp\httrack.exe"
LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories="C:\Dev\openssl\lib;C:\temp\release_libz;C:\Dev\openssl\lib\out32dll;C:\temp\Debuglib"
- GenerateDebugInformation="true"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="C:\Dev\openssl\lib,C:\temp\zlib,C:\Dev\openssl\lib\out32dll,C:\temp\Debuglib"
+ GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/httrack.pdb"
SubSystem="1"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="C:\temp\httrackcmd\Debug"
- IntermediateDirectory="C:\temp\httrackcmd\Debug"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
+ TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
- TargetEnvironment="3"
TypeLibraryName=".\Debug/httrack.tlb"
- HeaderFileName=""
- />
+ HeaderFileName=""/>
<Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/Zm200 "
- Optimization="0"
- AdditionalIncludeDirectories="&quot;C:\Dev\zlib-1.2.3\&quot;;C:\Dev\openssl\include;C:\Dev\Winhttrack"
- PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE;_CRT_SECURE_NO_WARNINGS"
- RuntimeLibrary="3"
- BufferSecurityCheck="true"
- RuntimeTypeInfo="true"
- PrecompiledHeaderFile="c:\temp\vcpp/httrack.pch"
- AssemblerOutput="2"
- AssemblerListingLocation="c:\temp\vcpp/"
- ObjectFile="c:\temp\vcpp/"
- ProgramDataBaseFileName="c:\temp\vcpp/"
- BrowseInformation="1"
- BrowseInformationFile="c:\temp\vcpp/"
- WarningLevel="3"
- SuppressStartupBanner="true"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- CompileAs="0"
- />
+ Name="VCPostBuildEventTool"/>
<Tool
- Name="VCManagedResourceCompilerTool"
- />
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
+ Culture="1033"/>
<Tool
- Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib libhttrack.lib"
- OutputFile="C:\temp\httrack64\httrack.exe"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories="C:\Dev\openssl\lib,C:\temp\zlib,C:\Dev\openssl\lib\out32dll,C:\temp\Debuglib"
- GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/httrack.pdb"
- SubSystem="1"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TargetMachine="17"
- />
+ Name="VCWebServiceProxyGeneratorTool"/>
<Tool
- Name="VCALinkTool"
- />
+ Name="VCXMLDataGeneratorTool"/>
<Tool
- Name="VCManifestTool"
- />
+ Name="VCWebDeploymentTool"/>
<Tool
- Name="VCXDCMakeTool"
- />
+ Name="VCManagedWrapperGeneratorTool"/>
<Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="C:\temp\httrackcmd\Release"
IntermediateDirectory="C:\temp\httrackcmd\Release"
ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Release/httrack.tlb"
- HeaderFileName=""
- />
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/Zm200 "
Optimization="3"
InlineFunctionExpansion="2"
- AdditionalIncludeDirectories="&quot;C:\Dev\zlib-1.2.3\&quot;;C:\Dev\openssl\include;C:\Dev\Winhttrack"
- PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE;_CRT_SECURE_NO_WARNINGS"
- StringPooling="true"
+ ImproveFloatingPointConsistency="TRUE"
+ AdditionalIncludeDirectories="C:\Dev\IPv6Kit\inc\,C:\Dev\zlib-1.2.3\,C:\Dev\openssl\include,C:\Dev\Winhttrack"
+ PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE"
+ StringPooling="TRUE"
RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="2"
PrecompiledHeaderFile="c:\temp\vcpp/httrack.pch"
AssemblerListingLocation="c:\temp\vcpp/"
ObjectFile="c:\temp\vcpp/"
ProgramDataBaseFileName="c:\temp\vcpp/"
WarningLevel="3"
- SuppressStartupBanner="true"
- Detect64BitPortabilityProblems="true"
- CompileAs="0"
- />
+ SuppressStartupBanner="TRUE"
+ Detect64BitPortabilityProblems="TRUE"
+ CompileAs="0"/>
<Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
+ Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Ws2_32.lib libhttrack.lib"
OutputFile="O:\HTTrack\httrack\httrack.exe"
LinkIncremental="1"
- SuppressStartupBanner="true"
+ SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="C:\Dev\openssl\lib,C:\temp\zlib,C:\Dev\openssl\lib\out32dll,C:\temp\Releaselib"
- ProgramDatabaseFile="C:\temp\httrackcmd\Release\httrack.pdb"
+ ProgramDatabaseFile=".\Release/httrack.pdb"
SubSystem="1"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
+ TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
- TargetEnvironment="3"
TypeLibraryName=".\Release/httrack.tlb"
- HeaderFileName=""
- />
+ HeaderFileName=""/>
<Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/Zm200 "
- Optimization="3"
- InlineFunctionExpansion="2"
- AdditionalIncludeDirectories="&quot;C:\Dev\zlib-1.2.3\&quot;;C:\Dev\openssl\include;C:\Dev\Winhttrack"
- PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE;_CRT_SECURE_NO_WARNINGS"
- StringPooling="true"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- PrecompiledHeaderFile="c:\temp\vcpp/httrack.pch"
- AssemblerListingLocation="c:\temp\vcpp/"
- ObjectFile="c:\temp\vcpp/"
- ProgramDataBaseFileName="c:\temp\vcpp/"
- WarningLevel="3"
- SuppressStartupBanner="true"
- Detect64BitPortabilityProblems="true"
- CompileAs="0"
- />
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
<Tool
- Name="VCManagedResourceCompilerTool"
- />
+ Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib libhttrack.lib"
- OutputFile="O:\HTTrack\httrack\x64\httrack.exe"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories="C:\Dev\openssl\lib,C:\temp\zlib,C:\Dev\openssl\lib\out32dll,C:\temp\Releaselib"
- ProgramDatabaseFile="C:\temp\httrackcmd\Release64\httrack.pdb"
- SubSystem="1"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
+ Culture="1033"/>
<Tool
- Name="VCXDCMakeTool"
- />
+ Name="VCWebServiceProxyGeneratorTool"/>
<Tool
- Name="VCBscMakeTool"
- />
+ Name="VCXMLDataGeneratorTool"/>
<Tool
- Name="VCFxCopTool"
- />
+ Name="VCWebDeploymentTool"/>
<Tool
- Name="VCAppVerifierTool"
- />
+ Name="VCManagedWrapperGeneratorTool"/>
<Tool
- Name="VCPostBuildEventTool"
- />
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
- RelativePath="httrack.c"
- >
+ RelativePath="httrack.c">
<FileConfiguration
- Name="Release avec debug|Win32"
- >
+ Name="Release avec debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
- BrowseInformation="1"
- />
+ BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
- Name="Release avec debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
+ Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
- BrowseInformation="1"
- />
+ BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- BrowseInformation="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
+ Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- />
+ PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
- RelativePath=".\httrack.h"
- >
+ RelativePath=".\httrack.h">
</File>
</Files>
<Globals>
diff --git a/src/minizip/mztools.c b/src/minizip/mztools.c
index a09bfb7..6021c49 100644
--- a/src/minizip/mztools.c
+++ b/src/minizip/mztools.c
@@ -1,287 +1,287 @@
-/*
- Additional tools for Minizip
- Code: Xavier Roche '2004
- License: Same as ZLIB (www.gzip.org)
-*/
-
-/* Code */
-#include <string.h>
-#ifndef _WIN32_WCE
-#include <stdio.h>
-#include <stdlib.h>
-#else
+/*
+ Additional tools for Minizip
+ Code: Xavier Roche '2004
+ License: Same as ZLIB (www.gzip.org)
+*/
+
+/* Code */
+#include <string.h>
+#ifndef _WIN32_WCE
#include <stdio.h>
-#include <stdlib.h>
-#include "celib.h"
-#endif
-#include "zlib.h"
-#include "unzip.h"
-
-#define READ_8(adr) ((unsigned char)*(adr))
-#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) )
-#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) )
-
-#define WRITE_8(buff, n) do { \
- *((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \
-} while(0)
-#define WRITE_16(buff, n) do { \
- WRITE_8((unsigned char*)(buff), n); \
- WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \
-} while(0)
-#define WRITE_32(buff, n) do { \
- WRITE_16((unsigned char*)(buff), (n) & 0xffff); \
- WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \
-} while(0)
-
-extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered)
-const char* file;
-const char* fileOut;
-const char* fileOutTmp;
-uLong* nRecovered;
-uLong* bytesRecovered;
-{
- int err = Z_OK;
- FILE* fpZip = fopen(file, "rb");
- FILE* fpOut = fopen(fileOut, "wb");
- FILE* fpOutCD = fopen(fileOutTmp, "wb");
- if (fpZip != NULL && fpOut != NULL) {
- int entries = 0;
- uLong totalBytes = 0;
- char header[30];
- char filename[1024];
- char extra[1024];
- int offset = 0;
- int offsetCD = 0;
- while ( fread(header, 1, 30, fpZip) == 30 ) {
- int currentOffset = offset;
-
- /* File entry */
- if (READ_32(header) == 0x04034b50) {
- unsigned int version = READ_16(header + 4);
- unsigned int gpflag = READ_16(header + 6);
- unsigned int method = READ_16(header + 8);
- unsigned int filetime = READ_16(header + 10);
- unsigned int filedate = READ_16(header + 12);
- unsigned int crc = READ_32(header + 14); /* crc */
- unsigned int cpsize = READ_32(header + 18); /* compressed size */
- unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */
- unsigned int fnsize = READ_16(header + 26); /* file name length */
- unsigned int extsize = READ_16(header + 28); /* extra field length */
- filename[0] = extra[0] = '\0';
-
- /* Header */
- if (fwrite(header, 1, 30, fpOut) == 30) {
- offset += 30;
- } else {
- err = Z_ERRNO;
- break;
- }
-
- /* Filename */
- if (fnsize > 0) {
- if (fnsize < sizeof(filename) && fread(filename, 1, fnsize, fpZip) == fnsize) {
- if (fwrite(filename, 1, fnsize, fpOut) == fnsize) {
- offset += fnsize;
- } else {
- err = Z_ERRNO;
- break;
- }
- } else {
- err = Z_ERRNO;
- break;
- }
- } else {
- err = Z_STREAM_ERROR;
- break;
- }
-
- /* Extra field */
- if (extsize > 0) {
- if (extsize < sizeof(extra) && fread(extra, 1, extsize, fpZip) == extsize) {
- if (fwrite(extra, 1, extsize, fpOut) == extsize) {
- offset += extsize;
- } else {
- err = Z_ERRNO;
- break;
- }
- } else {
- err = Z_ERRNO;
- break;
- }
- }
-
- /* Data */
- {
- int dataSize = cpsize;
- if (dataSize == 0) {
- dataSize = uncpsize;
- }
- if (dataSize > 0) {
- char* data = malloc(dataSize);
- if (data != NULL) {
- if ((int)fread(data, 1, dataSize, fpZip) == dataSize) {
- if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) {
- offset += dataSize;
- totalBytes += dataSize;
- } else {
- err = Z_ERRNO;
- }
- } else {
- err = Z_ERRNO;
- }
- free(data);
- if (err != Z_OK) {
- break;
- }
- } else {
- err = Z_MEM_ERROR;
- break;
- }
- }
- }
-
- /* Central directory entry */
- {
- char header[46];
- char* comment = "";
- int comsize = (int) strlen(comment);
- WRITE_32(header, 0x02014b50);
- WRITE_16(header + 4, version);
- WRITE_16(header + 6, version);
- WRITE_16(header + 8, gpflag);
- WRITE_16(header + 10, method);
- WRITE_16(header + 12, filetime);
- WRITE_16(header + 14, filedate);
- WRITE_32(header + 16, crc);
- WRITE_32(header + 20, cpsize);
- WRITE_32(header + 24, uncpsize);
- WRITE_16(header + 28, fnsize);
- WRITE_16(header + 30, extsize);
- WRITE_16(header + 32, comsize);
- WRITE_16(header + 34, 0); /* disk # */
- WRITE_16(header + 36, 0); /* int attrb */
- WRITE_32(header + 38, 0); /* ext attrb */
- WRITE_32(header + 42, currentOffset);
- /* Header */
- if (fwrite(header, 1, 46, fpOutCD) == 46) {
- offsetCD += 46;
-
- /* Filename */
- if (fnsize > 0) {
- if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) {
- offsetCD += fnsize;
- } else {
- err = Z_ERRNO;
- break;
- }
- } else {
- err = Z_STREAM_ERROR;
- break;
- }
-
- /* Extra field */
- if (extsize > 0) {
- if (fwrite(extra, 1, extsize, fpOutCD) == extsize) {
- offsetCD += extsize;
- } else {
- err = Z_ERRNO;
- break;
- }
- }
-
- /* Comment field */
- if (comsize > 0) {
- if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) {
- offsetCD += comsize;
- } else {
- err = Z_ERRNO;
- break;
- }
- }
-
-
- } else {
- err = Z_ERRNO;
- break;
- }
- }
-
- /* Success */
- entries++;
-
- } else {
- break;
- }
- }
-
- /* Final central directory */
- {
- int entriesZip = entries;
- char header[22];
- char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools";
- int comsize = (int) strlen(comment);
- if (entriesZip > 0xffff) {
- entriesZip = 0xffff;
- }
- WRITE_32(header, 0x06054b50);
- WRITE_16(header + 4, 0); /* disk # */
- WRITE_16(header + 6, 0); /* disk # */
- WRITE_16(header + 8, entriesZip); /* hack */
- WRITE_16(header + 10, entriesZip); /* hack */
- WRITE_32(header + 12, offsetCD); /* size of CD */
- WRITE_32(header + 16, offset); /* offset to CD */
- WRITE_16(header + 20, comsize); /* comment */
-
- /* Header */
- if (fwrite(header, 1, 22, fpOutCD) == 22) {
-
- /* Comment field */
- if (comsize > 0) {
- if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) {
- err = Z_ERRNO;
- }
- }
-
- } else {
- err = Z_ERRNO;
- }
- }
-
- /* Final merge (file + central directory) */
- fclose(fpOutCD);
- if (err == Z_OK) {
- fpOutCD = fopen(fileOutTmp, "rb");
- if (fpOutCD != NULL) {
- int nRead;
- char buffer[8192];
- while ( (nRead = fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) {
- if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) {
- err = Z_ERRNO;
- break;
- }
- }
- fclose(fpOutCD);
- }
- }
-
- /* Close */
- fclose(fpZip);
- fclose(fpOut);
-
- /* Wipe temporary file */
- (void)remove(fileOutTmp);
-
- /* Number of recovered entries */
- if (err == Z_OK) {
- if (nRecovered != NULL) {
- *nRecovered = entries;
- }
- if (bytesRecovered != NULL) {
- *bytesRecovered = totalBytes;
- }
- }
- } else {
- err = Z_STREAM_ERROR;
- }
- return err;
-}
+#include <stdlib.h>
+#else
+#include <stdio.h>
+#include <stdlib.h>
+#include "celib.h"
+#endif
+#include "zlib.h"
+#include "unzip.h"
+
+#define READ_8(adr) ((unsigned char)*(adr))
+#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) )
+#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) )
+
+#define WRITE_8(buff, n) do { \
+ *((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \
+} while(0)
+#define WRITE_16(buff, n) do { \
+ WRITE_8((unsigned char*)(buff), n); \
+ WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \
+} while(0)
+#define WRITE_32(buff, n) do { \
+ WRITE_16((unsigned char*)(buff), (n) & 0xffff); \
+ WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \
+} while(0)
+
+extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered)
+const char* file;
+const char* fileOut;
+const char* fileOutTmp;
+uLong* nRecovered;
+uLong* bytesRecovered;
+{
+ int err = Z_OK;
+ FILE* fpZip = fopen(file, "rb");
+ FILE* fpOut = fopen(fileOut, "wb");
+ FILE* fpOutCD = fopen(fileOutTmp, "wb");
+ if (fpZip != NULL && fpOut != NULL) {
+ int entries = 0;
+ uLong totalBytes = 0;
+ char header[30];
+ char filename[256];
+ char extra[1024];
+ int offset = 0;
+ int offsetCD = 0;
+ while ( fread(header, 1, 30, fpZip) == 30 ) {
+ int currentOffset = offset;
+
+ /* File entry */
+ if (READ_32(header) == 0x04034b50) {
+ unsigned int version = READ_16(header + 4);
+ unsigned int gpflag = READ_16(header + 6);
+ unsigned int method = READ_16(header + 8);
+ unsigned int filetime = READ_16(header + 10);
+ unsigned int filedate = READ_16(header + 12);
+ unsigned int crc = READ_32(header + 14); /* crc */
+ unsigned int cpsize = READ_32(header + 18); /* compressed size */
+ unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */
+ unsigned int fnsize = READ_16(header + 26); /* file name length */
+ unsigned int extsize = READ_16(header + 28); /* extra field length */
+ filename[0] = extra[0] = '\0';
+
+ /* Header */
+ if (fwrite(header, 1, 30, fpOut) == 30) {
+ offset += 30;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+
+ /* Filename */
+ if (fnsize > 0) {
+ if (fread(filename, 1, fnsize, fpZip) == fnsize) {
+ if (fwrite(filename, 1, fnsize, fpOut) == fnsize) {
+ offset += fnsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ break;
+ }
+
+ /* Extra field */
+ if (extsize > 0) {
+ if (fread(extra, 1, extsize, fpZip) == extsize) {
+ if (fwrite(extra, 1, extsize, fpOut) == extsize) {
+ offset += extsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Data */
+ {
+ int dataSize = cpsize;
+ if (dataSize == 0) {
+ dataSize = uncpsize;
+ }
+ if (dataSize > 0) {
+ char* data = malloc(dataSize);
+ if (data != NULL) {
+ if ((int)fread(data, 1, dataSize, fpZip) == dataSize) {
+ if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) {
+ offset += dataSize;
+ totalBytes += dataSize;
+ } else {
+ err = Z_ERRNO;
+ }
+ } else {
+ err = Z_ERRNO;
+ }
+ free(data);
+ if (err != Z_OK) {
+ break;
+ }
+ } else {
+ err = Z_MEM_ERROR;
+ break;
+ }
+ }
+ }
+
+ /* Central directory entry */
+ {
+ char header[46];
+ char* comment = "";
+ int comsize = (int) strlen(comment);
+ WRITE_32(header, 0x02014b50);
+ WRITE_16(header + 4, version);
+ WRITE_16(header + 6, version);
+ WRITE_16(header + 8, gpflag);
+ WRITE_16(header + 10, method);
+ WRITE_16(header + 12, filetime);
+ WRITE_16(header + 14, filedate);
+ WRITE_32(header + 16, crc);
+ WRITE_32(header + 20, cpsize);
+ WRITE_32(header + 24, uncpsize);
+ WRITE_16(header + 28, fnsize);
+ WRITE_16(header + 30, extsize);
+ WRITE_16(header + 32, comsize);
+ WRITE_16(header + 34, 0); /* disk # */
+ WRITE_16(header + 36, 0); /* int attrb */
+ WRITE_32(header + 38, 0); /* ext attrb */
+ WRITE_32(header + 42, currentOffset);
+ /* Header */
+ if (fwrite(header, 1, 46, fpOutCD) == 46) {
+ offsetCD += 46;
+
+ /* Filename */
+ if (fnsize > 0) {
+ if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) {
+ offsetCD += fnsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ break;
+ }
+
+ /* Extra field */
+ if (extsize > 0) {
+ if (fwrite(extra, 1, extsize, fpOutCD) == extsize) {
+ offsetCD += extsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Comment field */
+ if (comsize > 0) {
+ if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) {
+ offsetCD += comsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Success */
+ entries++;
+
+ } else {
+ break;
+ }
+ }
+
+ /* Final central directory */
+ {
+ int entriesZip = entries;
+ char header[22];
+ char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools";
+ int comsize = (int) strlen(comment);
+ if (entriesZip > 0xffff) {
+ entriesZip = 0xffff;
+ }
+ WRITE_32(header, 0x06054b50);
+ WRITE_16(header + 4, 0); /* disk # */
+ WRITE_16(header + 6, 0); /* disk # */
+ WRITE_16(header + 8, entriesZip); /* hack */
+ WRITE_16(header + 10, entriesZip); /* hack */
+ WRITE_32(header + 12, offsetCD); /* size of CD */
+ WRITE_32(header + 16, offset); /* offset to CD */
+ WRITE_16(header + 20, comsize); /* comment */
+
+ /* Header */
+ if (fwrite(header, 1, 22, fpOutCD) == 22) {
+
+ /* Comment field */
+ if (comsize > 0) {
+ if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) {
+ err = Z_ERRNO;
+ }
+ }
+
+ } else {
+ err = Z_ERRNO;
+ }
+ }
+
+ /* Final merge (file + central directory) */
+ fclose(fpOutCD);
+ if (err == Z_OK) {
+ fpOutCD = fopen(fileOutTmp, "rb");
+ if (fpOutCD != NULL) {
+ int nRead;
+ char buffer[8192];
+ while ( (nRead = fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) {
+ if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+ fclose(fpOutCD);
+ }
+ }
+
+ /* Close */
+ fclose(fpZip);
+ fclose(fpOut);
+
+ /* Wipe temporary file */
+ (void)remove(fileOutTmp);
+
+ /* Number of recovered entries */
+ if (err == Z_OK) {
+ if (nRecovered != NULL) {
+ *nRecovered = entries;
+ }
+ if (bytesRecovered != NULL) {
+ *bytesRecovered = totalBytes;
+ }
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ }
+ return err;
+}
diff --git a/src/proxy/proxytrack.c b/src/proxy/proxytrack.c
index 78775ab..195c1a5 100644
--- a/src/proxy/proxytrack.c
+++ b/src/proxy/proxytrack.c
@@ -1365,7 +1365,10 @@ static int proxytrack_process_HTTP_threaded(PT_Indexes indexes, T_SOC soc) {
static int proxytrack_start_HTTP(PT_Indexes indexes, T_SOC soc) {
while(soc != INVALID_SOCKET) {
T_SOC soc_c;
- if ( (soc_c = (T_SOC) accept(soc, NULL, NULL)) != INVALID_SOCKET) {
+ struct sockaddr clientAddr;
+ int clientAddrLen = sizeof(struct sockaddr);
+ memset(&clientAddr, 0, sizeof(clientAddr));
+ if ( (soc_c = (T_SOC) accept(soc, &clientAddr, &clientAddrLen)) != INVALID_SOCKET) {
if (!proxytrack_process_HTTP_threaded(indexes, soc_c)) {
CRITICAL("proxytrack_start_HTTP::Can not fork a thread");
}
diff --git a/src/webhttrack b/src/webhttrack
index 314e070..430b026 100755
--- a/src/webhttrack
+++ b/src/webhttrack
@@ -4,21 +4,14 @@
# Initializes the htsserver GUI frontend and launch the default browser
BROWSEREXE=
-SRCHBROWSEREXE="x-www-browser www-browser iceape mozilla firefox icecat iceweasel abrowser firebird galeon konqueror opera netscape"
+SRCHBROWSEREXE="x-www-browser www-browser iceape mozilla firefox firebird galeon konqueror opera netscape"
if test -n "${BROWSER}"; then
# sensible-browser will f up if BROWSER is not set
SRCHBROWSEREXE="xdg-open sensible-browser ${SRCHBROWSEREXE}"
fi
-# Patch for Darwin/Mac by Ross Williams
-if test "`uname -s`" == "Darwin"; then
-# Darwin/Mac OS X uses a system 'open' command to find
-# the default browser. The -W flag causes it to wait for
-# the browser to exit
-BROWSEREXE="/usr/bin/open -W"
-fi
-SRCHPATH="/usr/local/bin /usr/share/bin /usr/bin /usr/lib/httrack /usr/local/lib/httrack /usr/local/share/httrack /opt/local/bin /sw/bin ${HOME}/usr/bin ${HOME}/bin"
+SRCHPATH="/usr/local/bin /usr/share/bin /usr/bin /usr/lib/httrack /usr/local/lib/httrack /usr/local/share/httrack /sw/bin ${HOME}/usr/bin ${HOME}/bin"
SRCHPATH="$SRCHPATH "`echo $PATH | tr ":" " "`
-SRCHDISTPATH="/usr/share /usr/local /usr /local /usr/local/share ${HOME}/usr ${HOME}/usr/share /opt/local/share /sw ${HOME}/usr/local ${HOME}/usr/share"
+SRCHDISTPATH="/usr/share /usr/local /usr /local /usr/local/share ${HOME}/usr ${HOME}/usr/share /sw ${HOME}/usr/local ${HOME}/usr/share"
###
# And now some famous cuisine
@@ -40,12 +33,6 @@ echo "$1" | grep -q "firebird"
[ $? -eq 0 ] && return 0
echo "$1" | grep -q "firefox"
[ $? -eq 0 ] && return 0
-echo "$1" | grep -q "iceweasel"
-[ $? -eq 0 ] && return 0
-echo "$1" | grep -q "abrowser"
-[ $? -eq 0 ] && return 0
-echo "$1" | grep -q "icecat"
-[ $? -eq 0 ] && return 0
return 1;
}
function mozillaloaded {
@@ -54,7 +41,7 @@ if ! test -n "${user_name}"; then
user_name=`id -un`
fi
if test -n "${user_name}"; then
-ps -e -U "$user_name" | grep -E "(iceape|mozilla|netscape|firebird|firefox)" | grep -qv "grep -E"
+ps -e --user "$user_name" | grep -qE "(iceape|mozilla|netscape|firebird|firefox)"
else
false
fi