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