[BRLTTY] Virtual driver is not reading the socket

Jaroslav Skarvada jskarvad at redhat.com
Fri May 6 08:35:00 EDT 2016



----- Original Message -----
> ----- Original Message -----
> > Hi,
> > 
> > for me the Virtual driver (vr) doesn't work, reproducer:
> > 
> > $ brltty -b vr -d server:127.0.0.1 -x a2 -A auth=none
> > $ telnet 127.0.0.1 35752
> > cells 20
> > 
> > And nothing happened. It seems the 'vr' driver thinks there is
> > no data on the socket received, i.e. the awaitSocketInput check in
> > readNetworkSocket never succeed.
> > 
> > I didn't debug the complex underlying machinery, but the attached
> > patch that bypassed it and used MSG_DONTWAIT recv flag (which is
> > available since kernel 2.2) works for me and the Virtual driver
> > started to work again. I tested it on Fedora 23 (kernel 4.4.7)
> > 
> > thanks & regards
> > 
> > Jaroslav
> > 
> 
> I bisected the problem to the following commit:
> https://github.com/brltty/brltty/commit/cd62215b643b486c93fb28c3fe02e3727cdf3f91
> 
> and simply reverting the commit for the asyncAwaitCondtition resolved the
> problem
> for me
> 
> regards
> 
> Jaroslav
> 

The source of the problem is the following:
In Drivers/Braille/Virtual/braille.c:125
  if (awaitSocketInput(descriptor, 0)) {

i.e. it uses timeout = 0, but in Programs/async_wait.c:151
the 
if (afterTimePeriod(&period, &elapsed)) return 0;
returned immediately due to timeout = 0 without checking the
condition.

Maybe the 'vr' driver shouldn't use timeout = 0, but I think that
the underlaying logic should cope with it. For me it's more logical
behaviour if it do one check even with timeout = 0, so probably
the reverted version of the code is OK

thanks & regards

Jaroslav


More information about the BRLTTY mailing list