X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Fnet.c;h=e0d12af3ba3fb9e098921907bc65731f104090e6;hb=dcf7a1a214150f84d51159c9c679b7697cb05298;hp=9b5a34a8828c8c6fb9ddcc119d05d8b3ec216b9d;hpb=fa51e1530f34769a93c499e6997a390492547ff5;p=doldaconnect.git diff --git a/daemon/net.c b/daemon/net.c index 9b5a34a..e0d12af 100644 --- a/daemon/net.c +++ b/daemon/net.c @@ -388,12 +388,17 @@ static void sockrecv(struct socket *sk) #if defined(HAVE_LINUX_SOCKIOS_H) && defined(SIOCINQ) /* SIOCINQ is Linux-specific AFAIK, but I really have no idea * how to read the inqueue size on other OSs */ - if(ioctl(sk->fd, SIOCINQ, &inq)) - { - /* I don't really know what could go wrong here, so let's - * assume it's transient. */ - flog(LOG_WARNING, "SIOCINQ return %s on socket %i, falling back to 2048 bytes", strerror(errno), sk->fd); - inq = 2048; + if(sk->isrealsocket) { + if(ioctl(sk->fd, SIOCINQ, &inq)) + { + /* I don't really know what could go wrong here, so let's + * assume it's transient. */ + flog(LOG_WARNING, "SIOCINQ return %s on socket %i, falling back to 2048 bytes", strerror(errno), sk->fd); + inq = 2048; + } + } else { + /* There are perils when trying to use SIOCINQ on files >2GiB... */ + inq = 65536; } #else inq = 2048;