summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
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));