Commit 63acc55c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 889ea1a2
......@@ -65,6 +65,15 @@ struct IContext {
virtual error err() = 0;
};
// XXX wrap T* as IContext
template<typename T>
class Context {
T *obj;
public:
chan<structZ> done() { return obj->done(); }
error err() { return obj->err(); }
};
struct Conn;
struct _File;
struct _Mapping;
......@@ -394,13 +403,6 @@ error WatchLink::_send(StreamID stream, const string &msg) {
WatchLink *wlink = this;
if (msg.find('\n') != string::npos)
panic("msg has \\n");
// XXX Pkt is not needed here
#if 0
Pkt pkt;
pkt.stream = stream;
pkt.rawdata = // XXX copy msg XXX + "%d <stream> ...\n" ?
return wlink->_write(&pkt)
#endif
string pkt = fmt::sprintf("%lu %s\n", stream, msg.c_str());
return wlink->_write(pkt);
}
......@@ -419,10 +421,6 @@ error WatchLink::_write(const string &pkt) {
error err;
tie(n, err) = wlink->_f.write(pkt.c_str(), pkt.size());
return err;
#if 0
wlink->_wtx.write(pkt);
wlink->_wtx.flush();
#endif
}
// sendReq sends client -> server request and returns server reply.
......
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