[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r233 - in GNUnet/src/applications/fs: ecrs lib module
From: |
grothoff |
Subject: |
[GNUnet-SVN] r233 - in GNUnet/src/applications/fs: ecrs lib module |
Date: |
Thu, 10 Feb 2005 15:55:11 -0800 (PST) |
Author: grothoff
Date: 2005-02-10 15:55:11 -0800 (Thu, 10 Feb 2005)
New Revision: 233
Modified:
GNUnet/src/applications/fs/ecrs/download.c
GNUnet/src/applications/fs/ecrs/upload.c
GNUnet/src/applications/fs/lib/fslib.c
GNUnet/src/applications/fs/module/fs.c
Log:
adding debug statements
Modified: GNUnet/src/applications/fs/ecrs/download.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/download.c 2005-02-10 21:52:28 UTC (rev
232)
+++ GNUnet/src/applications/fs/ecrs/download.c 2005-02-10 23:55:11 UTC (rev
233)
@@ -482,7 +482,15 @@
static void addRequest(RequestManager * rm,
NodeClosure * node) {
RequestEntry * entry;
+ EncName enc;
+ IFLOG(LOG_DEBUG,
+ hash2enc(&node->chk.query,
+ &enc));
+ LOG(LOG_DEBUG,
+ "Queuing request (query: %s)\n",
+ &enc);
+
GNUNET_ASSERT(node != NULL);
entry
= MALLOC(sizeof(RequestEntry));
@@ -796,7 +804,15 @@
unsigned int size;
int i;
char * data;
+ EncName enc;
+ IFLOG(LOG_DEBUG,
+ hash2enc(query,
+ &enc));
+ LOG(LOG_DEBUG,
+ "Receiving reply to query %s\n",
+ &enc);
+
GNUNET_ASSERT(equalsHashCode160(query,
&node->chk.query));
size = ntohl(reply->size) - sizeof(Datastore_Value);
@@ -867,6 +883,8 @@
*/
static void issueRequest(RequestManager * rm,
int requestIndex) {
+ static unsigned int lastmpriority;
+ static cron_t lastmpritime;
RequestEntry * entry;
cron_t now;
unsigned int priority;
@@ -874,8 +892,7 @@
cron_t timeout;
unsigned int ttl;
int TTL_DECREMENT;
- static unsigned int lastmpriority;
- static cron_t lastmpritime;
+ EncName enc;
cronTime(&now);
entry = rm->requestList[requestIndex];
@@ -944,6 +961,13 @@
timeout = now + ttl;
}
+ IFLOG(LOG_DEBUG,
+ hash2enc(&entry->node->chk.query,
+ &enc));
+ LOG(LOG_DEBUG,
+ "Starting FS search for %s\n",
+ &enc);
+
entry->searchHandle
= FS_start_search(rm->sctx,
D_BLOCK,
Modified: GNUnet/src/applications/fs/ecrs/upload.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/upload.c 2005-02-10 21:52:28 UTC (rev
232)
+++ GNUnet/src/applications/fs/ecrs/upload.c 2005-02-10 23:55:11 UTC (rev
233)
@@ -22,7 +22,7 @@
* @file applications/fs/ecrs/upload.c
* @brief Break file that is inserted into blocks and encrypts
* them according to the ECRS scheme.
- * @see http://www.ovmj.org/GNUnet/encoding.php3
+ * @see http://gnunet.org/encoding.php3
* @author Krista Bennett
* @author Christian Grothoff
*/
@@ -53,6 +53,7 @@
Datastore_Value * value;
DBlock * db;
CHK ichk;
+ EncName enc;
size = ntohl(iblocks[level]->size) - sizeof(Datastore_Value) -
sizeof(DBlock);
present = size / sizeof(CHK);
@@ -70,6 +71,12 @@
size,
&ichk.query,
&value);
+ IFLOG(LOG_DEBUG,
+ hash2enc(&ichk.query,
+ &enc));
+ LOG(LOG_DEBUG,
+ "Publishing block (query: %s)\n",
+ &enc);
if (OK != FS_insert(sock,
value)) {
FREE(value);
Modified: GNUnet/src/applications/fs/lib/fslib.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslib.c 2005-02-10 21:52:28 UTC (rev
232)
+++ GNUnet/src/applications/fs/lib/fslib.c 2005-02-10 23:55:11 UTC (rev
233)
@@ -169,6 +169,7 @@
void * closure) {
SEARCH_HANDLE * ret;
RequestSearch * req;
+ EncName enc;
ret = MALLOC(sizeof(SEARCH_HANDLE));
req = MALLOC(sizeof(RequestSearch) + (keyCount-1) * sizeof(HashCode160));
@@ -191,6 +192,12 @@
}
ctx->handles[ctx->handleCount++] = ret;
MUTEX_UNLOCK(&ctx->lock);
+ IFLOG(LOG_DEBUG,
+ hash2enc(&req->query[0],
+ &enc));
+ LOG(LOG_DEBUG,
+ "FS initiating search for %s\n",
+ &enc);
if (OK != writeToSocket(ctx->sock,
&req->header)) {
FS_stop_search(ctx,
Modified: GNUnet/src/applications/fs/module/fs.c
===================================================================
--- GNUnet/src/applications/fs/module/fs.c 2005-02-10 21:52:28 UTC (rev
232)
+++ GNUnet/src/applications/fs/module/fs.c 2005-02-10 23:55:11 UTC (rev
233)
@@ -190,15 +190,19 @@
const CS_HEADER * req) {
RequestSearch * rs;
unsigned int keyCount;
+ EncName enc;
if (ntohs(req->size) < sizeof(RequestSearch)) {
BREAK();
return SYSERR;
}
rs = (RequestSearch*) req;
+ IFLOG(LOG_DEBUG,
+ hash2enc(&rs->query[0],
+ &enc));
LOG(LOG_DEBUG,
- "FS received QUERY START (key: %u)\n",
- rs->query[0].a);
+ "FS received QUERY START (query: %s)\n",
+ &enc);
trackQuery(&rs->query[0],
ntohl(rs->type),
sock);
@@ -268,6 +272,7 @@
int ret;
HashCode160 query;
unsigned int type;
+ EncName enc;
if (ntohs(req->size) < sizeof(RequestInsert)) {
BREAK();
@@ -288,11 +293,14 @@
FREE(datum);
return SYSERR;
}
+ IFLOG(LOG_DEBUG,
+ hash2enc(&query,
+ &enc));
type = getTypeOfBlock(ntohs(ri->header.size) - sizeof(RequestInsert),
&ri[1]);
LOG(LOG_DEBUG,
- "FS received REQUEST INSERT (key: %u, type: %u)\n",
- query.a,
+ "FS received REQUEST INSERT (query: %s, type: %u)\n",
+ &enc,
type);
datum->type = htonl(type);
memcpy(&datum[1],
@@ -795,7 +803,7 @@
}
gw = (const GapWrapper*) content;
if ( (OK == getQueryFor(size - sizeof(GapWrapper),
- &gw[1],
+ (const char*) &gw[1],
&q)) &&
(equalsHashCode160(&q,
primaryKey)) &&
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r233 - in GNUnet/src/applications/fs: ecrs lib module,
grothoff <=