summaryrefslogtreecommitdiff
path: root/src/ivysocket.c
diff options
context:
space:
mode:
authorfcolin2005-07-19 13:15:06 +0000
committerfcolin2005-07-19 13:15:06 +0000
commitb9adeda584ab24b9c7ed34496ab9af9d9fed1fe2 (patch)
tree683b4796b2043c61863867c7ecf01efc095b6ed4 /src/ivysocket.c
parenta68db8d4f235c2ea59aea9cf7311474ac85f5124 (diff)
downloadivy-c-b9adeda584ab24b9c7ed34496ab9af9d9fed1fe2.zip
ivy-c-b9adeda584ab24b9c7ed34496ab9af9d9fed1fe2.tar.gz
ivy-c-b9adeda584ab24b9c7ed34496ab9af9d9fed1fe2.tar.bz2
ivy-c-b9adeda584ab24b9c7ed34496ab9af9d9fed1fe2.tar.xz
binary protocol
Diffstat (limited to 'src/ivysocket.c')
-rw-r--r--src/ivysocket.c7
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 */