passed test
authorJi Lu <jilu@140774ce-b5e7-0310-ab8b-a85725594a96>
Thu, 1 Apr 2010 15:00:33 +0000 (15:00 +0000)
committerJi Lu <jilu@140774ce-b5e7-0310-ab8b-a85725594a96>
Thu, 1 Apr 2010 15:00:33 +0000 (15:00 +0000)
src/fragmentation/fragmentation.c
src/fragmentation/test_frag_ji.c

index 74d5a6b4c04b292243ea93202b7a7d899e97a980..c3739a3e9e71116b3ec76de5435a8e39c9c05939 100644 (file)
@@ -50,10 +50,9 @@ struct Fragment
        uint16_t off GNUNET_PACKED;
 
        /**
-                        * "unique" id for the fragment
-                        */
+       * "unique" id for the fragment
+        */
        uint32_t id GNUNET_PACKED;
-
        uint16_t mtu;
        uint16_t totalNum;
        uint16_t totalSize;
@@ -153,7 +152,6 @@ GNUNET_FRAGMENT_fragment (const struct GNUNET_MessageHeader *msg,
        }
 }
 
-
 /**
  * Create a defragmentation context.
  *
@@ -216,7 +214,6 @@ GNUNET_FRAGMENT_process (struct GNUNET_FRAGMENT_Context *ctx,
        buffer = ctx->buffer;
        while (buffer != NULL)
        {
-//for(buffer = ctx->buffer; buffer != NULL; buffer = buffer->next){
                if(buffer->id == ntohl(frag->id)&&(buffer->peerID==sender)){
                        exist = 1;
                        break;
index 6512ddb034624352de1cff48268642bd430d2398..4779abdddbea5358ff35a58a68193fac45aad769 100644 (file)
@@ -41,7 +41,7 @@ main(int argc, char * argv[]){
        struct GNUNET_FRAGMENT_Context * ctx;\r
        struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *)GNUNET_malloc(sizeof(struct GNUNET_MessageHeader)+2*mtu);\r
        ctx = GNUNET_FRAGMENT_context_create(NULL, message_proc1, msg);\r
-       msg->size = htons(sizeof(struct GNUNET_MessageHeader)+2*mtu);\r
+       msg->size = htons(sizeof(struct GNUNET_MessageHeader)+4*mtu);\r
        msg->type = htons(GNUNET_MESSAGE_TYPE_HELLO);\r
        struct GNUNET_PeerIdentity *sender;\r
        sender = (struct GNUNET_PeerIdentity *)GNUNET_malloc(sizeof(struct GNUNET_PeerIdentity));\r