diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.in | 15 | ||||
-rw-r--r-- | src/htsback.c | 8 | ||||
-rw-r--r-- | src/htscore.h | 1 | ||||
-rw-r--r-- | src/htsglobal.h | 4 | ||||
-rw-r--r-- | src/htshash.c | 2 | ||||
-rw-r--r-- | src/htshash.h | 2 | ||||
-rw-r--r-- | src/htsparse.c | 11 |
7 files changed, 30 insertions, 13 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 2380102..0562491 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -62,37 +62,43 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LFS_FLAG = @LFS_FLAG@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +NM = @NM@ NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ @@ -108,7 +114,7 @@ VERSION = @VERSION@ VERSION_INFO = @VERSION_INFO@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -140,6 +146,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ diff --git a/src/htsback.c b/src/htsback.c index 723ad60..c43df69 100644 --- a/src/htsback.c +++ b/src/htsback.c @@ -2150,10 +2150,12 @@ static int slot_can_be_cleaned(const lien_back* back) { static int slot_can_be_finalized(httrackp* opt, const lien_back* back) { return - (back->r.is_write // not in memory (on disk, ready) + back->r.is_write // not in memory (on disk, ready) && !is_hypertext_mime(opt,back->r.contenttype, back->url_fil) // not HTML/hypertext && !may_be_hypertext_mime(opt,back->r.contenttype, back->url_fil) // may NOT be parseable mime type - ); + /* Has not been added before the heap saw the link, or now exists on heap */ + && ( !back->early_add || hash_read(opt->hash,back->url_sav,"",0,opt->urlhack) >= 0 ) + ; } void back_clean(httrackp* opt,cache_back* cache,struct_back* sback) { @@ -3243,7 +3245,7 @@ void back_wait(struct_back* sback,httrackp* opt,cache_back* cache,TStamp stat_ti /* Solve "false" 416 problems */ - if (back[i].r.statuscode==416) { // 'Requested Range Not Satisfiable' + if (back[i].r.statuscode==HTTP_REQUESTED_RANGE_NOT_SATISFIABLE) { // 'Requested Range Not Satisfiable' // Example: // Range: bytes=2830- // -> diff --git a/src/htscore.h b/src/htscore.h index c115bc1..c653f24 100644 --- a/src/htscore.h +++ b/src/htscore.h @@ -207,6 +207,7 @@ struct lien_back { char info[256]; // éventuel status pour le ftp int stop_ftp; // flag stop pour ftp int finalized; // finalized (optim memory) + int early_add; // was added before link heap saw it #if DEBUG_CHECKINT char magic2; #endif diff --git a/src/htsglobal.h b/src/htsglobal.h index be06e5d..69588f9 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.44-1" +#define HTTRACK_VERSIONID "3.44.1" #define HTTRACK_AFF_VERSION "3.x" #define HTTRACK_LIB_VERSION "2.0" diff --git a/src/htshash.c b/src/htshash.c index cf6b3ec..6e70032 100644 --- a/src/htshash.c +++ b/src/htshash.c @@ -63,7 +63,7 @@ Please visit our Website: http://www.httrack.com // type: numero enregistrement - 0 est case insensitive (sav) 1 (adr+fil) 2 (former_adr+former_fil) // recherche dans la table selon nom1,nom2 et le no d'enregistrement // retour: position ou -1 si non trouvé -int hash_read(hash_struct* hash,char* nom1,char* nom2,int type,int normalized) { +int hash_read(const hash_struct* hash,char* nom1,char* nom2,int type,int normalized) { char BIGSTK normfil_[HTS_URLMAXSIZE*2]; char catbuff[CATBUFF_SIZE]; char* normfil; diff --git a/src/htshash.h b/src/htshash.h index 15f111e..39ee395 100644 --- a/src/htshash.h +++ b/src/htshash.h @@ -50,7 +50,7 @@ typedef struct hash_struct hash_struct; #endif // tables de hachage -int hash_read(hash_struct* hash,char* nom1,char* nom2,int type,int normalized); +int hash_read(const hash_struct* hash,char* nom1,char* nom2,int type,int normalized); void hash_write(hash_struct* hash,int lpos,int normalized); int* hash_calc_chaine(hash_struct* hash,int type,int pos); unsigned long int hash_cle(char* nom1,char* nom2); diff --git a/src/htsparse.c b/src/htsparse.c index 34ef831..1d83add 100644 --- a/src/htsparse.c +++ b/src/htsparse.c @@ -3427,8 +3427,8 @@ int hts_mirror_check_moved(htsmoduleStruct* str, htsmoduleStructExtended* stre) } // bloc // erreur HTTP (ex: 404, not found) } else if ( - (r->statuscode==412) - || (r->statuscode==416) + (r->statuscode==HTTP_PRECONDITION_FAILED) + || (r->statuscode==HTTP_REQUESTED_RANGE_NOT_SATISFIABLE) ) { // Precondition Failed, c'est à dire pour nous redemander TOUT le fichier if (fexist(liens[ptr]->sav)) { remove(liens[ptr]->sav); // Eliminer @@ -4283,6 +4283,9 @@ int hts_wait_delayed(htsmoduleStruct* str, return -1; } + /* We added the link before the parser recorded it -- the background download MUST NOT clean silently this entry! (Petr Gajdusek) */ + back[b].early_add = 1; + /* Cache read failed because file does not exists (bad delayed name!) Just re-add with the correct name, as we know the MIME now! */ @@ -4329,6 +4332,10 @@ int hts_wait_delayed(htsmoduleStruct* str, XH_uninit; // désallocation mémoire & buffers return -1; } + + /* We added the link before the parser recorded it -- the background download MUST NOT clean silently this entry! (Petr Gajdusek) */ + back[b].early_add = 1; + if ((opt->debug>1) && (opt->log!=NULL)) { HTS_LOG(opt,LOG_DEBUG); fprintf(opt->log,"Type immediately loaded from cache: %s"LF, delayed_back.r.contenttype); test_flush; |