| > I want to do this: for a given URL, HEAD request the
> first N bytes, md5sum them, and using this md5sum
> decide whether or not to proceed with a full GET of
> all bytes.
Humm, this isn't a HEAD request, but a regular GET request. (HEAD requests
have no data associated)
I don't think this is something possible, because it would require some
hacking deep in the code ; but in theory the only change would be to download
the first bytes in memory, checksum the file, and decide to disconnect the
socket ending (sparing bandwidth ; only few additional TCP packets would be
sent/received) upon identical checksum.
Note that the current "update hack" include a more basic heuristic: the GET
request is issued, but immediately closed, if the file size is identical to
the previous one. This is probably not less or more safe than checksuming the
first bytes.
| |