Commit 1e467c19 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0e0c6522
...@@ -122,7 +122,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ? ...@@ -122,7 +122,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ?
// when finishing - wakeup everyone waiting for rx // when finishing - wakeup everyone waiting for rx
defer([&]() { defer([&]() {
printf("serveRX: close all chans\n"); //printf("serveRX: close all chans\n");
wlink._acceptq.close(); wlink._acceptq.close();
wlink._rxmu.lock(); wlink._rxmu.lock();
wlink._rxdown = true; // don't allow new rxtab registers wlink._rxdown = true; // don't allow new rxtab registers
...@@ -141,7 +141,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ? ...@@ -141,7 +141,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ?
// NOTE: .close() makes sure .f.read*() will wake up // NOTE: .close() makes sure .f.read*() will wake up
//printf("serveRX -> readline ...\n"); //printf("serveRX -> readline ...\n");
tie(l, err) = wlink._readline(); // XXX +maxlen tie(l, err) = wlink._readline(); // XXX +maxlen
printf(" readline -> woken up; l='%s' ; err='%s'\n", l.c_str(), v(err)); //printf(" readline -> woken up; l='%s' ; err='%s'\n", l.c_str(), v(err));
if (err == io::EOF_) { // peer closed its tx if (err == io::EOF_) { // peer closed its tx
// XXX what happens on other errors? // XXX what happens on other errors?
wlink._rx_eof.close(); wlink._rx_eof.close();
...@@ -155,12 +155,12 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ? ...@@ -155,12 +155,12 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ?
printf("C: watch : rx: \"%s\"", l.c_str()); printf("C: watch : rx: \"%s\"", l.c_str());
err = pkt.from_string(l); err = pkt.from_string(l);
printf("line -> pkt: err='%s'\n", v(err)); //printf("line -> pkt: err='%s'\n", v(err));
if (err != nil) if (err != nil)
return err; return err;
printf("pkt.stream: %lu\n", pkt.stream); //printf("pkt.stream: %lu\n", pkt.stream);
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
// XXX print -> receive somewhere? XXX -> recvCtl ? // XXX print -> receive somewhere? XXX -> recvCtl ?
...@@ -187,7 +187,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ? ...@@ -187,7 +187,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ?
ctx->done().recvs(), // 0 ctx->done().recvs(), // 0
rxq.sends(&pkt), // 1 rxq.sends(&pkt), // 1
}); });
printf("rxq <- pkt: -> sel #%d\n", _); //printf("rxq <- pkt: -> sel #%d\n", _);
if (_ == 0) if (_ == 0)
return ctx->err(); return ctx->err();
} }
...@@ -332,17 +332,17 @@ error _WatchLink::recvReq(context::Context ctx, PinReq *prx) { ...@@ -332,17 +332,17 @@ error _WatchLink::recvReq(context::Context ctx, PinReq *prx) {
// _parsePinReq parses message into PinReq according to wcfs invalidation protocol. // _parsePinReq parses message into PinReq according to wcfs invalidation protocol.
static error _parsePinReq(PinReq *pin, const rxPkt *pkt) { static error _parsePinReq(PinReq *pin, const rxPkt *pkt) {
// XXX err ctx "bad pin" // XXX err ctx "bad pin"
printf("parse pinreq: stream=%lu msg='%s'\n", pkt->stream, &pkt->data[0]); //printf("parse pinreq: stream=%lu msg='%s'\n", pkt->stream, &pkt->data[0]);
pin->stream = pkt->stream; pin->stream = pkt->stream;
string msg = pkt->to_string(); string msg = pkt->to_string();
pin->msg = msg; pin->msg = msg;
printf("'%s'\n", msg.c_str()); //printf("'%s'\n", msg.c_str());
printf("has_prefix: %i\n", strings::has_prefix(msg, "pin ")); //printf("has_prefix: %i\n", strings::has_prefix(msg, "pin "));
// pin <foid>) #<blk> @<at> // pin <foid>) #<blk> @<at>
if (!strings::has_prefix(msg, "pin ")) { if (!strings::has_prefix(msg, "pin ")) {
printf("\n\n\nnot a pin request: '%s'\n", msg.c_str()); // XXX temp //printf("\n\n\nnot a pin request: '%s'\n", msg.c_str()); // XXX temp
abort(); //abort();
return fmt::errorf("not a pin request: '%s'", msg.c_str()); // XXX msg -> errctx ? return fmt::errorf("not a pin request: '%s'", msg.c_str()); // XXX msg -> errctx ?
} }
......
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