Commit 16371832 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 37238244
...@@ -1593,23 +1593,24 @@ func (wlink *WatchLink) _serveRX() (err error) { ...@@ -1593,23 +1593,24 @@ func (wlink *WatchLink) _serveRX() (err error) {
func (wlink *WatchLink) handleWatch(ctx context.Context, stream uint64, msg string) (err error) { func (wlink *WatchLink) handleWatch(ctx context.Context, stream uint64, msg string) (err error) {
defer xerr.Contextf(&err, "%d", stream) defer xerr.Contextf(&err, "%d", stream)
foid, at, err := parseWatch(msg) err = wlink._handleWatch(ctx, msg)
reply := "ok"
if err != nil { if err != nil {
return err reply = fmt.Sprintf("error %s", err)
} }
err = wlink.setupWatch(ctx, foid, at) err = wlink.send(ctx, stream, reply)
if err != nil {
fmt.Printf("S: watch: QQQ: %s\n", err)
return err return err
} }
err = wlink.send(ctx, stream, "ok") func (wlink *WatchLink) _handleWatch(ctx context.Context, msg string) error {
foid, at, err := parseWatch(msg)
if err != nil { if err != nil {
return err return err
} }
return nil err = wlink.setupWatch(ctx, foid, at)
return err
} }
// sendReq sends wcfs-originated request to client and returns client response. // sendReq sends wcfs-originated request to client and returns client response.
......
...@@ -876,9 +876,9 @@ def test_wcfs(): ...@@ -876,9 +876,9 @@ def test_wcfs():
# XXX invalid requests -> wcfs replies error # XXX invalid requests -> wcfs replies error
# XXX -> separate test? # XXX -> separate test?
wl = t.openwatch() wl = t.openwatch()
assert wl.sendReq(context.background(), b'bla bla') == "" # XXX -> == None XXX or error? assert wl.sendReq(context.background(), b'bla bla') == b"error bad watch: not a watch request"
# assert wl closed # XXX assert wl closed
wl.close() wl.close()
for zf in t.zfiles(): for zf in t.zfiles():
......
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