From 5a19a3603418ed80bd39fc3a260ff6557045f7b0 Mon Sep 17 00:00:00 2001 From: fcolin Date: Fri, 20 May 2005 15:29:54 +0000 Subject: portages des modifications sur windows --- src/ivy.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/ivy.c') diff --git a/src/ivy.c b/src/ivy.c index 21e1841..ec1fc53 100644 --- a/src/ivy.c +++ b/src/ivy.c @@ -17,7 +17,10 @@ */ #include +#ifdef WIN32 +#else #include +#endif #include #include #include @@ -186,6 +189,9 @@ static void IvyCleanup() static int MsgCall (const char *message, MsgSndPtr msg, Client client) { + static char *buffer = NULL; /* Use satic mem to eliminate multiple call to malloc /free */ + static int size = 0; /* donc non reentrant !!!! */ + int offset = 0; int ovector[OVECSIZE]; int index; int rc=pcre_exec( @@ -204,19 +210,18 @@ MsgCall (const char *message, MsgSndPtr msg, Client client) // il faut essayer d'envoyer le message en une seule fois sur la socket // pour eviter au maximun de passer dans le select plusieur fois par message du protocole Ivy // pour eviter la latence ( PB de perfo detecte par ivyperf ping roudtrip ) - SocketSendBuffered( client, "%d %d" ARG_START ,Msg, msg->id); + offset += make_message_var( &buffer, &size, offset, "%d %d" ARG_START ,Msg, msg->id); #ifdef DEBUG printf( "Send matching args count %ld\n",msg->regexp.re_nsub); #endif index=1; while ( indexclient, Error, id, buffer); } -- cgit v1.1