struct sockaddr_un s_un;
unixpath = NULL;
- if ((GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "UNIXPATH", &unixpath)) &&
- (0 < strlen (unixpath)))
+ if ((GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "UNIXPATH", &unixpath)) &&
+ (0 < strlen (unixpath)))
{
/* We have a non-NULL unixpath, need to validate it */
if (strlen (unixpath) >= sizeof (s_un.sun_path))
unixpath = GNUNET_NETWORK_shorten_unixpath (unixpath);
LOG (GNUNET_ERROR_TYPE_INFO,
_("Using `%s' instead\n"), unixpath);
+ if (NULL == unixpath)
+ return NULL;
}
connection = GNUNET_CONNECTION_create_from_connect_to_unixpath (cfg, unixpath);
if (NULL != connection)
#if AF_UNIX
char *unixpath = NULL;
- if ((GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "UNIXPATH", &unixpath)) &&
- (0 < strlen (unixpath)))
+ if ((GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "UNIXPATH", &unixpath)) &&
+ (0 < strlen (unixpath)))
ret = GNUNET_OK;
GNUNET_free_non_null (unixpath);
#endif
if ( (GNUNET_YES ==
GNUNET_CONFIGURATION_have_value (cfg, service_name, "PORT")) &&
(GNUNET_OK ==
- GNUNET_CONFIGURATION_get_value_number (cfg, service_name, "PORT", &port)) &&
+ GNUNET_CONFIGURATION_get_value_number (cfg, service_name, "PORT", &port)) &&
(port <= 65535) && (0 != port) &&
(GNUNET_OK ==
GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "HOSTNAME",
struct GNUNET_CLIENT_Connection *client;
struct GNUNET_CONNECTION_Handle *connection;
- if (GNUNET_OK !=
+ if (GNUNET_OK !=
test_service_configuration (service_name,
cfg))
return NULL;
/**
* Handle for a test to check if a service is running.
*/
-struct GNUNET_CLIENT_TestHandle
+struct GNUNET_CLIENT_TestHandle
{
/**
* Function to call with the result of the test.
/**
* Client connection we are using for the test, if any.
- */
+ */
struct GNUNET_CLIENT_Connection *client;
/**
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_CLIENT_TestHandle *th = cls;
-
+
th->task = GNUNET_SCHEDULER_NO_TASK;
th->cb (th->cb_cls, th->result);
GNUNET_CLIENT_service_test_cancel (th);
{
th->result = result;
th->task = GNUNET_SCHEDULER_add_now (&report_result,
- th);
+ th);
}
th->th = NULL;
if (size < sizeof (struct GNUNET_MessageHeader))
{
- LOG (GNUNET_ERROR_TYPE_DEBUG,
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
"Failed to transmit TEST request.\n");
service_test_report (th, GNUNET_NO);
return 0; /* client disconnected */
}
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Transmitting `%s' request.\n",
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Transmitting `%s' request.\n",
"TEST");
msg = (struct GNUNET_MessageHeader *) buf;
msg->type = htons (GNUNET_MESSAGE_TYPE_TEST);
msg->size = htons (sizeof (struct GNUNET_MessageHeader));
- GNUNET_CLIENT_receive (th->client,
+ GNUNET_CLIENT_receive (th->client,
&confirm_handler, th,
GNUNET_TIME_absolute_get_remaining
(th->test_deadline));
th->cb = cb;
th->cb_cls = cb_cls;
th->test_deadline = GNUNET_TIME_relative_to_absolute (timeout);
- LOG (GNUNET_ERROR_TYPE_DEBUG,
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
"Testing if service `%s' is running.\n",
service);
#ifdef AF_UNIX
service_test_report (th, GNUNET_YES);
return th;
}
- (void) GNUNET_NETWORK_socket_close (sock);
+ (void) GNUNET_NETWORK_socket_close (sock);
/* let's try IP */
}
}
{
struct GNUNET_CLIENT_TransmitHandle *th = cls;
struct GNUNET_TIME_Relative delay;
-
+
th->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
{
GNUNET_CONNECTION_receive_cancel (client->connection);
client->in_receive = GNUNET_NO;
- }
+ }
GNUNET_CONNECTION_destroy (client->connection);
client->connection = NULL;
delay = GNUNET_TIME_relative_min (delay, client->back_off);