Commit 2a4ad58d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e0f03507
...@@ -153,12 +153,14 @@ error _WatchLink::_serveRX(context::Context ctx) { ...@@ -153,12 +153,14 @@ error _WatchLink::_serveRX(context::Context ctx) {
//printf("pkt.datalen: %u\n", pkt.datalen); //printf("pkt.datalen: %u\n", pkt.datalen);
if (pkt.stream == 0) { // control/fatal message from wcfs if (pkt.stream == 0) { // control/fatal message from wcfs
log::Warnf("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;
} }
bool reply = (pkt.stream % 2 != 0); bool reply = (pkt.stream % 2 != 0);
// wcfs replies to our request
if (reply) { if (reply) {
chan<rxPkt> rxq; chan<rxPkt> rxq;
bool ok; bool ok;
...@@ -168,9 +170,9 @@ error _WatchLink::_serveRX(context::Context ctx) { ...@@ -168,9 +170,9 @@ error _WatchLink::_serveRX(context::Context ctx) {
wlink._rxmu.unlock(); wlink._rxmu.unlock();
if (!ok) { if (!ok) {
// wcfs sent reply on unexpected stream // wcfs sent reply on unexpected stream
// XXX log + down. // XXX down.
printf("wcfs sent reply on unexpected stream\n"); log::Errorf("%s: wcfs sent reply on unexpected stream %lu", v(wlink), pkt.stream);
continue; continue; // XXX -> down
} }
int _ = select({ int _ = select({
ctx->done().recvs(), // 0 ctx->done().recvs(), // 0
...@@ -180,6 +182,8 @@ error _WatchLink::_serveRX(context::Context ctx) { ...@@ -180,6 +182,8 @@ error _WatchLink::_serveRX(context::Context ctx) {
if (_ == 0) if (_ == 0)
return E(ctx->err()); return E(ctx->err());
} }
// wcfs originated request
else { else {
wlink._rxmu.lock(); wlink._rxmu.lock();
if (wlink._accepted.has(pkt.stream)) { if (wlink._accepted.has(pkt.stream)) {
......
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