mirror of
https://github.com/xroche/httrack.git
synced 2026-05-18 17:06:04 +03:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cad9ccb7aa | ||
|
|
3059bd6f53 | ||
|
|
e5b3c85156 | ||
|
|
843faaf83d | ||
|
|
75969b1147 | ||
|
|
6ad604624d | ||
|
|
c05f54ae04 | ||
|
|
ae1db762e7 | ||
|
|
16aec722bf | ||
|
|
4ff55249ed | ||
|
|
fea8122ed3 | ||
|
|
7323230eb3 | ||
|
|
c9f656fdeb | ||
|
|
042525a1db | ||
|
|
3fde59c090 | ||
|
|
edaaa73328 |
20
configure
vendored
20
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# 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.8.
|
||||
#
|
||||
# Report bugs to <roche+packaging@httrack.com>.
|
||||
#
|
||||
@@ -590,8 +590,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='httrack'
|
||||
PACKAGE_TARNAME='httrack'
|
||||
PACKAGE_VERSION='3.48.6'
|
||||
PACKAGE_STRING='httrack 3.48.6'
|
||||
PACKAGE_VERSION='3.48.8'
|
||||
PACKAGE_STRING='httrack 3.48.8'
|
||||
PACKAGE_BUGREPORT='roche+packaging@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.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures httrack 3.48.6 to adapt to many kinds of systems.
|
||||
\`configure' configures httrack 3.48.8 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1407,7 +1407,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of httrack 3.48.6:";;
|
||||
short | recursive ) echo "Configuration of httrack 3.48.8:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1521,7 +1521,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
httrack configure 3.48.6
|
||||
httrack configure 3.48.8
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -2248,7 +2248,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
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.8, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -3067,7 +3067,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='httrack'
|
||||
VERSION='3.48.6'
|
||||
VERSION='3.48.8'
|
||||
|
||||
|
||||
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
|
||||
# values after options handling.
|
||||
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.8, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -16959,7 +16959,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
httrack config.status 3.48.6
|
||||
httrack config.status 3.48.8
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
AC_INIT([httrack], [3.48.6], [roche+packaging@httrack.com], [httrack], [http://www.httrack.com/])
|
||||
AC_INIT([httrack], [3.48.8], [roche+packaging@httrack.com], [httrack], [http://www.httrack.com/])
|
||||
AC_CONFIG_SRCDIR(src/httrack.c)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
12
debian/changelog
vendored
12
debian/changelog
vendored
@@ -1,3 +1,15 @@
|
||||
httrack (3.48.8-1) unstable; urgency=low
|
||||
|
||||
* Updated to 3.48.8 (3.48-8)
|
||||
|
||||
-- Xavier Roche <xavier@debian.org> Thu, 15 May 2014 19:21:21 +0200
|
||||
|
||||
httrack (3.48.7-1) unstable; urgency=low
|
||||
|
||||
* Updated to 3.48.7 (3.48-7)
|
||||
|
||||
-- Xavier Roche <xavier@debian.org> Wed, 14 May 2014 19:51:57 +0200
|
||||
|
||||
httrack (3.48.6-1) unstable; urgency=low
|
||||
|
||||
* Updated to 3.48.6 (3.48-6)
|
||||
|
||||
@@ -4,8 +4,10 @@ HTTrack Website Copier release history:
|
||||
|
||||
This file lists all changes and fixes that have been made for HTTrack.
|
||||
|
||||
3.48-6
|
||||
+ Fixed: mitigate the "hashtable internal error: cuckoo/stash collision" errors
|
||||
3.48-8
|
||||
+ Fixed: new zlib version fixing CVE-2004-0797 and CVE-2005-2096
|
||||
+ Fixed: more reliable crash reporting
|
||||
+ Fixed: fixed infamous "hashtable internal error: cuckoo/stash collision" errors
|
||||
+ Fixed: safety cleanup in many strings operations
|
||||
+ Fixed: buggy option pannels
|
||||
+ New: Enforce check against CVE-2014-0160
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\" Process this file with
|
||||
.\" groff -man -Tascii httrack.1
|
||||
.\"
|
||||
.TH httrack 1 "12 May 2014" "httrack website copier"
|
||||
.TH httrack 1 "14 May 2014" "httrack website copier"
|
||||
.SH NAME
|
||||
httrack \- offline browser : copy websites to a local directory
|
||||
.SH SYNOPSIS
|
||||
|
||||
@@ -2355,7 +2355,7 @@ void host_ban(httrackp * opt, lien_url ** liens, int ptr, int lien_tot,
|
||||
if (strfield2(jump_identification(liens[i]->adr), host)) { // host
|
||||
hts_log_print(opt, LOG_DEBUG, "Cancel: %s%s", liens[i]->adr,
|
||||
liens[i]->fil);
|
||||
strcpybuff(liens[i]->adr, "!"); // cancel (invalide hash)
|
||||
hash_invalidate_entry(opt->hash, i); // invalidate hashtable entry
|
||||
// on efface pas le hash, because si on rencontre le lien, reverif sav..
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -36,8 +36,8 @@ Please visit our Website: http://www.httrack.com
|
||||
#define HTTRACK_GLOBAL_DEFH
|
||||
|
||||
// Version (also check external version information)
|
||||
#define HTTRACK_VERSION "3.48-6"
|
||||
#define HTTRACK_VERSIONID "3.48.6"
|
||||
#define HTTRACK_VERSION "3.48-8"
|
||||
#define HTTRACK_VERSIONID "3.48.8"
|
||||
#define HTTRACK_AFF_VERSION "3.x"
|
||||
#define HTTRACK_LIB_VERSION "2.0"
|
||||
|
||||
|
||||
@@ -85,6 +85,14 @@ static int key_sav_equals(void *arg, const char *a, const char *b) {
|
||||
return strcasecmp(a, b) == 0;
|
||||
}
|
||||
|
||||
static const char* key_sav_debug_print(void *arg, const char *a) {
|
||||
return a;
|
||||
}
|
||||
|
||||
static const char* value_sav_debug_print(void *arg, void *a) {
|
||||
return (char*) a;
|
||||
}
|
||||
|
||||
/* Pseudo-key (lien_url structure) hash function */
|
||||
static inthash_keys key_adrfil_hashes_generic(void *arg, const char *value_,
|
||||
const int former) {
|
||||
@@ -151,6 +159,32 @@ static int key_adrfil_equals_generic(void *arg, const char *a_, const char *b_,
|
||||
}
|
||||
}
|
||||
|
||||
static const char* key_adrfil_debug_print_(void *arg, const char *a_, const int former) {
|
||||
hash_struct *const hash = (hash_struct*) arg;
|
||||
const int normalized = hash->normalized;
|
||||
const lien_url*const a = (lien_url*) a_;
|
||||
const char *const a_adr = !former ? a->adr : a->former_adr;
|
||||
const char *const a_fil = !former ? a->fil : a->former_fil;
|
||||
snprintf(hash->normfil, sizeof(hash->normfil), "%s%s", a_adr, a_fil);
|
||||
return hash->normfil;
|
||||
}
|
||||
|
||||
static const char* key_adrfil_debug_print(void *arg, const char *a_) {
|
||||
return key_adrfil_debug_print_(arg, a_, 0);
|
||||
}
|
||||
|
||||
static const char* key_former_adrfil_debug_print(void *arg, const char *a_) {
|
||||
return key_adrfil_debug_print_(arg, a_, 1);
|
||||
}
|
||||
|
||||
static const char* value_adrfil_debug_print(void *arg, void *value) {
|
||||
hash_struct *const hash = (hash_struct*) arg;
|
||||
inthash_value v;
|
||||
v.ptr = value;
|
||||
snprintf(hash->normfil2, sizeof(hash->normfil2), "%d", (int) v.intg);
|
||||
return hash->normfil2;
|
||||
}
|
||||
|
||||
/* "adr"/"fil" lien_url structure members hashing function */
|
||||
static inthash_keys key_adrfil_hashes(void *arg, const char *value_) {
|
||||
return key_adrfil_hashes_generic(arg, value_, 0);
|
||||
@@ -207,6 +241,20 @@ void hash_init(httrackp *opt, hash_struct * hash, int normalized) {
|
||||
key_former_adrfil_hashes,
|
||||
key_former_adrfil_equals,
|
||||
hash);
|
||||
|
||||
/* pretty-printing */
|
||||
inthash_set_print_handler(hash->sav,
|
||||
key_sav_debug_print,
|
||||
value_sav_debug_print,
|
||||
NULL);
|
||||
inthash_set_print_handler(hash->adrfil,
|
||||
key_adrfil_debug_print,
|
||||
value_adrfil_debug_print,
|
||||
hash);
|
||||
inthash_set_print_handler(hash->former_adrfil,
|
||||
key_former_adrfil_debug_print,
|
||||
value_adrfil_debug_print,
|
||||
hash);
|
||||
}
|
||||
|
||||
void hash_free(hash_struct *hash) {
|
||||
@@ -272,3 +320,14 @@ void hash_write(hash_struct * hash, int lpos) {
|
||||
inthash_write(hash->former_adrfil, (char*) hash->liens[lpos], lpos);
|
||||
}
|
||||
}
|
||||
|
||||
void hash_invalidate_entry(hash_struct * hash, int lpos) {
|
||||
if (inthash_remove(hash->adrfil, (char*) hash->liens[lpos])) {
|
||||
/* devalidate entry now it is removed from hashtable */
|
||||
strcpybuff(hash->liens[lpos]->adr, "!");
|
||||
/* add back */
|
||||
inthash_write(hash->adrfil, (char*) hash->liens[lpos], lpos);
|
||||
} else {
|
||||
assertf(! "error invalidating hash entry");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ void hash_free(hash_struct *hash);
|
||||
int hash_read(const hash_struct * hash, const char *nom1, const char *nom2,
|
||||
hash_struct_type type);
|
||||
void hash_write(hash_struct * hash, int lpos);
|
||||
void hash_invalidate_entry(hash_struct * hash, int lpos);
|
||||
int *hash_calc_chaine(hash_struct * hash, hash_struct_type type, int pos);
|
||||
unsigned long int hash_cle(const char *nom1, const char *nom2);
|
||||
#endif
|
||||
|
||||
@@ -187,6 +187,16 @@ struct struct_inthash {
|
||||
/** hashtable name for logging **/
|
||||
const char *name;
|
||||
} error;
|
||||
|
||||
/** How to handle pretty-print (debug) (might be NULL). **/
|
||||
struct {
|
||||
/** key print() **/
|
||||
t_inthash_printkeyhandler key;
|
||||
/** value print() **/
|
||||
t_inthash_printvaluehandler value;
|
||||
/** opaque argument **/
|
||||
void *arg;
|
||||
} print;
|
||||
} custom;
|
||||
};
|
||||
|
||||
@@ -889,10 +899,62 @@ static int inthash_add_item_(inthash hashtable, inthash_item item) {
|
||||
(int) hashtable->stash.size);
|
||||
return 1; /* added */
|
||||
} else {
|
||||
/* debugging */
|
||||
if (hashtable->custom.print.key != NULL
|
||||
&& hashtable->custom.print.value != NULL) {
|
||||
size_t i;
|
||||
for(i = 0 ; i < hashtable->stash.size ; i++) {
|
||||
inthash_item *const item = &hashtable->stash.items[i];
|
||||
const size_t pos1 = inthash_hash_to_pos(hashtable, item->hashes.hash1);
|
||||
const size_t pos2 = inthash_hash_to_pos(hashtable, item->hashes.hash2);
|
||||
inthash_crit(hashtable,
|
||||
"stash[%u]: key='%s' value='%s' pos1=%d pos2=%d hash1=%04x hash2=%04x",
|
||||
(int) i,
|
||||
hashtable->custom.print.key(hashtable->custom.print.arg, item->name),
|
||||
hashtable->custom.print.value(hashtable->custom.print.arg, item->value.ptr),
|
||||
(int) pos1, (int) pos2,
|
||||
item->hashes.hash1, item->hashes.hash2);
|
||||
if (!inthash_is_free(hashtable, pos1)) {
|
||||
inthash_item *const item = &hashtable->items[pos1];
|
||||
const size_t pos1 = inthash_hash_to_pos(hashtable, item->hashes.hash1);
|
||||
const size_t pos2 = inthash_hash_to_pos(hashtable, item->hashes.hash2);
|
||||
inthash_crit(hashtable,
|
||||
"\t.. collisionning with key='%s' value='%s' pos1=%d pos2=%d hash1=%04x hash2=%04x",
|
||||
hashtable->custom.print.key(hashtable->custom.print.arg, item->name),
|
||||
hashtable->custom.print.value(hashtable->custom.print.arg, item->value.ptr),
|
||||
(int) pos1, (int) pos2,
|
||||
item->hashes.hash1, item->hashes.hash2);
|
||||
} else {
|
||||
inthash_crit(hashtable, "\t.. collisionning with a free slot (%d)!", (int) pos1);
|
||||
}
|
||||
if (!inthash_is_free(hashtable, pos2)) {
|
||||
inthash_item *const item = &hashtable->items[pos2];
|
||||
const size_t pos1 = inthash_hash_to_pos(hashtable, item->hashes.hash1);
|
||||
const size_t pos2 = inthash_hash_to_pos(hashtable, item->hashes.hash2);
|
||||
inthash_crit(hashtable,
|
||||
"\t.. collisionning with key='%s' value='%s' pos1=%d pos2=%d hash1=%04x hash2=%04x",
|
||||
hashtable->custom.print.key(hashtable->custom.print.arg, item->name),
|
||||
hashtable->custom.print.value(hashtable->custom.print.arg, item->value.ptr),
|
||||
(int) pos1, (int) pos2,
|
||||
item->hashes.hash1, item->hashes.hash2);
|
||||
} else {
|
||||
inthash_crit(hashtable, "\t.. collisionning with a free slot (%d)!", (int) pos2);
|
||||
}
|
||||
}
|
||||
//struct_inthash_enum e = inthash_enum_new(hashtable);
|
||||
//while((item = inthash_enum_next(&e)) != NULL) {
|
||||
// inthash_crit(hashtable, "element key='%s' value='%s' hash1=%04x hash2=%04x",
|
||||
// hashtable->custom.print.key(hashtable->custom.print.arg, item->name),
|
||||
// hashtable->custom.print.value(hashtable->custom.print.arg, item->value.ptr),
|
||||
// item->hashes.hash1, item->hashes.hash2);
|
||||
//}
|
||||
}
|
||||
|
||||
/* we are doomed. hopefully the probability is lower than being killed
|
||||
by a wandering radioactive monkey */
|
||||
inthash_log_stats(hashtable);
|
||||
inthash_assert(hashtable, ! "hashtable internal error: cuckoo/stash collision");
|
||||
|
||||
/* not reachable code */
|
||||
return -1;
|
||||
}
|
||||
@@ -1235,9 +1297,13 @@ inthash inthash_new(size_t initial_size) {
|
||||
hashtable->custom.key.hash = NULL;
|
||||
hashtable->custom.key.equals = NULL;
|
||||
hashtable->custom.key.arg = NULL;
|
||||
hashtable->custom.error.log = NULL;
|
||||
hashtable->custom.error.fatal = NULL;
|
||||
hashtable->custom.error.name = NULL;
|
||||
hashtable->custom.error.arg = NULL;
|
||||
hashtable->custom.print.key = NULL;
|
||||
hashtable->custom.print.value = NULL;
|
||||
hashtable->custom.print.arg = NULL;
|
||||
}
|
||||
return hashtable;
|
||||
}
|
||||
@@ -1288,12 +1354,20 @@ 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;
|
||||
}
|
||||
|
||||
void inthash_set_print_handler(inthash hashtable,
|
||||
t_inthash_printkeyhandler key,
|
||||
t_inthash_printvaluehandler value,
|
||||
void *arg) {
|
||||
hashtable->custom.print.key = key;
|
||||
hashtable->custom.print.value = value;
|
||||
hashtable->custom.print.arg = arg;
|
||||
}
|
||||
|
||||
size_t inthash_nitems(inthash hashtable) {
|
||||
if (hashtable != NULL)
|
||||
return hashtable->used;
|
||||
|
||||
@@ -67,6 +67,7 @@ typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
|
||||
/** Value. **/
|
||||
typedef union inthash_value {
|
||||
@@ -140,6 +141,12 @@ typedef void (*t_inthash_loghandler)(void *arg, inthash_loglevel level,
|
||||
/** Hashtable fatal assertion failure. **/
|
||||
typedef void (*t_inthash_asserthandler)(void *arg, const char* exp, const char* file, int line);
|
||||
|
||||
/** Key printer (debug) **/
|
||||
typedef const char* (*t_inthash_printkeyhandler)(void *arg, const char *name);
|
||||
|
||||
/** Value printer (debug) **/
|
||||
typedef const char* (*t_inthash_printvaluehandler)(void *arg, void *value);
|
||||
|
||||
/**
|
||||
* Value comparison handler (returns non-zero value if strings are equal).
|
||||
**/
|
||||
@@ -240,6 +247,18 @@ void inthash_set_assert_handler(inthash hashtable,
|
||||
t_inthash_asserthandler fatal,
|
||||
void *arg);
|
||||
|
||||
/**
|
||||
* Set pretty print loggers (debug). Both handlers must return a string
|
||||
* pointer which shall be valid until the next call. Both key and value
|
||||
* pointers shall be valid at the same time.
|
||||
* name: handler called to print the string representation of the name
|
||||
* value: handler called to print the string representation of the value
|
||||
**/
|
||||
void inthash_set_print_handler(inthash hashtable,
|
||||
t_inthash_printkeyhandler key,
|
||||
t_inthash_printvaluehandler value,
|
||||
void *arg);
|
||||
|
||||
/**
|
||||
* Set the hashtable name, for degugging purpose.
|
||||
* name: the hashtable name (ASCII or UTF-8)
|
||||
|
||||
12
src/htslib.c
12
src/htslib.c
@@ -62,6 +62,7 @@ Please visit our Website: http://www.httrack.com
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif /* _WIN32 */
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
@@ -5112,6 +5113,17 @@ static int ssl_vulnerable(const char *version) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* user abort callback */
|
||||
htsErrorCallback htsCallbackErr = NULL;
|
||||
|
||||
HTSEXT_API void hts_set_error_callback(htsErrorCallback handler) {
|
||||
htsCallbackErr = handler;
|
||||
}
|
||||
|
||||
HTSEXT_API htsErrorCallback hts_get_error_callback() {
|
||||
return htsCallbackErr;
|
||||
}
|
||||
|
||||
static void default_inthash_asserthandler(void *arg, const char* exp, const char* file, int line) {
|
||||
abortf_(exp, file, line);
|
||||
}
|
||||
|
||||
@@ -3606,7 +3606,7 @@ int hts_mirror_check_moved(htsmoduleStruct * str,
|
||||
urladr, urlfil, mov_adr, mov_fil);
|
||||
// canceller lien actuel
|
||||
error = 1;
|
||||
strcpybuff(liens[ptr]->adr, "!"); // caractère bidon (invalide hash)
|
||||
hash_invalidate_entry(hashptr, ptr); // invalidate hashtable entry
|
||||
// noter NOUVEAU lien
|
||||
//xxc xxc
|
||||
// set_prio_to=0+1; // protection if the moved URL is an html page!!
|
||||
@@ -3742,7 +3742,7 @@ int hts_mirror_check_moved(htsmoduleStruct * str,
|
||||
//
|
||||
// canceller lien actuel
|
||||
error = 1;
|
||||
strcpybuff(liens[ptr]->adr, "!"); // caractère bidon (invalide hash)
|
||||
hash_invalidate_entry(hashptr, ptr); // invalidate hashtable entry
|
||||
//
|
||||
} else { // oups erreur, plus de mémoire!!
|
||||
printf("PANIC! : Not enough memory [%d]\n", __LINE__);
|
||||
|
||||
@@ -35,17 +35,26 @@ Please visit our Website: http://www.httrack.com
|
||||
|
||||
#include "htsglobal.h"
|
||||
|
||||
/**
|
||||
* Optional user-defined callback upon fatal error.
|
||||
*/
|
||||
typedef void (*htsErrorCallback) (const char *msg, const char *file, int line);
|
||||
|
||||
/**
|
||||
* Emergency logging.
|
||||
* Default is to use libhttrack one.
|
||||
*/
|
||||
#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)
|
||||
|
||||
/** Assert error callback. **/
|
||||
#ifndef HTS_DEF_FWSTRUCT_htsErrorCallback
|
||||
#define HTS_DEF_FWSTRUCT_htsErrorCallback
|
||||
typedef void (*htsErrorCallback) (const char *msg, const char *file, int line);
|
||||
HTSEXT_API htsErrorCallback hts_get_error_callback(void);
|
||||
#endif
|
||||
|
||||
#define HTSSAFE_ABORT_FUNCTION(A,B,C) do { \
|
||||
htsErrorCallback callback = hts_get_error_callback(); \
|
||||
if (callback != NULL) { \
|
||||
callback(A,B,C); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -61,7 +70,7 @@ HTSEXT_API htsErrorCallback htsCallbackErr;
|
||||
/**
|
||||
* Fatal assertion check.
|
||||
*/
|
||||
#define assertf_(exp, file, line) assertf__(exp, #exp, __FILE__, __LINE__)
|
||||
#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
|
||||
|
||||
/**
|
||||
* Fatal assertion check.
|
||||
|
||||
@@ -38,6 +38,7 @@ Please visit our Website: http://www.httrack.com
|
||||
#ifndef _WIN32
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifndef HTS_DEF_FWSTRUCT_httrackp
|
||||
#define HTS_DEF_FWSTRUCT_httrackp
|
||||
@@ -65,6 +66,12 @@ typedef enum hts_log_type {
|
||||
typedef struct hts_stat_struct hts_stat_struct;
|
||||
#endif
|
||||
|
||||
/** Assert error callback. **/
|
||||
#ifndef HTS_DEF_FWSTRUCT_htsErrorCallback
|
||||
#define HTS_DEF_FWSTRUCT_htsErrorCallback
|
||||
typedef void (*htsErrorCallback) (const char *msg, const char *file, int line);
|
||||
#endif
|
||||
|
||||
/* Helpers for plugging callbacks
|
||||
requires: htsdefines.h */
|
||||
|
||||
@@ -111,6 +118,8 @@ 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 void hts_set_error_callback(htsErrorCallback handler);
|
||||
HTSEXT_API htsErrorCallback hts_get_error_callback(void);
|
||||
|
||||
/* Logging */
|
||||
HTSEXT_API int hts_log(httrackp * opt, const char *prefix, const char *msg);
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.3\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.8\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
PreprocessorDefinitions="WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -152,7 +152,7 @@
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.3\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.8\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
PreprocessorDefinitions="WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -246,7 +246,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm200 "
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.3\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.8\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="3"
|
||||
BufferSecurityCheck="true"
|
||||
@@ -343,7 +343,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm200 "
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.3\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.8\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="3"
|
||||
BufferSecurityCheck="true"
|
||||
@@ -440,7 +440,7 @@
|
||||
AdditionalOptions="/Zm200 "
|
||||
Optimization="3"
|
||||
InlineFunctionExpansion="2"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.3\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.8\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE;_CRT_SECURE_NO_WARNINGS"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
@@ -535,7 +535,7 @@
|
||||
AdditionalOptions="/Zm200 "
|
||||
Optimization="3"
|
||||
InlineFunctionExpansion="2"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.3\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
AdditionalIncludeDirectories=""C:\Dev\zlib-1.2.8\";"C:\Dev\openssl-1.0.1e\include";C:\Dev\Winhttrack"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;HTS_ANALYSTE_CONSOLE;_CRT_SECURE_NO_WARNINGS"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
|
||||
Reference in New Issue
Block a user