Code Monkey home page Code Monkey logo

Comments (3)

azat avatar azat commented on June 8, 2024

Thanks for the report.

The check for old_fd is done to check should be call close or not, for new fd we do not need this.
Are you experiencing some issues with this behavior?

from libevent.

mllw avatar mllw commented on June 8, 2024

I first exported evhttp_get_request as a public function for logical processing.

After accepting a socket, use bufferevent to read the handshake information, then determine the protocol type, if it is http protocol, it is processed by evhttp_get_request.
This is done by passing the bufferevent and socket fd into evhttp_get_request, however, in the processing of evhttp_get_request, the bufferevent_replacefd function will be called, and at this time, the fd of the bufferevent and the fd of the socket are equal,. bufferevent_replacefd does not determine whether the new fd and old fd are equal, but instead closes the old fd directly, causing the socket to be closed.

from libevent.

azat avatar azat commented on June 8, 2024

I first exported evhttp_get_request as a public function for logical processing.

This is not an official API
Thought it had been requested multiple times - #1471
Are you interested?
I'm OK with exporting it if it will have some example that will show that it make sense in the official repo

but not check
fd is eq old_fd

And then I'm ok with this change as well

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.