From 5d691b99232f9741ab814d14f60e93869af2cf29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Thu, 9 Apr 2015 00:20:40 +0200 Subject: [PATCH] 2015-04-09 00:20 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbnetio/netiosrv.c * contrib/hbtcpio/tcpio.c * call hb_socketShutdown() before hb_socketClose() to force output buffer flush in systems like MS-Windows. --- ChangeLog.txt | 6 ++++++ contrib/hbnetio/netiosrv.c | 4 ++++ contrib/hbtcpio/tcpio.c | 1 + 3 files changed, 11 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index d584153b9c..afa4b1fa81 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,12 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2015-04-09 00:20 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/hbnetio/netiosrv.c + * contrib/hbtcpio/tcpio.c + * call hb_socketShutdown() before hb_socketClose() to force output + buffer flush in systems like MS-Windows. + 2015-04-01 14:59 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/debug/dbgentry.c ! fixed typo in my previous commit for AltD() function detection diff --git a/contrib/hbnetio/netiosrv.c b/contrib/hbnetio/netiosrv.c index 4222d9834c..a6253a9e84 100644 --- a/contrib/hbnetio/netiosrv.c +++ b/contrib/hbnetio/netiosrv.c @@ -238,6 +238,7 @@ static void s_consrv_disconnect( PHB_CONSRV conn ) { if( conn->sd != HB_NO_SOCKET ) { + hb_socketShutdown( conn->sd, HB_SOCKET_SHUT_RDWR ); hb_socketClose( conn->sd ); conn->sd = HB_NO_SOCKET; } @@ -267,7 +268,10 @@ static void s_consrv_close( PHB_CONSRV conn ) hb_itemRelease( conn->mutex ); if( conn->sd != HB_NO_SOCKET ) + { + hb_socketShutdown( conn->sd, HB_SOCKET_SHUT_RDWR ); hb_socketClose( conn->sd ); + } if( conn->zstream ) hb_znetClose( conn->zstream ); diff --git a/contrib/hbtcpio/tcpio.c b/contrib/hbtcpio/tcpio.c index fed258f8c5..27d8c7a7de 100644 --- a/contrib/hbtcpio/tcpio.c +++ b/contrib/hbtcpio/tcpio.c @@ -176,6 +176,7 @@ static PHB_FILE s_fileOpen( PHB_FILE_FUNCS pFuncs, const char * pszName, static void s_fileClose( PHB_FILE pFile ) { + hb_socketShutdown( pFile->sd, HB_SOCKET_SHUT_RDWR ); hb_socketClose( pFile->sd ); hb_fsSetError( hb_socketGetError() ); hb_xfree( pFile );