Comments (6)
Hm. It could be that there's another evhttp_request_free somewhere in here happening first. Can you use a debugger or valgrind or something to see where the first call to evhttp_request_free is happening?
from libevent.
A request still in progress when an evhttp_connection
gets freed will get blown away:
https://github.com/libevent/libevent/blob/patches-2.0/http.c#L1142
Is that expected? I'd think that if you used evhttp_request_own
, the user should be the one doing the evhttp_request_free
?
from libevent.
Got started on a pull request to fix this (it fixes the case that the example program above triggers), but I think we should go over the calls to evhttp_request_free
in http.c
and review whether they should be conditional or not (which I could add to this pull request).
from libevent.
Just for my own information: we have made no claims that after evhttp_request_own()
we do further processing on it, correct? in evhtp, the function evhtp_take_ownership()
relinquishes all further processing from the library.
If this is the case, maybe a simple macro for internal use only:
#define evhttp_request_free_(req_) do { \
if ((req_->flags & EVHTTP_USER_OWNED) == 0) { \
evhttp_request_free(req_); \
} } while(0) \
from libevent.
My understanding is that this function only changes the memory ownership (in other words, processing continues, but now the user is responsible for freeing the request, as maybe they want to access the header/body after returning from the callback).
from libevent.
So I decided to use inline function instead of macros (since it is easy to debug), other then this it is the same as @ellzey suggested. Plus add a regression test for this.
from libevent.
Related Issues (20)
- Class member functions to be param callback of event_new HOT 1
- deadlock on event_del_nolock_() HOT 2
- Segmentation fault after bufferevent_write HOT 7
- bufferevent_write deadlock HOT 4
- buffereven_write blocking problem HOT 1
- HTTP parser allows empty header names
- How to verify libevent release download with provided asc file? HOT 1
- New security rules (NULL check) HOT 3
- New security rules (other type)
- Websocket connection fails with 404 for request header "Connection: keep-alive, Upgrade" (Firefox) HOT 4
- HTTP parser does not properly strip spaces and tabs from the beginnings of header values
- Hard coding of unknown IP addresses(1.2.3.4 and 18.244.0.188) HOT 1
- NDK 编译 libevent + openssl
- NDK 编译 libevent-2.1.8-stable + openssl;成功编译
- Unexpected DNS resolve procedure if dual stack enviroment and multiple subdomain exists HOT 1
- lost call http_request_done sometimes as httpclient
- Support 16KB page size devices
- mbedstl double free (libevent-2.2.1-alpha-dev)
- Configure without SSL/TLS support in cmake
- Experts, may I ask when the current open source libraries will undergo version iteration and upgrade? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libevent.