8157045: NPE during websocket communication with wss

Reviewed-by: michaelm, prappo
This commit is contained in:
Chris Hegarty 2016-06-15 19:18:19 +01:00
parent 431772cea7
commit b48a0e79c4
3 changed files with 9 additions and 2 deletions

View File

@ -142,6 +142,9 @@ class SSLConnection extends HttpConnection {
// TODO: check for closure
String s = "Receive) ";
//debugPrint(s, r.buf);
if (r.result.bytesProduced() > 0) {
assert buf == r.buf;
}
return r.result.bytesProduced();
}

View File

@ -344,8 +344,8 @@ class SSLDelegate {
/* we wait until some user data arrives */
int mark = dst.position();
WrapperResult r = null;
assert dst.position() == 0;
while (dst.position() == 0) {
int pos = dst.position();
while (dst.position() == pos) {
r = wrapper.recvAndUnwrap (dst);
dst = (r.buf != dst) ? r.buf: dst;
Status status = r.result.getStatus();

View File

@ -150,6 +150,10 @@ class SSLTunnelConnection extends HttpConnection {
// TODO: check for closure
String s = "Receive) ";
//debugPrint(s, r.buf);
if (r.result.bytesProduced() > 0) {
assert buf == r.buf;
}
return r.result.bytesProduced();
}