curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: «--etag-compare» while «--continue-at»

From: Коваленко Анатолий Викторович via curl-users <curl-users_at_cool.haxx.se>
Date: Sat, 9 May 2020 13:09:52 +0300

You asked an example. My script saved (as JSON) history of HTTP-headers while downloading with
breaks of provider's connection.
Page: http://get.opera.com/ftp/pub/opera/desktop/68.0.3618.63/win/
File: http://get.opera.com/ftp/pub/opera/desktop/68.0.3618.63/win/Opera_68.0.3618.63_Setup_x64.exe
Call: curl.exe -C - -D Dump.txt -O -R -y 10 -Y 1024 $HRef

You can see, that changed and restored for a short time (from «05:12:42» to «08:19:29») values of
next parameters:
«ETag» (from «5ea97a29-38b5528» to «5ea97a2a-38b5528» and back);
«Last-Modified» (from «Wed, 29 Apr 2020 12:59:21 GMT» to «Wed, 29 Apr 2020 12:59:22 GMT» and back);
«Content-Type» (from «application/octet-stream» to «application/x-msdos-program»).
The hash (at file Opera_68.0.3618.63_Setup_x64.exe.sha256sum on the same page) was not checked, but
target file was not corrupted after downloading.
Dump 1 ==================================================
        "Date": "Sat, 09 May 2020 05:12:42 GMT",
        "Content-Length": "59462952",
        "ETag": "\"5ea97a29-38b5528\"",
        "Last-Modified": "Wed, 29 Apr 2020 12:59:21 GMT",
        "Content-Type": "application/octet-stream",
        "Connection": "keep-alive",
        "Server": "nginx",
        "КодОтветаСервера": "200",
        "Accept-Ranges": "bytes"
Dump 2 ==================================================
        "Date": "Sat, 09 May 2020 05:27:13 GMT",
        "Content-Length": "56841512",
        "Content-Range": "bytes 2621440-59462951/59462952",
        "ETag": "\"5ea97a29-38b5528\"",
        "Last-Modified": "Wed, 29 Apr 2020 12:59:21 GMT",
        "Content-Type": "application/octet-stream",
        "Connection": "keep-alive",
        "Server": "nginx",
        "КодОтветаСервера": "206"
Dump 3 ==================================================
        "Date": "Sat, 09 May 2020 05:29:10 GMT",
        "Content-Length": "56841512",
        "Content-Range": "bytes 2621440-59462951/59462952",
        "ETag": "\"5ea97a2a-38b5528\"",
        "Last-Modified": "Wed, 29 Apr 2020 12:59:22 GMT",
        "Content-Type": "application/octet-stream",
        "Connection": "keep-alive",
        "Server": "nginx",
        "КодОтветаСервера": "206"
Dump 4 ==================================================
        "Date": "Sat, 09 May 2020 07:04:37 GMT",
        "Content-Length": "34297128",
        "Content-Range": "bytes 25165824-59462951/59462952",
        "ETag": "\"5ea97a29-38b5528\"",
        "Last-Modified": "Wed, 29 Apr 2020 12:59:21 GMT",
        "Content-Type": "application/octet-stream",
        "Connection": "keep-alive",
        "Server": "nginx",
        "КодОтветаСервера": "206"
Dump 5 ==================================================
        "Date": "Sat, 09 May 2020 08:19:29 GMT",
        "Content-Length": "18568488",
        "Content-Range": "bytes 40894464-59462951/59462952",
        "ETag": "\"5ea97a2a-38b5528\"",
        "Last-Modified": "Wed, 29 Apr 2020 12:59:22 GMT",
        "Content-Type": "application/x-msdos-program",
        "Connection": "keep-alive",
        "Server": "nginx",
        "КодОтветаСервера": "206"

> On Sun, 29 Mar 2020, Коваленко Анатолий Викторович via curl-users wrote:

>> When I resume a previous file transfer, I wish to MATCH previous ETag, NOT
>> «If-None-Match», as now. And I hope to see error message to stop my script
>> if ETag not match. Sorry.

> I'm not sure I understand. Can you please show with examples of how you'd want
> it to work compared to how it works now?

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-05-09