Return the same job on retry #4584

This commit is contained in:
Jerry (Xinyu Hou) 2015-06-05 13:35:22 -07:00
parent 0680c33909
commit bbf53bb9b8
1 changed files with 9 additions and 1 deletions

View File

@ -483,16 +483,21 @@ TCPSocket::serviceConnected(ISocketMultiplexerJob* job,
} }
const void* buffer = m_outputBuffer.peek(buffSize); const void* buffer = m_outputBuffer.peek(buffSize);
if (isSecure()) { if (isSecure()) {
if (isSecureReady()) { if (isSecureReady()) {
s_retryOutputBufferSize = buffSize;
status = secureWrite(buffer, buffSize, bytesWrote); status = secureWrite(buffer, buffSize, bytesWrote);
if (status > 0) { if (status > 0) {
s_retryOutputBufferSize = 0; s_retryOutputBufferSize = 0;
} }
else if (status < 0) { else if (status < 0) {
return NULL; return NULL;
} }
else if (status == 0) {
s_retryOutputBufferSize = buffSize;
return job;
}
} }
else { else {
return job; return job;
@ -553,6 +558,9 @@ TCPSocket::serviceConnected(ISocketMultiplexerJob* job,
if (status < 0) { if (status < 0) {
return NULL; return NULL;
} }
else if (status == 0) {
return job;
}
} }
else { else {
return job; return job;