From: Christian Grothoff Date: Mon, 14 May 2012 23:44:22 +0000 (+0000) Subject: -fixing misc seaspider parser errors X-Git-Tag: initial-import-from-subversion-38251~13492 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=720afac61536fbb212c0010f31764704c12aab0f;p=oweals%2Fgnunet.git -fixing misc seaspider parser errors --- diff --git a/src/ats/perf_ats_mlp.c b/src/ats/perf_ats_mlp.c index a06f16c3e..bace9809f 100644 --- a/src/ats/perf_ats_mlp.c +++ b/src/ats/perf_ats_mlp.c @@ -231,7 +231,7 @@ check (void *cls, char *const *args, const char *cfgfile, if ((update_percentage >= 0) && (update_percentage <= 100)) { update = GNUNET_YES; - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Benchmarking with existing presolution and %u \% updated addresses\n", update_percentage); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Benchmarking with existing presolution and %u%% updated addresses\n", update_percentage); } else if ((update_percentage > 100) && (update_percentage != UINT_MAX)) { diff --git a/src/chat/gnunet-chat.c b/src/chat/gnunet-chat.c index fb958d98a..7b11c0d18 100644 --- a/src/chat/gnunet-chat.c +++ b/src/chat/gnunet-chat.c @@ -44,13 +44,14 @@ static struct GNUNET_CONTAINER_MetaData *meta; static struct GNUNET_CHAT_Room *room; -static GNUNET_SCHEDULER_TaskIdentifier handle_cmd_task = - GNUNET_SCHEDULER_NO_TASK; +static GNUNET_SCHEDULER_TaskIdentifier handle_cmd_task; + +typedef int (*ActionFunction)(const char *argumetns, const void *xtra); struct ChatCommand { const char *command; - int (*Action) (const char *arguments, const void *xtra); + ActionFunction Action; const char *helptext; }; @@ -234,7 +235,8 @@ member_list_cb (void *cls, const struct GNUNET_CONTAINER_MetaData *member_info, const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *member_id, enum GNUNET_CHAT_MsgOptions options) { - char *nick, *non_unique_nick; + char *nick; + char *non_unique_nick; int nick_is_a_dup; GNUNET_HashCode id; struct UserList *pos; diff --git a/src/fragmentation/defragmentation.c b/src/fragmentation/defragmentation.c index b07f20407..061277c41 100644 --- a/src/fragmentation/defragmentation.c +++ b/src/fragmentation/defragmentation.c @@ -362,7 +362,7 @@ estimate_latency (struct MessageContext *mc) if (ret.rel_value == 0) ret = GNUNET_TIME_UNIT_MILLISECONDS; /* always at least 1 */ return ret; -}; +} /** diff --git a/src/gns/gnunet-gns-fcfsd.c b/src/gns/gnunet-gns-fcfsd.c index 7e099df62..accdf1e0d 100644 --- a/src/gns/gnunet-gns-fcfsd.c +++ b/src/gns/gnunet-gns-fcfsd.c @@ -621,7 +621,7 @@ run_httpd () struct GNUNET_NETWORK_FDSet *wes; int max; int haveto; - unsigned MHD_LONG_LONG timeout; + MHD_LONG_LONG timeout; struct GNUNET_TIME_Relative tv; FD_ZERO (&rs); diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 9caa52c26..26a496d4a 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c @@ -146,14 +146,14 @@ struct GNUNET_CRYPTO_ShortHashCode zone_hash; /** * Useful for zone update for DHT put */ -static int num_public_records = 0; +static int num_public_records; /** * update interval in seconds */ -static unsigned long long int max_record_put_interval; +static unsigned long long max_record_put_interval; -static unsigned long long int dht_max_update_interval; +static unsigned long long dht_max_update_interval; /* dht update interval FIXME define? */ static struct GNUNET_TIME_Relative record_put_interval; @@ -383,10 +383,9 @@ put_gns_record(void *cls, static void update_zone_dht_start(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Scheduling DHT zone update!\n"); - - unsigned long long int interval = 0; + unsigned long long interval = 0; + GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Scheduling DHT zone update!\n"); if (0 == num_public_records) { /** diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index 8c55e13a4..eadbeb55f 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c @@ -935,7 +935,8 @@ clean_up_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } GNUNET_free(h); h = NULL; -}; +} + /** * Disconnect from the namestore service (and free associated diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 9c3fedc75..1a4ab765a 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c @@ -457,6 +457,8 @@ plugin_tcp_access_check (void *cls, { struct Plugin *plugin = cls; + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Accepting new incoming TCP connection\n"); if (0 == plugin->max_connections) return GNUNET_NO; plugin->max_connections--; @@ -712,6 +714,9 @@ create_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *target, GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", "Creating new session for peer `%4s'\n", GNUNET_i2s (target)); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Creating new TCP session for peer `%s'\n", + GNUNET_i2s (target)); ret = GNUNET_malloc (sizeof (struct Session)); ret->last_activity = GNUNET_TIME_absolute_get (); @@ -1089,9 +1094,10 @@ struct SessionItCtx struct Session * result; }; -int session_lookup_it (void *cls, - const GNUNET_HashCode * key, - void *value) +static int +session_lookup_it (void *cls, + const GNUNET_HashCode * key, + void *value) { struct SessionItCtx * si_ctx = cls; struct Session * session = value; @@ -1144,11 +1150,10 @@ nat_connect_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", "NAT WAIT connection to `%4s' at `%s' could not be established, removing session\n", GNUNET_i2s (&session->target), tcp_address_to_string(NULL, session->addr, session->addrlen)); - disconnect_session (session); - } + /** * Create a new session to transmit data to the target * This session will used to send data to this peer and the plugin will @@ -1164,7 +1169,6 @@ tcp_plugin_get_session (void *cls, { struct Plugin * plugin = cls; struct Session * session = NULL; - int af; const void *sb; size_t sbs; @@ -1175,20 +1179,19 @@ tcp_plugin_get_session (void *cls, const struct IPv6TcpAddress *t6; struct GNUNET_ATS_Information ats; unsigned int is_natd = GNUNET_NO; - size_t addrlen = 0; + size_t addrlen; GNUNET_assert (plugin != NULL); GNUNET_assert (address != NULL); - addrlen = address->address_length; - - GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", - "Trying to get session for `%s' address length %i\n", + GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp", + "Trying to get session for `%s' address of peer `%s'\n", tcp_address_to_string(NULL, address->address, address->address_length), - addrlen); + GNUNET_i2s (&address->peer)); /* look for existing session */ - if (GNUNET_CONTAINER_multihashmap_contains(plugin->sessionmap, &address->peer.hashPubKey)) + if (GNUNET_YES == + GNUNET_CONTAINER_multihashmap_contains(plugin->sessionmap, &address->peer.hashPubKey)) { struct SessionItCtx si_ctx; @@ -1208,6 +1211,11 @@ tcp_plugin_get_session (void *cls, session); return session; } + GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp", + "Existing sessions did not match address `%s' or peer `%s'\n", + tcp_address_to_string(NULL, address->address, address->address_length), + GNUNET_i2s (&address->peer)); + } if (addrlen == sizeof (struct IPv6TcpAddress)) @@ -1281,7 +1289,7 @@ tcp_plugin_get_session (void *cls, &address->peer.hashPubKey))) { GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", - _("Found valid IPv4 NAT address (creating session)!\n")); + "Found valid IPv4 NAT address (creating session)!\n") ; session = create_session (plugin, &address->peer, NULL, GNUNET_YES); session->addrlen = 0; session->addr = NULL; @@ -1324,7 +1332,7 @@ tcp_plugin_get_session (void *cls, } plugin->max_connections--; - GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", + GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp", "Asked to transmit to `%4s', creating fresh session using address `%s'.\n", GNUNET_i2s (&address->peer), GNUNET_a2s (sb, sbs)); @@ -1769,7 +1777,7 @@ handle_tcp_welcome (void *cls, struct GNUNET_SERVER_Client *client, return; } - GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", + GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp", "Received %s message from `%4s'\n", "WELCOME", GNUNET_i2s (&wm->clientIdentity)); GNUNET_STATISTICS_update (plugin->env->stats,