summaryrefslogtreecommitdiff
path: root/src/htswizard.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2013-05-14 20:30:28 +0000
committerXavier Roche <xroche@users.noreply.github.com>2013-05-14 20:30:28 +0000
commit07f4b003675260004c49755dde413944a16ca2d3 (patch)
tree11050b4c7fbe1d7c63a38f5f9a6b5ba6d8260ae1 /src/htswizard.c
parentb09def438c5e47305e4a5ab18d8a646a3b004fdc (diff)
Indenting cleanup for all *.[ch] files, except htsparse.c (too ugly to be automatically indented for now) and /minizip/, /mmsrip/ (external files)
setup: indent -l80 -lc80 -nhnl -nut -bad -bap -bbo -br -brf -bli2 -brs -bls -br -ss -sai -pmt -nsaw -nsaf -nprs -i2 -ce -npsl -npcs -cs -sob -cdw -nbc -lp logs: indent: ./src/htsback.c:157: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsback.c:1417: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsback.c:1826: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsback.c:1833: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsback.c:1981: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsback.c:2685: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsback.c:2747: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsback.c:2861: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsback.c:3128: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsback.c:3512: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htswizard.c:140: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htswizard.c:597: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htswizard.c:598: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htswizard.c:611: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htscoremain.c:97: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htscoremain.c:106: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htscoremain.c:106: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htscoremain.c:256: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htscoremain.c:262: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htscoremain.c:935: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:271: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:272: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:273: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:274: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:275: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:276: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:277: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:278: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:279: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:280: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:281: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:662: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/httrack.c:752: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsweb.c:413: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsweb.c:414: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsweb.c:415: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsweb.c:416: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsweb.c:417: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsweb.c:418: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsweb.c:419: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsweb.c:420: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsweb.c:421: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsweb.c:422: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsweb.c:423: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.c:188: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.c:507: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.c:508: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.c:509: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.c:510: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.c:511: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.c:512: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.c:580: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.c:581: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.h:115: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.h:246: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.h:247: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.h:248: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.h:249: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.h:250: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.h:251: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.h:314: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/proxy/proxytrack.h:315: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:151: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:158: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:161: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:166: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:174: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:177: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:188: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:243: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:245: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:248: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:257: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htstools.c:647: Warning:old style assignment ambiguity in "=*". Assuming "= *" indent: ./src/htsbauth.c:364: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htsbauth.c:387: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htscache.c:473: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsserver.h:112: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsserver.h:187: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsjava.c:312: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsjava.c:379: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htsjava.c:407: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsjava.c:472: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htsjava.c:483: Warning:old style assignment ambiguity in "=*". Assuming "= *" indent: ./src/htslib.c:593: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:809: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:1743: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:1874: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:1896: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:1984: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2085: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2604: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2605: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2606: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2607: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2608: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2609: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2672: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2673: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2906: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2928: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:2996: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:4802: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htslib.c:5353: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:5354: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:5355: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:5357: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:5429: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htslib.c:5435: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htscore.c:208: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htscore.c:277: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htscore.c:279: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htscore.c:357: Warning:old style assignment ambiguity in "=*". Assuming "= *" indent: ./src/htscore.c:394: Warning:old style assignment ambiguity in "=*". Assuming "= *" indent: ./src/htscore.c:1544: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htscore.c:3330: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htscore.c:3361: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htshash.c:140: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htshash.c:217: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsname.c:733: Warning:old style assignment ambiguity in "=*". Assuming "= *" indent: ./src/htsname.c:749: Warning:old style assignment ambiguity in "=*". Assuming "= *" indent: ./src/htsname.c:933: Warning:old style assignment ambiguity in "=*". Assuming "= *" indent: ./src/htsname.c:1520: Warning:old style assignment ambiguity in "=*". Assuming "= *" indent: ./src/htszlib.c:76: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htszlib.c:81: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htscatchurl.c:268: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsinthash.c:156: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htsinthash.c:159: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htsinthash.c:176: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htsinthash.c:179: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htsinthash.c:226: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htsinthash.c:253: Warning:old style assignment ambiguity in "=&". Assuming "= &" indent: ./src/htsftp.c:169: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsftp.c:177: Warning:old style assignment ambiguity in "=-". Assuming "= -" indent: ./src/htsfilters.c:67: Warning:old style assignment ambiguity in "=*". Assuming "= *" indent: ./src/htsfilters.c:80: Warning:old style assignment ambiguity in "=*". Assuming "= *"
Diffstat (limited to 'src/htswizard.c')
-rw-r--r--src/htswizard.c1145
1 files changed, 613 insertions, 532 deletions
diff --git a/src/htswizard.c b/src/htswizard.c
index 3bc8691..b4ceaeb 100644
--- a/src/htswizard.c
+++ b/src/htswizard.c
@@ -17,18 +17,15 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
Important notes:
- We hereby ask people using this source NOT to use it in purpose of grabbing
emails addresses, or collecting any other private information on persons.
This would disgrace our work, and spoil the many hours we spent on it.
-
Please visit our Website: http://www.httrack.com
*/
-
/* ------------------------------------------------------------ */
/* File: httrack.c subroutines: */
/* wizard system (accept/refuse links) */
@@ -64,31 +61,29 @@ Please visit our Website: http://www.httrack.com
} while(0)
typedef struct htspair_t {
- char *tag;
- char *attr;
+ char *tag;
+ char *attr;
} htspair_t;
/* "embedded" */
htspair_t hts_detect_embed[] = {
- { "img", "src" },
- { "link", "href" },
+ {"img", "src"},
+ {"link", "href"},
- /* embedded script hack */
- { "script", ".src" },
+ /* embedded script hack */
+ {"script", ".src"},
- /* style */
- { "style", "import" },
+ /* style */
+ {"style", "import"},
- { NULL, NULL }
+ {NULL, NULL}
};
/* Internal */
-static int hts_acceptlink_(httrackp* opt,
- int ptr,int lien_tot,lien_url** liens,
- char* adr,char* fil,
- char* tag, char* attribute,
- int* set_prio_to,
- int* just_test_it);
+static int hts_acceptlink_(httrackp * opt, int ptr, int lien_tot,
+ lien_url ** liens, char *adr, char *fil, char *tag,
+ char *attribute, int *set_prio_to,
+ int *just_test_it);
/*
httrackp opt bloc d'options
@@ -110,99 +105,94 @@ retour:
-1 pas d'avis
*/
-int hts_acceptlink(httrackp* opt,
- int ptr,int lien_tot,lien_url** liens,
- char* adr,char* fil,
- char* tag, char* attribute,
- int* set_prio_to,
- int* just_test_it)
-{
- int forbidden_url = hts_acceptlink_(opt, ptr, lien_tot, liens,
- adr, fil, tag, attribute, set_prio_to, just_test_it);
- int prev_prio = set_prio_to ? *set_prio_to : 0;
-
- // -------------------- PHASE 6 --------------------
- {
- int test_url = RUN_CALLBACK3(opt, check_link, adr, fil, forbidden_url);
- if (test_url != -1) {
- forbidden_url = test_url;
- if (set_prio_to)
- *set_prio_to = prev_prio;
- }
- }
-
- return forbidden_url;
+int hts_acceptlink(httrackp * opt, int ptr, int lien_tot, lien_url ** liens,
+ char *adr, char *fil, char *tag, char *attribute,
+ int *set_prio_to, int *just_test_it) {
+ int forbidden_url = hts_acceptlink_(opt, ptr, lien_tot, liens,
+ adr, fil, tag, attribute, set_prio_to,
+ just_test_it);
+ int prev_prio = set_prio_to ? *set_prio_to : 0;
+
+ // -------------------- PHASE 6 --------------------
+ {
+ int test_url = RUN_CALLBACK3(opt, check_link, adr, fil, forbidden_url);
+
+ if (test_url != -1) {
+ forbidden_url = test_url;
+ if (set_prio_to)
+ *set_prio_to = prev_prio;
+ }
+ }
+
+ return forbidden_url;
}
static int cmp_token(const char *tag, const char *cmp) {
- int p;
- return (strncasecmp(tag, cmp, ( p = (int) strlen(cmp) ) ) == 0
- && !isalnum((unsigned char) tag[p]));
+ int p;
+
+ return (strncasecmp(tag, cmp, (p = (int) strlen(cmp))) == 0
+ && !isalnum((unsigned char) tag[p]));
}
-static int hts_acceptlink_(httrackp* opt,
- int ptr,int lien_tot,lien_url** liens,
- char* adr,char* fil,
- char* tag, char* attribute,
- int* set_prio_to,
- int* just_test_it)
-{
- int forbidden_url=-1;
+static int hts_acceptlink_(httrackp * opt, int ptr, int lien_tot,
+ lien_url ** liens, char *adr, char *fil, char *tag,
+ char *attribute, int *set_prio_to,
+ int *just_test_it) {
+ int forbidden_url = -1;
int meme_adresse;
- int embedded_triggered = 0;
+ int embedded_triggered = 0;
+
#define _FILTERS (*opt->filters.filters)
#define _FILTERS_PTR (opt->filters.filptr)
#define _ROBOTS ((robots_wizard*)opt->robotsptr)
- int may_set_prio_to=0;
+ int may_set_prio_to = 0;
// -------------------- PHASE 0 --------------------
/* Infos */
- hts_log_print(opt, LOG_DEBUG, "wizard test begins: %s%s",adr,fil);
-
+ hts_log_print(opt, LOG_DEBUG, "wizard test begins: %s%s", adr, fil);
+
/* Already exists? Then, we know that we knew that this link had to be known */
- if (adr[0] != '\0'
- && fil[0] != '\0'
- && opt->hash != NULL
- && hash_read(opt->hash, adr, fil, 1, opt->urlhack) >= 0
- ) {
- return 0; /* Yokai */
+ if (adr[0] != '\0' && fil[0] != '\0' && opt->hash != NULL
+ && hash_read(opt->hash, adr, fil, 1, opt->urlhack) >= 0) {
+ return 0; /* Yokai */
}
-
// -------------------- PRELUDE OF PHASE 3-BIS --------------------
- /* Built-in known tags (<img src=..>, ..) */
- if (forbidden_url != 0 && opt->nearlink && tag != NULL && attribute != NULL) {
- int i;
- for(i = 0 ; hts_detect_embed[i].tag != NULL ; i++) {
- if (cmp_token(tag, hts_detect_embed[i].tag)
- && cmp_token(attribute, hts_detect_embed[i].attr)
- )
- {
- embedded_triggered = 1;
- break;
- }
- }
- }
+ /* Built-in known tags (<img src=..>, ..) */
+ if (forbidden_url != 0 && opt->nearlink && tag != NULL && attribute != NULL) {
+ int i;
+ for(i = 0; hts_detect_embed[i].tag != NULL; i++) {
+ if (cmp_token(tag, hts_detect_embed[i].tag)
+ && cmp_token(attribute, hts_detect_embed[i].attr)
+ ) {
+ embedded_triggered = 1;
+ break;
+ }
+ }
+ }
// -------------------- PHASE 1 --------------------
/* Doit-on traiter les non html? */
- if ((opt->getmode & 2)==0) { // non on ne doit pas
- if (!ishtml(opt,fil)) { // non il ne faut pas
+ if ((opt->getmode & 2) == 0) { // non on ne doit pas
+ if (!ishtml(opt, fil)) { // non il ne faut pas
//adr[0]='\0'; // ne pas traiter ce lien, pas traiter
- forbidden_url=1; // interdire récupération du lien
- hts_log_print(opt, LOG_DEBUG, "non-html file ignored at %s : %s",adr,fil);
-
+ forbidden_url = 1; // interdire récupération du lien
+ hts_log_print(opt, LOG_DEBUG, "non-html file ignored at %s : %s", adr,
+ fil);
+
}
}
-
+
/* Niveau 1: ne pas parser suivant! */
- if (ptr>0) {
- if ( ( liens[ptr]->depth <= 0 ) || ( liens[ptr]->depth <= 1 && !embedded_triggered ) ) {
- forbidden_url=1; // interdire récupération du lien
- hts_log_print(opt, LOG_DEBUG, "file from too far level ignored at %s : %s",adr,fil);
+ if (ptr > 0) {
+ if ((liens[ptr]->depth <= 0)
+ || (liens[ptr]->depth <= 1 && !embedded_triggered)) {
+ forbidden_url = 1; // interdire récupération du lien
+ hts_log_print(opt, LOG_DEBUG,
+ "file from too far level ignored at %s : %s", adr, fil);
}
}
@@ -210,263 +200,295 @@ static int hts_acceptlink_(httrackp* opt,
if (forbidden_url == 1) {
return forbidden_url;
}
-
// -------------------- PHASE 2 --------------------
// ------------------------------------------------------
// doit-on traiter ce lien?.. vérifier droits de déplacement
- meme_adresse=strfield2(adr,urladr);
- if (meme_adresse)
- hts_log_print(opt, LOG_DEBUG, "Compare addresses: %s=%s",adr,urladr);
+ meme_adresse = strfield2(adr, urladr);
+ if (meme_adresse)
+ hts_log_print(opt, LOG_DEBUG, "Compare addresses: %s=%s", adr, urladr);
else
- hts_log_print(opt, LOG_DEBUG, "Compare addresses: %s!=%s",adr,urladr);
- if (meme_adresse) { // même adresse
- { // tester interdiction de descendre
+ hts_log_print(opt, LOG_DEBUG, "Compare addresses: %s!=%s", adr, urladr);
+ if (meme_adresse) { // même adresse
+ { // tester interdiction de descendre
// MODIFIE : en cas de remontée puis de redescente, il se pouvait qu'on ne puisse pas atteindre certains fichiers
// problème: si un fichier est virtuellement accessible via une page mais dont le lien est sur une autre *uniquement*..
- char BIGSTK tempo[HTS_URLMAXSIZE*2];
- char BIGSTK tempo2[HTS_URLMAXSIZE*2];
+ char BIGSTK tempo[HTS_URLMAXSIZE * 2];
+ char BIGSTK tempo2[HTS_URLMAXSIZE * 2];
+
tempo[0] = tempo2[0] = '\0';
-
+
// note (up/down): on calcule à partir du lien primaire, ET du lien précédent.
// ex: si on descend 2 fois on peut remonter 1 fois
-
- if (lienrelatif(tempo,fil,liens[liens[ptr]->premier]->fil)==0) {
- if (lienrelatif(tempo2,fil,liens[ptr]->fil)==0) {
- hts_log_print(opt, LOG_DEBUG, "build relative links to test: %s %s (with %s and %s)",tempo,tempo2,liens[liens[ptr]->premier]->fil,liens[ptr]->fil);
-
+
+ if (lienrelatif(tempo, fil, liens[liens[ptr]->premier]->fil) == 0) {
+ if (lienrelatif(tempo2, fil, liens[ptr]->fil) == 0) {
+ hts_log_print(opt, LOG_DEBUG,
+ "build relative links to test: %s %s (with %s and %s)",
+ tempo, tempo2, liens[liens[ptr]->premier]->fil,
+ liens[ptr]->fil);
+
// si vient de primary, ne pas tester lienrelatif avec (car host "différent")
/*if (liens[liens[ptr]->premier] == 0) { // vient de primary
- }
- */
-
+ }
+ */
+
// NEW: finalement OK, sauf pour les moved repérés par link_import
// PROBLEME : annulé a cause d'un lien éventuel isolé accepté..qui entrainerait un miroir
-
+
// (test même niveau (NOUVEAU à cause de certains problèmes de filtres non intégrés))
// NEW
- if (
- (tempo[0] != '\0' && tempo[1] != '\0' && strchr(tempo+1,'/') == 0)
- ||
- (tempo2[0] != '\0' && tempo2[1] != '\0' && strchr(tempo2+1,'/') == 0)
+ if ((tempo[0] != '\0' && tempo[1] != '\0'
+ && strchr(tempo + 1, '/') == 0)
+ || (tempo2[0] != '\0' && tempo2[1] != '\0'
+ && strchr(tempo2 + 1, '/') == 0)
) {
- if (!liens[ptr]->link_import) { // ne résulte pas d'un 'moved'
- forbidden_url=0;
- hts_log_print(opt, LOG_DEBUG, "same level link authorized: %s%s",adr,fil);
+ if (!liens[ptr]->link_import) { // ne résulte pas d'un 'moved'
+ forbidden_url = 0;
+ hts_log_print(opt, LOG_DEBUG, "same level link authorized: %s%s",
+ adr, fil);
}
}
-
// down
- if ( (strncmp(tempo,"../",3)) || (strncmp(tempo2,"../",3))) { // pas montée sinon ne nbous concerne pas
- int test1,test2;
- if (!strncmp(tempo,"../",3))
- test1=0;
+ if ((strncmp(tempo, "../", 3)) || (strncmp(tempo2, "../", 3))) { // pas montée sinon ne nbous concerne pas
+ int test1, test2;
+
+ if (!strncmp(tempo, "../", 3))
+ test1 = 0;
else
- test1 = (strchr(tempo +((*tempo =='/')?1:0),'/')!=NULL);
- if (!strncmp(tempo2,"../",3))
- test2=0;
+ test1 = (strchr(tempo + ((*tempo == '/') ? 1 : 0), '/') != NULL);
+ if (!strncmp(tempo2, "../", 3))
+ test2 = 0;
else
- test2 = (strchr(tempo2+((*tempo2=='/')?1:0),'/')!=NULL);
- if ( (test1) && (test2) ) { // on ne peut que descendre
- if ((opt->seeker & 1)==0) { // interdiction de descendre
- forbidden_url=1;
- hts_log_print(opt, LOG_DEBUG, "lower link canceled: %s%s",adr,fil);
- } else { // autorisé à priori - NEW
- if (!liens[ptr]->link_import) { // ne résulte pas d'un 'moved'
- forbidden_url=0;
- hts_log_print(opt, LOG_DEBUG, "lower link authorized: %s%s",adr,fil);
+ test2 =
+ (strchr(tempo2 + ((*tempo2 == '/') ? 1 : 0), '/') != NULL);
+ if ((test1) && (test2)) { // on ne peut que descendre
+ if ((opt->seeker & 1) == 0) { // interdiction de descendre
+ forbidden_url = 1;
+ hts_log_print(opt, LOG_DEBUG, "lower link canceled: %s%s", adr,
+ fil);
+ } else { // autorisé à priori - NEW
+ if (!liens[ptr]->link_import) { // ne résulte pas d'un 'moved'
+ forbidden_url = 0;
+ hts_log_print(opt, LOG_DEBUG, "lower link authorized: %s%s",
+ adr, fil);
}
}
- } else if ( (test1) || (test2) ) { // on peut descendre pour accéder au lien
- if ((opt->seeker & 1)!=0) { // on peut descendre - NEW
- if (!liens[ptr]->link_import) { // ne résulte pas d'un 'moved'
- forbidden_url=0;
- hts_log_print(opt, LOG_DEBUG, "lower link authorized: %s%s",adr,fil);
+ } else if ((test1) || (test2)) { // on peut descendre pour accéder au lien
+ if ((opt->seeker & 1) != 0) { // on peut descendre - NEW
+ if (!liens[ptr]->link_import) { // ne résulte pas d'un 'moved'
+ forbidden_url = 0;
+ hts_log_print(opt, LOG_DEBUG, "lower link authorized: %s%s",
+ adr, fil);
}
}
}
}
-
-
+
// up
- if ( (!strncmp(tempo,"../",3)) && (!strncmp(tempo2,"../",3)) ) { // impossible sans monter
- if ((opt->seeker & 2)==0) { // interdiction de monter
- forbidden_url=1;
- hts_log_print(opt, LOG_DEBUG, "upper link canceled: %s%s",adr,fil);
- } else { // autorisé à monter - NEW
+ if ((!strncmp(tempo, "../", 3)) && (!strncmp(tempo2, "../", 3))) { // impossible sans monter
+ if ((opt->seeker & 2) == 0) { // interdiction de monter
+ forbidden_url = 1;
+ hts_log_print(opt, LOG_DEBUG, "upper link canceled: %s%s", adr,
+ fil);
+ } else { // autorisé à monter - NEW
if (!liens[ptr]->link_import) { // ne résulte pas d'un 'moved'
- forbidden_url=0;
- hts_log_print(opt, LOG_DEBUG, "upper link authorized: %s%s",adr,fil);
+ forbidden_url = 0;
+ hts_log_print(opt, LOG_DEBUG, "upper link authorized: %s%s",
+ adr, fil);
}
}
- } else if ( (!strncmp(tempo,"../",3)) || (!strncmp(tempo2,"../",3)) ) { // Possible en montant
- if ((opt->seeker & 2)!=0) { // autorisé à monter - NEW
+ } else if ((!strncmp(tempo, "../", 3)) || (!strncmp(tempo2, "../", 3))) { // Possible en montant
+ if ((opt->seeker & 2) != 0) { // autorisé à monter - NEW
if (!liens[ptr]->link_import) { // ne résulte pas d'un 'moved'
- forbidden_url=0;
- hts_log_print(opt, LOG_DEBUG, "upper link authorized: %s%s",adr,fil);
+ forbidden_url = 0;
+ hts_log_print(opt, LOG_DEBUG, "upper link authorized: %s%s",
+ adr, fil);
}
- } // sinon autorisé en descente
+ } // sinon autorisé en descente
}
-
-
+
} else {
- hts_log_print(opt, LOG_ERROR, "Error building relative link %s and %s",fil,liens[ptr]->fil);
+ hts_log_print(opt, LOG_ERROR,
+ "Error building relative link %s and %s", fil,
+ liens[ptr]->fil);
}
} else {
- hts_log_print(opt, LOG_ERROR, "Error building relative link %s and %s",fil,liens[liens[ptr]->premier]->fil);
+ hts_log_print(opt, LOG_ERROR, "Error building relative link %s and %s",
+ fil, liens[liens[ptr]->premier]->fil);
}
-
- } // tester interdiction de descendre?
-
- { // tester interdiction de monter
- char BIGSTK tempo[HTS_URLMAXSIZE*2];
- char BIGSTK tempo2[HTS_URLMAXSIZE*2];
- if (lienrelatif(tempo,fil,liens[liens[ptr]->premier]->fil)==0) {
- if (lienrelatif(tempo2,fil,liens[ptr]->fil)==0) {
+
+ } // tester interdiction de descendre?
+
+ { // tester interdiction de monter
+ char BIGSTK tempo[HTS_URLMAXSIZE * 2];
+ char BIGSTK tempo2[HTS_URLMAXSIZE * 2];
+
+ if (lienrelatif(tempo, fil, liens[liens[ptr]->premier]->fil) == 0) {
+ if (lienrelatif(tempo2, fil, liens[ptr]->fil) == 0) {
} else {
- hts_log_print(opt, LOG_ERROR, "Error building relative link %s and %s",fil,liens[ptr]->fil);
+ hts_log_print(opt, LOG_ERROR,
+ "Error building relative link %s and %s", fil,
+ liens[ptr]->fil);
}
} else {
- hts_log_print(opt, LOG_ERROR, "Error building relative link %s and %s",fil,liens[liens[ptr]->premier]->fil);
-
+ hts_log_print(opt, LOG_ERROR, "Error building relative link %s and %s",
+ fil, liens[liens[ptr]->premier]->fil);
+
}
- } // fin tester interdiction de monter
-
- } else { // adresse différente, sortir?
-
+ } // fin tester interdiction de monter
+
+ } else { // adresse différente, sortir?
+
//if (!opt->wizard) { // mode non wizard
// doit-on traiter ce lien?.. vérifier droits de sortie
- switch((opt->travel & 255)) {
- case 0:
- if (!opt->wizard) // mode non wizard
- forbidden_url=1;
- break; // interdicton de sortir au dela de l'adresse
- case 1: { // sortie sur le même dom.xxx
- size_t i = strlen(adr)-1;
- size_t j = strlen(urladr)-1;
- if ((i>0) && (j>0)) {
- while( (i>0) && (adr[i]!='.')) i--;
- while( (j>0) && (urladr[j]!='.')) j--;
- if ((i>0) && (j>0)) {
- i--; j--;
- while( (i>0) && (adr[i]!='.')) i--;
- while( (j>0) && (urladr[j]!='.')) j--;
- }
- }
- if ((i>0) && (j>0)) {
- if (!strfield2(adr+i,urladr+j)) { // !=
- if (!opt->wizard) { // mode non wizard
- //printf("refused: %s\n",adr);
- forbidden_url=1; // pas même domaine
- hts_log_print(opt, LOG_DEBUG, "foreign domain link canceled: %s%s",adr,fil);
- }
-
- } else {
- if (opt->wizard) { // mode wizard
- forbidden_url=0; // même domaine
- hts_log_print(opt, LOG_DEBUG, "same domain link authorized: %s%s",adr,fil);
+ switch ((opt->travel & 255)) {
+ case 0:
+ if (!opt->wizard) // mode non wizard
+ forbidden_url = 1;
+ break; // interdicton de sortir au dela de l'adresse
+ case 1:{ // sortie sur le même dom.xxx
+ size_t i = strlen(adr) - 1;
+ size_t j = strlen(urladr) - 1;
+
+ if ((i > 0) && (j > 0)) {
+ while((i > 0) && (adr[i] != '.'))
+ i--;
+ while((j > 0) && (urladr[j] != '.'))
+ j--;
+ if ((i > 0) && (j > 0)) {
+ i--;
+ j--;
+ while((i > 0) && (adr[i] != '.'))
+ i--;
+ while((j > 0) && (urladr[j] != '.'))
+ j--;
}
}
-
- } else
- forbidden_url=1;
- }
- break;
- case 2: { // sortie sur le même .xxx
- size_t i = strlen(adr)-1;
- size_t j = strlen(urladr)-1;
- while( (i>0) && (adr[i]!='.')) i--;
- while( (j>0) && (urladr[j]!='.')) j--;
- if ((i>0) && (j>0)) {
- if (!strfield2(adr+i,urladr+j)) { // !-
- if (!opt->wizard) { // mode non wizard
- //printf("refused: %s\n",adr);
- forbidden_url=1; // pas même .xx
- hts_log_print(opt, LOG_DEBUG, "foreign location link canceled: %s%s",adr,fil);
+ if ((i > 0) && (j > 0)) {
+ if (!strfield2(adr + i, urladr + j)) { // !=
+ if (!opt->wizard) { // mode non wizard
+ //printf("refused: %s\n",adr);
+ forbidden_url = 1; // pas même domaine
+ hts_log_print(opt, LOG_DEBUG,
+ "foreign domain link canceled: %s%s", adr, fil);
+ }
+
+ } else {
+ if (opt->wizard) { // mode wizard
+ forbidden_url = 0; // même domaine
+ hts_log_print(opt, LOG_DEBUG, "same domain link authorized: %s%s",
+ adr, fil);
+ }
}
- } else {
- if (opt->wizard) { // mode wizard
- forbidden_url=0; // même domaine
- hts_log_print(opt, LOG_DEBUG, "same location link authorized: %s%s",adr,fil);
+
+ } else
+ forbidden_url = 1;
+ }
+ break;
+ case 2:{ // sortie sur le même .xxx
+ size_t i = strlen(adr) - 1;
+ size_t j = strlen(urladr) - 1;
+
+ while((i > 0) && (adr[i] != '.'))
+ i--;
+ while((j > 0) && (urladr[j] != '.'))
+ j--;
+ if ((i > 0) && (j > 0)) {
+ if (!strfield2(adr + i, urladr + j)) { // !-
+ if (!opt->wizard) { // mode non wizard
+ //printf("refused: %s\n",adr);
+ forbidden_url = 1; // pas même .xx
+ hts_log_print(opt, LOG_DEBUG,
+ "foreign location link canceled: %s%s", adr, fil);
+ }
+ } else {
+ if (opt->wizard) { // mode wizard
+ forbidden_url = 0; // même domaine
+ hts_log_print(opt, LOG_DEBUG,
+ "same location link authorized: %s%s", adr, fil);
+ }
}
- }
- } else forbidden_url=1;
- }
+ } else
+ forbidden_url = 1;
+ }
break;
- case 7: // everywhere!!
- if (opt->wizard) { // mode wizard
- forbidden_url=0;
+ case 7: // everywhere!!
+ if (opt->wizard) { // mode wizard
+ forbidden_url = 0;
break;
}
- } // switch
-
+ } // switch
+
// ANCIENNE POS -- récupérer les liens à côtés d'un lien (nearlink)
-
- } // fin test adresse identique/différente
+
+ } // fin test adresse identique/différente
// -------------------- PHASE 3 --------------------
// récupérer les liens à côtés d'un lien (nearlink) (nvelle pos)
if (forbidden_url != 0 && opt->nearlink) {
- if (!ishtml(opt,fil)) { // non html
+ if (!ishtml(opt, fil)) { // non html
//printf("ok %s%s\n",ad,fil);
- forbidden_url=0; // autoriser
- may_set_prio_to=1+1; // set prio to 1 (parse but skip urls) if near is the winner
- hts_log_print(opt, LOG_DEBUG, "near link authorized: %s%s",adr,fil);
+ forbidden_url = 0; // autoriser
+ may_set_prio_to = 1 + 1; // set prio to 1 (parse but skip urls) if near is the winner
+ hts_log_print(opt, LOG_DEBUG, "near link authorized: %s%s", adr, fil);
}
}
-
// -------------------- PHASE 3-BIS --------------------
- /* Built-in known tags (<img src=..>, ..) */
- if (forbidden_url != 0 && embedded_triggered) {
- forbidden_url=0; // autoriser
- may_set_prio_to=1+1; // set prio to 1 (parse but skip urls) if near is the winner
- hts_log_print(opt, LOG_DEBUG, "near link authorized (friendly tag): %s%s",adr,fil);
- }
-
+ /* Built-in known tags (<img src=..>, ..) */
+ if (forbidden_url != 0 && embedded_triggered) {
+ forbidden_url = 0; // autoriser
+ may_set_prio_to = 1 + 1; // set prio to 1 (parse but skip urls) if near is the winner
+ hts_log_print(opt, LOG_DEBUG, "near link authorized (friendly tag): %s%s",
+ adr, fil);
+ }
// -------------------- PHASE 4 --------------------
-
+
// ------------------------------------------------------
// Si wizard, il se peut qu'on autorise ou qu'on interdise
// un lien spécial avant même de tester sa position, sa hiérarchie etc.
// peut court-circuiter le forbidden_url précédent
- if (opt->wizard) { // le wizard entre en action..
+ if (opt->wizard) { // le wizard entre en action..
//
- int question=1; // poser une question
- int force_mirror=0; // pour mirror links
- int filters_answer=0; // décision prise par les filtres
- char BIGSTK l[HTS_URLMAXSIZE*2];
- char BIGSTK lfull[HTS_URLMAXSIZE*2];
-
- if (forbidden_url!=-1) question=0; // pas de question, résolu
-
+ int question = 1; // poser une question
+ int force_mirror = 0; // pour mirror links
+ int filters_answer = 0; // décision prise par les filtres
+ char BIGSTK l[HTS_URLMAXSIZE * 2];
+ char BIGSTK lfull[HTS_URLMAXSIZE * 2];
+
+ if (forbidden_url != -1)
+ question = 0; // pas de question, résolu
+
// former URL complète du lien actuel
- strcpybuff(l,jump_identification(adr));
- if (*fil!='/') strcatbuff(l,"/");
- strcatbuff(l,fil);
+ strcpybuff(l, jump_identification(adr));
+ if (*fil != '/')
+ strcatbuff(l, "/");
+ strcatbuff(l, fil);
// full version (http://foo:bar@www.foo.com/bar.html)
if (!link_has_authority(adr))
- strcpybuff(lfull,"http://");
+ strcpybuff(lfull, "http://");
else
- lfull[0]='\0';
- strcatbuff(lfull,adr);
- if (*fil!='/') strcatbuff(lfull,"/");
- strcatbuff(lfull,fil);
-
+ lfull[0] = '\0';
+ strcatbuff(lfull, adr);
+ if (*fil != '/')
+ strcatbuff(lfull, "/");
+ strcatbuff(lfull, fil);
+
// tester filters (URLs autorisées ou interdites explicitement)
-
+
// si lien primaire on saute le joker, on est pas lémur
- if (ptr==0) { // lien primaire, autoriser
- question=1; // la question sera résolue automatiquement
- forbidden_url=0;
- may_set_prio_to=0; // clear may-set flag
+ if (ptr == 0) { // lien primaire, autoriser
+ question = 1; // la question sera résolue automatiquement
+ forbidden_url = 0;
+ may_set_prio_to = 0; // clear may-set flag
} else {
// eternal depth first
// vérifier récursivité extérieure
- if (opt->extdepth>0) {
- if ( /*question && */ (ptr>0) && (!force_mirror)) {
+ if (opt->extdepth > 0) {
+ if ( /*question && */ (ptr > 0) && (!force_mirror)) {
// well, this is kinda a hak
// we don't want to mirror EVERYTHING, and we have to decide where to stop
// there is no way yet to tag "external" links, and therefore links that are
@@ -475,320 +497,365 @@ static int hts_acceptlink_(httrackp* opt,
if (liens[ptr]->depth > opt->extdepth) {
// *set_prio_to = opt->extdepth + 1;
*set_prio_to = 1 + (opt->extdepth);
- may_set_prio_to=0; // clear may-set flag
- forbidden_url=0; // autorisé
- question=0; // résolution auto
+ may_set_prio_to = 0; // clear may-set flag
+ forbidden_url = 0; // autorisé
+ question = 0; // résolution auto
if (question) {
- hts_log_print(opt, LOG_DEBUG, "(wizard) ambiguous link accepted (external depth): link %s at %s%s",l,urladr,urlfil);
+ hts_log_print(opt, LOG_DEBUG,
+ "(wizard) ambiguous link accepted (external depth): link %s at %s%s",
+ l, urladr, urlfil);
} else {
- hts_log_print(opt, LOG_DEBUG, "(wizard) forced to accept link (external depth): link %s at %s%s",l,urladr,urlfil);
+ hts_log_print(opt, LOG_DEBUG,
+ "(wizard) forced to accept link (external depth): link %s at %s%s",
+ l, urladr, urlfil);
}
-
+
}
}
- }
-
+ }
// filters
{
int jok;
- char* mdepth="";
+ char *mdepth = "";
+
// filters, 0=sait pas 1=ok -1=interdit
{
- int jokDepth1=0,jokDepth2=0;
- int jok1=0,jok2=0;
- jok1 = fa_strjoker(/*url*/0, _FILTERS,*_FILTERS_PTR,lfull,NULL,NULL,&jokDepth1);
- jok2 = fa_strjoker(/*url*/0, _FILTERS,*_FILTERS_PTR,l, NULL,NULL,&jokDepth2);
+ int jokDepth1 = 0, jokDepth2 = 0;
+ int jok1 = 0, jok2 = 0;
+
+ jok1 =
+ fa_strjoker( /*url */ 0, _FILTERS, *_FILTERS_PTR, lfull, NULL, NULL,
+ &jokDepth1);
+ jok2 =
+ fa_strjoker( /*url */ 0, _FILTERS, *_FILTERS_PTR, l, NULL, NULL,
+ &jokDepth2);
if (jok2 == 0) { // #2 doesn't know
- jok = jok1; // then, use #1
+ jok = jok1; // then, use #1
mdepth = _FILTERS[jokDepth1];
- } else if (jok1 == 0) { // #1 doesn't know
- jok = jok2; // then, use #2
+ } else if (jok1 == 0) { // #1 doesn't know
+ jok = jok2; // then, use #2
mdepth = _FILTERS[jokDepth2];
- } else if (jokDepth1 >= jokDepth2) { // #1 matching rule is "after" #2, then it is prioritary
+ } else if (jokDepth1 >= jokDepth2) { // #1 matching rule is "after" #2, then it is prioritary
jok = jok1;
mdepth = _FILTERS[jokDepth1];
- } else { // #2 matching rule is "after" #1, then it is prioritary
+ } else { // #2 matching rule is "after" #1, then it is prioritary
jok = jok2;
mdepth = _FILTERS[jokDepth2];
}
}
-
- if (jok == 1) { // autorisé
- filters_answer=1; // décision prise par les filtres
- question=0; // ne pas poser de question, autorisé
- forbidden_url=0; // URL autorisée
- may_set_prio_to=0; // clear may-set flag
- hts_log_print(opt, LOG_DEBUG, "(wizard) explicit authorized (%s) link: link %s at %s%s",mdepth,l,urladr,urlfil);
- } else if (jok == -1) { // forbidden
- filters_answer=1; // décision prise par les filtres
- question=0; // ne pas poser de question:
- forbidden_url=1; // URL interdite
- hts_log_print(opt, LOG_DEBUG, "(wizard) explicit forbidden (%s) link: link %s at %s%s",mdepth,l,urladr,urlfil);
- } // sinon on touche à rien
+
+ if (jok == 1) { // autorisé
+ filters_answer = 1; // décision prise par les filtres
+ question = 0; // ne pas poser de question, autorisé
+ forbidden_url = 0; // URL autorisée
+ may_set_prio_to = 0; // clear may-set flag
+ hts_log_print(opt, LOG_DEBUG,
+ "(wizard) explicit authorized (%s) link: link %s at %s%s",
+ mdepth, l, urladr, urlfil);
+ } else if (jok == -1) { // forbidden
+ filters_answer = 1; // décision prise par les filtres
+ question = 0; // ne pas poser de question:
+ forbidden_url = 1; // URL interdite
+ hts_log_print(opt, LOG_DEBUG,
+ "(wizard) explicit forbidden (%s) link: link %s at %s%s",
+ mdepth, l, urladr, urlfil);
+ } // sinon on touche à rien
}
}
-
+
// vérifier mode mirror links
if (question) {
- if (opt->mirror_first_page) { // mode mirror links
- if (liens[ptr]->precedent==0) { // parent=primary!
- forbidden_url=0; // autorisé
- may_set_prio_to=0; // clear may-set flag
- question=1; // résolution auto
- force_mirror=5; // mirror (5)
- hts_log_print(opt, LOG_DEBUG, "(wizard) explicit mirror link: link %s at %s%s",l,urladr,urlfil);
+ if (opt->mirror_first_page) { // mode mirror links
+ if (liens[ptr]->precedent == 0) { // parent=primary!
+ forbidden_url = 0; // autorisé
+ may_set_prio_to = 0; // clear may-set flag
+ question = 1; // résolution auto
+ force_mirror = 5; // mirror (5)
+ hts_log_print(opt, LOG_DEBUG,
+ "(wizard) explicit mirror link: link %s at %s%s", l,
+ urladr, urlfil);
}
}
}
-
// on doit poser la question.. peut on la poser?
// (oui je sais quel preuve de délicatesse, merci merci)
- if ((question) && (ptr>0) && (!force_mirror)) {
- if (opt->wizard==2) { // éliminer tous les liens non répertoriés comme autorisés (ou inconnus)
- question=0;
- forbidden_url=1;
- hts_log_print(opt, LOG_DEBUG, "(wizard) ambiguous forbidden link: link %s at %s%s",l,urladr,urlfil);
+ if ((question) && (ptr > 0) && (!force_mirror)) {
+ if (opt->wizard == 2) { // éliminer tous les liens non répertoriés comme autorisés (ou inconnus)
+ question = 0;
+ forbidden_url = 1;
+ hts_log_print(opt, LOG_DEBUG,
+ "(wizard) ambiguous forbidden link: link %s at %s%s", l,
+ urladr, urlfil);
}
}
-
// vérifier robots.txt
if (opt->robots) {
- int r = checkrobots(_ROBOTS,adr,fil);
- if (r == -1) { // interdiction
+ int r = checkrobots(_ROBOTS, adr, fil);
+
+ if (r == -1) { // interdiction
#if DEBUG_ROBOTS
- printf("robots.txt forbidden: %s%s\n",adr,fil);
+ printf("robots.txt forbidden: %s%s\n", adr, fil);
#endif
// question résolue, par les filtres, et mode robot non strict
- if ((!question) && (filters_answer) && (opt->robots == 1) && (forbidden_url!=1)) {
- r=0; // annuler interdiction des robots
+ if ((!question) && (filters_answer) && (opt->robots == 1)
+ && (forbidden_url != 1)) {
+ r = 0; // annuler interdiction des robots
if (!forbidden_url) {
- hts_log_print(opt, LOG_DEBUG, "Warning link followed against robots.txt: link %s at %s%s",l,adr,fil);
+ hts_log_print(opt, LOG_DEBUG,
+ "Warning link followed against robots.txt: link %s at %s%s",
+ l, adr, fil);
}
}
- if (r == -1) { // interdire
- forbidden_url=1;
- question=0;
- hts_log_print(opt, LOG_DEBUG, "(robots.txt) forbidden link: link %s at %s%s",l,adr,fil);
+ if (r == -1) { // interdire
+ forbidden_url = 1;
+ question = 0;
+ hts_log_print(opt, LOG_DEBUG,
+ "(robots.txt) forbidden link: link %s at %s%s", l, adr,
+ fil);
}
}
}
-
+
if (!question) {
if (!forbidden_url) {
- hts_log_print(opt, LOG_DEBUG, "(wizard) shared foreign domain link: link %s at %s%s",l,urladr,urlfil);
+ hts_log_print(opt, LOG_DEBUG,
+ "(wizard) shared foreign domain link: link %s at %s%s", l,
+ urladr, urlfil);
} else {
- hts_log_print(opt, LOG_DEBUG, "(wizard) cancelled foreign domain link: link %s at %s%s",l,urladr,urlfil);
+ hts_log_print(opt, LOG_DEBUG,
+ "(wizard) cancelled foreign domain link: link %s at %s%s",
+ l, urladr, urlfil);
}
#if BDEBUG==3
- printf("at %s in %s, wizard says: url %s ",urladr,urlfil,l);
- if (forbidden_url) printf("cancelled"); else printf(">SHARED<");
+ printf("at %s in %s, wizard says: url %s ", urladr, urlfil, l);
+ if (forbidden_url)
+ printf("cancelled");
+ else
+ printf(">SHARED<");
printf("\n");
-#endif
+#endif
}
/* en cas de question, ou lien primaire (enregistrer autorisations) */
- if (question || (ptr==0)) {
- const char* s;
- int n=0;
-
+ if (question || (ptr == 0)) {
+ const char *s;
+ int n = 0;
+
// si primaire (plus bas) alors ...
- if ((ptr!=0) && (force_mirror==0)) {
- char BIGSTK tempo[HTS_URLMAXSIZE*2];
- tempo[0]='\0';
- strcatbuff(tempo,adr);
- strcatbuff(tempo,fil);
+ if ((ptr != 0) && (force_mirror == 0)) {
+ char BIGSTK tempo[HTS_URLMAXSIZE * 2];
+
+ tempo[0] = '\0';
+ strcatbuff(tempo, adr);
+ strcatbuff(tempo, fil);
s = RUN_CALLBACK1(opt, query3, tempo);
- if (strnotempty(s)==0) // entrée
- n=0;
- else if (isdigit((unsigned char)*s))
- sscanf(s,"%d",&n);
- else {
- switch(*s) {
- case '*': n=-1; break;
- case '!': n=-999; {
+ if (strnotempty(s) == 0) // entrée
+ n = 0;
+ else if (isdigit((unsigned char) *s))
+ sscanf(s, "%d", &n);
+ else {
+ switch (*s) {
+ case '*':
+ n = -1;
+ break;
+ case '!':
+ n = -999; {
/*char *a;
- int i;
- a=copie_de_adr-128;
- if (a<r.adr) a=r.adr;
- for(i=0;i<256;i++) {
- if (a==copie_de_adr) printf("\nHERE:\n");
- printf("%c",*a++);
- }
- printf("\n\n");
- */
- }
- break;
- default: n=-999; printf("What did you say?\n"); break;
-
- }
+ int i;
+ a=copie_de_adr-128;
+ if (a<r.adr) a=r.adr;
+ for(i=0;i<256;i++) {
+ if (a==copie_de_adr) printf("\nHERE:\n");
+ printf("%c",*a++);
+ }
+ printf("\n\n");
+ */
+ }
+ break;
+ default:
+ n = -999;
+ printf("What did you say?\n");
+ break;
+
}
+ }
io_flush;
- } else { // lien primaire: autoriser répertoire entier
+ } else { // lien primaire: autoriser répertoire entier
if (!force_mirror) {
- if ((opt->seeker & 1)==0) { // interdiction de descendre
- n=7;
+ if ((opt->seeker & 1) == 0) { // interdiction de descendre
+ n = 7;
} else {
- n=5; // autoriser miroir répertoires descendants (lien primaire)
+ n = 5; // autoriser miroir répertoires descendants (lien primaire)
}
- } else // forcer valeur (sub-wizard)
- n=force_mirror;
+ } else // forcer valeur (sub-wizard)
+ n = force_mirror;
}
-
+
/* sanity check - reallocate filters HERE */
if ((*_FILTERS_PTR) + 1 >= opt->maxfilter) {
opt->maxfilter += HTS_FILTERSINC;
if (filters_init(&_FILTERS, opt->maxfilter, HTS_FILTERSINC) == 0) {
- printf("PANIC! : Too many filters : >%d [%d]\n", (*_FILTERS_PTR),__LINE__);
+ printf("PANIC! : Too many filters : >%d [%d]\n", (*_FILTERS_PTR),
+ __LINE__);
fflush(stdout);
- hts_log_print(opt, LOG_PANIC, "Too many filters, giving up..(>%d)", (*_FILTERS_PTR) );
- hts_log_print(opt, LOG_INFO, "To avoid that: use #F option for more filters (example: -#F5000)");
- assertf("too many filters - giving up" == NULL); // wild..
+ hts_log_print(opt, LOG_PANIC, "Too many filters, giving up..(>%d)",
+ (*_FILTERS_PTR));
+ hts_log_print(opt, LOG_INFO,
+ "To avoid that: use #F option for more filters (example: -#F5000)");
+ assertf("too many filters - giving up" == NULL); // wild..
}
}
-
// here we have enough room for a new filter if necessary
- switch(n) {
- case -1: // sauter tout le reste
- forbidden_url=1;
- opt->wizard=2; // sauter tout le reste
+ switch (n) {
+ case -1: // sauter tout le reste
+ forbidden_url = 1;
+ opt->wizard = 2; // sauter tout le reste
break;
- case 0: // interdire les mêmes liens: adr/fil
- forbidden_url=1;
- HT_INSERT_FILTERS0; // insérer en 0
- strcpybuff(_FILTERS[0],"-");
- strcatbuff(_FILTERS[0],jump_identification(adr));
- if (*fil!='/') strcatbuff(_FILTERS[0],"/");
- strcatbuff(_FILTERS[0],fil);
+ case 0: // interdire les mêmes liens: adr/fil
+ forbidden_url = 1;
+ HT_INSERT_FILTERS0; // insérer en 0
+ strcpybuff(_FILTERS[0], "-");
+ strcatbuff(_FILTERS[0], jump_identification(adr));
+ if (*fil != '/')
+ strcatbuff(_FILTERS[0], "/");
+ strcatbuff(_FILTERS[0], fil);
break;
-
- case 1: // éliminer répertoire entier et sous rép: adr/path/ *
- forbidden_url=1;
+
+ case 1: // éliminer répertoire entier et sous rép: adr/path/ *
+ forbidden_url = 1;
{
- size_t i = strlen(fil)-1;
- while((fil[i]!='/') && (i>0)) i--;
- if (fil[i]=='/') {
- HT_INSERT_FILTERS0; // insérer en 0
- strcpybuff(_FILTERS[0],"-");
- strcatbuff(_FILTERS[0],jump_identification(adr));
- if (*fil!='/') strcatbuff(_FILTERS[0],"/");
- strncatbuff(_FILTERS[0] ,fil,i);
- if (_FILTERS[0][strlen(_FILTERS[0])-1]!='/')
- strcatbuff(_FILTERS[0],"/");
- strcatbuff(_FILTERS[0],"*");
+ size_t i = strlen(fil) - 1;
+
+ while((fil[i] != '/') && (i > 0))
+ i--;
+ if (fil[i] == '/') {
+ HT_INSERT_FILTERS0; // insérer en 0
+ strcpybuff(_FILTERS[0], "-");
+ strcatbuff(_FILTERS[0], jump_identification(adr));
+ if (*fil != '/')
+ strcatbuff(_FILTERS[0], "/");
+ strncatbuff(_FILTERS[0], fil, i);
+ if (_FILTERS[0][strlen(_FILTERS[0]) - 1] != '/')
+ strcatbuff(_FILTERS[0], "/");
+ strcatbuff(_FILTERS[0], "*");
}
- }
-
+ }
+
// ** ...
break;
-
- case 2: // adresse adr*
- forbidden_url=1;
- HT_INSERT_FILTERS0; // insérer en 0
- strcpybuff(_FILTERS[0],"-");
- strcatbuff(_FILTERS[0],jump_identification(adr));
- strcatbuff(_FILTERS[0],"*");
+
+ case 2: // adresse adr*
+ forbidden_url = 1;
+ HT_INSERT_FILTERS0; // insérer en 0
+ strcpybuff(_FILTERS[0], "-");
+ strcatbuff(_FILTERS[0], jump_identification(adr));
+ strcatbuff(_FILTERS[0], "*");
break;
-
- case 3: // ** A FAIRE
- forbidden_url=1;
+
+ case 3: // ** A FAIRE
+ forbidden_url = 1;
/*
- {
- int i=strlen(adr)-1;
- while((adr[i]!='/') && (i>0)) i--;
- if (i>0) {
-
- }
-
- }*/
-
+ {
+ int i=strlen(adr)-1;
+ while((adr[i]!='/') && (i>0)) i--;
+ if (i>0) {
+
+ }
+
+ } */
+
break;
//
- case 4: // same link
+ case 4: // same link
// PAS BESOIN!!
/*HT_INSERT_FILTERS0; // insérer en 0
- strcpybuff(_FILTERS[0],"+");
- strcatbuff(_FILTERS[0],adr);
- if (*fil!='/') strcatbuff(_FILTERS[0],"/");
- strcatbuff(_FILTERS[0],fil);*/
-
-
+ strcpybuff(_FILTERS[0],"+");
+ strcatbuff(_FILTERS[0],adr);
+ if (*fil!='/') strcatbuff(_FILTERS[0],"/");
+ strcatbuff(_FILTERS[0],fil); */
+
// étant donné le renversement wizard/primary filter (les primary autorisent up/down ET interdisent)
// il faut éviter d'un lien isolé effectue un miroir total..
-
- *set_prio_to = 0+1; // niveau de récursion=0 (pas de miroir)
-
+
+ *set_prio_to = 0 + 1; // niveau de récursion=0 (pas de miroir)
+
break;
-
- case 5: // autoriser répertoire entier et fils
- if ((opt->seeker & 2)==0) { // interdiction de monter
- size_t i = strlen(fil)-1;
- while((fil[i]!='/') && (i>0)) i--;
- if (fil[i]=='/') {
- HT_INSERT_FILTERS0; // insérer en 0
- strcpybuff(_FILTERS[0],"+");
- strcatbuff(_FILTERS[0],jump_identification(adr));
- if (*fil!='/') strcatbuff(_FILTERS[0],"/");
- strncatbuff(_FILTERS[0],fil,i+1);
- strcatbuff(_FILTERS[0],"*");
+
+ case 5: // autoriser répertoire entier et fils
+ if ((opt->seeker & 2) == 0) { // interdiction de monter
+ size_t i = strlen(fil) - 1;
+
+ while((fil[i] != '/') && (i > 0))
+ i--;
+ if (fil[i] == '/') {
+ HT_INSERT_FILTERS0; // insérer en 0
+ strcpybuff(_FILTERS[0], "+");
+ strcatbuff(_FILTERS[0], jump_identification(adr));
+ if (*fil != '/')
+ strcatbuff(_FILTERS[0], "/");
+ strncatbuff(_FILTERS[0], fil, i + 1);
+ strcatbuff(_FILTERS[0], "*");
}
- } else { // autoriser domaine alors!!
- HT_INSERT_FILTERS0; // insérer en 0 strcpybuff(filters[filptr],"+");
- strcpybuff(_FILTERS[0],"+");
- strcatbuff(_FILTERS[0],jump_identification(adr));
- strcatbuff(_FILTERS[0],"*");
+ } else { // autoriser domaine alors!!
+ HT_INSERT_FILTERS0; // insérer en 0 strcpybuff(filters[filptr],"+");
+ strcpybuff(_FILTERS[0], "+");
+ strcatbuff(_FILTERS[0], jump_identification(adr));
+ strcatbuff(_FILTERS[0], "*");
}
break;
-
- case 6: // same domain
- HT_INSERT_FILTERS0; // insérer en 0 strcpybuff(filters[filptr],"+");
- strcpybuff(_FILTERS[0],"+");
- strcatbuff(_FILTERS[0],jump_identification(adr));
- strcatbuff(_FILTERS[0],"*");
+
+ case 6: // same domain
+ HT_INSERT_FILTERS0; // insérer en 0 strcpybuff(filters[filptr],"+");
+ strcpybuff(_FILTERS[0], "+");
+ strcatbuff(_FILTERS[0], jump_identification(adr));
+ strcatbuff(_FILTERS[0], "*");
break;
//
- case 7: // autoriser ce répertoire
+ case 7: // autoriser ce répertoire
{
- size_t i = strlen(fil)-1;
- while((fil[i]!='/') && (i>0)) i--;
- if (fil[i]=='/') {
- HT_INSERT_FILTERS0; // insérer en 0
- strcpybuff(_FILTERS[0],"+");
- strcatbuff(_FILTERS[0],jump_identification(adr));
- if (*fil!='/') strcatbuff(_FILTERS[0],"/");
- strncatbuff(_FILTERS[0],fil,i+1);
- strcatbuff(_FILTERS[0],"*[file]");
+ size_t i = strlen(fil) - 1;
+
+ while((fil[i] != '/') && (i > 0))
+ i--;
+ if (fil[i] == '/') {
+ HT_INSERT_FILTERS0; // insérer en 0
+ strcpybuff(_FILTERS[0], "+");
+ strcatbuff(_FILTERS[0], jump_identification(adr));
+ if (*fil != '/')
+ strcatbuff(_FILTERS[0], "/");
+ strncatbuff(_FILTERS[0], fil, i + 1);
+ strcatbuff(_FILTERS[0], "*[file]");
}
}
-
+
break;
-
- case 50: // on fait rien
+
+ case 50: // on fait rien
break;
- } // switch
-
- } // test du wizard sur l'url
- } // fin du test wizard..
+ } // switch
+
+ } // test du wizard sur l'url
+ } // fin du test wizard..
// -------------------- PHASE 5 --------------------
// lien non autorisé, peut-on juste le tester?
if (just_test_it) {
- if (forbidden_url==1) {
- if (opt->travel&256) { // tester tout de même
- if (strfield(adr,"ftp://")==0
+ if (forbidden_url == 1) {
+ if (opt->travel & 256) { // tester tout de même
+ if (strfield(adr, "ftp://") == 0
#if HTS_USEMMS
- && strfield(adr,"mms://")==0
+ && strfield(adr, "mms://") == 0
#endif
- ) { // PAS ftp!
- forbidden_url=1; // oui oui toujours interdit (note: sert à rien car ==1 mais c pour comprendre)
- *just_test_it=1; // mais on teste
- hts_log_print(opt, LOG_DEBUG, "Testing link %s%s",adr,fil);
+ ) { // PAS ftp!
+ forbidden_url = 1; // oui oui toujours interdit (note: sert à rien car ==1 mais c pour comprendre)
+ *just_test_it = 1; // mais on teste
+ hts_log_print(opt, LOG_DEBUG, "Testing link %s%s", adr, fil);
}
}
}
//adr[0]='\0'; // cancel
}
-
// -------------------- FINAL PHASE --------------------
// Test if the "Near" test won
if (may_set_prio_to && forbidden_url == 0) {
@@ -801,38 +868,42 @@ static int hts_acceptlink_(httrackp* opt,
#undef _ROBOTS
}
-int hts_acceptmime(httrackp* opt,
- int ptr,int lien_tot,lien_url** liens,
- char* adr,char* fil,
- char* mime)
-{
+int hts_acceptmime(httrackp * opt, int ptr, int lien_tot, lien_url ** liens,
+ char *adr, char *fil, char *mime) {
#define _FILTERS (*opt->filters.filters)
#define _FILTERS_PTR (opt->filters.filptr)
#define _ROBOTS ((robots_wizard*)opt->robotsptr)
int forbidden_url = -1;
- char* mdepth="";
+ char *mdepth = "";
int jokDepth = 0;
int jok = 0;
/* Authorized ? */
- jok = fa_strjoker(/*mime*/1, _FILTERS, *_FILTERS_PTR, mime, NULL, NULL, &jokDepth);
+ jok =
+ fa_strjoker( /*mime */ 1, _FILTERS, *_FILTERS_PTR, mime, NULL, NULL,
+ &jokDepth);
if (jok != 0) {
mdepth = _FILTERS[jokDepth];
- if (jok == 1) { // autorisé
- forbidden_url=0; // URL autorisée
- hts_log_print(opt, LOG_DEBUG, "(wizard) explicit authorized (%s) link %s%s: mime '%s'",mdepth,adr,fil,mime);
- } else if (jok == -1) { // forbidden
- forbidden_url=1; // URL interdite
- hts_log_print(opt, LOG_DEBUG, "(wizard) explicit forbidden (%s) link %s%s: mime '%s'",mdepth,adr,fil,mime);
- } // sinon on touche à rien
+ if (jok == 1) { // autorisé
+ forbidden_url = 0; // URL autorisée
+ hts_log_print(opt, LOG_DEBUG,
+ "(wizard) explicit authorized (%s) link %s%s: mime '%s'",
+ mdepth, adr, fil, mime);
+ } else if (jok == -1) { // forbidden
+ forbidden_url = 1; // URL interdite
+ hts_log_print(opt, LOG_DEBUG,
+ "(wizard) explicit forbidden (%s) link %s%s: mime '%s'",
+ mdepth, adr, fil, mime);
+ } // sinon on touche à rien
}
/* userdef test */
- {
- int test_url = RUN_CALLBACK4(opt, check_mime, adr, fil, mime, forbidden_url);
- if (test_url!=-1) {
- forbidden_url=test_url;
+ {
+ int test_url =
+ RUN_CALLBACK4(opt, check_mime, adr, fil, mime, forbidden_url);
+ if (test_url != -1) {
+ forbidden_url = test_url;
}
- }
+ }
return forbidden_url;
#undef _FILTERS
#undef _FILTERS_PTR
@@ -840,66 +911,77 @@ int hts_acceptmime(httrackp* opt,
}
// tester taille
-int hts_testlinksize(httrackp* opt,
- char* adr,char* fil,
- LLint size) {
- int jok=0;
- if (size>=0) {
- char BIGSTK l[HTS_URLMAXSIZE*2];
- char BIGSTK lfull[HTS_URLMAXSIZE*2];
- if (size>=0) {
- LLint sz=size;
- int size_flag=0;
-
+int hts_testlinksize(httrackp * opt, char *adr, char *fil, LLint size) {
+ int jok = 0;
+
+ if (size >= 0) {
+ char BIGSTK l[HTS_URLMAXSIZE * 2];
+ char BIGSTK lfull[HTS_URLMAXSIZE * 2];
+
+ if (size >= 0) {
+ LLint sz = size;
+ int size_flag = 0;
+
// former URL complète du lien actuel
- strcpybuff(l,jump_identification(adr));
- if (*fil!='/') strcatbuff(l,"/");
- strcatbuff(l,fil);
+ strcpybuff(l, jump_identification(adr));
+ if (*fil != '/')
+ strcatbuff(l, "/");
+ strcatbuff(l, fil);
//
if (!link_has_authority(adr))
- strcpybuff(lfull,"http://");
+ strcpybuff(lfull, "http://");
else
- lfull[0]='\0';
- strcatbuff(lfull,adr);
- if (*fil!='/') strcatbuff(l,"/");
- strcatbuff(lfull,fil);
-
+ lfull[0] = '\0';
+ strcatbuff(lfull, adr);
+ if (*fil != '/')
+ strcatbuff(l, "/");
+ strcatbuff(lfull, fil);
+
// filters, 0=sait pas 1=ok -1=interdit
{
- int jokDepth1=0,jokDepth2=0;
- int jok1=0,jok2=0;
- LLint sz1=size,sz2=size;
- int size_flag1=0,size_flag2=0;
- jok1 = fa_strjoker(/*url*/0, *opt->filters.filters,*opt->filters.filptr,lfull,&sz1,&size_flag1,&jokDepth1);
- jok2 = fa_strjoker(/*url*/0, *opt->filters.filters,*opt->filters.filptr,l, &sz2,&size_flag2,&jokDepth2);
- if (jok2 == 0) { // #2 doesn't know
- jok = jok1; // then, use #1
+ int jokDepth1 = 0, jokDepth2 = 0;
+ int jok1 = 0, jok2 = 0;
+ LLint sz1 = size, sz2 = size;
+ int size_flag1 = 0, size_flag2 = 0;
+
+ jok1 =
+ fa_strjoker( /*url */ 0, *opt->filters.filters, *opt->filters.filptr,
+ lfull, &sz1, &size_flag1, &jokDepth1);
+ jok2 =
+ fa_strjoker( /*url */ 0, *opt->filters.filters, *opt->filters.filptr,
+ l, &sz2, &size_flag2, &jokDepth2);
+ if (jok2 == 0) { // #2 doesn't know
+ jok = jok1; // then, use #1
sz = sz1;
size_flag = size_flag1;
- } else if (jok1 == 0) { // #1 doesn't know
- jok = jok2; // then, use #2
+ } else if (jok1 == 0) { // #1 doesn't know
+ jok = jok2; // then, use #2
sz = sz2;
size_flag = size_flag2;
- } else if (jokDepth1 >= jokDepth2) { // #1 matching rule is "after" #2, then it is prioritary
+ } else if (jokDepth1 >= jokDepth2) { // #1 matching rule is "after" #2, then it is prioritary
jok = jok1;
sz = sz1;
size_flag = size_flag1;
- } else { // #2 matching rule is "after" #1, then it is prioritary
+ } else { // #2 matching rule is "after" #1, then it is prioritary
jok = jok2;
sz = sz2;
size_flag = size_flag2;
- }
+ }
}
-
// log
- if (jok==1) {
- hts_log_print(opt, LOG_DEBUG, "File confirmed (size test): %s%s ("LLintP")",adr,fil,(LLint)(size));
- } else if (jok==-1) {
+ if (jok == 1) {
+ hts_log_print(opt, LOG_DEBUG,
+ "File confirmed (size test): %s%s (" LLintP ")", adr, fil,
+ (LLint) (size));
+ } else if (jok == -1) {
if (size_flag) { /* interdit à cause de la taille */
- hts_log_print(opt, LOG_DEBUG, "File cancelled due to its size: %s%s ("LLintP", limit: "LLintP")",adr,fil,(LLint)(size),(LLint)(sz));
+ hts_log_print(opt, LOG_DEBUG,
+ "File cancelled due to its size: %s%s (" LLintP
+ ", limit: " LLintP ")", adr, fil, (LLint) (size),
+ (LLint) (sz));
} else {
- jok=1;
+ jok = 1;
}
}
}
@@ -911,4 +993,3 @@ int hts_testlinksize(httrackp* opt,
#undef urlfil
#undef HT_INSERT_FILTERS0
-