summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2015-01-17 14:28:00 -0200
committershennetsind <ind@henn.et>2015-01-17 14:28:00 -0200
commit36fa0940d5c97457f7093d81e7d298c88dac14af (patch)
tree59c13724f211c80cab1f94e5f0294fb286303159 /src
parent67fbbd2b41ae93c095232bb6b07615261245436f (diff)
downloadhercules-36fa0940d5c97457f7093d81e7d298c88dac14af.tar.gz
hercules-36fa0940d5c97457f7093d81e7d298c88dac14af.tar.bz2
hercules-36fa0940d5c97457f7093d81e7d298c88dac14af.tar.xz
hercules-36fa0940d5c97457f7093d81e7d298c88dac14af.zip
Stat server submission logic update
to ensure report is submit in full. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/char/char.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 1b8d466f9..1d9d1d65c 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -45,6 +45,10 @@
#include "../common/timer.h"
#include "../common/utils.h"
+#ifndef WIN32
+ #include <unistd.h>
+#endif
+
// private declarations
#define CHAR_CONF_NAME "conf/char-server.conf"
#define LAN_CONF_NAME "conf/subnet.conf"
@@ -3746,7 +3750,14 @@ void char_parse_frommap_request_stats_report(int fd)
WFIFOSET(sfd, RFIFOW(fd,2) );
- flush_fifo(sfd);
+ do {
+ flush_fifo(sfd);
+#ifdef WIN32
+ Sleep(1);
+#else
+ sleep(1);
+#endif
+ } while( !session[sfd]->flag.eof && session[sfd]->wdata_size );
do_close(sfd);