summaryrefslogtreecommitdiff
path: root/instr-client.c
diff options
context:
space:
mode:
authorMike <mjc@avtechpulse.com>2000-01-01 02:16:19 +0900
committerMike <mjc@avtechpulse.com>2000-01-01 02:16:19 +0900
commit8b01a22ac70e86118b232bd2ae35433ac97f8418 (patch)
tree23fbfc18c233811a4ef7d256b699c3e8ed1b1cd5 /instr-client.c
parent58fd38e868db4dd690a3c2164857f377b19df841 (diff)
Split inputs into separate lines when multiple interactive commands are received
Diffstat (limited to 'instr-client.c')
-rw-r--r--instr-client.c14
1 files changed, 7 insertions, 7 deletions
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 <glib/gprintf.h>
#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);
}