Commit 30553e72 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9edcc300
...@@ -253,7 +253,7 @@ pair<string, error> _WatchLink::sendReq(context::Context ctx, const string &req) ...@@ -253,7 +253,7 @@ pair<string, error> _WatchLink::sendReq(context::Context ctx, const string &req)
//printf("wlink sendReq '%s'\n", req.c_str()); //printf("wlink sendReq '%s'\n", req.c_str());
rxPkt rx; rxPkt rx; bool ok;
chan<rxPkt> rxq; chan<rxPkt> rxq;
error err; error err;
tie(rxq, err) = wlink->_sendReq(ctx, req); tie(rxq, err) = wlink->_sendReq(ctx, req);
...@@ -263,13 +263,14 @@ pair<string, error> _WatchLink::sendReq(context::Context ctx, const string &req) ...@@ -263,13 +263,14 @@ pair<string, error> _WatchLink::sendReq(context::Context ctx, const string &req)
//printf("sendReq: wait ...\n"); //printf("sendReq: wait ...\n");
int _ = select({ int _ = select({
ctx->done().recvs(), // 0 ctx->done().recvs(), // 0
rxq.recvs(&rx), // 1 rxq.recvs(&rx, &ok), // 1
}); });
//printf("sendReq: woken up #%d\n", _); //printf("sendReq: woken up #%d\n", _);
if (_ == 0) if (_ == 0)
return make_pair("", ctx->err()); return make_pair("", ctx->err());
// XXX check for EOF if (!ok)
return make_pair("", 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", reply.c_str());
return make_pair(reply, nil); return make_pair(reply, nil);
......
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