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