Skip to content
Snippets Groups Projects
Commit 2cddddce authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Check socket writability in JS Socket.send()

BINKP is suddenly frequently hanging on sendsocket() on Vertrauen on Windows
(sending files to my Z1 hub) so try this as a solution.
parent 798835d4
No related branches found
No related tags found
No related merge requests found
......@@ -337,8 +337,12 @@ static ptrdiff_t js_socket_sendsocket(js_socket_private_t *p, const void *msg, s
int copied=0,ret;
char *estr;
if(p->session==-1)
if(p->session==-1) {
BOOL wr = FALSE;
if(!socket_check(p->sock, NULL, &wr, 0) || !wr)
return 0;
return sendsocket(p->sock, msg, len);
}
do {
// If we don't limit this, we occasionally get errors on large sends...
if((ret=cryptPushData(p->session, msg, len > 0x2000 ? 0x2000 : len, &copied))==CRYPT_OK) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment