From 8b01a22ac70e86118b232bd2ae35433ac97f8418 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 1 Jan 2000 02:16:19 +0900 Subject: Split inputs into separate lines when multiple interactive commands are received --- instr-client.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'instr-client.c') diff --git a/instr-client.c b/instr-client.c index 6685176..29a3fe0 100644 --- a/instr-client.c +++ b/instr-client.c @@ -8,9 +8,9 @@ #include #include "response.h" +#include "globals.h" static int port = 3333; -#define BUFSIZE 1024 GMainContext *context=NULL; GMainLoop *mainLoop=NULL; @@ -54,9 +54,9 @@ static gboolean Matches(char *src, char* dst, gssize size) static gboolean stdinAvailable (GIOChannel *source, GIOCondition condition, gpointer data) { - char tmp[BUFSIZE]; - memset(tmp,0,BUFSIZE); - int size = read(0, tmp, BUFSIZE); + char tmp[STDBUFSIZE]; + memset(tmp,0,STDBUFSIZE); + int size = read(0, tmp, STDBUFSIZE); if(size<=0) { return TRUE; } @@ -133,14 +133,14 @@ stdinAvailable (GIOChannel *source, GIOCondition condition, gpointer data) //callback for server input static gboolean cbServerInput(gpointer data, gpointer additional) { - char buffer[BUFSIZE]; + char buffer[STDBUFSIZE]; gssize size=0; - memset(buffer,0,BUFSIZE); + memset(buffer,0,STDBUFSIZE); GPollableInputStream* inStream = (GPollableInputStream*)data; GError *error = NULL; - size=g_pollable_input_stream_read_nonblocking(inStream, buffer, BUFSIZE, NULL, &error); + size=g_pollable_input_stream_read_nonblocking(inStream, buffer, STDBUFSIZE, NULL, &error); if(size <=0) { terminate("Connection to server lost", -1); } -- cgit