HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: Socket error: what to do ?
Author: Xavier Roche
Date: 01/10/2002 16:50
 
> connections. It sure runs a lot slower then, but I 
> still get the errors.

Ah, I just found 2 errors in htsback.c, files that 
aren't closed properly.

Around line 1889 (>>> = add/change), you have to add 
a 'fclose(fp);' :

}
>>>fclose(fp);
} else {  // Argh.. 
back[i].status=0;  // terminé (voir plus loin)

And in htsback.c, around line 175, you have to replace 
filecreate by a nex filecreateempty function :

if (back[p].tmpfile[0] && back[p].url_sav[0]) {
LLint size;
>>>filecreateempty(back[p].url_sav);      // filenote 
& co
if ((size = hts_zunpack(back[p].tmpfile,back
[p].url_sav))>=0) {

Also and add in htscore.c: (for example before 
the 'int filenote' function)

// create an empty file
int filecreateempty(char* filename) {
  FILE* fp;
  fp=filecreate(filename);      // filenote & co
  if (fp) {
    fclose(fp);
    return 1;
  } else
    return 0; 
}

And in htscore.h: (for example after the 'filecreate' 
definition)

int filecreateempty(char* filename);

This should avoid problems of non-closed files, that 
may be the cause of your problems. (fixed for upcoming 
3.11)
 
Reply Create subthread


All articles

Subject Author Date
Socket error: what to do ?

01/10/2002 10:31
Re: Socket error: what to do ?

01/10/2002 13:29
Re: Socket error: what to do ?

01/10/2002 15:47
Re: Socket error: what to do ?

01/10/2002 16:08
Re: Socket error: what to do ?

01/10/2002 16:50
Re: Socket error: what to do ?

01/11/2002 18:07
Re: Socket error: what to do ?

01/12/2002 09:19




1

Created with FORUM 2.0.11