Git Product home page Git Product logo

Comments (4)

JohnOhl avatar JohnOhl commented on May 18, 2024

Pretty sure the request should be freed automatically after the http_request_done has finished executing since you didn't use evhttp_request_own to take ownership of the request object so it results in a double free.

If you could paste a dump of the segfault information it may be helpful.

from libevent.

user1020 avatar user1020 commented on May 18, 2024

Thanks John for the quick reply. I would like to see "http_request_done" call back to free request object automatically. However, I see the TCP session is still there after the call back - which I wish to be closed.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bb9fd7 in evhttp_clear_headers () from /usr/lib/libevent-2.0.so.5
(gdb) bt
#0  0x00007ffff7bb9fd7 in evhttp_clear_headers ()
   from /usr/lib/libevent-2.0.so.5
#1  0x00007ffff7bbbe9e in evhttp_request_free ()
   from /usr/lib/libevent-2.0.so.5
#2  0x00007ffff7bbd96d in ?? () from /usr/lib/libevent-2.0.so.5
#3  0x00007ffff7bbdaa8 in ?? () from /usr/lib/libevent-2.0.so.5
#4  0x00007ffff7bade2d in ?? () from /usr/lib/libevent-2.0.so.5
#5  0x00007ffff7ba394c in event_base_loop () from /usr/lib/libevent-2.0.so.5
#6  0x00000000004015db in main (argc=3, argv=0x7fffffffe678)
    at libEventAgent.c:136

from libevent.

user1020 avatar user1020 commented on May 18, 2024

John, you are right.

I used a debugger and found that even when I removed the call to "evhttp_request_free()", this function is still called.

But my test (wireshark sniffer) shows that the connection for the http request was not closed. Any idea how to close it? Thanks.

from libevent.

user1020 avatar user1020 commented on May 18, 2024

Better close this issue and open a new one. Thanks John.

from libevent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.