Commit a9848fe7 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent fc69bd18
......@@ -379,7 +379,7 @@ func (c *Client) LastOid(ctx context.Context) (zodb.Oid, error) {
panic("TODO")
}
func (c *Client) Load(ctx context.Context, xid zodb.Xid) (data *zodb.Buf, serial zodb.Tid, err error) {
func (c *Client) Load(ctx context.Context, xid zodb.Xid) (buf *zodb.Buf, serial zodb.Tid, err error) {
defer func() {
switch err.(type) {
case nil:
......@@ -446,7 +446,7 @@ func (c *Client) Load(ctx context.Context, xid zodb.Xid) (data *zodb.Buf, serial
return nil, 0, err // XXX err context
}
buf = resp.DataBuf
buf = resp.Data
//checksum := sha1.Sum(buf.Data)
//if checksum != resp.Checksum {
......@@ -469,7 +469,7 @@ func (c *Client) Load(ctx context.Context, xid zodb.Xid) (data *zodb.Buf, serial
// reply.NextSerial
// reply.DataSerial
return data, resp.Serial, nil
return buf, resp.Serial, nil
}
func (c *Client) Iterate(tidMin, tidMax zodb.Tid) zodb.ITxnIterator {
......
......@@ -646,7 +646,7 @@ type AnswerObject struct {
NextSerial zodb.Tid // XXX but there it is out of sync
Compression bool
Checksum Checksum
DataBuf *zodb.Buf // TODO encode -> separately (for writev)
Data *zodb.Buf // TODO encode -> separately (for writev)
DataSerial zodb.Tid
}
......
......@@ -502,7 +502,7 @@ func (stor *Storage) serveClient1(ctx context.Context, req neo.Msg) (resp neo.Ms
xid.TidBefore = true
}
data, tid, err := stor.zstor.Load(ctx, xid)
buf, tid, err := stor.zstor.Load(ctx, xid)
if err != nil {
// translate err to NEO protocol error codes
return neo.ErrEncode(err)
......@@ -513,8 +513,8 @@ func (stor *Storage) serveClient1(ctx context.Context, req neo.Msg) (resp neo.Ms
Serial: tid,
Compression: false,
Data: data,
//Checksum: sha1.Sum(data), // XXX computing every time
Data: buf,
//Checksum: sha1.Sum(buf.Data), // XXX computing every time
// XXX .NextSerial
// XXX .DataSerial
......
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