aboutsummaryrefslogtreecommitdiff
path: root/src/hostlist/hostlist-client.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-03-16 09:00:33 +0000
committerChristian Grothoff <christian@grothoff.org>2010-03-16 09:00:33 +0000
commitaea1ff2765ee7f6ba2317e4f68693094effb448d (patch)
tree438737272f4b7ddb47cae24d76ce5d7b8fa13ec3 /src/hostlist/hostlist-client.c
parente715b0ba6779f1b9a2764ce7adbbcb36d97ec1fc (diff)
downloadgnunet-aea1ff2765ee7f6ba2317e4f68693094effb448d.tar.gz
gnunet-aea1ff2765ee7f6ba2317e4f68693094effb448d.zip
logging
Diffstat (limited to 'src/hostlist/hostlist-client.c')
-rw-r--r--src/hostlist/hostlist-client.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c
index 381638554..99b43f008 100644
--- a/src/hostlist/hostlist-client.c
+++ b/src/hostlist/hostlist-client.c
@@ -159,7 +159,10 @@ download_hostlist_processor (void *ptr,
159 download_pos += cpy; 159 download_pos += cpy;
160 left -= cpy; 160 left -= cpy;
161 if (download_pos < sizeof(struct GNUNET_MessageHeader)) 161 if (download_pos < sizeof(struct GNUNET_MessageHeader))
162 break; 162 {
163 GNUNET_assert (left == 0);
164 break;
165 }
163 msg = (const struct GNUNET_MessageHeader *) download_buffer; 166 msg = (const struct GNUNET_MessageHeader *) download_buffer;
164 msize = ntohs(msg->size); 167 msize = ntohs(msg->size);
165 if (msize < sizeof(struct GNUNET_MessageHeader)) 168 if (msize < sizeof(struct GNUNET_MessageHeader))
@@ -176,7 +179,10 @@ download_hostlist_processor (void *ptr,
176 return total; 179 return total;
177 } 180 }
178 if (download_pos < msize) 181 if (download_pos < msize)
179 break; 182 {
183 GNUNET_assert (left == 0);
184 break;
185 }
180 if (GNUNET_HELLO_size ((const struct GNUNET_HELLO_Message*)msg) == msize) 186 if (GNUNET_HELLO_size ((const struct GNUNET_HELLO_Message*)msg) == msize)
181 { 187 {
182#if DEBUG_HOSTLIST_CLIENT 188#if DEBUG_HOSTLIST_CLIENT
@@ -200,7 +206,7 @@ download_hostlist_processor (void *ptr,
200 _("Invalid `%s' message received from hostlist at `%s'\n"), 206 _("Invalid `%s' message received from hostlist at `%s'\n"),
201 "HELLO", 207 "HELLO",
202 current_url); 208 current_url);
203 bogus_url = 1; 209 bogus_url = GNUNET_YES;
204 return total; 210 return total;
205 } 211 }
206 memmove (download_buffer, 212 memmove (download_buffer,