#include "gnunet_socks.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-client",__VA_ARGS__)
/**
static void
connect_fail_continuation (struct ClientState *cstate)
{
- LOG (GNUNET_ERROR_TYPE_WARNING,
- "Failed to establish connection to `%s', no further addresses to try.\n",
- cstate->service_name);
GNUNET_break (NULL == cstate->ap_head);
GNUNET_break (NULL == cstate->ap_tail);
GNUNET_break (NULL == cstate->dns_active);
// GNUNET_assert (NULL == cstate->proxy_handshake);
cstate->back_off = GNUNET_TIME_STD_BACKOFF (cstate->back_off);
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Failed to establish connection to `%s', no further addresses to try, will try again in %s.\n",
+ cstate->service_name,
+ GNUNET_STRINGS_relative_time_to_string (cstate->back_off,
+ GNUNET_YES));
cstate->retry_task
= GNUNET_SCHEDULER_add_delayed (cstate->back_off,
&start_connect,
cstate->sock,
&transmit_ready,
cstate);
- if (notify_in_flight)
+ if (notify_in_flight)
GNUNET_MQ_impl_send_in_flight (cstate->mq);
return;
}
if (GNUNET_YES == cstate->in_destroy)
return GNUNET_SYSERR;
+
+ LOG (GNUNET_ERROR_TYPE_INFO,
+ "Received message of type %u and size %u from %s\n",
+ ntohs (msg->type), ntohs (msg->size), cstate->service_name);
+
GNUNET_MQ_inject_message (cstate->mq,
msg);
if (GNUNET_YES == cstate->in_destroy)
s_un.sun_path[0] = '\0';
}
#endif
-#if HAVE_SOCKADDR_IN_SIN_LEN
- un.sun_len = (u_char) sizeof (struct sockaddr_un);
+#if HAVE_SOCKADDR_UN_SUN_LEN
+ s_un.sun_len = (u_char) sizeof (struct sockaddr_un);
#endif
sock = GNUNET_NETWORK_socket_create (AF_UNIX,
SOCK_STREAM,
GNUNET_free (unixpath);
return sock;
}
+ if (NULL != sock)
+ GNUNET_NETWORK_socket_close (sock);
}
GNUNET_free_non_null (unixpath);
#endif
{
struct ClientState *cstate = cls;
struct AddressProbe *ap;
-
+
if (NULL == addr)
{
cstate->dns_active = NULL;
{
connect_success_continuation (cstate);
return;
- }
+ }
}
if ( (NULL == cstate->hostname) ||
(0 == cstate->port) )
* @return the message queue, NULL on error
*/
struct GNUNET_MQ_Handle *
-GNUNET_CLIENT_connecT (const struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_CLIENT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
const char *service_name,
const struct GNUNET_MQ_MessageHandler *handlers,
GNUNET_MQ_ErrorHandler error_handler,
return cstate->mq;
}
-/* end of client_new.c */
+/* end of client.c */