| > > - 'receive-header'
> That one isn't included by default, but only if
HTS_ANALYSTE
> is != 0 -- but setting that kills main().
You do NOT have to recompile httrack to plug callbacks!!
The only thing to compile is the very small .c file you
will make using the example provided!
> Can I trust that the htsblk passed to receive-header is
not
> deallocated before the corresponding call to
> transfer-status? Is it perhaps the same htsblk in both
cases?
Yes it is - at least the last htsblk address passed by
receive-header is the same as the transfer-status one.
> How can I get the IP corresponding to the address?
This is not possible yet - but I will add two members to
the htsblk structure:
SOCaddr address; // IP address
int address_size; // IP address structure length
SOCaddr can be either sockaddr_in, sockaddr_in6, or
sockaddr depending on the size
> Where's the actual content passed to transfer-status?
- If the 'adr' member of the htsblk structure is != NULL,
adr is the address of the buffer and 'size' its size (the
htsblk structure is the r member of the lien_back
structure - that is, back->r.adr and back->r.size)
- Else, the 'url_sav' member of the lien_back structure is
the destination file of the stored URL (you'll have to do a
fopen(r->url_sav, "rb") to fetch the file)
Note: lien_back is defined in htscore.h
> Is the size field in lien_back the one sent by the server?
No - this one is 'totalsize'. 'size' is the size 'seen'
(downloaded) by httrack.
There are many other useful things in the structures - ask
me if necessary.
The .h files are a bit messy - I will definitely have to
extract relevant (especiallt htsblk/lien_back structures)
data to put them in a separate file one day.
| |