diff options
author | t3sserakt <t3ss@posteo.de> | 2022-04-25 17:38:31 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2022-04-25 17:38:31 +0200 |
commit | b35022d6d82b62605ebbcb7db565371af720552f (patch) | |
tree | 8126e12ed687e2c57a9ccddc3820bcd38ae351cc /src | |
parent | 3d9951c55a345640a6f240d6d5c3b7b5fe342b29 (diff) | |
download | gnunet-b35022d6d82b62605ebbcb7db565371af720552f.tar.gz gnunet-b35022d6d82b62605ebbcb7db565371af720552f.zip |
- added debug information
Diffstat (limited to 'src')
-rw-r--r-- | src/util/client.c | 10 | ||||
-rw-r--r-- | src/util/mst.c | 19 |
2 files changed, 19 insertions, 10 deletions
diff --git a/src/util/client.c b/src/util/client.c index 4e5eca32a..9950c9e2f 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -261,12 +261,13 @@ transmit_ready (void *cls) | |||
261 | len = ntohs (cstate->msg->size); | 261 | len = ntohs (cstate->msg->size); |
262 | GNUNET_assert (cstate->msg_off < len); | 262 | GNUNET_assert (cstate->msg_off < len); |
263 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 263 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
264 | "message of type %u trying to send with socket %p (MQ: %p\n", | 264 | "message of type %u and size %u trying to send with socket %p (MQ: %p\n", |
265 | ntohs (cstate->msg->type), | 265 | ntohs (cstate->msg->type), |
266 | ntohs (cstate->msg->size), | ||
266 | cstate->sock, | 267 | cstate->sock, |
267 | cstate->mq); | 268 | cstate->mq); |
268 | 269 | ||
269 | RETRY: | 270 | RETRY: |
270 | ret = GNUNET_NETWORK_socket_send (cstate->sock, | 271 | ret = GNUNET_NETWORK_socket_send (cstate->sock, |
271 | &pos[cstate->msg_off], | 272 | &pos[cstate->msg_off], |
272 | len - cstate->msg_off); | 273 | len - cstate->msg_off); |
@@ -311,8 +312,9 @@ RETRY: | |||
311 | return; | 312 | return; |
312 | } | 313 | } |
313 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 314 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
314 | "sending message of type %u successful\n", | 315 | "sending message of type %u and size %u successful\n", |
315 | ntohs (cstate->msg->type)); | 316 | ntohs (cstate->msg->type), |
317 | ntohs (cstate->msg->size)); | ||
316 | cstate->msg = NULL; | 318 | cstate->msg = NULL; |
317 | GNUNET_MQ_impl_send_continue (cstate->mq); | 319 | GNUNET_MQ_impl_send_continue (cstate->mq); |
318 | } | 320 | } |
diff --git a/src/util/mst.c b/src/util/mst.c index 13835ffd0..2236f2883 100644 --- a/src/util/mst.c +++ b/src/util/mst.c | |||
@@ -129,14 +129,16 @@ GNUNET_MST_from_buffer (struct GNUNET_MessageStreamTokenizer *mst, | |||
129 | GNUNET_assert (mst->off <= mst->pos); | 129 | GNUNET_assert (mst->off <= mst->pos); |
130 | GNUNET_assert (mst->pos <= mst->curr_buf); | 130 | GNUNET_assert (mst->pos <= mst->curr_buf); |
131 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 131 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
132 | "MST receives %u bytes with %u bytes already in private buffer\n", | 132 | "MST receives %u bytes with %u (%u/%u) bytes already in private buffer\n", |
133 | (unsigned int) size, | 133 | (unsigned int) size, |
134 | (unsigned int) (mst->pos - mst->off)); | 134 | (unsigned int) (mst->pos - mst->off), |
135 | (unsigned int) mst->pos, | ||
136 | (unsigned int) mst->off); | ||
135 | ret = GNUNET_OK; | 137 | ret = GNUNET_OK; |
136 | ibuf = (char *) mst->hdr; | 138 | ibuf = (char *) mst->hdr; |
137 | while (mst->pos > 0) | 139 | while (mst->pos > 0) |
138 | { | 140 | { |
139 | do_align: | 141 | do_align: |
140 | GNUNET_assert (mst->pos >= mst->off); | 142 | GNUNET_assert (mst->pos >= mst->off); |
141 | if ((mst->curr_buf - mst->off < sizeof(struct GNUNET_MessageHeader)) || | 143 | if ((mst->curr_buf - mst->off < sizeof(struct GNUNET_MessageHeader)) || |
142 | (0 != (mst->off % ALIGN_FACTOR))) | 144 | (0 != (mst->off % ALIGN_FACTOR))) |
@@ -172,6 +174,9 @@ do_align: | |||
172 | } | 174 | } |
173 | hdr = (const struct GNUNET_MessageHeader *) &ibuf[mst->off]; | 175 | hdr = (const struct GNUNET_MessageHeader *) &ibuf[mst->off]; |
174 | want = ntohs (hdr->size); | 176 | want = ntohs (hdr->size); |
177 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
178 | "We want to read message of size %u\n", | ||
179 | want); | ||
175 | if (want < sizeof(struct GNUNET_MessageHeader)) | 180 | if (want < sizeof(struct GNUNET_MessageHeader)) |
176 | { | 181 | { |
177 | GNUNET_break_op (0); | 182 | GNUNET_break_op (0); |
@@ -299,7 +304,7 @@ do_align: | |||
299 | goto do_align; | 304 | goto do_align; |
300 | } | 305 | } |
301 | } | 306 | } |
302 | copy: | 307 | copy: |
303 | if ((size > 0) && (! purge)) | 308 | if ((size > 0) && (! purge)) |
304 | { | 309 | { |
305 | if (size + mst->pos > mst->curr_buf) | 310 | if (size + mst->pos > mst->curr_buf) |
@@ -321,8 +326,10 @@ copy: | |||
321 | mst->pos = 0; | 326 | mst->pos = 0; |
322 | } | 327 | } |
323 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 328 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
324 | "Server-mst leaves %u bytes in private buffer\n", | 329 | "Server-mst leaves %u (%u/%u) bytes in private buffer\n", |
325 | (unsigned int) (mst->pos - mst->off)); | 330 | (unsigned int) (mst->pos - mst->off), |
331 | (unsigned int) mst->pos, | ||
332 | (unsigned int) mst->off); | ||
326 | return ret; | 333 | return ret; |
327 | } | 334 | } |
328 | 335 | ||