[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1681 - GNUnet/src/applications/fragmentation
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1681 - GNUnet/src/applications/fragmentation |
Date: |
Sun, 14 Aug 2005 23:40:43 -0700 (PDT) |
Author: grothoff
Date: 2005-08-14 23:40:42 -0700 (Sun, 14 Aug 2005)
New Revision: 1681
Modified:
GNUnet/src/applications/fragmentation/fragmentation.c
Log:
cleanup
Modified: GNUnet/src/applications/fragmentation/fragmentation.c
===================================================================
--- GNUnet/src/applications/fragmentation/fragmentation.c 2005-08-15
04:22:07 UTC (rev 1680)
+++ GNUnet/src/applications/fragmentation/fragmentation.c 2005-08-15
06:40:42 UTC (rev 1681)
@@ -62,15 +62,6 @@
} P2P_fragmentation_MESSAGE;
/**
- * Message fragment.
- */
-typedef struct {
- P2P_fragmentation_MESSAGE fragment_message;
-
- char data[1];
-} P2P_fragmentation_MESSAGE_GENERIC;
-
-/**
* How many buckets does the fragment hash table
* have?
*/
@@ -216,7 +207,7 @@
pos = pep->head;
while (pos != NULL) {
memcpy(&msg[ntohs(pos->frag->off)],
- &((P2P_fragmentation_MESSAGE_GENERIC*)pos->frag)->data[0],
+ &pos->frag[1],
FRAGSIZE(pos));
pos = pos->link;
}
@@ -330,7 +321,9 @@
/* allocate pep */
pep = MALLOC(sizeof(FC));
pep->frag = MALLOC(ntohs(packet->header.size));
- memcpy(pep->frag, packet, ntohs(packet->header.size));
+ memcpy(pep->frag,
+ packet,
+ ntohs(packet->header.size));
pep->link = NULL;
if (before == NULL) {
@@ -472,7 +465,7 @@
frag->id = id;
frag->off = htons(0);
frag->len = htons(ctx->len);
- memcpy(&((P2P_fragmentation_MESSAGE_GENERIC*)frag)->data[0],
+ memcpy(&frag[1],
&ctx[1],
len - sizeof(P2P_fragmentation_MESSAGE));
@@ -489,7 +482,7 @@
frag->id = id;
frag->off = htons(pos);
frag->len = htons(ctx->len);
- memcpy(&((P2P_fragmentation_MESSAGE_GENERIC*)frag)->data[0],
+ memcpy(&frag[1],
&ctx[1],
mlen - sizeof(P2P_fragmentation_MESSAGE));
coreAPI->unicast(&ctx->sender,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1681 - GNUnet/src/applications/fragmentation,
grothoff <=