Commit 90301a73 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 10db70e4
...@@ -168,7 +168,9 @@ struct rxPkt { ...@@ -168,7 +168,9 @@ struct rxPkt {
// XXX not e.g. string as chan<T> currently does not support types with // XXX not e.g. string as chan<T> currently does not support types with
// non-trivial copy. Note: we anyway need to limit line length to avoid DoS // non-trivial copy. Note: we anyway need to limit line length to avoid DoS
// but just for DoS the limit would be higher. // but just for DoS the limit would be higher.
char rawdata[128-sizeof(StreamID)]; char data[128-sizeof(StreamID)];
string to_string() const;
}; };
...@@ -468,7 +470,7 @@ tuple<string, error> WatchLink::sendReq(IContext *ctx, const string &req) { ...@@ -468,7 +470,7 @@ tuple<string, error> WatchLink::sendReq(IContext *ctx, const string &req) {
return make_tuple("", ctx->err()); return make_tuple("", ctx->err());
// XXX check for EOF // XXX check for EOF
string reply = rx.XXXtostring(); string reply = rx.to_string();
return make_tuple(reply, nil); return make_tuple(reply, nil);
} }
...@@ -478,7 +480,7 @@ tuple</*rxq*/chan<rxPkt>, error> WatchLink::_sendReq(IContext *ctx, const string ...@@ -478,7 +480,7 @@ tuple</*rxq*/chan<rxPkt>, error> WatchLink::_sendReq(IContext *ctx, const string
wlink->_txmu.lock(); // XXX -> atomic (currently uses arbitrary lock) wlink->_txmu.lock(); // XXX -> atomic (currently uses arbitrary lock)
StreamID stream = wlink->_req_next; StreamID stream = wlink->_req_next;
wlink->_req_next = (wlink->_req_next + 2); // wrapped around at uint64 max wlink->_req_next = (wlink->_req_next + 2); // wraparound at uint64 max
wlink->_txmu.unlock(); wlink->_txmu.unlock();
auto rxq = makechan<rxPkt>(1); auto rxq = makechan<rxPkt>(1);
......
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