A fix for Windows where the client stops trying to read decrypted data back from the client before it's ready.
git-svn-id: svn://10.0.0.236/trunk@75748 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
96c4541085
commit
14fc817b69
@ -202,6 +202,9 @@ CMTStatus CMT_PKCS7DecoderFinish(PCMT_CONTROL control, CMUint32 connectionID,
|
||||
long nbytes;
|
||||
char buf[128];
|
||||
CMTSocket sock, ctrlsock, selSock, sockArr[2];
|
||||
#ifndef XP_MAC
|
||||
int numTries = 0;
|
||||
#endif
|
||||
|
||||
/* Do some parameter checking */
|
||||
if (!control) {
|
||||
@ -223,8 +226,12 @@ CMTStatus CMT_PKCS7DecoderFinish(PCMT_CONTROL control, CMUint32 connectionID,
|
||||
sockArr[1] = ctrlsock;
|
||||
/* Let's see if doing a poll first gets rid of a weird bug where we
|
||||
* lock up the client.
|
||||
* There are some cases where the server doesn't put up data fast
|
||||
* enough, so we should loop on this poll instead of just trying it
|
||||
* once.
|
||||
*/
|
||||
#ifndef XP_MAC
|
||||
poll_sockets:
|
||||
if (control->sockFuncs.select(sockArr,2,1) != NULL)
|
||||
#endif
|
||||
{
|
||||
@ -243,6 +250,17 @@ CMTStatus CMT_PKCS7DecoderFinish(PCMT_CONTROL control, CMUint32 connectionID,
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef XP_MAC
|
||||
else {
|
||||
#ifdef WIN32
|
||||
if (numTries < 20) {
|
||||
Sleep(100);
|
||||
numTries++;
|
||||
goto poll_sockets;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if (CMT_CloseDataConnection(control, connectionID) == CMTFailure) {
|
||||
goto loser;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user