Fix the handling of out-of-band (OOB) data in a socket.

* fhandler.h (class fhandler_socket_inet): Add variable bool oobinline.
* fhandler_socket_inet.cc (fhandler_socket_inet::fhandler_socket_inet):
  Initialize variable oobinline.
(fhandler_socket_inet::recv_internal): Make the handling of OOB data
  as consistent with POSIX as possible. Add simulation of inline mode
  for OOB data as a workaround for broken winsock behavior.
(fhandler_socket_inet::setsockopt): Ditto.
(fhandler_socket_inet::getsockopt): Ditto.
(fhandler_socket_wsock::ioctl): Fix return value of SIOCATMARK command.
  The return value of SIOCATMARK of winsock is almost opposite to
  expectation.
* fhandler_socket_local.cc (fhandler_socket_local::recv_internal):
  Remove the handling of OOB data from AF_LOCAL domain socket. Operation
  related to OOB data will result in an error like Linux does.
(fhandler_socket_local::sendto): Ditto.
(fhandler_socket_local::sendmsg): Ditto.

This fixes the issue reported in following post.
https://cygwin.com/ml/cygwin/2018-06/msg00143.html
This commit is contained in:
Takashi Yano
2018-06-21 23:11:49 +09:00
committed by Corinna Vinschen
parent 3baadb9912
commit 9c84bfd479
3 changed files with 120 additions and 9 deletions

View File

@ -684,6 +684,8 @@ class fhandler_socket_wsock: public fhandler_socket
class fhandler_socket_inet: public fhandler_socket_wsock
{
private:
bool oobinline; /* True if option SO_OOBINLINE is set */
protected:
int af_local_connect () { return 0; }