File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -193,8 +193,10 @@ func (v *connection) recvMessage() (msgs.BackEndMsg, error) {
193193
194194 msgBytes := make ([]byte , msgSize )
195195
196- if err = v .readAll (msgBytes ); err != nil {
197- return nil , err
196+ if msgSize > 0 {
197+ if err = v .readAll (msgBytes ); err != nil {
198+ return nil , err
199+ }
198200 }
199201
200202 bem , err := msgs .CreateBackEndMsg (msgHeader [0 ], msgBytes )
@@ -230,10 +232,12 @@ func (v *connection) sendMessage(msg msgs.FrontEndMsg) error {
230232 _ , result = v .conn .Write (sizeBytes )
231233
232234 if result == nil {
233- _ , result = v .conn .Write (msgBytes )
235+ if len (msgBytes ) > 0 {
236+ _ , result = v .conn .Write (msgBytes )
234237
235- if result == nil {
236- connectionLogger .Debug ("-> " + msg .String ())
238+ if result == nil {
239+ connectionLogger .Debug ("-> " + msg .String ())
240+ }
237241 }
238242 }
239243 }
You can’t perform that action at this time.
0 commit comments