Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#3270 closed defect (fixed)

Libevent callbacks should take sockets as evutil_socket_t, not int

Reported by: nickm Owned by:
Priority: High Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


On 64-bit Windows, SOCKET of type UINT_PTR, which is 64-bit, whereas int is only 32-bit. To solve this, Libevent 2 defines a type "evutil_socket_t" which is SOCKET on windows and int elsewhere. We should revise all of our libevent callbacks that receive sockets so that they receive evutil_socket_t instead, when libevent2 is present. If we are built against libevent 1.4, however, we should just #define evutil_socket_t to int.

Child Tickets

Change History (5)

comment:1 Changed 9 years ago by nickm

We should also audit all the users of conn->s to make sure that they don't treat the thing as an int.

comment:2 Changed 9 years ago by nickm

Status: newneeds_review

See branch bug3270 in my public repository. It got a little big.

comment:3 Changed 9 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

ok, looks like I'm not going to get any review here. The patch still seems fine to me, so I merged it.

comment:4 Changed 8 years ago by nickm

Keywords: tor-relay added

comment:5 Changed 8 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.