summaryrefslogtreecommitdiff
path: root/src/htscoremain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/htscoremain.c')
-rw-r--r--src/htscoremain.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/htscoremain.c b/src/htscoremain.c
index 1ca82e8..e5af672 100644
--- a/src/htscoremain.c
+++ b/src/htscoremain.c
@@ -2007,8 +2007,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
cache.hashtable = (void *) cache_hashtable; /* copy backcache hash */
cache.ro = 1; /* read only */
if (cache.hashtable) {
- char BIGSTK adr[HTS_URLMAXSIZE * 2];
- char BIGSTK fil[HTS_URLMAXSIZE * 2];
+ lien_adrfilsave afs;
char BIGSTK url[HTS_URLMAXSIZE * 2];
char linepos[256];
int pos;
@@ -2031,52 +2030,50 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
/* */
a++;
/* read "host/file" */
- a += binput(a, adr, HTS_URLMAXSIZE);
- a += binput(a, fil, HTS_URLMAXSIZE);
+ a += binput(a, afs.af.adr, HTS_URLMAXSIZE);
+ a += binput(a, afs.af.fil, HTS_URLMAXSIZE);
url[0] = '\0';
- if (!link_has_authority(adr))
+ if (!link_has_authority(afs.af.adr))
strcatbuff(url, "http://");
- strcatbuff(url, adr);
- strcatbuff(url, fil);
+ strcatbuff(url, afs.af.adr);
+ strcatbuff(url, afs.af.fil);
/* read position */
a += binput(a, linepos, 200);
sscanf(linepos, "%d", &pos);
if (!hasFilter
|| (strjoker(url, filter, NULL, NULL) != NULL)
) {
- r = cache_read_ro(opt, &cache, adr, fil, "", NULL); // lire entrée cache + data
+ r = cache_read_ro(opt, &cache, afs.af.adr, afs.af.fil, "", NULL); // lire entrée cache + data
if (r.statuscode != -1) { // No errors
found++;
if (!hasFilter) {
fprintf(stdout, "%s%s%s\r\n",
- (link_has_authority(adr)) ? "" :
- "http://", adr, fil);
+ (link_has_authority(afs.af.adr)) ? "" :
+ "http://", afs.af.adr, afs.af.fil);
} else {
char msg[256], cdate[256];
- char BIGSTK sav[HTS_URLMAXSIZE * 2];
infostatuscode(msg, r.statuscode);
time_gmt_rfc822(cdate);
fprintf(stdout, "HTTP/1.1 %d %s\r\n",
r.statuscode, r.msg[0] ? r.msg : msg);
- fprintf(stdout, "X-Host: %s\r\n", adr);
- fprintf(stdout, "X-File: %s\r\n", fil);
+ fprintf(stdout, "X-Host: %s\r\n", afs.af.adr);
+ fprintf(stdout, "X-File: %s\r\n", afs.af.fil);
fprintf(stdout, "X-URL: %s%s%s\r\n",
- (link_has_authority(adr)) ? "" :
- "http://", adr, fil);
+ (link_has_authority(afs.af.adr)) ? "" :
+ "http://", afs.af.adr, afs.af.fil);
if (url_savename
- (adr, fil, sav, /*former_adr */ NULL,
- /*former_fil */ NULL, /*referer_adr */
+ (&afs, /*former */ NULL,
+ /*referer_adr */
NULL, /*referer_fil */ NULL,
- /*opt */ opt, /*liens */ NULL,
- /*lien_tot */ 0, /*sback */ NULL,
+ /*opt */ opt, /*sback */ NULL,
/*cache */ &cache, /*hash */ NULL, /*ptr */
0, /*numero_passe */ 0, /*mime_type */
NULL) != -1) {
- if (fexist(sav)) {
+ if (fexist(afs.save)) {
fprintf(stdout, "Content-location: %s\r\n",
- sav);
+ afs.save);
}
}
fprintf(stdout, "Date: %s\r\n", cdate);