[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r2734 - in GNUnet/src/applications: fs/ecrs fs/module gap s
From: |
grothoff |
Subject: |
[GNUnet-SVN] r2734 - in GNUnet/src/applications: fs/ecrs fs/module gap sqstore_sqlite |
Date: |
Fri, 5 May 2006 00:53:38 -0700 (PDT) |
Author: grothoff
Date: 2006-05-05 00:53:34 -0700 (Fri, 05 May 2006)
New Revision: 2734
Modified:
GNUnet/src/applications/fs/ecrs/download.c
GNUnet/src/applications/fs/ecrs/upload.c
GNUnet/src/applications/fs/module/fs.c
GNUnet/src/applications/gap/gap.c
GNUnet/src/applications/gap/gap.h
GNUnet/src/applications/sqstore_sqlite/sqlite.c
Log:
some IBlocks had priority 0 resulting in being quickly discarded if the
datastore was near-full
Modified: GNUnet/src/applications/fs/ecrs/download.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/download.c 2006-05-05 06:41:18 UTC (rev
2733)
+++ GNUnet/src/applications/fs/ecrs/download.c 2006-05-05 07:53:34 UTC (rev
2734)
@@ -31,7 +31,7 @@
#include "ecrs.h"
#include "tree.h"
-#define DEBUG_DOWNLOAD NO
+#define DEBUG_DOWNLOAD NO
/**
* Highest TTL allowed? (equivalent of 25-50 HOPS distance!)
Modified: GNUnet/src/applications/fs/ecrs/upload.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/upload.c 2006-05-05 06:41:18 UTC (rev
2733)
+++ GNUnet/src/applications/fs/ecrs/upload.c 2006-05-05 07:53:34 UTC (rev
2734)
@@ -49,7 +49,8 @@
static int pushBlock(GNUNET_TCP_SOCKET * sock,
const CHK * chk,
unsigned int level,
- Datastore_Value ** iblocks) {
+ Datastore_Value ** iblocks,
+ unsigned int prio) {
unsigned int size;
unsigned int present;
Datastore_Value * value;
@@ -84,7 +85,8 @@
if (OK != pushBlock(sock,
&ichk,
level+1,
- iblocks))
+ iblocks,
+ prio))
return SYSERR;
fileBlockEncode(db,
size,
@@ -94,6 +96,7 @@
BREAK();
return SYSERR;
}
+ value->prio = htonl(prio);
#if DEBUG_UPLOAD
IFLOG(LOG_DEBUG,
hash2enc(&ichk.query,
@@ -330,7 +333,8 @@
if (OK != pushBlock(sock,
&chk,
0, /* dblocks are on level 0 */
- iblocks))
+ iblocks,
+ priority))
goto FAILURE;
}
if (tt != NULL)
@@ -376,7 +380,8 @@
if (OK != pushBlock(sock,
&chk,
i+1,
- iblocks))
+ iblocks,
+ priority))
goto FAILURE;
fileBlockEncode(db,
size,
@@ -386,6 +391,7 @@
BREAK();
goto FAILURE;
}
+ value->prio = htonl(priority);
if (OK != FS_insert(sock,
value)) {
FREE(value);
Modified: GNUnet/src/applications/fs/module/fs.c
===================================================================
--- GNUnet/src/applications/fs/module/fs.c 2006-05-05 06:41:18 UTC (rev
2733)
+++ GNUnet/src/applications/fs/module/fs.c 2006-05-05 07:53:34 UTC (rev
2734)
@@ -298,9 +298,10 @@
hash2enc(&query,
&enc));
LOG(LOG_DEBUG,
- "FS received REQUEST INSERT (query: `%s', type: %u)\n",
+ "FS received REQUEST INSERT (query: `%s', type: %u, priority %u)\n",
&enc,
- type);
+ type,
+ ntohl(ri->prio));
#endif
datum->type = htonl(type);
memcpy(&datum[1],
Modified: GNUnet/src/applications/gap/gap.c
===================================================================
--- GNUnet/src/applications/gap/gap.c 2006-05-05 06:41:18 UTC (rev 2733)
+++ GNUnet/src/applications/gap/gap.c 2006-05-05 07:53:34 UTC (rev 2734)
@@ -1265,7 +1265,7 @@
&recv);
#if DEBUG_GAP
IFLOG(LOG_DEBUG,
- hash2enc(&recv,
+ hash2enc(&recv.hashPubKey,
&enc));
LOG(LOG_DEBUG,
"GAP sending reply to `%s'\n",
@@ -1540,7 +1540,7 @@
IFLOG(LOG_DEBUG,
if (host != NULL)
- hash2enc(&hostId->hashPubKey,
+ hash2enc(&host->hashPubKey,
&enc));
LOG(LOG_DEBUG,
"GAP received content from `%s'\n",
@@ -1914,7 +1914,7 @@
}
LOG(LOG_DEBUG,
"Dropping query from %s, this peer is too busy.\n",
- sender == NULL ? "localhost" : &enc);
+ sender == NULL ? "localhost" : (char*)&enc);
#endif
return OK;
}
@@ -1980,7 +1980,7 @@
}
LOG(LOG_DEBUG,
"Dropping query from %s, policy decided that this peer is too busy.\n",
- sender == NULL ? "localhost" : &enc);
+ sender == NULL ? "localhost" : (const char*) &enc);
#endif
if (stats != NULL)
stats->change(stat_routing_direct_drops, 1);
Modified: GNUnet/src/applications/gap/gap.h
===================================================================
--- GNUnet/src/applications/gap/gap.h 2006-05-05 06:41:18 UTC (rev 2733)
+++ GNUnet/src/applications/gap/gap.h 2006-05-05 07:53:34 UTC (rev 2734)
@@ -37,7 +37,7 @@
#include "gnunet_topology_service.h"
#include "pid_table.h"
-#define DEBUG_GAP NO
+#define DEBUG_GAP YES
#define EXTRA_CHECKS YES
@@ -158,8 +158,8 @@
* THE VALUE YOU PICK MUST BE A POWER OF 2, for example:
* 128, 256, 512, 1024, 2048, 4092, 8192, 16384, 32768, 65536
*/
-#define MIN_INDIRECTION_TABLE_SIZE 1024
-/* #define MIN_INDIRECTION_TABLE_SIZE 8 */
+/* #define MIN_INDIRECTION_TABLE_SIZE 1024 */
+#define MIN_INDIRECTION_TABLE_SIZE 4
/**
* Under certain cirumstances, two peers can interlock in their
Modified: GNUnet/src/applications/sqstore_sqlite/sqlite.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlite.c 2006-05-05 06:41:18 UTC
(rev 2733)
+++ GNUnet/src/applications/sqstore_sqlite/sqlite.c 2006-05-05 07:53:34 UTC
(rev 2734)
@@ -776,9 +776,10 @@
hash2enc(key,
&enc));
LOG(LOG_DEBUG,
- "Storing in database block with type %u and key `%s'.\n",
+ "Storing in database block with type %u, key `%s' and priority %u.\n",
ntohl(*(int*)&value[1]),
- &enc);
+ &enc,
+ ntohl(value->prio));
#endif
if ( (ntohl(value->size) < sizeof(Datastore_Value)) ) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r2734 - in GNUnet/src/applications: fs/ecrs fs/module gap sqstore_sqlite,
grothoff <=