libevent icon indicating copy to clipboard operation
libevent copied to clipboard

Added evhttp request on free callback

Open jcoffland opened this issue 7 years ago • 4 comments

This adds a callback from evhttp_request_free() that guarantees resources associated with an evhttp_request can be deallocated. I found this necessary because the on complete and on error callbacks are not always called which can lead to memory leaks. This callback makes the resource deallocation explicit.

jcoffland avatar Jan 30 '18 23:01 jcoffland

Coverage Status

Coverage decreased (-0.008%) to 80.539% when pulling 63a61932f5906929fc83370725c83f4ea4c6e7e4 on CauldronDevelopmentLLC:evhttp_request_on_free_cb into f24b28e4aff1dbc3440e283f70ac15aa7cebcc8d on libevent:master.

coveralls avatar Jan 31 '18 03:01 coveralls

This patch is what I want

imay avatar Jun 15 '18 11:06 imay

@azat

Plus this change will need a unit test.

I'm confused as to how to create a unit test in this code base.

Also would you mind to change the documentation to address issues that you found in #589?

Not sure what you mean here.

jcoffland avatar Nov 30 '18 21:11 jcoffland

I'm confused as to how to create a unit test in this code base.

regress_http.c

Not sure what you mean here.

I meant that we need to document order/cases in which callbacks will be called, so that it will be possible to figure this out without looking into sources, and since you adding yet another callback (and I assume that already look into all available callbacks in http and your knowledge was fresh, egh was cause it passed almost year since this pull request had been submitted) I would love to see separate patch that documents this.

azat avatar Dec 02 '18 14:12 azat