Commit 0b9cfeb2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cc6e57db
...@@ -164,7 +164,7 @@ error _WatchLink::_serveRX(context::Context ctx) { ...@@ -164,7 +164,7 @@ error _WatchLink::_serveRX(context::Context ctx) {
if (pkt.stream == 0) { // control/fatal message from wcfs if (pkt.stream == 0) { // control/fatal message from wcfs
log::Errorf("C: watch : rx fatal: %s\n", v(l)); log::Errorf("C: watch : rx fatal: %s\n", v(l));
wlink.fatalv.push_back(pkt.to_string()); wlink.fatalv.push_back(pkt.to_string());
continue; continue; // XXX -> shutdown ?
} }
bool reply = (pkt.stream % 2 != 0); bool reply = (pkt.stream % 2 != 0);
...@@ -178,10 +178,10 @@ error _WatchLink::_serveRX(context::Context ctx) { ...@@ -178,10 +178,10 @@ error _WatchLink::_serveRX(context::Context ctx) {
tie(rxq, ok) = wlink._rxtab.pop_(pkt.stream); tie(rxq, ok) = wlink._rxtab.pop_(pkt.stream);
wlink._rxmu.unlock(); wlink._rxmu.unlock();
if (!ok) { if (!ok) {
// wcfs sent reply on unexpected stream // wcfs sent reply on unexpected stream -> shutdown wlink.
// XXX down. // XXX down.
log::Errorf("%s: wcfs sent reply on unexpected stream %lu", v(wlink), pkt.stream); log::Errorf("%s: .%lu: wcfs sent reply on unexpected stream", v(wlink), pkt.stream);
continue; // XXX -> down return XXX;
} }
int _ = select({ int _ = select({
ctx->done().recvs(), // 0 ctx->done().recvs(), // 0
...@@ -198,10 +198,10 @@ error _WatchLink::_serveRX(context::Context ctx) { ...@@ -198,10 +198,10 @@ error _WatchLink::_serveRX(context::Context ctx) {
if (wlink._accepted.has(pkt.stream)) { if (wlink._accepted.has(pkt.stream)) {
wlink._rxmu.unlock(); wlink._rxmu.unlock();
// XXX log + down // XXX log + down
printf("wcfs sent request on already used stream\n"); printf("%s: .%lu: wcfs sent request on already used stream", v(wlink), pkt.stream);
continue; continue; // XXX -> return
} }
// XXX clear _accepted not to leak memory after reply is sent? // XXX clear _accepted not to leak memory after reply is sent
wlink._accepted.insert(pkt.stream); wlink._accepted.insert(pkt.stream);
wlink._rxmu.unlock(); wlink._rxmu.unlock();
int _ = select({ int _ = select({
......
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