mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
Add empty response for proto message
This commit is contained in:
parent
9b7b92f5c2
commit
491fe04d5c
2 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,9 @@ func (r *Response) MsgSize() uint64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Response) ProtoMessage() (proto.Message, error) {
|
func (r *Response) ProtoMessage() (proto.Message, error) {
|
||||||
|
if r.objectId == "" {
|
||||||
|
return &spacesyncproto.ObjectSyncMessage{}, nil
|
||||||
|
}
|
||||||
resp := &consensusproto.LogFullSyncResponse{
|
resp := &consensusproto.LogFullSyncResponse{
|
||||||
Head: r.head,
|
Head: r.head,
|
||||||
Records: r.records,
|
Records: r.records,
|
||||||
|
|
|
@ -29,6 +29,9 @@ func (r *Response) MsgSize() uint64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Response) ProtoMessage() (proto.Message, error) {
|
func (r *Response) ProtoMessage() (proto.Message, error) {
|
||||||
|
if r.objectId == "" {
|
||||||
|
return &spacesyncproto.ObjectSyncMessage{}, nil
|
||||||
|
}
|
||||||
resp := &treechangeproto.TreeFullSyncResponse{
|
resp := &treechangeproto.TreeFullSyncResponse{
|
||||||
Heads: r.heads,
|
Heads: r.heads,
|
||||||
SnapshotPath: r.snapshotPath,
|
SnapshotPath: r.snapshotPath,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue