[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r6313 - in GNUnet/src: applications/chat applications/fs/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r6313 - in GNUnet/src: applications/chat applications/fs/fsui applications/fs/gap applications/fs/tools applications/sqstore_mysql applications/sqstore_sqlite transports |
Date: |
Fri, 15 Feb 2008 18:30:40 -0700 (MST) |
Author: grothoff
Date: 2008-02-15 18:30:40 -0700 (Fri, 15 Feb 2008)
New Revision: 6313
Modified:
GNUnet/src/applications/chat/chat.c
GNUnet/src/applications/fs/fsui/upload.c
GNUnet/src/applications/fs/gap/gap.c
GNUnet/src/applications/fs/gap/migration.c
GNUnet/src/applications/fs/tools/gnunet-auto-share.c
GNUnet/src/applications/sqstore_mysql/mysql.c
GNUnet/src/applications/sqstore_sqlite/sqlite.c
GNUnet/src/transports/common.c
GNUnet/src/transports/http.c
GNUnet/src/transports/tcp.c
Log:
indent
Modified: GNUnet/src/applications/chat/chat.c
===================================================================
--- GNUnet/src/applications/chat/chat.c 2008-02-16 01:29:53 UTC (rev 6312)
+++ GNUnet/src/applications/chat/chat.c 2008-02-16 01:30:40 UTC (rev 6313)
@@ -139,40 +139,40 @@
for (i = 0; i < MAX_LAST_MESSAGES; i++)
if (0 == memcmp (&hc, &lastMsgs[i], sizeof (GNUNET_HashCode)))
j = i;
- if (j == -1)
- {
-
- if (clientCount == MAX_CLIENTS)
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_WARNING | GNUNET_GE_BULK |
GNUNET_GE_USER,
- _("Maximum number of chat clients reached.\n"));
- }
- else
- {
- GNUNET_array_grow (clients, clientCount, clientCount + 1);
- clients[clientCount] = client;
- ++clientCount;
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
- _("Now %d of %d chat clients at this node.\n"),
- clientCount, MAX_CLIENTS);
- }
- /* we have not seen it before, send to all TCP clients
- and broadcast to all peers */
+ if (j == -1)
+ {
+
+ if (clientCount == MAX_CLIENTS)
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
+ _("Maximum number of chat clients reached.\n"));
+ }
+ else
+ {
+ GNUNET_array_grow (clients, clientCount, clientCount + 1);
+ clients[clientCount] = client;
+ ++clientCount;
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
+ _("Now %d of %d chat clients at this node.\n"),
+ clientCount, MAX_CLIENTS);
+ }
+ /* we have not seen it before, send to all TCP clients
+ and broadcast to all peers */
markSeen (&hc);
broadcastToConnected (message, 5, 1);
- /*cmsg->header.type = htons (GNUNET_CS_PROTO_CHAT_MSG);*/
+ /*cmsg->header.type = htons (GNUNET_CS_PROTO_CHAT_MSG); */
for (j = 0; j < clientCount; j++)
coreAPI->cs_send_to_client (clients[j], &cmsg->header, GNUNET_YES);
- /*pmsg->nick[CHAT_NICK_LENGTH - 1] = '\0';
- pmsg->message[CHAT_MSG_LENGTH - 1] = '\0'; */
+ /*pmsg->nick[CHAT_NICK_LENGTH - 1] = '\0';
+ pmsg->message[CHAT_MSG_LENGTH - 1] = '\0'; */
- /*
- GNUNET_GE_LOG(ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST |
GNUNET_GE_USER,
- " CHAT: received new message from %s: %s\n",
- &pmsg->nick[0],
- &pmsg->message[0]);
- */
+ /*
+ GNUNET_GE_LOG(ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
+ " CHAT: received new message from %s: %s\n",
+ &pmsg->nick[0],
+ &pmsg->message[0]);
+ */
GNUNET_mutex_unlock (chatMutex);
return GNUNET_OK;
}
@@ -242,23 +242,23 @@
j = i;
else
coreAPI->cs_send_to_client (clients[i], message, GNUNET_YES);
- if (j == -1)
- {
- if (clientCount == MAX_CLIENTS)
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_WARNING | GNUNET_GE_BULK |
GNUNET_GE_USER,
- _("Maximum number of chat clients reached.\n"));
- else
- {
- GNUNET_array_grow (clients, clientCount, clientCount + 1);
- clients[clientCount] = client;
- ++clientCount;
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_DEBUG | GNUNET_GE_REQUEST |
GNUNET_GE_USER,
- _("Now %d of %d chat clients at this node.\n"),
- clientCount, MAX_CLIENTS);
- }
- }
+ if (j == -1)
+ {
+ if (clientCount == MAX_CLIENTS)
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
+ _("Maximum number of chat clients reached.\n"));
+ else
+ {
+ GNUNET_array_grow (clients, clientCount, clientCount + 1);
+ clients[clientCount] = client;
+ ++clientCount;
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
+ _("Now %d of %d chat clients at this node.\n"),
+ clientCount, MAX_CLIENTS);
+ }
+ }
/* forward to all other nodes in the network */
/*pmsg->header.type = htons (GNUNET_P2P_PROTO_CHAT_MSG);
broadcastToConnected (&pmsg->header, 5, 1); */
Modified: GNUnet/src/applications/fs/fsui/upload.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload.c 2008-02-16 01:29:53 UTC (rev
6312)
+++ GNUnet/src/applications/fs/fsui/upload.c 2008-02-16 01:30:40 UTC (rev
6313)
@@ -623,7 +623,10 @@
GNUNET_free (utc);
return NULL;
}
- utc->meta = (md == NULL) ? GNUNET_ECRS_meta_data_create() :
GNUNET_ECRS_meta_data_duplicate (md);
+ utc->meta =
+ (md ==
+ NULL) ? GNUNET_ECRS_meta_data_create () :
+ GNUNET_ECRS_meta_data_duplicate (md);
}
else
{
Modified: GNUnet/src/applications/fs/gap/gap.c
===================================================================
--- GNUnet/src/applications/fs/gap/gap.c 2008-02-16 01:29:53 UTC (rev
6312)
+++ GNUnet/src/applications/fs/gap/gap.c 2008-02-16 01:30:40 UTC (rev
6313)
@@ -99,10 +99,11 @@
GNUNET_free (msg);
}
-struct DVPClosure {
- struct RequestList * request;
+struct DVPClosure
+{
+ struct RequestList *request;
unsigned int iteration_count;
- unsigned int result_count;
+ unsigned int result_count;
};
/**
@@ -128,7 +129,7 @@
const GNUNET_DatastoreValue *
value, void *closure, unsigned long long uid)
{
- struct DVPClosure * cls = closure;
+ struct DVPClosure *cls = closure;
struct RequestList *req = cls->request;
P2P_gap_reply_MESSAGE *msg;
GNUNET_DatastoreValue *enc;
@@ -157,8 +158,8 @@
GNUNET_hash (&value[1],
ntohl (value->size) - sizeof (GNUNET_DatastoreValue), &hc);
GNUNET_FS_HELPER_mingle_hash (&hc, req->bloomfilter_mutator, &mhc);
- if (GNUNET_YES == GNUNET_bloomfilter_test (req->bloomfilter, &mhc))
- return want_more; /* not useful */
+ if (GNUNET_YES == GNUNET_bloomfilter_test (req->bloomfilter, &mhc))
+ return want_more; /* not useful */
}
et = GNUNET_ntohll (value->expirationTime);
now = GNUNET_get_time ();
Modified: GNUnet/src/applications/fs/gap/migration.c
===================================================================
--- GNUnet/src/applications/fs/gap/migration.c 2008-02-16 01:29:53 UTC (rev
6312)
+++ GNUnet/src/applications/fs/gap/migration.c 2008-02-16 01:30:40 UTC (rev
6313)
@@ -257,14 +257,13 @@
#endif
if (ntohl (value->type) == GNUNET_ECRS_BLOCKTYPE_ONDEMAND_OLD)
{
- datastore->del(&content[entry].key,
- value);
+ datastore->del (&content[entry].key, value);
GNUNET_free_non_null (value);
content[entry].value = NULL;
GNUNET_mutex_unlock (GNUNET_FS_lock);
return 0;
}
- if (ntohl (value->type) == GNUNET_ECRS_BLOCKTYPE_ONDEMAND)
+ if (ntohl (value->type) == GNUNET_ECRS_BLOCKTYPE_ONDEMAND)
{
if (GNUNET_FS_ONDEMAND_get_indexed_content
(value, &content[entry].key, &enc) != GNUNET_OK)
Modified: GNUnet/src/applications/fs/tools/gnunet-auto-share.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-auto-share.c 2008-02-16
01:29:53 UTC (rev 6312)
+++ GNUnet/src/applications/fs/tools/gnunet-auto-share.c 2008-02-16
01:30:40 UTC (rev 6313)
@@ -64,13 +64,13 @@
break;
case GNUNET_FSUI_upload_completed:
if (*verboselevel)
- {
- fstring = GNUNET_ECRS_uri_to_string (event->data.UploadCompleted.uri);
- printf(_("Upload of `%s' complete, URI is `%s'."),
- event->data.UploadCompleted.filename,
- fstring);
- GNUNET_free (fstring);
- }
+ {
+ fstring =
+ GNUNET_ECRS_uri_to_string (event->data.UploadCompleted.uri);
+ printf (_("Upload of `%s' complete, URI is `%s'."),
+ event->data.UploadCompleted.filename, fstring);
+ GNUNET_free (fstring);
+ }
if (ul == event->data.UploadCompleted.uc.pos)
upload_done = GNUNET_YES;
break;
@@ -106,7 +106,7 @@
gettext_noop
("do not use libextractor to add additional references to directory entries
and/or the published file"),
0, &GNUNET_getopt_configure_set_one, &do_no_direct_references},
- GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Automatically share a
directory.")), /* -h */
+ GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Automatically share a
directory.")), /* -h */
GNUNET_COMMAND_LINE_OPTION_HOSTNAME, /* -H */
{'K', "global-key", "KEYWORD",
gettext_noop ("add an additional keyword for all files and directories"
@@ -122,92 +122,77 @@
};
static int
-find_latest(const char * filename,
- const char * dirName,
- void * cls)
+find_latest (const char *filename, const char *dirName, void *cls)
{
- time_t * latest = cls;
+ time_t *latest = cls;
struct stat buf;
- char * fn;
+ char *fn;
if (filename[0] == '.')
return GNUNET_OK;
if (ul != NULL)
return GNUNET_SYSERR;
- fn = GNUNET_malloc(strlen(filename) + strlen(dirName) + 2);
- strcpy(fn, dirName);
- strcat(fn, DIR_SEPARATOR_STR);
- strcat(fn, filename);
- if (0 != stat(fn, &buf))
+ fn = GNUNET_malloc (strlen (filename) + strlen (dirName) + 2);
+ strcpy (fn, dirName);
+ strcat (fn, DIR_SEPARATOR_STR);
+ strcat (fn, filename);
+ if (0 != stat (fn, &buf))
{
- printf("Could not stat `%s': %s\n",
- fn,
- strerror(errno));
- GNUNET_free(fn);
+ printf ("Could not stat `%s': %s\n", fn, strerror (errno));
+ GNUNET_free (fn);
return GNUNET_OK;
}
if (*latest < buf.st_mtime)
*latest = buf.st_mtime;
- if (S_ISDIR(buf.st_mode))
- GNUNET_disk_directory_scan(ectx,
- fn,
- &find_latest,
- latest);
- GNUNET_free(fn);
+ if (S_ISDIR (buf.st_mode))
+ GNUNET_disk_directory_scan (ectx, fn, &find_latest, latest);
+ GNUNET_free (fn);
return GNUNET_OK;
}
static int
-probe_directory(const char * filename,
- const char * dirName,
- void * cls)
+probe_directory (const char *filename, const char *dirName, void *cls)
{
- time_t * last = cls;
+ time_t *last = cls;
time_t latest;
struct stat buf;
- char * fn;
+ char *fn;
if (filename[0] == '.')
return GNUNET_OK;
if (ul != NULL)
- return GNUNET_SYSERR;
- fn = GNUNET_malloc(strlen(filename) + strlen(dirName) + 2);
- strcpy(fn, dirName);
- strcat(fn, DIR_SEPARATOR_STR);
- strcat(fn, filename);
- if (0 != stat(fn, &buf))
+ return GNUNET_SYSERR;
+ fn = GNUNET_malloc (strlen (filename) + strlen (dirName) + 2);
+ strcpy (fn, dirName);
+ strcat (fn, DIR_SEPARATOR_STR);
+ strcat (fn, filename);
+ if (0 != stat (fn, &buf))
{
- printf("Could not stat `%s': %s\n",
- fn,
- strerror(errno));
- GNUNET_free(fn);
+ printf ("Could not stat `%s': %s\n", fn, strerror (errno));
+ GNUNET_free (fn);
return GNUNET_OK;
}
- if ( (buf.st_mtime < *last) &&
- (! S_ISDIR(buf.st_mode)) )
+ if ((buf.st_mtime < *last) && (!S_ISDIR (buf.st_mode)))
{
- GNUNET_free(fn);
+ GNUNET_free (fn);
return GNUNET_OK;
}
latest = buf.st_mtime;
- GNUNET_disk_directory_scan(ectx,
- fn,
- &find_latest,
- &latest);
- if (latest < *last)
+ GNUNET_disk_directory_scan (ectx, fn, &find_latest, &latest);
+ if (latest < *last)
{
- GNUNET_free(fn);
+ GNUNET_free (fn);
return GNUNET_OK;
}
ul = GNUNET_FSUI_upload_start (ctx,
- fn,
- (GNUNET_FSUI_DirectoryScanCallback) &
- GNUNET_disk_directory_scan, ectx, anonymity,
- priority, GNUNET_YES, GNUNET_YES,
- !do_no_direct_references,
- GNUNET_get_time() + 2 * GNUNET_CRON_YEARS,
NULL,
- gloKeywords, NULL);
- GNUNET_free(fn);
+ fn,
+ (GNUNET_FSUI_DirectoryScanCallback) &
+ GNUNET_disk_directory_scan, ectx, anonymity,
+ priority, GNUNET_YES, GNUNET_YES,
+ !do_no_direct_references,
+ GNUNET_get_time () + 2 * GNUNET_CRON_YEARS,
+ NULL, gloKeywords, NULL);
+ GNUNET_free (fn);
return GNUNET_SYSERR;
}
@@ -242,11 +227,11 @@
if (i != argc - 1)
{
printf (_
- ("You must specify one and only one directory for sharing.\n"));
+ ("You must specify one and only one directory for sharing.\n"));
errorCode = -1;
goto quit;
}
- dirname = GNUNET_expand_file_name(ectx, argv[i]);
+ dirname = GNUNET_expand_file_name (ectx, argv[i]);
GNUNET_GC_get_configuration_value_number (cfg,
"GNUNET",
"VERBOSE", 0, 9999, 0, &verbose);
@@ -254,34 +239,30 @@
ctx = GNUNET_FSUI_start (ectx, cfg, "gnunet-auto-share", GNUNET_NO, 32,
&printstatus, &verbose);
/* first insert all of the top-level files or directories */
-
+
last = 0;
- while (GNUNET_NO == GNUNET_shutdown_test())
+ while (GNUNET_NO == GNUNET_shutdown_test ())
{
- start = time(NULL);
- GNUNET_disk_directory_scan(ectx,
- dirname,
- &probe_directory,
- &last);
+ start = time (NULL);
+ GNUNET_disk_directory_scan (ectx, dirname, &probe_directory, &last);
if (ul == NULL)
- last = start;
+ last = start;
if (GNUNET_YES == upload_done)
- {
- GNUNET_FSUI_upload_abort (ctx, ul);
- GNUNET_FSUI_upload_stop (ctx, ul);
- upload_done = GNUNET_NO;
- ul = NULL;
- }
- if ( (ul == NULL) &&
- (GNUNET_NO == GNUNET_shutdown_test()) )
- {
- GNUNET_thread_sleep(delay);
- delay *= 2;
- if (delay > GNUNET_CRON_HOURS)
- delay = GNUNET_CRON_HOURS;
- }
+ {
+ GNUNET_FSUI_upload_abort (ctx, ul);
+ GNUNET_FSUI_upload_stop (ctx, ul);
+ upload_done = GNUNET_NO;
+ ul = NULL;
+ }
+ if ((ul == NULL) && (GNUNET_NO == GNUNET_shutdown_test ()))
+ {
+ GNUNET_thread_sleep (delay);
+ delay *= 2;
+ if (delay > GNUNET_CRON_HOURS)
+ delay = GNUNET_CRON_HOURS;
+ }
else
- delay = 5 * GNUNET_CRON_SECONDS;
+ delay = 5 * GNUNET_CRON_SECONDS;
}
GNUNET_FSUI_stop (ctx);
if (gloKeywords != NULL)
Modified: GNUnet/src/applications/sqstore_mysql/mysql.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysql.c 2008-02-16 01:29:53 UTC
(rev 6312)
+++ GNUnet/src/applications/sqstore_mysql/mysql.c 2008-02-16 01:30:40 UTC
(rev 6313)
@@ -1219,10 +1219,10 @@
if (mysql_stmt_bind_param (stmt, qbind))
{
GNUNET_GE_LOG (ectx,
- GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
- _("`%s' failed at %s:%d with error: %s\n"),
- "mysql_stmt_bind_param",
- __FILE__, __LINE__, mysql_stmt_error (stmt));
+ GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
+ _("`%s' failed at %s:%d with error: %s\n"),
+ "mysql_stmt_bind_param",
+ __FILE__, __LINE__, mysql_stmt_error (stmt));
iclose ();
mysql_thread_end ();
GNUNET_mutex_unlock (lock);
@@ -1231,10 +1231,10 @@
if (mysql_stmt_execute (stmt))
{
GNUNET_GE_LOG (ectx,
- GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
- _("`%s' failed at %s:%d with error: %s\n"),
- "mysql_stmt_execute",
- __FILE__, __LINE__, mysql_stmt_error (stmt));
+ GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
+ _("`%s' failed at %s:%d with error: %s\n"),
+ "mysql_stmt_execute",
+ __FILE__, __LINE__, mysql_stmt_error (stmt));
iclose ();
GNUNET_mutex_unlock (lock);
mysql_thread_end ();
@@ -1243,10 +1243,10 @@
if (mysql_stmt_bind_result (stmt, rbind))
{
GNUNET_GE_LOG (ectx,
- GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
- _("`%s' failed at %s:%d with error: %s\n"),
- "mysql_stmt_bind_result",
- __FILE__, __LINE__, mysql_stmt_error (stmt));
+ GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
+ _("`%s' failed at %s:%d with error: %s\n"),
+ "mysql_stmt_bind_result",
+ __FILE__, __LINE__, mysql_stmt_error (stmt));
iclose ();
mysql_thread_end ();
GNUNET_mutex_unlock (lock);
@@ -1259,30 +1259,29 @@
mysql_thread_end ();
return GNUNET_SYSERR;
}
- if (-1 == total)
+ if (-1 == total)
{
GNUNET_GE_LOG (ectx,
- GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
- _("`%s' failed at %s:%d with error: %s\n"),
- "mysql_stmt_num_rows",
- __FILE__, __LINE__, mysql_stmt_error (stmt));
+ GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
+ _("`%s' failed at %s:%d with error: %s\n"),
+ "mysql_stmt_num_rows",
+ __FILE__, __LINE__, mysql_stmt_error (stmt));
iclose ();
GNUNET_mutex_unlock (lock);
mysql_thread_end ();
return GNUNET_SYSERR;
}
mysql_stmt_reset (stmt);
- if ( (iter == NULL) ||
- (total == 0) )
+ if ((iter == NULL) || (total == 0))
{
GNUNET_mutex_unlock (lock);
mysql_thread_end ();
return (int) total;
- }
+ }
GNUNET_mutex_unlock (lock);
last_vkey = 0;
count = 0;
- off = GNUNET_random_u32(GNUNET_RANDOM_QUALITY_WEAK, total);
+ off = GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, total);
memset (qbind, 0, sizeof (qbind));
qbind[0].buffer_type = MYSQL_TYPE_BLOB;
qbind[0].buffer = (void *) query;
@@ -1299,7 +1298,7 @@
qbind[3].buffer_type = MYSQL_TYPE_LONG;
qbind[3].is_unsigned = GNUNET_YES;
qbind[3].buffer = &limit_off;
- }
+ }
else
{
qbind[2].buffer_type = MYSQL_TYPE_LONG;
@@ -1339,13 +1338,13 @@
return GNUNET_SYSERR;
}
if (type != 0)
- stmt = dbh->select_entry_by_hash_and_type;
+ stmt = dbh->select_entry_by_hash_and_type;
else
- stmt = dbh->select_entry_by_hash;
+ stmt = dbh->select_entry_by_hash;
if (count == 0)
- limit_off = off;
+ limit_off = off;
else
- limit_off = 0;
+ limit_off = 0;
GNUNET_GE_ASSERT (ectx, mysql_stmt_param_count (stmt) <= 4);
GNUNET_GE_ASSERT (ectx, mysql_stmt_field_count (stmt) == 7);
if (mysql_stmt_bind_param (stmt, qbind))
@@ -1413,9 +1412,9 @@
}
GNUNET_free (datum);
if (count + off == total)
- last_vkey = 0; /* back to start */
+ last_vkey = 0; /* back to start */
if (count == total)
- break;
+ break;
}
mysql_thread_end ();
return count;
Modified: GNUnet/src/applications/sqstore_sqlite/sqlite.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlite.c 2008-02-16 01:29:53 UTC
(rev 6312)
+++ GNUnet/src/applications/sqstore_sqlite/sqlite.c 2008-02-16 01:30:40 UTC
(rev 6313)
@@ -1145,9 +1145,8 @@
return GNUNET_SYSERR;
}
ret = sqlite3_bind_blob (stmt,
- 1,
- key, sizeof (GNUNET_HashCode),
- SQLITE_TRANSIENT);
+ 1,
+ key, sizeof (GNUNET_HashCode), SQLITE_TRANSIENT);
if (type && (ret == SQLITE_OK))
ret = sqlite3_bind_int (stmt, 2, type);
if (ret != SQLITE_OK)
@@ -1162,7 +1161,7 @@
}
ret = sqlite3_step (stmt);
- if (ret != SQLITE_ROW)
+ if (ret != SQLITE_ROW)
{
LOG_SQLITE (handle,
GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER |
@@ -1176,23 +1175,22 @@
total = sqlite3_column_int (stmt, 0);
sqlite3_reset (stmt);
sqlite3_finalize (stmt);
- if ( (iter == NULL) ||
- (total == 0) )
+ if ((iter == NULL) || (total == 0))
{
GNUNET_mutex_unlock (lock);
return total;
}
- strcpy (scratch,
- "SELECT size, type, prio, anonLevel, expire, hash, value, _ROWID_ "
- "FROM gn070 WHERE hash = :1 AND _ROWID_ >= :2");
+ strcpy (scratch,
+ "SELECT size, type, prio, anonLevel, expire, hash, value, _ROWID_ "
+ "FROM gn070 WHERE hash = :1 AND _ROWID_ >= :2");
if (type)
strcat (scratch, " AND type = :3");
strcat (scratch, " ORDER BY _ROWID_ ASC LIMIT 1");
if (type)
- strcat(scratch, " OFFSET :4");
+ strcat (scratch, " OFFSET :4");
else
- strcat(scratch, " OFFSET :3");
+ strcat (scratch, " OFFSET :3");
if (sq_prepare (dbh, scratch, &stmt) != SQLITE_OK)
{
LOG_SQLITE (handle,
@@ -1203,14 +1201,14 @@
}
count = 0;
last_rowid = 0;
- off = GNUNET_random_u32(GNUNET_RANDOM_QUALITY_WEAK, total);
+ off = GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, total);
while (1)
{
- if (count == 0)
- limit_off = off;
- else
- limit_off = 0;
- ret = sqlite3_bind_blob (stmt,
+ if (count == 0)
+ limit_off = off;
+ else
+ limit_off = 0;
+ ret = sqlite3_bind_blob (stmt,
1,
key, sizeof (GNUNET_HashCode),
SQLITE_TRANSIENT);
@@ -1219,7 +1217,7 @@
if (type && (ret == SQLITE_OK))
ret = sqlite3_bind_int (stmt, 3, type);
if (ret == SQLITE_OK)
- ret = sqlite3_bind_int (stmt, (type == 0) ? 3 : 4, limit_off);
+ ret = sqlite3_bind_int (stmt, (type == 0) ? 3 : 4, limit_off);
if (ret == SQLITE_OK)
{
ret = sqlite3_step (stmt);
@@ -1255,9 +1253,9 @@
GNUNET_free (datum);
}
if (count + off == total)
- last_rowid = 0; /* back to start */
+ last_rowid = 0; /* back to start */
if (count == total)
- break;
+ break;
}
sqlite3_reset (stmt);
sqlite3_finalize (stmt);
Modified: GNUnet/src/transports/common.c
===================================================================
--- GNUnet/src/transports/common.c 2008-02-16 01:29:53 UTC (rev 6312)
+++ GNUnet/src/transports/common.c 2008-02-16 01:30:40 UTC (rev 6313)
@@ -323,14 +323,14 @@
if (!GNUNET_GC_have_configuration_value
(coreAPI->cfg, MY_TRANSPORT_NAME, "ADVERTISED-PORT"))
{
- port = get_port();
+ port = get_port ();
}
else if (-1 == GNUNET_GC_get_configuration_value_number (coreAPI->cfg,
MY_TRANSPORT_NAME,
"ADVERTISED-PORT",
0, 65535, 80,
&port))
- port = get_port();
+ port = get_port ();
return (unsigned short) port;
}
Modified: GNUnet/src/transports/http.c
===================================================================
--- GNUnet/src/transports/http.c 2008-02-16 01:29:53 UTC (rev 6312)
+++ GNUnet/src/transports/http.c 2008-02-16 01:30:40 UTC (rev 6313)
@@ -450,9 +450,7 @@
acceptPolicyCallback (void *cls,
const struct sockaddr *addr, socklen_t addr_len)
{
- if (GNUNET_NO !=
- is_rejected_tester(addr,
- addr_len))
+ if (GNUNET_NO != is_rejected_tester (addr, addr_len))
return MHD_NO;
return MHD_YES;
}
@@ -1128,7 +1126,8 @@
char *url;
GNUNET_EncName enc;
unsigned short available;
- const HostAddress * haddr = (const HostAddress *)
&httpSession->cs.client.address;
+ const HostAddress *haddr =
+ (const HostAddress *) &httpSession->cs.client.address;
ENTER ();
url = httpSession->cs.client.url;
@@ -1137,37 +1136,29 @@
GNUNET_hash_to_enc (&coreAPI->myIdentity->hashPubKey, &enc);
available = ntohs (haddr->availability) & available_protocols;
if (available == 0)
- return;
+ return;
if ((available & VERSION_AVAILABLE_IPV6) > 0)
- {
- if (NULL == inet_ntop(AF_INET6,
- &haddr->ipv6,
- buf,
- IP_BUF_LEN))
- {
- /* log? */
- return;
- EXIT ();
- }
- }
+ {
+ if (NULL == inet_ntop (AF_INET6, &haddr->ipv6, buf, IP_BUF_LEN))
+ {
+ /* log? */
+ return;
+ EXIT ();
+ }
+ }
else
- {
- if (NULL == inet_ntop(AF_INET,
- &haddr->ipv4,
- buf,
- IP_BUF_LEN))
- {
- /* log? */
- EXIT ();
- return;
- }
- }
- url = GNUNET_malloc (64 + sizeof (GNUNET_EncName) + strlen(buf));
+ {
+ if (NULL == inet_ntop (AF_INET, &haddr->ipv4, buf, IP_BUF_LEN))
+ {
+ /* log? */
+ EXIT ();
+ return;
+ }
+ }
+ url = GNUNET_malloc (64 + sizeof (GNUNET_EncName) + strlen (buf));
GNUNET_snprintf (url,
- 64 + sizeof (GNUNET_EncName),
- "http://%s:%u/%s",
- buf,
- ntohs (haddr->port), &enc);
+ 64 + sizeof (GNUNET_EncName),
+ "http://%s:%u/%s", buf, ntohs (haddr->port), &enc);
httpSession->cs.client.url = url;
}
EXIT ();
@@ -1938,7 +1929,7 @@
STEP ();
if (curl_multi == NULL)
return GNUNET_SYSERR;
- port = get_port();
+ port = get_port ();
if ((mhd_daemon == NULL) && (port != 0))
{
STEP ();
@@ -1958,30 +1949,30 @@
&requestCompletedCallback, NULL,
MHD_OPTION_END);
if (mhd_daemon == NULL)
- {
- /* try without IPv6 */
- mhd_daemon = MHD_start_daemon (MHD_NO_FLAG,
- port,
- &acceptPolicyCallback,
- NULL, &accessHandlerCallback, NULL,
- MHD_OPTION_CONNECTION_TIMEOUT,
- (unsigned int) HTTP_TIMEOUT,
- MHD_OPTION_CONNECTION_MEMORY_LIMIT,
- (unsigned int) 1024 * 128,
- MHD_OPTION_CONNECTION_LIMIT,
- (unsigned int) 128,
- MHD_OPTION_PER_IP_CONNECTION_LIMIT,
- (unsigned int) 8,
- MHD_OPTION_NOTIFY_COMPLETED,
- &requestCompletedCallback, NULL,
- MHD_OPTION_END);
- }
+ {
+ /* try without IPv6 */
+ mhd_daemon = MHD_start_daemon (MHD_NO_FLAG,
+ port,
+ &acceptPolicyCallback,
+ NULL, &accessHandlerCallback, NULL,
+ MHD_OPTION_CONNECTION_TIMEOUT,
+ (unsigned int) HTTP_TIMEOUT,
+ MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+ (unsigned int) 1024 * 128,
+ MHD_OPTION_CONNECTION_LIMIT,
+ (unsigned int) 128,
+ MHD_OPTION_PER_IP_CONNECTION_LIMIT,
+ (unsigned int) 8,
+ MHD_OPTION_NOTIFY_COMPLETED,
+ &requestCompletedCallback, NULL,
+ MHD_OPTION_END);
+ }
else
- {
- available_protocols |= VERSION_AVAILABLE_IPV6;
- }
+ {
+ available_protocols |= VERSION_AVAILABLE_IPV6;
+ }
if (mhd_daemon != NULL)
- available_protocols |= VERSION_AVAILABLE_IPV4;
+ available_protocols |= VERSION_AVAILABLE_IPV4;
STEP ();
}
if (port == 0)
@@ -2125,7 +2116,7 @@
myAPI.protocolNumber = GNUNET_TRANSPORT_PROTOCOL_NUMBER_HTTP;
myAPI.mtu = 0;
- myAPI.cost = 20000; /* about equal to udp */
+ myAPI.cost = 20000; /* about equal to udp */
myAPI.verifyHello = &verify_hello;
myAPI.createhello = &create_hello;
myAPI.connect = &httpConnect;
@@ -2150,7 +2141,7 @@
GNUNET_free_non_null (proxy);
proxy = NULL;
GNUNET_array_grow (tsessions, tsessionArrayLength, 0);
- do_shutdown();
+ do_shutdown ();
EXIT ();
}
Modified: GNUnet/src/transports/tcp.c
===================================================================
--- GNUnet/src/transports/tcp.c 2008-02-16 01:29:53 UTC (rev 6312)
+++ GNUnet/src/transports/tcp.c 2008-02-16 01:30:40 UTC (rev 6313)
@@ -571,7 +571,7 @@
}
GNUNET_mutex_unlock (lock);
}
- haddr = (const HostAddress *) & hello[1];
+ haddr = (const HostAddress *) &hello[1];
available = ntohs (haddr->availability) & available_protocols;
if ((available & VERSION_AVAILABLE_IPV4) > 0)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r6313 - in GNUnet/src: applications/chat applications/fs/fsui applications/fs/gap applications/fs/tools applications/sqstore_mysql applications/sqstore_sqlite transports,
gnunet <=