aboutsummaryrefslogtreecommitdiff
path: root/src/fragmentation
diff options
context:
space:
mode:
authorJi Lu <jilu@140774ce-b5e7-0310-ab8b-a85725594a96>2010-04-01 15:00:33 +0000
committerJi Lu <jilu@140774ce-b5e7-0310-ab8b-a85725594a96>2010-04-01 15:00:33 +0000
commitebb09b65cddeee11ea8a6e3a95eb328bc0f7711c (patch)
treed3a818f76920c3ae8e838bb25dd75ec88dfd9315 /src/fragmentation
parent6dac073d8bdd079f31b147ee35757d86fcac0246 (diff)
downloadgnunet-ebb09b65cddeee11ea8a6e3a95eb328bc0f7711c.tar.gz
gnunet-ebb09b65cddeee11ea8a6e3a95eb328bc0f7711c.zip
passed test
Diffstat (limited to 'src/fragmentation')
-rw-r--r--src/fragmentation/fragmentation.c7
-rw-r--r--src/fragmentation/test_frag_ji.c2
2 files changed, 3 insertions, 6 deletions
diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c
index 74d5a6b4c..c3739a3e9 100644
--- a/src/fragmentation/fragmentation.c
+++ b/src/fragmentation/fragmentation.c
@@ -50,10 +50,9 @@ struct Fragment
50 uint16_t off GNUNET_PACKED; 50 uint16_t off GNUNET_PACKED;
51 51
52 /** 52 /**
53 * "unique" id for the fragment 53 * "unique" id for the fragment
54 */ 54 */
55 uint32_t id GNUNET_PACKED; 55 uint32_t id GNUNET_PACKED;
56
57 uint16_t mtu; 56 uint16_t mtu;
58 uint16_t totalNum; 57 uint16_t totalNum;
59 uint16_t totalSize; 58 uint16_t totalSize;
@@ -153,7 +152,6 @@ GNUNET_FRAGMENT_fragment (const struct GNUNET_MessageHeader *msg,
153 } 152 }
154} 153}
155 154
156
157/** 155/**
158 * Create a defragmentation context. 156 * Create a defragmentation context.
159 * 157 *
@@ -216,7 +214,6 @@ GNUNET_FRAGMENT_process (struct GNUNET_FRAGMENT_Context *ctx,
216 buffer = ctx->buffer; 214 buffer = ctx->buffer;
217 while (buffer != NULL) 215 while (buffer != NULL)
218 { 216 {
219//for(buffer = ctx->buffer; buffer != NULL; buffer = buffer->next){
220 if(buffer->id == ntohl(frag->id)&&(buffer->peerID==sender)){ 217 if(buffer->id == ntohl(frag->id)&&(buffer->peerID==sender)){
221 exist = 1; 218 exist = 1;
222 break; 219 break;
diff --git a/src/fragmentation/test_frag_ji.c b/src/fragmentation/test_frag_ji.c
index 6512ddb03..4779abddd 100644
--- a/src/fragmentation/test_frag_ji.c
+++ b/src/fragmentation/test_frag_ji.c
@@ -41,7 +41,7 @@ main(int argc, char * argv[]){
41 struct GNUNET_FRAGMENT_Context * ctx; 41 struct GNUNET_FRAGMENT_Context * ctx;
42 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *)GNUNET_malloc(sizeof(struct GNUNET_MessageHeader)+2*mtu); 42 struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *)GNUNET_malloc(sizeof(struct GNUNET_MessageHeader)+2*mtu);
43 ctx = GNUNET_FRAGMENT_context_create(NULL, message_proc1, msg); 43 ctx = GNUNET_FRAGMENT_context_create(NULL, message_proc1, msg);
44 msg->size = htons(sizeof(struct GNUNET_MessageHeader)+2*mtu); 44 msg->size = htons(sizeof(struct GNUNET_MessageHeader)+4*mtu);
45 msg->type = htons(GNUNET_MESSAGE_TYPE_HELLO); 45 msg->type = htons(GNUNET_MESSAGE_TYPE_HELLO);
46 struct GNUNET_PeerIdentity *sender; 46 struct GNUNET_PeerIdentity *sender;
47 sender = (struct GNUNET_PeerIdentity *)GNUNET_malloc(sizeof(struct GNUNET_PeerIdentity)); 47 sender = (struct GNUNET_PeerIdentity *)GNUNET_malloc(sizeof(struct GNUNET_PeerIdentity));