From 8fe793a82af300c70a0006fd4247ccd0cda49d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Thu, 3 Apr 2014 14:26:49 +0200 Subject: [PATCH] 2014-04-03 14:26 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbnetio/netiosrv.c * fully consume RPC messages even if RPC is disabled. It allows to continue client connection in such case and process next messages. --- ChangeLog.txt | 5 +++++ contrib/hbnetio/netiosrv.c | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index b30596cf46..ba6da40003 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,11 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2014-04-03 14:26 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/hbnetio/netiosrv.c + * fully consume RPC messages even if RPC is disabled. It allows to + continue client connection in such case and process next messages. + 2014-04-03 12:17 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbnetio/netiosrv.c ! added missing condition to interrupt broken client connections diff --git a/contrib/hbnetio/netiosrv.c b/contrib/hbnetio/netiosrv.c index d30a48cdef..8b8b7f95b3 100644 --- a/contrib/hbnetio/netiosrv.c +++ b/contrib/hbnetio/netiosrv.c @@ -1449,11 +1449,6 @@ HB_FUNC( NETIO_SERVER ) case NETIO_PROCW: case NETIO_FUNC: case NETIO_FUNCCTRL: - if( ! conn->rpc ) - { - errCode = NETIO_ERR_UNSUPPORTED; - break; - } size = HB_GET_LE_UINT32( &msgbuf[ 4 ] ); if( size < 2 ) errCode = NETIO_ERR_WRONG_PARAM; @@ -1463,6 +1458,8 @@ HB_FUNC( NETIO_SERVER ) ptr = msg = ( HB_BYTE * ) hb_xgrab( size ); if( s_srvRecvAll( conn, msg, size ) != size ) errCode = NETIO_ERR_READ; + else if( ! conn->rpc ) + errCode = NETIO_ERR_UNSUPPORTED; else { const char * data = ( const char * ) msg;