[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r212 - GNUnet GNUnet/src/applications/fs GNUnet/src/applica
From: |
grothoff |
Subject: |
[GNUnet-SVN] r212 - GNUnet GNUnet/src/applications/fs GNUnet/src/applications/fs/ecrs GNUnet/src/applications/fs/fsui GNUnet/src/applications/fs/module GNUnet/src/applications/sqstore_mysql GNUnet/src/util branches/GNUnet06/src/util |
Date: |
Mon, 7 Feb 2005 18:38:25 -0800 (PST) |
Author: grothoff
Date: 2005-02-07 18:38:24 -0800 (Mon, 07 Feb 2005)
New Revision: 212
Modified:
GNUnet/src/applications/fs/ecrs/keyspace.c
GNUnet/src/applications/fs/ecrs/namespace.c
GNUnet/src/applications/fs/ecrs/search.c
GNUnet/src/applications/fs/ecrs_core.c
GNUnet/src/applications/fs/fsui/upload.c
GNUnet/src/applications/fs/module/fs.c
GNUnet/src/applications/sqstore_mysql/mysql.c
GNUnet/src/util/tcpio.c
GNUnet/todo
branches/GNUnet06/src/util/tcpio.c
Log:
more bugfixes
Modified: GNUnet/src/applications/fs/ecrs/keyspace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/keyspace.c 2005-02-08 01:47:48 UTC (rev
211)
+++ GNUnet/src/applications/fs/ecrs/keyspace.c 2005-02-08 02:38:24 UTC (rev
212)
@@ -80,7 +80,7 @@
value = MALLOC(sizeof(Datastore_Value) +
size);
kb = (KBlock*) &value[1];
- kb->type = ntohl(K_BLOCK);
+ kb->type = htonl(K_BLOCK);
memcpy(&kb[1],
dstURI,
strlen(dstURI)+1);
@@ -99,7 +99,7 @@
value = MALLOC(sizeof(Datastore_Value) +
size);
kb = (KBlock*) &value[1];
- kb->type = ntohl(K_BLOCK);
+ kb->type = htonl(K_BLOCK);
memcpy(&kb[1],
dstURI,
strlen(dstURI)+1);
Modified: GNUnet/src/applications/fs/ecrs/namespace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/namespace.c 2005-02-08 01:47:48 UTC (rev
211)
+++ GNUnet/src/applications/fs/ecrs/namespace.c 2005-02-08 02:38:24 UTC (rev
212)
@@ -449,7 +449,7 @@
/* FINALLY: sign & publish SBlock */
GNUNET_ASSERT(OK == sign(hk,
- sizeof(SBlock) - sizeof(Signature) -
sizeof(PublicKey),
+ sizeof(SBlock) - sizeof(Signature) -
sizeof(PublicKey) - sizeof(unsigned int),
&sb->identifier,
&sb->signature));
freePrivateKey(hk);
Modified: GNUnet/src/applications/fs/ecrs/search.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/search.c 2005-02-08 01:47:48 UTC (rev
211)
+++ GNUnet/src/applications/fs/ecrs/search.c 2005-02-08 02:38:24 UTC (rev
212)
@@ -180,6 +180,8 @@
PublicKey pub;
int i;
+ LOG(LOG_DEBUG,
+ "Computing queries (this may take a while).\n");
for (i=0;i<uri->data.ksk.keywordCount;i++) {
hash(uri->data.ksk.keywords[i],
strlen(uri->data.ksk.keywords[i]),
@@ -196,6 +198,8 @@
&hc,
sqc);
}
+ LOG(LOG_DEBUG,
+ "Queries ready.\n");
break;
}
case loc:
@@ -489,7 +493,8 @@
MUTEX_LOCK(&ctx.lock);
for (i=0;i<ctx.queryCount;i++) {
ps = ctx.queries[i];
- if (now > ps->timeout)
+ if ( (now < ps->timeout) &&
+ (ps->timeout != 0) )
continue;
if (ps->handle != NULL)
FS_stop_search(ctx.sctx,
Modified: GNUnet/src/applications/fs/ecrs_core.c
===================================================================
--- GNUnet/src/applications/fs/ecrs_core.c 2005-02-08 01:47:48 UTC (rev
211)
+++ GNUnet/src/applications/fs/ecrs_core.c 2005-02-08 02:38:24 UTC (rev
212)
@@ -136,7 +136,7 @@
BREAK();
return ANY_BLOCK; /* signal error */
}
- return *((const unsigned int*)data);
+ return ntohl(*((const unsigned int*)data));
}
/**
@@ -168,7 +168,7 @@
}
sb = (SBlock*) data;
if (OK != verifySig(&sb->identifier,
- size - sizeof(Signature) - sizeof(PublicKey),
+ size - sizeof(Signature) - sizeof(PublicKey) -
sizeof(unsigned int),
&sb->signature,
&sb->subspace)) {
BREAK();
@@ -185,7 +185,7 @@
}
kb = (KBlock*) data;
if ( (OK != verifySig(&kb[1],
- size - sizeof(Signature) - sizeof(PublicKey),
+ size - sizeof(KBlock),
&kb->signature,
&kb->keyspace)) ) {
BREAK();
@@ -204,7 +204,7 @@
}
nb = (NBlock*) data;
if (OK != verifySig(&nb->identifier,
- size - sizeof(Signature) - sizeof(PublicKey),
+ size - sizeof(Signature) - sizeof(PublicKey) -
sizeof(unsigned int),
&nb->signature,
&nb->subspace)) {
BREAK();
@@ -221,7 +221,7 @@
}
kb = (KNBlock*) data;
if ( (OK != verifySig(&kb->nblock,
- size - sizeof(Signature) - sizeof(PublicKey),
+ size - sizeof(Signature) - sizeof(PublicKey) -
sizeof(unsigned int),
&kb->kblock.signature,
&kb->kblock.keyspace)) ) {
BREAK();
Modified: GNUnet/src/applications/fs/fsui/upload.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload.c 2005-02-08 01:47:48 UTC (rev
211)
+++ GNUnet/src/applications/fs/fsui/upload.c 2005-02-08 02:38:24 UTC (rev
212)
@@ -381,6 +381,8 @@
EXTRACTOR_FILENAME,
inboundFN);
}
+ LOG(LOG_DEBUG,
+ "Adding URI to keyspace.\n");
keywordUri = ECRS_metaDataToUri(utc->meta);
if (keywordUri != NULL) {
ECRS_addToKeyspace(keywordUri,
Modified: GNUnet/src/applications/fs/module/fs.c
===================================================================
--- GNUnet/src/applications/fs/module/fs.c 2005-02-08 01:47:48 UTC (rev
211)
+++ GNUnet/src/applications/fs/module/fs.c 2005-02-08 02:38:24 UTC (rev
212)
@@ -255,6 +255,8 @@
ri = (RequestInsert*) req;
datum = MALLOC(sizeof(Datastore_Value) +
ntohs(req->size) - sizeof(RequestInsert));
+ datum->size = htonl(sizeof(Datastore_Value) +
+ ntohs(req->size) - sizeof(RequestInsert));
datum->expirationTime = ri->expiration;
datum->prio = ri->prio;
datum->anonymityLevel = ri->anonymityLevel;
Modified: GNUnet/src/applications/sqstore_mysql/mysql.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysql.c 2005-02-08 01:47:48 UTC
(rev 211)
+++ GNUnet/src/applications/sqstore_mysql/mysql.c 2005-02-08 02:38:24 UTC
(rev 212)
@@ -542,8 +542,12 @@
char * escapedHash;
char * scratch;
int n;
- int contentSize;
-
+ unsigned int contentSize;
+
+ if ( (ntohl(value->size) <= sizeof(Datastore_Value)) ) {
+ BREAK();
+ return SYSERR;
+ }
MUTEX_LOCK(&dbh->DATABASE_Lock_);
contentSize = ntohl(value->size)-sizeof(Datastore_Value);
Modified: GNUnet/src/util/tcpio.c
===================================================================
--- GNUnet/src/util/tcpio.c 2005-02-08 01:47:48 UTC (rev 211)
+++ GNUnet/src/util/tcpio.c 2005-02-08 02:38:24 UTC (rev 212)
@@ -148,7 +148,7 @@
}
wasSockBlocking = isSocketBlocking(sock->socket);
- setBlocking(sock->socket, NO);
+ setBlocking(sock->socket, NO);
soaddr.sin_family = AF_INET;
GNUNET_ASSERT(sizeof(struct in_addr) == sizeof(sock->ip.addr));
@@ -181,6 +181,8 @@
FD_ZERO(&rset);
FD_ZERO(&wset);
FD_ZERO(&eset);
+ if (sock->socket < 0)
+ return SYSERR;
FD_SET(sock->socket, &wset);
timeout.tv_sec = 5;
timeout.tv_usec = 0;
@@ -193,6 +195,7 @@
PRIP(ntohl(*(int*)&sock->ip.addr)),
sock->port,
STRERROR(errno));
+ setBlocking(sock->socket, wasSockBlocking);
return SYSERR;
}
setBlocking(sock->socket, wasSockBlocking);
Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2005-02-08 01:47:48 UTC (rev 211)
+++ GNUnet/todo 2005-02-08 02:38:24 UTC (rev 212)
@@ -20,6 +20,8 @@
- sqlite sqstore implementation does not compile yet (Nils)
- gnunet-search:
* dump directory with search results [ easy ]
+- ecrs-search:
+ * anonymity policy is ignored [ easy ]
- gap:
* economy for local queries (see applications/gap/TODO) [ tricky ]
- FSUI:
Modified: branches/GNUnet06/src/util/tcpio.c
===================================================================
--- branches/GNUnet06/src/util/tcpio.c 2005-02-08 01:47:48 UTC (rev 211)
+++ branches/GNUnet06/src/util/tcpio.c 2005-02-08 02:38:24 UTC (rev 212)
@@ -181,6 +181,8 @@
FD_ZERO(&rset);
FD_ZERO(&wset);
FD_ZERO(&eset);
+ if (sock->socket == -1)
+ return SYSERR;
FD_SET(sock->socket, &wset);
timeout.tv_sec = 5;
timeout.tv_usec = 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r212 - GNUnet GNUnet/src/applications/fs GNUnet/src/applications/fs/ecrs GNUnet/src/applications/fs/fsui GNUnet/src/applications/fs/module GNUnet/src/applications/sqstore_mysql GNUnet/src/util branches/GNUnet06/src/util,
grothoff <=