rsrv: locking in cas_send_bs_msg()
Must lock around "pclient->send.stk = 0u;"
This commit is contained in:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user