Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Implementing ETag compare options for the curl tool #4543
Implementing code for a feature request #4277
Regarding saving an ETag, I'm gonna be saving only ETag to a file not URLs with it.
Will add more stuff to help and hugehelp later.
Sounds like you're off to a good start!
I would encourage you to write up a test case or two really early on so that you can work on making sure those pass, as then you get the functionality there at the same time as you get a test or two added. The compare operation needs to pass in the given ETag in the HTTP request so that it will be made conditional. I would recommend you make yourself familiar with RFC7232 section 3.2.
As you see, the CI builds fail on test 1139. If you run that locally, check the tests/log/stderr* and stdout* files after the failed test to see what it doesn't like.
This happens because you use
I love the test cases, but I miss one like test case 341 but with an existing file file so that we get an actual Etag match case tested. And then maybe one with a compare that fails to match?
The travis builds find memory leaks.
The appveyor builds warn on this:
removing unnecessary custom files, putting header processing to header callback function Adding new OutStruct for saving ETag to a file, and implementing function for saving adding compare functionality in tool_operate, and waiting for response header callback in tool_cb_hdr testing compare func fixing minor issues with writing, and constructin If-None-Match etag header with different functions adding tmp man pages, + fixing string formatting in etag-compare fix typos in man option definition, import library for strtok_r another fixes to satisfy builds create two new curl tool options to work with etag rewriting man pages, fixing issues mentioned in review fix sscanf width restriction lgtm complaint init local variable, alloc memory for it code pr quality fix fixes after review, adding 2 tests for --etag-save and --etag-compare type fix add new test, fix build errors and leaks type error
@s-3ntinel any particular reason why both options can't be used at once?
It seems like the perfect use case to run in a cronjob, like:
Only update once the etag changes, and if it changes save it again to the output file?