diff options
Diffstat (limited to 'src/ivysocket.c')
-rw-r--r-- | src/ivysocket.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 */ |