Commit 3cd2dd08 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 76f9145b
...@@ -132,7 +132,7 @@ error _WatchLink::_serveRX(context::Context ctx) { ...@@ -132,7 +132,7 @@ error _WatchLink::_serveRX(context::Context ctx) {
wlink._rxmu.lock(); wlink._rxmu.lock();
wlink._rxdown = true; // don't allow new rxtab registers wlink._rxdown = true; // don't allow new rxtab registers
wlink._rxmu.unlock(); wlink._rxmu.unlock();
for (auto _ : wlink._rxtab) { for (auto _ : wlink._rxtab) { // FIXME iterates without lock
auto rxq = _.second; auto rxq = _.second;
rxq.close(); rxq.close();
} }
...@@ -143,16 +143,14 @@ error _WatchLink::_serveRX(context::Context ctx) { ...@@ -143,16 +143,14 @@ error _WatchLink::_serveRX(context::Context ctx) {
rxPkt pkt; rxPkt pkt;
while (1) { while (1) {
// NOTE: .close() makes sure .f.read*() will wake up // NOTE: .close() makes sure ._f.read*() will wake up
tie(l, err) = wlink._readline(); tie(l, err) = wlink._readline();
if (err == io::EOF_) { // peer closed its tx
// XXX what happens on other errors?
wlink.rx_eof.close();
}
if (err != nil) { if (err != nil) {
// XXX place=ok? // peer closed its tx
if (err == io::EOF_) if (err == io::EOF_) {
err = nil; err = nil;
wlink.rx_eof.close();
}
return E(err); return E(err);
} }
trace("C: watch : rx: \"%s\"", v(l)); trace("C: watch : rx: \"%s\"", v(l));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment