aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-03-12 17:09:36 +0000
committerChristian Grothoff <christian@grothoff.org>2010-03-12 17:09:36 +0000
commit81b31b0577c1c4e3ddfc736f65d3329b5afad1a9 (patch)
tree5aab336a58f87f1729ad0f26ecfc91b4f7256049
parentce5766138d2e443b8d13bdc5d5134a1a78745cab (diff)
downloadgnunet-81b31b0577c1c4e3ddfc736f65d3329b5afad1a9.tar.gz
gnunet-81b31b0577c1c4e3ddfc736f65d3329b5afad1a9.zip
fixes
-rw-r--r--contrib/defaults.conf3
-rw-r--r--src/core/gnunet-service-core.c11
-rw-r--r--src/datastore/gnunet-service-datastore.c12
-rw-r--r--src/fs/fs_test_lib_data.conf6
-rw-r--r--src/util/connection.c11
-rw-r--r--src/util/disk.c5
-rw-r--r--src/util/server.c2
7 files changed, 39 insertions, 11 deletions
diff --git a/contrib/defaults.conf b/contrib/defaults.conf
index d469bf2a8..07bea3732 100644
--- a/contrib/defaults.conf
+++ b/contrib/defaults.conf
@@ -32,7 +32,7 @@ ACCEPT_FROM = 127.0.0.1;
32ACCEPT_FROM6 = ::1; 32ACCEPT_FROM6 = ::1;
33ALLOW_SHUTDOWN = YES 33ALLOW_SHUTDOWN = YES
34DEFAULTSERVICES = resolver transport core topology hostlist 34DEFAULTSERVICES = resolver transport core topology hostlist
35GLOBAL_POSTFIX = -l $SERVICEHOME/{}-logs 35#GLOBAL_POSTFIX = -l $SERVICEHOME/{}-logs
36# GLOBAL_PREFIX = 36# GLOBAL_PREFIX =
37# USERNAME = 37# USERNAME =
38# MAXBUF = 38# MAXBUF =
@@ -132,6 +132,7 @@ ALLOW_SHUTDOWN = YES
132# quotas are in bytes per second now! 132# quotas are in bytes per second now!
133TOTAL_QUOTA_IN = 65536 133TOTAL_QUOTA_IN = 65536
134TOTAL_QUOTA_OUT = 65536 134TOTAL_QUOTA_OUT = 65536
135DEBUG = YES
135# USERNAME = 136# USERNAME =
136# MAXBUF = 137# MAXBUF =
137# TIMEOUT = 138# TIMEOUT =
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c
index 1dd7e1d8b..8f22313e6 100644
--- a/src/core/gnunet-service-core.c
+++ b/src/core/gnunet-service-core.c
@@ -805,7 +805,14 @@ send_to_all_clients (const struct GNUNET_MessageHeader *msg,
805 while (c != NULL) 805 while (c != NULL)
806 { 806 {
807 if (0 != (c->options & options)) 807 if (0 != (c->options & options))
808 send_to_client (c, msg, can_drop); 808 {
809#if DEBUG_CORE_CLIENT
810 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
811 "Sending message of type %u to client.\n",
812 ntohs (msg->type));
813#endif
814 send_to_client (c, msg, can_drop);
815 }
809 c = c->next; 816 c = c->next;
810 } 817 }
811} 818}
@@ -885,7 +892,7 @@ handle_client_init (void *cls,
885 "Sending `%s' message to client.\n", "INIT_REPLY"); 892 "Sending `%s' message to client.\n", "INIT_REPLY");
886#endif 893#endif
887 send_to_client (c, &irm.header, GNUNET_NO); 894 send_to_client (c, &irm.header, GNUNET_NO);
888 if (c->options & GNUNET_CORE_OPTION_SEND_CONNECT) 895 if (0 != (c->options & GNUNET_CORE_OPTION_SEND_CONNECT))
889 { 896 {
890 /* notify new client about existing neighbours */ 897 /* notify new client about existing neighbours */
891 cnm.header.size = htons (sizeof (struct ConnectNotifyMessage)); 898 cnm.header.size = htons (sizeof (struct ConnectNotifyMessage));
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index 9f5d594b5..06f07f474 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -234,6 +234,11 @@ static struct TransmitCallbackContext *tcc_head;
234 */ 234 */
235static struct TransmitCallbackContext *tcc_tail; 235static struct TransmitCallbackContext *tcc_tail;
236 236
237/**
238 * Have we already clean ed up the TCCs and are hence no longer
239 * willing (or able) to transmit anything to anyone?
240 */
241static int cleaning_done;
237 242
238/** 243/**
239 * Task that is used to remove expired entries from 244 * Task that is used to remove expired entries from
@@ -502,6 +507,12 @@ transmit (struct GNUNET_SERVER_Client *client,
502{ 507{
503 struct TransmitCallbackContext *tcc; 508 struct TransmitCallbackContext *tcc;
504 509
510 if (GNUNET_YES == cleaning_done)
511 {
512 if (NULL != tc)
513 tc (tc_cls, GNUNET_SYSERR);
514 return;
515 }
505 tcc = GNUNET_malloc (sizeof(struct TransmitCallbackContext)); 516 tcc = GNUNET_malloc (sizeof(struct TransmitCallbackContext));
506 tcc->msg = msg; 517 tcc->msg = msg;
507 tcc->client = client; 518 tcc->client = client;
@@ -1257,6 +1268,7 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1257{ 1268{
1258 struct TransmitCallbackContext *tcc; 1269 struct TransmitCallbackContext *tcc;
1259 1270
1271 cleaning_done = GNUNET_YES;
1260 while (NULL != (tcc = tcc_head)) 1272 while (NULL != (tcc = tcc_head))
1261 { 1273 {
1262 GNUNET_CONTAINER_DLL_remove (tcc_head, 1274 GNUNET_CONTAINER_DLL_remove (tcc_head,
diff --git a/src/fs/fs_test_lib_data.conf b/src/fs/fs_test_lib_data.conf
index 70b47a9d8..20004ab16 100644
--- a/src/fs/fs_test_lib_data.conf
+++ b/src/fs/fs_test_lib_data.conf
@@ -21,6 +21,8 @@ DEFAULTSERVICES = resolver datastore transport core fs peerinfo
21 21
22[datastore] 22[datastore]
23#DEBUG = YES 23#DEBUG = YES
24#PREFIX = valgrind --tool=memcheck --leak-check=yes
25#BINARY = /home/grothoff/bin/gnunet-service-datastore
24 26
25[statistics] 27[statistics]
26PORT = 43467 28PORT = 43467
@@ -40,7 +42,9 @@ PORT = 43470
40HOSTNAME = localhost 42HOSTNAME = localhost
41#TOTAL_QUOTA_IN = 3932160 43#TOTAL_QUOTA_IN = 3932160
42#TOTAL_QUOTA_OUT = 3932160 44#TOTAL_QUOTA_OUT = 3932160
43#DEBUG = YES 45DEBUG = YES
46#PREFIX = valgrind --tool=memcheck --leak-check=yes
47#BINARY = /home/grothoff/bin/gnunet-service-core
44 48
45[fs] 49[fs]
46PORT = 43471 50PORT = 43471
diff --git a/src/util/connection.c b/src/util/connection.c
index 10f53dcf9..22a75691b 100644
--- a/src/util/connection.c
+++ b/src/util/connection.c
@@ -931,11 +931,6 @@ void
931GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, 931GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock,
932 int finish_pending_write) 932 int finish_pending_write)
933{ 933{
934 if ((sock->write_buffer_off == 0) && (sock->dns_active != NULL))
935 {
936 GNUNET_RESOLVER_request_cancel (sock->dns_active);
937 sock->dns_active = NULL;
938 }
939 if (GNUNET_NO == finish_pending_write) 934 if (GNUNET_NO == finish_pending_write)
940 { 935 {
941 if (sock->write_task != GNUNET_SCHEDULER_NO_TASK) 936 if (sock->write_task != GNUNET_SCHEDULER_NO_TASK)
@@ -943,8 +938,14 @@ GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock,
943 GNUNET_SCHEDULER_cancel (sock->sched, 938 GNUNET_SCHEDULER_cancel (sock->sched,
944 sock->write_task); 939 sock->write_task);
945 sock->write_task = GNUNET_SCHEDULER_NO_TASK; 940 sock->write_task = GNUNET_SCHEDULER_NO_TASK;
941 sock->write_buffer_off = 0;
946 } 942 }
947 } 943 }
944 if ((sock->write_buffer_off == 0) && (sock->dns_active != NULL))
945 {
946 GNUNET_RESOLVER_request_cancel (sock->dns_active);
947 sock->dns_active = NULL;
948 }
948 GNUNET_assert (sock->sched != NULL); 949 GNUNET_assert (sock->sched != NULL);
949 GNUNET_SCHEDULER_add_now (sock->sched, 950 GNUNET_SCHEDULER_add_now (sock->sched,
950 &destroy_continuation, sock); 951 &destroy_continuation, sock);
diff --git a/src/util/disk.c b/src/util/disk.c
index fa737843c..588ecae3c 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1239,7 +1239,10 @@ GNUNET_DISK_file_open (const char *fn,
1239 fd = open (expfn, oflags | O_LARGEFILE, mode); 1239 fd = open (expfn, oflags | O_LARGEFILE, mode);
1240 if (fd == -1) 1240 if (fd == -1)
1241 { 1241 {
1242 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "open", expfn); 1242 if (0 == (flags & GNUNET_DISK_OPEN_FAILIFEXISTS))
1243 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "open", expfn);
1244 else
1245 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_DEBUG, "open", expfn);
1243 GNUNET_free (expfn); 1246 GNUNET_free (expfn);
1244 return NULL; 1247 return NULL;
1245 } 1248 }
diff --git a/src/util/server.c b/src/util/server.c
index b3c03d710..1353d4c05 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -1198,7 +1198,7 @@ GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client)
1198 } 1198 }
1199 if (rc > 0) 1199 if (rc > 0)
1200 return; 1200 return;
1201 if (client->in_process_client_buffer) 1201 if (client->in_process_client_buffer == GNUNET_YES)
1202 return; 1202 return;
1203 client->destroy (client->client_closure); 1203 client->destroy (client->client_closure);
1204 GNUNET_free (client); 1204 GNUNET_free (client);