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

.

parent 1519b8ae
......@@ -269,8 +269,6 @@ pair</*reply*/string, error> _WatchLink::sendReq(context::Context ctx, const str
_WatchLink& wlink = *this;
xerr::Contextf E("%s: sendReq", v(wlink)); // XXX + streamID
//printf("wlink sendReq '%s'\n", v(req));
rxPkt rx; bool ok;
chan<rxPkt> rxq;
error err;
......@@ -278,19 +276,16 @@ pair</*reply*/string, error> _WatchLink::sendReq(context::Context ctx, const str
if (err != nil)
return make_pair("", E(err));
//printf("sendReq: wait ...\n");
int _ = select({
ctx->done().recvs(), // 0
rxq.recvs(&rx, &ok), // 1
});
//printf("sendReq: woken up #%d\n", _);
if (_ == 0)
return make_pair("", E(ctx->err()));
if (!ok)
return make_pair("", E(io::ErrUnexpectedEOF)); // XXX error ok?
string reply = rx.to_string();
//printf("sendReq: reply='%s'\n", v(reply));
return make_pair(reply, nil);
}
......@@ -354,6 +349,7 @@ error _WatchLink::_write(const string &pkt) {
});
trace("C: watch : tx: \"%s\"", v(pkt));
int n;
error err;
tie(n, err) = wlink._f->write(pkt.c_str(), pkt.size());
......
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