rsrv: locking in cas_send_bs_msg()

Must lock around "pclient->send.stk = 0u;"
This commit is contained in:
Michael Davidsaver
2017-07-31 12:38:14 +02:00
parent 619a99bf99
commit 4b272cc0cf
+6 -4
View File
@@ -45,6 +45,10 @@ void cas_send_bs_msg ( struct client *pclient, int lock_needed )
{
int status;
if ( lock_needed ) {
SEND_LOCK ( pclient );
}
if ( CASDEBUG > 2 && pclient->send.stk ) {
errlogPrintf ( "CAS: Sending a message of %d bytes\n", pclient->send.stk );
}
@@ -55,13 +59,11 @@ void cas_send_bs_msg ( struct client *pclient, int lock_needed )
pclient->sock, (unsigned) pclient->addr.sin_addr.s_addr );
}
pclient->send.stk = 0u;
if(lock_needed)
SEND_UNLOCK(pclient);
return;
}
if ( lock_needed ) {
SEND_LOCK ( pclient );
}
while ( pclient->send.stk && ! pclient->disconnect ) {
status = send ( pclient->sock, pclient->send.buf, pclient->send.stk, 0 );
if ( status >= 0 ) {