* fhandler.h (class fhandler_socket): Add "owner" status flag.
* fhandler_socket.cc (wait): Take flag parameter to take FD_OOB into account. Don't wait infinitely. (fhandler_socket::recvfrom): Also wait for FD_OOB if socket owner. (fhandler_socket::recvmsg): Ditto. (fhandler_socket::sendto): Ditto. (fhandler_socket::sendmsg): Ditto. (fhandler_socket::fcntl): Set owner status flag if F_SETOWN with own pid is called.
This commit is contained in:
@ -341,16 +341,17 @@ class fhandler_socket: public fhandler_base
|
||||
unsigned saw_shutdown_read : 1; /* Socket saw a SHUT_RD */
|
||||
unsigned saw_shutdown_write : 1; /* Socket saw a SHUT_WR */
|
||||
unsigned closed : 1;
|
||||
unsigned owner : 1;
|
||||
unsigned connect_state : 2;
|
||||
public:
|
||||
status_flags () :
|
||||
async_io (0), saw_shutdown_read (0), saw_shutdown_write (0),
|
||||
closed (0), connect_state (unconnected)
|
||||
closed (0), owner (0), connect_state (unconnected)
|
||||
{}
|
||||
} status;
|
||||
|
||||
bool prepare (HANDLE &event, long event_mask);
|
||||
int wait (HANDLE event);
|
||||
int wait (HANDLE event, int flags);
|
||||
void release (HANDLE event);
|
||||
|
||||
public:
|
||||
@ -363,6 +364,7 @@ class fhandler_socket: public fhandler_base
|
||||
IMPLEMENT_STATUS_FLAG (bool, saw_shutdown_read)
|
||||
IMPLEMENT_STATUS_FLAG (bool, saw_shutdown_write)
|
||||
IMPLEMENT_STATUS_FLAG (bool, closed)
|
||||
IMPLEMENT_STATUS_FLAG (bool, owner)
|
||||
IMPLEMENT_STATUS_FLAG (conn_state, connect_state)
|
||||
|
||||
int bind (const struct sockaddr *name, int namelen);
|
||||
|
Reference in New Issue
Block a user