[srm-cvs] CVS Update: - Fix reading long packets (patch by: Christian Dickmann <chrisdicki@gmx.de>)

From: <d.rethans[@]jdimedia.nl>
Date: Tue Feb 19 2002 - 17:27:10 CET

Date: Tue Feb 19 17:27:09 CET 2002
User: Derick Rethans
Directory: srm/main/src

Log Message:
 [0.25]
 - Fix reading long packets (patch by: Christian Dickmann <chrisdicki@gmx.de>)
 
Modified files:
           srm/main/src/srm_client.c (version: 1.14)

[FILE: /srm/main/src/srm_client.c]

--- srm/main/src/srm_client.c:1.13 Mon Jan 14 18:53:52 2002 GMT
+++ srm/main/src/srm_client.c Tue Feb 19 15:27:09 2002 GMT
@@ -1,4 +1,4 @@
-/* $Id: cvstemp,v 1.13 2002/01/14 19:53:52 peter Exp $ */
+/* $Id: cvstemp,v 1.14 2002/02/19 16:27:09 derick Exp $ */
 
 /* The contents of this file are subject to the Vulcan Logic Public
  * License Version 1.1 (the "License"); you may not use this file
@@ -72,7 +72,10 @@
                 memcpy (connect_data->sess_key, packet.session_key, sizeof (sess_key_t));
                 if (packet.data_length != 0) {
                         data = malloc (packet.data_length);
- dlength = read (connect_data->sock, data, packet.data_length);
+ dlength = 0;
+ while (packet.data_length != dlength) {
+ dlength += read (connect_data->sock, data + dlength, packet.data_length - dlength);
+ }
                         deserialize (data, dlength, (struct srm_value**) &val, 0);
                         free (data);
                         if (NULL != sdata) {
Received on Tue Feb 19 17:26:52 2002

This archive was generated by hypermail 2.1.8 : Tue Jan 06 2009 - 03:00:03 CET