Conversation
| user_data_on_write_ = data; | ||
| return CURLE_OK; | ||
| } | ||
| class SingleRequestMockCurlLibrary : public CurlLibrary { |
There was a problem hiding this comment.
This code is moved and renamed from the class MockCurlLibrary that used to be in the TEST_CASE("parse response headers and body"). It's used there and in the new test case.
I also added data members created_handles_, destroyed_handles_, message_result_, and delay_message_.
| // Here are the checks relevant to this test. | ||
| REQUIRE(library.created_handles_.size() == 1); | ||
| REQUIRE(library.created_handles_ == library.destroyed_handles_); |
There was a problem hiding this comment.
The SECTIONs above are all setup. The post-condition, here, is always the same: one handle created and one handle destroyed.
|
I find that "hide whitespace" in the diff gearbox menu improves the diff. |
cgilmour
left a comment
There was a problem hiding this comment.
Seems OK, marking as approved.
Are there any consequences to doing this with a request in-flight?
|
Thanks!
Nope, removing the easy handle from the multi-handle (event loop) unregisters it from anything that would drive its installed callbacks. Then cleaning up the easy handle frees resources. |
See #31.
In addition to the recommended change, this revision also adds unit tests that verify that a CURL handle, once created, is destroyed.