From b9adeda584ab24b9c7ed34496ab9af9d9fed1fe2 Mon Sep 17 00:00:00 2001 From: fcolin Date: Tue, 19 Jul 2005 13:15:06 +0000 Subject: binary protocol --- src/ivysocket.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/ivysocket.c') diff --git a/src/ivysocket.c b/src/ivysocket.c index 4b9f279..16991d9 100644 --- a/src/ivysocket.c +++ b/src/ivysocket.c @@ -175,16 +175,17 @@ static void HandleSocket (Channel channel, HANDLE fd, void *data) return; } client->ptr += nb; - ptr = client->buffer; if (! client->interpretation ) { client->ptr = client->buffer; fprintf (stderr,"Socket No interpretation function ??? skipping data\n"); return; } - while ((ptr_end = (*client->interpretation) (client, client->data, ptr, client->ptr - ptr ))) + ptr = client->buffer; + + while ( (client->ptr > ptr )&&(ptr_end = (*client->interpretation) (client, client->data, ptr, client->ptr - ptr ))) { - ptr = ++ptr_end; + ptr = ptr_end; } if (ptr < client->ptr ) { /* recopie message incomplet au debut du buffer */ -- cgit v1.1