Commit d876da33 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 272e43bd
...@@ -139,7 +139,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ? ...@@ -139,7 +139,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", v(l), 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();
...@@ -150,7 +150,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ? ...@@ -150,7 +150,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ?
err = nil; err = nil;
return E(err); return E(err);
} }
printf("C: watch : rx: \"%s\"", l.c_str()); printf("C: watch : rx: \"%s\"", v(l));
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));
...@@ -162,7 +162,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ? ...@@ -162,7 +162,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ?
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 ?
printf("C: watch : rx fatal: %s\n", l.c_str()); printf("C: watch : rx fatal: %s\n", v(l));
wlink.fatalv.push_back(pkt.to_string()); wlink.fatalv.push_back(pkt.to_string());
continue; continue;
} }
...@@ -219,7 +219,7 @@ error _WatchLink::_send(StreamID stream, const string &msg) { ...@@ -219,7 +219,7 @@ error _WatchLink::_send(StreamID stream, const string &msg) {
// XXX +errctx ? // XXX +errctx ?
if (msg.find('\n') != string::npos) if (msg.find('\n') != string::npos)
panic("msg has \\n"); panic("msg has \\n");
string pkt = fmt::sprintf("%lu %s\n", stream, msg.c_str()); string pkt = fmt::sprintf("%lu %s\n", stream, v(msg));
return wlink->_write(pkt); return wlink->_write(pkt);
} }
...@@ -248,7 +248,7 @@ pair<string, error> _WatchLink::sendReq(context::Context ctx, const string &req) ...@@ -248,7 +248,7 @@ pair<string, error> _WatchLink::sendReq(context::Context ctx, const string &req)
_WatchLink *wlink = this; _WatchLink *wlink = this;
xerr::Contextf E("wlink X: sendReq"); // XXX wlink details xerr::Contextf E("wlink X: sendReq"); // XXX wlink details
//printf("wlink sendReq '%s'\n", req.c_str()); //printf("wlink sendReq '%s'\n", v(req));
rxPkt rx; bool ok; rxPkt rx; bool ok;
chan<rxPkt> rxq; chan<rxPkt> rxq;
...@@ -269,7 +269,7 @@ pair<string, error> _WatchLink::sendReq(context::Context ctx, const string &req) ...@@ -269,7 +269,7 @@ pair<string, error> _WatchLink::sendReq(context::Context ctx, const string &req)
if (!ok) if (!ok)
return make_pair("", E(io::ErrUnexpectedEOF)); // XXX error ok? return make_pair("", E(io::ErrUnexpectedEOF)); // XXX error ok?
string reply = rx.to_string(); string reply = rx.to_string();
//printf("sendReq: reply='%s'\n", reply.c_str()); //printf("sendReq: reply='%s'\n", v(reply));
return make_pair(reply, nil); return make_pair(reply, nil);
} }
...@@ -365,7 +365,7 @@ static error _parsePinReq(PinReq *pin, const rxPkt *pkt) { ...@@ -365,7 +365,7 @@ static error _parsePinReq(PinReq *pin, const rxPkt *pkt) {
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", v(msg));
//printf("has_prefix: %i\n", strings::has_prefix(msg, "pin ")); //printf("has_prefix: %i\n", strings::has_prefix(msg, "pin "));
xerr::Contextf E("bad pin: '%s'", v(msg)); xerr::Contextf E("bad pin: '%s'", v(msg));
...@@ -416,7 +416,7 @@ tuple<string, error> _WatchLink::_readline() { ...@@ -416,7 +416,7 @@ tuple<string, error> _WatchLink::_readline() {
if (nl != string::npos) { if (nl != string::npos) {
auto line = wlink._rxbuf.substr(0, nl+1); auto line = wlink._rxbuf.substr(0, nl+1);
wlink._rxbuf = wlink._rxbuf.substr(nl+1); wlink._rxbuf = wlink._rxbuf.substr(nl+1);
//printf("\t_readline -> ret '%s'\n", line.c_str()); //printf("\t_readline -> ret '%s'\n", v(line));
return make_tuple(line, nil); return make_tuple(line, nil);
} }
nl_searchfrom = wlink._rxbuf.length(); nl_searchfrom = wlink._rxbuf.length();
......
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