-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing ETag compare options for the curl tool #4543
Conversation
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. |
201d4e6
to
700f763
Compare
can someone look at this? |
This happens because you use |
700f763
to
d6c4b88
Compare
This pull request introduces 1 alert when merging d6c4b88 into cba52e2 - view on LGTM.com new alerts:
|
816bf28
to
00ce754
Compare
can look at this again 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Please consider adding a test case or two for next round. They will help to verify that things work as intended, and that there are no leaks etc.
a75a8e1
to
face2b3
Compare
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:
|
face2b3
to
bb9fe41
Compare
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
bb9fe41
to
6a0d7be
Compare
How about now? I see some failed tests but i think its a fault build |
Thanks! |
@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? |
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.
As far as comparing ETag from a file to the one in the header of a request, i don't really know what should be a successful output of a request with compare.
@paulehoffman of @bagder do you have any ideas about the functionality of compare?
Will add more stuff to help and hugehelp later.