libevent / libevent/libevent

bufferevent_replacefd close socket when bufferevent‘s socket fd is eq new fd

Open
#1,578 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:unconfirmed type:q
Dominant language
C
Stars
12k
Forks
3.5k
Avg merge
12h 55m
Merged PRs (30d)
6

Description

in function
int
bufferevent_replacefd(struct bufferevent *bev, evutil_socket_t fd)

line 896
only check
if (old_fd != EVUTIL_INVALID_SOCKET)

but not check
fd is eq old_fd

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in bufferevent_replacefd(struct bufferevent *bev, evutil_socket_t fd), around line 896, and trace how the existing socket descriptor is handled. Verify the behavior when fd equals the current descriptor, then confirm that replacing with the same descriptor does not close the socket.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.