From: eihrul Date: Thu, 1 Dec 2011 19:39:23 +0000 (+0000) Subject: check for valid socket in Con_Rcon_Redirect_Flush X-Git-Tag: xonotic-v0.6.0~102^2~33 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=71b34cba76442935fbe8b1a1db334da8715f5ceb;p=xonotic%2Fdarkplaces.git check for valid socket in Con_Rcon_Redirect_Flush git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11586 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/console.c b/console.c index 14175b07..831c30a9 100644 --- a/console.c +++ b/console.c @@ -905,13 +905,16 @@ void Con_Rcon_Redirect_Init(lhnetsocket_t *sock, lhnetaddress_t *dest, qboolean static void Con_Rcon_Redirect_Flush(void) { - rcon_redirect_buffer[rcon_redirect_bufferpos] = 0; - if (rcon_redirect_proquakeprotocol) + if(rcon_redirect_sock) { - // update the length in the packet header - StoreBigLong((unsigned char *)rcon_redirect_buffer, NETFLAG_CTL | (rcon_redirect_bufferpos & NETFLAG_LENGTH_MASK)); + rcon_redirect_buffer[rcon_redirect_bufferpos] = 0; + if (rcon_redirect_proquakeprotocol) + { + // update the length in the packet header + StoreBigLong((unsigned char *)rcon_redirect_buffer, NETFLAG_CTL | (rcon_redirect_bufferpos & NETFLAG_LENGTH_MASK)); + } + NetConn_Write(rcon_redirect_sock, rcon_redirect_buffer, rcon_redirect_bufferpos, rcon_redirect_dest); } - NetConn_Write(rcon_redirect_sock, rcon_redirect_buffer, rcon_redirect_bufferpos, rcon_redirect_dest); memcpy(rcon_redirect_buffer, "\377\377\377\377n", 5); // QW rcon print rcon_redirect_bufferpos = 5; rcon_redirect_proquakeprotocol = false;