Todd Lipcon has submitted this change and it was merged.

Change subject: tls_socket: support zero-length writes
......................................................................


tls_socket: support zero-length writes

In some cases, we try to call Write() with a zero-length buffer. This is
allowed with the normal write() or writev() APIs, but OpenSSL uses a '0'
return value to indicate certain types of errors.

This would result in a weird Status like 'NetworkError:
TlsSocket::Write: Success' in cases where we have zero-length sidecars
(e.g empty scan result sets).

This adds a new test with an empty sidecar which triggered the bug, and
fixes TlsSocket::Write to avoid the issue.

Change-Id: Ia4c91722b4c0692384f881a212784d248ec9eeea
Reviewed-on: http://gerrit.cloudera.org:8080/5861
Reviewed-by: Alexey Serbin <[email protected]>
Tested-by: Kudu Jenkins
---
M src/kudu/rpc/rpc-test.cc
M src/kudu/security/tls_socket.cc
2 files changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Alexey Serbin: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/5861
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia4c91722b4c0692384f881a212784d248ec9eeea
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to