summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2013-08-16 13:10:20 +0000
committerXavier Roche <xroche@users.noreply.github.com>2013-08-16 13:10:20 +0000
commitd99ea7fb86c266f9bb69166519b3fed269eadf4b (patch)
tree7e3b679d9933fd42e89ee430e8f6bc517f4dbe37 /src
parenta4ce809b0682708461a56f8fa85e253471ad07f0 (diff)
Make "Unexpected 412/416 error" non-fatal until I find out why in hell this bug is still out there.
Diffstat (limited to 'src')
-rw-r--r--src/htsback.c4
-rw-r--r--src/htsparse.c73
2 files changed, 38 insertions, 39 deletions
diff --git a/src/htsback.c b/src/htsback.c
index 7b950c9..27e3996 100644
--- a/src/htsback.c
+++ b/src/htsback.c
@@ -1785,7 +1785,7 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, char *adr,
}
/* Not in cache ; maybe in temporary cache ? Warning: non-movable "url_sav" */
else if (back_unserialize_ref(opt, adr, fil, &itemback) == 0) {
- const long file_size = fsize_utf8(itemback->url_sav);
+ const off_t file_size = fsize_utf8(itemback->url_sav);
/* Found file on disk */
if (file_size > 0) {
@@ -1820,7 +1820,7 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, char *adr,
}
/* Not in cache or temporary cache ; found on disk ? (hack) */
else if (fexist_utf8(save)) {
- off_t sz = fsize_utf8(save);
+ const off_t sz = fsize_utf8(save);
// Bon, là il est possible que le fichier ait été partiellement transféré
// (s'il l'avait été en totalité il aurait été inscrit dans le cache ET existerait sur disque)
diff --git a/src/htsparse.c b/src/htsparse.c
index 7648d07..711165c 100644
--- a/src/htsparse.c
+++ b/src/htsparse.c
@@ -3745,48 +3745,47 @@ int hts_mirror_check_moved(htsmoduleStruct * str,
) { // Precondition Failed, c'est à dire pour nous redemander TOUT le fichier
if (fexist_utf8(liens[ptr]->sav)) {
remove(liens[ptr]->sav); // Eliminer
- if (!fexist_utf8(liens[ptr]->sav)) { // Bien éliminé? (sinon on boucle..)
-#if HDEBUG
- printf("Partial content NOT up-to-date, reget all file for %s\n",
- liens[ptr]->sav);
-#endif
- hts_log_print(opt, LOG_DEBUG, "Partial file reget (%s) for %s%s",
- r->msg, urladr, urlfil);
- // enregistrer le MEME lien (MACRO)
- liens_record(liens[ptr]->adr, liens[ptr]->fil, liens[ptr]->sav, "",
- "");
- if (liens[lien_tot] != NULL) { // OK, pas d'erreur
- liens[lien_tot]->testmode = liens[ptr]->testmode; // mode test?
- liens[lien_tot]->link_import = 0; // pas mode import
- liens[lien_tot]->depth = liens[ptr]->depth;
- liens[lien_tot]->pass2 = max(liens[ptr]->pass2, numero_passe);
- liens[lien_tot]->retry = liens[ptr]->retry;
- liens[lien_tot]->premier = liens[ptr]->premier;
- liens[lien_tot]->precedent = ptr;
- lien_tot++;
- //
- // canceller lien actuel
- error = 1;
- strcpybuff(liens[ptr]->adr, "!"); // caractère bidon (invalide hash)
- //
- } else { // oups erreur, plus de mémoire!!
- printf("PANIC! : Not enough memory [%d]\n", __LINE__);
- hts_log_print(opt, LOG_PANIC,
- "Not enough memory, can not re-allocate %d bytes",
- (int) ((add_tab_alloc + 1) * sizeof(lien_url)));
- //if (opt->getmode & 1) { if (fp) { fclose(fp); fp=NULL; } }
- XH_uninit; // désallocation mémoire & buffers
- return 0;
- }
- } else {
- hts_log_print(opt, LOG_ERROR, "Can not remove old file %s", urlfil);
- error = 1;
- }
} else {
hts_log_print(opt, LOG_WARNING,
"Unexpected 412/416 error (%s) for %s%s, '%s' could not be found on disk",
r->msg, urladr, urlfil,
liens[ptr]->sav != NULL ? liens[ptr]->sav : "");
+ }
+ if (!fexist_utf8(liens[ptr]->sav)) { // Bien éliminé? (sinon on boucle..)
+#if HDEBUG
+ printf("Partial content NOT up-to-date, reget all file for %s\n",
+ liens[ptr]->sav);
+#endif
+ hts_log_print(opt, LOG_DEBUG, "Partial file reget (%s) for %s%s",
+ r->msg, urladr, urlfil);
+ // enregistrer le MEME lien (MACRO)
+ liens_record(liens[ptr]->adr, liens[ptr]->fil, liens[ptr]->sav, "",
+ "");
+ if (liens[lien_tot] != NULL) { // OK, pas d'erreur
+ liens[lien_tot]->testmode = liens[ptr]->testmode; // mode test?
+ liens[lien_tot]->link_import = 0; // pas mode import
+ liens[lien_tot]->depth = liens[ptr]->depth;
+ liens[lien_tot]->pass2 = max(liens[ptr]->pass2, numero_passe);
+ liens[lien_tot]->retry = liens[ptr]->retry;
+ liens[lien_tot]->premier = liens[ptr]->premier;
+ liens[lien_tot]->precedent = ptr;
+ lien_tot++;
+ //
+ // canceller lien actuel
+ error = 1;
+ strcpybuff(liens[ptr]->adr, "!"); // caractère bidon (invalide hash)
+ //
+ } else { // oups erreur, plus de mémoire!!
+ printf("PANIC! : Not enough memory [%d]\n", __LINE__);
+ hts_log_print(opt, LOG_PANIC,
+ "Not enough memory, can not re-allocate %d bytes",
+ (int) ((add_tab_alloc + 1) * sizeof(lien_url)));
+ //if (opt->getmode & 1) { if (fp) { fclose(fp); fp=NULL; } }
+ XH_uninit; // désallocation mémoire & buffers
+ return 0;
+ }
+ } else {
+ hts_log_print(opt, LOG_ERROR, "Can not remove old file %s", urlfil);
error = 1;
}