Commit ca5e34cd authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3725aa97
......@@ -1245,7 +1245,7 @@ retry:
// XXX place=ok?
func (w *FileWatch) pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
foid := w.file.zfile.POid()
defer xerr.Contextf(&err, "f<%s>: watch%d: pin #blk @%s", foid, w.link.id, blk, rev)
defer xerr.Contextf(&err, "f<%s>: watch%d: pin #%d @%s", foid, w.link.id, blk, rev)
// XXX locking?
// XXX simultaneous calls?
......@@ -1262,7 +1262,7 @@ func (w *FileWatch) pin(ctx context.Context, blk int64, rev zodb.Tid) (err error
// XXX comment
rev, _ = w.file.δFtail.LastRevOf(blk, w.at)
ack, err := w.link.sendReq(ctx, fmt.Sprintf("pin %s #%s @%s", foid, blk, rev))
ack, err := w.link.sendReq(ctx, fmt.Sprintf("pin %s #%d @%s", foid, blk, rev))
if err != nil {
return err
}
......@@ -1364,7 +1364,7 @@ func (w *Watcher) _serveRX() (err error) {
func (w *Watcher) sendReq(ctx context.Context, req string) (reply string, err error) {
// XXX err ctx
// XXX assert '\n' not in req
stream = ... // XXX
stream := uint64(2) // FIXME allocate stream anew as several in-flight sendReq are possible
rxq := make(chan string) // XXX cap=1? (so that if we return canceled we do not block client)
w.rxMu.Lock()
......@@ -1374,7 +1374,7 @@ func (w *Watcher) sendReq(ctx context.Context, req string) (reply string, err er
// XXX lock tx
// XXX timeout write on ctx cancel
err = w.sk.Write(fmt.Sprintf("%d %s\n", stream, req))
_, err = w.sk.Write([]byte(fmt.Sprintf("%d %s\n", stream, req)))
if err != nil {
return "", err
}
......
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