diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-09-24 11:58:19 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-09-24 11:58:19 +0000 |
commit | d02c15600b668a30e091d2c5c59d918bb1e4fee7 (patch) | |
tree | 104fe1f196f7b26d48dde82964d8a8d775c27291 | |
parent | ce0ede295cde67140a18eae97a39527dd2f347eb (diff) | |
download | gnunet-d02c15600b668a30e091d2c5c59d918bb1e4fee7.tar.gz gnunet-d02c15600b668a30e091d2c5c59d918bb1e4fee7.zip |
handle case of missing handler properly
-rw-r--r-- | src/util/service_new.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/util/service_new.c b/src/util/service_new.c index 274b0f869..c547e3bf3 100644 --- a/src/util/service_new.c +++ b/src/util/service_new.c | |||
@@ -269,7 +269,7 @@ struct GNUNET_SERVICE_Client | |||
269 | * Pointer to the message to be transmitted by @e send_task. | 269 | * Pointer to the message to be transmitted by @e send_task. |
270 | */ | 270 | */ |
271 | const struct GNUNET_MessageHeader *msg; | 271 | const struct GNUNET_MessageHeader *msg; |
272 | 272 | ||
273 | /** | 273 | /** |
274 | * User context value, value returned from | 274 | * User context value, value returned from |
275 | * the connect callback. | 275 | * the connect callback. |
@@ -286,7 +286,7 @@ struct GNUNET_SERVICE_Client | |||
286 | * Current position in @e msg at which we are transmitting. | 286 | * Current position in @e msg at which we are transmitting. |
287 | */ | 287 | */ |
288 | size_t msg_pos; | 288 | size_t msg_pos; |
289 | 289 | ||
290 | /** | 290 | /** |
291 | * Persist the file handle for this client no matter what happens, | 291 | * Persist the file handle for this client no matter what happens, |
292 | * force the OS to close once the process actually dies. Should only | 292 | * force the OS to close once the process actually dies. Should only |
@@ -1234,7 +1234,7 @@ setup_service (struct GNUNET_SERVICE_Handle *sh) | |||
1234 | { | 1234 | { |
1235 | /* listen only on inherited sockets if we have any */ | 1235 | /* listen only on inherited sockets if we have any */ |
1236 | struct GNUNET_NETWORK_Handle **ls; | 1236 | struct GNUNET_NETWORK_Handle **ls; |
1237 | 1237 | ||
1238 | for (ls = lsocks; NULL != *ls; ls++) | 1238 | for (ls = lsocks; NULL != *ls; ls++) |
1239 | { | 1239 | { |
1240 | struct ServiceListenContext *slc; | 1240 | struct ServiceListenContext *slc; |
@@ -1694,7 +1694,7 @@ GNUNET_SERVICE_ruN_ (int argc, | |||
1694 | clock_offset); | 1694 | clock_offset); |
1695 | } | 1695 | } |
1696 | GNUNET_RESOLVER_connect (sh.cfg); | 1696 | GNUNET_RESOLVER_connect (sh.cfg); |
1697 | 1697 | ||
1698 | /* actually run service */ | 1698 | /* actually run service */ |
1699 | err = 0; | 1699 | err = 0; |
1700 | GNUNET_SCHEDULER_run (&service_main, | 1700 | GNUNET_SCHEDULER_run (&service_main, |
@@ -1908,7 +1908,13 @@ service_mq_error_handler (void *cls, | |||
1908 | 1908 | ||
1909 | if ( (GNUNET_MQ_ERROR_NO_MATCH == error) && | 1909 | if ( (GNUNET_MQ_ERROR_NO_MATCH == error) && |
1910 | (GNUNET_NO == sh->require_found) ) | 1910 | (GNUNET_NO == sh->require_found) ) |
1911 | { | ||
1912 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1913 | "No handler for message of type %u found\n", | ||
1914 | (unsigned int) client->warn_type); | ||
1915 | GNUNET_SERVICE_client_continue (client); | ||
1911 | return; /* ignore error */ | 1916 | return; /* ignore error */ |
1917 | } | ||
1912 | GNUNET_SERVICE_client_drop (client); | 1918 | GNUNET_SERVICE_client_drop (client); |
1913 | } | 1919 | } |
1914 | 1920 | ||
@@ -1924,7 +1930,7 @@ warn_no_client_continue (void *cls) | |||
1924 | struct GNUNET_SERVICE_Client *client = cls; | 1930 | struct GNUNET_SERVICE_Client *client = cls; |
1925 | 1931 | ||
1926 | GNUNET_break (0 != client->warn_type); /* type should never be 0 here, as we don't use 0 */ | 1932 | GNUNET_break (0 != client->warn_type); /* type should never be 0 here, as we don't use 0 */ |
1927 | client->warn_task | 1933 | client->warn_task |
1928 | = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, | 1934 | = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, |
1929 | &warn_no_client_continue, | 1935 | &warn_no_client_continue, |
1930 | client); | 1936 | client); |
@@ -2138,7 +2144,7 @@ accept_client (void *cls) | |||
2138 | struct sockaddr_storage sa; | 2144 | struct sockaddr_storage sa; |
2139 | socklen_t addrlen; | 2145 | socklen_t addrlen; |
2140 | int ok; | 2146 | int ok; |
2141 | 2147 | ||
2142 | addrlen = sizeof (sa); | 2148 | addrlen = sizeof (sa); |
2143 | sock = GNUNET_NETWORK_socket_accept (slc->listen_socket, | 2149 | sock = GNUNET_NETWORK_socket_accept (slc->listen_socket, |
2144 | (struct sockaddr *) &sa, | 2150 | (struct sockaddr *) &sa, |
@@ -2259,7 +2265,7 @@ resume_client_receive (void *cls) | |||
2259 | = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, | 2265 | = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, |
2260 | c->sock, | 2266 | c->sock, |
2261 | &service_client_recv, | 2267 | &service_client_recv, |
2262 | c); | 2268 | c); |
2263 | } | 2269 | } |
2264 | 2270 | ||
2265 | 2271 | ||