summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-29 05:19:01 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-29 05:19:01 +0000
commit02720aae3af5cc563a8b6dd374b5aebd5a0da074 (patch)
tree59ebbe47fe076464218bbde1a5206768ae1d0601 /src/common
parent893a5922031f91f0599480d2ffbf525b76803165 (diff)
downloadhercules-02720aae3af5cc563a8b6dd374b5aebd5a0da074.tar.gz
hercules-02720aae3af5cc563a8b6dd374b5aebd5a0da074.tar.bz2
hercules-02720aae3af5cc563a8b6dd374b5aebd5a0da074.tar.xz
hercules-02720aae3af5cc563a8b6dd374b5aebd5a0da074.zip
A few bug fixes
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@412 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common')
-rw-r--r--src/common/socket.c13
-rw-r--r--src/common/socket.h2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index 4afcf50d4..703361627 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -121,8 +121,10 @@ static int send_from_fifo(int fd)
int len;
//printf("send_from_fifo : %d\n",fd);
- if(session[fd]->eof)
+ if(session[fd]->eof || session[fd]->wdata == 0)
return -1;
+ if (session[fd]->wdata_size == 0)
+ return 0;
#ifdef _WIN32
len=send(fd, session[fd]->wdata,session[fd]->wdata_size, 0);
@@ -148,6 +150,15 @@ static int send_from_fifo(int fd)
return 0;
}
+void flush_fifos_for_final()
+{
+ int i;
+ for(i=0;i<fd_max;i++)
+ if(session[i] != NULL &&
+ session[i]->func_send == send_from_fifo)
+ send_from_fifo(i);
+}
+
static int null_parse(int fd)
{
printf("null_parse : %d\n",fd);
diff --git a/src/common/socket.h b/src/common/socket.h
index e3ad0826a..94ca1b93f 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -90,6 +90,8 @@ int do_sendrecv(int next);
int do_parsepacket(void);
void do_socket(void);
+extern void flush_fifos_for_final();
+
int start_console(void);
void set_defaultparse(int (*defaultparse)(int));