}
}
GNUNET_SCHEDULER_cancel (shutdown_ctx->cancel_task);
- GNUNET_CLIENT_disconnect (shutdown_ctx->sock, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (shutdown_ctx->sock);
GNUNET_free (shutdown_ctx);
return;
}
/* ARM is not shutting down, well, report the error and be done with it... */
shutdown_ctx->cont (shutdown_ctx->cont_cls, shutdown_ctx->confirmed);
GNUNET_SCHEDULER_cancel (shutdown_ctx->cancel_task);
- GNUNET_CLIENT_disconnect (shutdown_ctx->sock, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (shutdown_ctx->sock);
GNUNET_free (shutdown_ctx);
return;
}
struct ShutdownContext *shutdown_ctx = cls;
shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_ARM_PROCESS_COMMUNICATION_TIMEOUT);
- GNUNET_CLIENT_disconnect (shutdown_ctx->sock, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (shutdown_ctx->sock);
GNUNET_free (shutdown_ctx);
}
LOG (GNUNET_ERROR_TYPE_WARNING,
_("Failed to transmit shutdown request to client.\n"));
shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_ARM_PROCESS_COMMUNICATION_ERROR);
- GNUNET_CLIENT_disconnect (shutdown_ctx->sock, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (shutdown_ctx->sock);
GNUNET_free (shutdown_ctx);
return 0; /* client disconnected */
}
GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h)
{
if (h->client != NULL)
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
GNUNET_CONFIGURATION_destroy (h->cfg);
GNUNET_free (h);
}
("Error receiving response to `%s' request from ARM for service `%s'\n"),
(sc->type == GNUNET_MESSAGE_TYPE_ARM_START) ? "START" : "STOP",
(const char *) &sc[1]);
- GNUNET_CLIENT_disconnect (sc->h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (sc->h->client);
sc->h->client = GNUNET_CLIENT_connect ("arm", sc->h->cfg);
GNUNET_assert (NULL != sc->h->client);
if (sc->callback != NULL)
{
LOG (GNUNET_ERROR_TYPE_WARNING,
"Error receiving response to LIST request from ARM\n");
- GNUNET_CLIENT_disconnect (sc->h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (sc->h->client);
sc->h->client = GNUNET_CLIENT_connect ("arm", sc->h->cfg);
GNUNET_assert (NULL != sc->h->client);
if (sc->callback != NULL)
if (shutdown_ctx->cont != NULL)
shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_SYSERR);
GNUNET_SCHEDULER_cancel (shutdown_ctx->cancel_task);
- GNUNET_CLIENT_disconnect (shutdown_ctx->sock, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (shutdown_ctx->sock);
GNUNET_free (shutdown_ctx);
}
else if ((msg == NULL) && (shutdown_ctx->confirmed == GNUNET_YES))
shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_NO);
GNUNET_SCHEDULER_cancel (shutdown_ctx->cancel_task);
- GNUNET_CLIENT_disconnect (shutdown_ctx->sock, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (shutdown_ctx->sock);
GNUNET_free (shutdown_ctx);
}
else
shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_YES);
GNUNET_SCHEDULER_cancel (shutdown_ctx->cancel_task);
- GNUNET_CLIENT_disconnect (shutdown_ctx->sock, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (shutdown_ctx->sock);
GNUNET_free (shutdown_ctx);
break;
}
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "service_shutdown_cancel called!\n");
shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_SYSERR);
- GNUNET_CLIENT_disconnect (shutdown_ctx->sock, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (shutdown_ctx->sock);
GNUNET_free (shutdown_ctx);
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
_("Failed to transmit shutdown request to client.\n"));
shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_SYSERR);
- GNUNET_CLIENT_disconnect (shutdown_ctx->sock, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (shutdown_ctx->sock);
GNUNET_free (shutdown_ctx);
return 0; /* client disconnected */
}
GNUNET_assert (doNothingConnection != NULL);
if (trialCount == 12)
{
- GNUNET_CLIENT_disconnect (doNothingConnection, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (doNothingConnection);
GNUNET_ARM_stop_service (arm, "do-nothing", TIMEOUT, &arm_notify_stop,
NULL);
ok = 0;
GNUNET_TIME_UNIT_FOREVER_REL);
return;
reconnect:
- GNUNET_CLIENT_disconnect (ph->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (ph->client);
ph->client = NULL;
ph->task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &reconnect_task,
}
if (NULL != ph->client)
{
- GNUNET_CLIENT_disconnect (ph->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (ph->client);
ph->client = NULL;
}
GNUNET_free (ph);
#include "gnunet_ats_service.h"
#include "ats.h"
-#define DEBUG_ATS GNUNET_EXTRA_LOGGING
#define INTERFACE_PROCESSING_INTERVALL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
force_reconnect (struct GNUNET_ATS_SchedulingHandle *sh)
{
sh->reconnect = GNUNET_NO;
- GNUNET_CLIENT_disconnect (sh->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (sh->client);
sh->client = NULL;
sh->task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &reconnect_task,
}
if (NULL != sh->client)
{
- GNUNET_CLIENT_disconnect (sh->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (sh->client);
sh->client = NULL;
}
if (GNUNET_SCHEDULER_NO_TASK != sh->task)
}
if (h->client != NULL)
{
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
h->currently_down = GNUNET_YES;
}
if (handle->client != NULL)
{
- GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (handle->client);
handle->client = NULL;
}
GNUNET_CONTAINER_multihashmap_iterate (handle->peers,
{
if (request_context->peer_cb != NULL)
request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0);
- GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (request_context->client);
GNUNET_free (request_context);
return;
}
GNUNET_break (0);
if (request_context->peer_cb != NULL)
request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0);
- GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (request_context->client);
GNUNET_free (request_context);
return;
}
GNUNET_break (0);
if (request_context->peer_cb != NULL)
request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0);
- GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (request_context->client);
GNUNET_free (request_context);
return;
}
}
if (h->client != NULL)
{
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_TIME_UNIT_MINUTES,
GNUNET_YES, &transmit_drop, h))
return;
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
GNUNET_break (0);
GNUNET_STATISTICS_update (stats, gettext_noop ("# reconnected to DATASTORE"),
1, GNUNET_NO);
#endif
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->skip_next_messages = 0;
h->client = NULL;
h->reconnect_task =
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Disconnecting from DHT service, will try to reconnect in %llu ms\n",
(unsigned long long) handle->retry_time.rel_value);
- GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (handle->client);
handle->client = NULL;
handle->reconnect_task =
GNUNET_SCHEDULER_add_delayed (handle->retry_time, &try_reconnect, handle);
}
if (handle->client != NULL)
{
- GNUNET_CLIENT_disconnect (handle->client, GNUNET_YES);
+ GNUNET_CLIENT_disconnect (handle->client);
handle->client = NULL;
}
if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
/**
- * Perform a PUT operation storing data in the DHT.
+ * Perform a PUT operation storing data in the DHT. FIXME: we should
+ * change the protocol to get a confirmation for the PUT from the DHT
+ * and call 'cont' only after getting the confirmation; otherwise, the
+ * client has no good way of telling if the 'PUT' message actually got
+ * to the DHT service!
*
* @param handle handle to DHT service
* @param key the key to store under
}
if (NULL != dh->dns_connection)
{
- GNUNET_CLIENT_disconnect (dh->dns_connection, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (dh->dns_connection);
dh->dns_connection = NULL;
}
while (NULL != (qe = dh->rq_head))
GNUNET_CLIENT_notify_transmit_ready_cancel (dc->th);
dc->th = NULL;
}
- GNUNET_CLIENT_disconnect (dc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (dc->client);
dc->in_receive = GNUNET_NO;
dc->client = NULL;
GNUNET_FS_free_download_request_ (dc->top_request);
dc->pending_head = NULL;
dc->pending_tail = NULL;
GNUNET_CONTAINER_multihashmap_iterate (dc->active, &retry_entry, dc);
- GNUNET_CLIENT_disconnect (dc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (dc->client);
dc->in_receive = GNUNET_NO;
dc->client = NULL;
}
}
if (NULL != dc->client)
{
- GNUNET_CLIENT_disconnect (dc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (dc->client);
dc->in_receive = GNUNET_NO;
dc->client = NULL;
}
void
GNUNET_FS_get_indexed_files_cancel (struct GNUNET_FS_GetIndexedContext *gic)
{
- GNUNET_CLIENT_disconnect (gic->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (gic->client);
GNUNET_free (gic);
}
}
if (pc->client != NULL)
{
- GNUNET_CLIENT_disconnect (pc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (pc->client);
pc->client = NULL;
}
GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
const char *emsg;
uint16_t msize;
- GNUNET_CLIENT_disconnect (pc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (pc->client);
pc->client = NULL;
p = pc->fi_pos;
if (msg == NULL)
#include "gnunet_protocols.h"
#include "fs_api.h"
-#define DEBUG_SEARCH GNUNET_EXTRA_LOGGING
/**
* Number of availability trials we perform per search result.
{
if (NULL != sc->client)
{
- GNUNET_CLIENT_disconnect (sc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (sc->client);
sc->client = NULL;
}
sc->task =
if (sc->task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_SCHEDULER_cancel (sc->task);
if (NULL != sc->client)
- GNUNET_CLIENT_disconnect (sc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (sc->client);
GNUNET_CONTAINER_multihashmap_destroy (sc->master_result_map);
if (sc->requests != NULL)
{
GNUNET_SCHEDULER_cancel (sc->task);
sc->task = GNUNET_SCHEDULER_NO_TASK;
if (NULL != sc->client)
- GNUNET_CLIENT_disconnect (sc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (sc->client);
sc->client = NULL;
GNUNET_FS_search_sync_ (sc);
GNUNET_CONTAINER_multihashmap_iterate (sc->master_result_map,
if (sc->task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_SCHEDULER_cancel (sc->task);
if (NULL != sc->client)
- GNUNET_CLIENT_disconnect (sc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (sc->client);
GNUNET_CONTAINER_multihashmap_iterate (sc->master_result_map,
&search_result_free, sc);
GNUNET_CONTAINER_multihashmap_destroy (sc->master_result_map);
if (uc->client != NULL)
{
- GNUNET_CLIENT_disconnect (uc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (uc->client);
uc->client = NULL;
}
if (uc->state != UNINDEX_STATE_FS_NOTIFY)
}
if (uc->client != NULL)
{
- GNUNET_CLIENT_disconnect (uc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (uc->client);
uc->client = NULL;
}
if (NULL != uc->dsh)
}
if (uc->client != NULL)
{
- GNUNET_CLIENT_disconnect (uc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (uc->client);
uc->client = NULL;
}
if (NULL != uc->dsh)
force_reconnect (struct GNUNET_GNS_Handle *h)
{
h->reconnect = GNUNET_NO;
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
h->reconnect_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
&reconnect_task,
void
GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle)
{
- GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (handle->client);
if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task)
{
GNUNET_SCHEDULER_cancel (handle->reconnect_task);
* which case the message may still be lost).
*
* @param sock handle to the service connection
- * @param finish_pending_write should a transmission already passed to the
- * handle be completed?
*/
void
-GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock,
- int finish_pending_write);
+GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock);
/**
}
if (NULL != h->client)
{
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
}
/* connect again */
}
if (NULL != handle->client)
{
- GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (handle->client);
handle->client = NULL;
}
if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task)
#include "gnunet_namestore_service.h"
#include "namestore.h"
-#define DEBUG_GNS_API GNUNET_EXTRA_LOGGING
#define LOG(kind,...) GNUNET_log_from (kind, "gns-api",__VA_ARGS__)
force_reconnect (struct GNUNET_NAMESTORE_Handle *h)
{
h->reconnect = GNUNET_NO;
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
h->reconnect_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
&reconnect_task,
if (NULL != h->client)
{
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task)
while (NULL != (cpos = tst->ca_head))
{
GNUNET_CONTAINER_DLL_remove (tst->ca_head, tst->ca_tail, cpos);
- GNUNET_CLIENT_disconnect (cpos->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (cpos->client);
GNUNET_free (cpos);
}
while (NULL != (pos = tst->na_head))
if (msg == NULL)
{
/* Error, timeout, death */
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
h->reconnect_task =
GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, &reconnect, h);
}
if (NULL != h->client)
{
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
}
if (h->client != NULL)
{
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
GNUNET_free (h);
}
if (NULL != h->client)
{
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
if (GNUNET_SCHEDULER_NO_TASK != h->r_task)
}
if (NULL != h->client)
{
- GNUNET_CLIENT_disconnect (h->client, GNUNET_SYSERR);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
h->client = GNUNET_CLIENT_connect ("peerinfo", h->cfg);
if (msg == NULL)
{
- GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (nc->client);
reconnect (nc, NULL);
return;
}
(ntohs (msg->type) != GNUNET_MESSAGE_TYPE_PEERINFO_INFO))
{
GNUNET_break (0);
- GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (nc->client);
nc->client = GNUNET_CLIENT_connect ("peerinfo", nc->cfg);
request_notifications (nc);
return;
if (ms != sizeof (struct InfoMessage) + GNUNET_HELLO_size (hello))
{
GNUNET_break (0);
- GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (nc->client);
nc->client = GNUNET_CLIENT_connect ("peerinfo", nc->cfg);
request_notifications (nc);
return;
nc->init = NULL;
if (buf == NULL)
{
- GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (nc->client);
nc->client = GNUNET_CLIENT_connect ("peerinfo", nc->cfg);
request_notifications (nc);
return 0;
nc->init = NULL;
}
if (NULL != nc->client)
- GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (nc->client);
if (GNUNET_SCHEDULER_NO_TASK != nc->task)
GNUNET_SCHEDULER_cancel (nc->task);
GNUNET_free (nc);
}
if (NULL != h->client)
{
- GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
h->receiving = GNUNET_NO;
}
if (NULL != h->client)
{
- GNUNET_CLIENT_disconnect (h->client, GNUNET_YES);
+ GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
/* Forget about all neighbours that we used to be connected to */
reconnect (struct GNUNET_TRANSPORT_PeerIterateContext *pal_ctx)
{
GNUNET_assert (GNUNET_NO == pal_ctx->one_shot);
- GNUNET_CLIENT_disconnect (pal_ctx->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (pal_ctx->client);
pal_ctx->client = NULL;
pal_ctx->backoff = GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS,
GNUNET_TIME_relative_min (GNUNET_TIME_relative_multiply (pal_ctx->backoff, 2),
{
if (NULL != alc->client)
{
- GNUNET_CLIENT_disconnect (alc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (alc->client);
alc->client = NULL;
}
if (GNUNET_SCHEDULER_NO_TASK != alc->reconnect_task)
if (msg == NULL)
{
alucb->cb (alucb->cb_cls, NULL);
- GNUNET_CLIENT_disconnect (alucb->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (alucb->client);
GNUNET_free (alucb);
return;
}
{
/* done! */
alucb->cb (alucb->cb_cls, NULL);
- GNUNET_CLIENT_disconnect (alucb->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (alucb->client);
GNUNET_free (alucb);
return;
}
/* invalid reply */
GNUNET_break (0);
alucb->cb (alucb->cb_cls, NULL);
- GNUNET_CLIENT_disconnect (alucb->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (alucb->client);
GNUNET_free (alucb);
return;
}
GNUNET_TRANSPORT_AddressToStringContext
*alc)
{
- GNUNET_CLIENT_disconnect (alc->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (alc->client);
GNUNET_free (alc);
}
reconnect (struct GNUNET_TRANSPORT_Blacklist *br)
{
if (br->client != NULL)
- GNUNET_CLIENT_disconnect (br->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (br->client);
br->client = GNUNET_CLIENT_connect ("transport", br->cfg);
GNUNET_assert (br->client != NULL);
br->th =
GNUNET_CLIENT_notify_transmit_ready_cancel (br->th);
br->th = NULL;
}
- GNUNET_CLIENT_disconnect (br->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (br->client);
GNUNET_free (br);
}
* destroyed (unless, of course, there is an error with the server in
* which case the message may still be lost).
*
- * @param finish_pending_write should a transmission already passed to the
- * handle be completed?
* @param sock handle to the service connection
*/
void
-GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock,
- int finish_pending_write)
+GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock)
{
if (sock->in_receive == GNUNET_YES)
{
}
if (NULL != sock->sock)
{
- GNUNET_CONNECTION_destroy (sock->sock, finish_pending_write);
+ GNUNET_CONNECTION_destroy (sock->sock, GNUNET_NO);
sock->sock = NULL;
}
if (sock->receive_task != GNUNET_SCHEDULER_NO_TASK)
{
service_test_error (conn->test_cb, conn->test_cb_cls);
}
- GNUNET_CLIENT_disconnect (conn, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (conn);
}
{
LOG (GNUNET_ERROR_TYPE_DEBUG, _("Failure to transmit TEST request.\n"));
service_test_error (conn->test_cb, conn->test_cb_cls);
- GNUNET_CLIENT_disconnect (conn, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (conn);
return 0; /* client disconnected */
}
LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "TEST");
LOG (GNUNET_ERROR_TYPE_WARNING,
_("Failure to transmit request to service `%s'\n"), service);
service_test_error (task, task_cls);
- GNUNET_CLIENT_disconnect (conn, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (conn);
return;
}
}
return GNUNET_NETWORK_socket_disable_corking (sock->sock);
}
+
/**
* Create a socket handle by boxing an existing OS socket. The OS
* socket should henceforth be no longer used directly.
return ret;
}
+
/**
* Obtain the network address of the other party.
*
GNUNET_RESOLVER_request_cancel (sock->dns_active);
sock->dns_active = NULL;
}
-
GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sock->destroy_task);
sock->destroy_task = GNUNET_SCHEDULER_add_now (&destroy_continuation, sock);
}
#if DEBUG_RESOLVER
LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from DNS service\n");
#endif
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
}
if (r_task != GNUNET_SCHEDULER_NO_TASK)
}
GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
GNUNET_free (rh);
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
reconnect ();
return;
if (GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE != ntohs (msg->type))
{
GNUNET_break (0);
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
reconnect ();
return;
rh->name_callback (rh->cls, NULL);
GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
GNUNET_free (rh);
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
reconnect ();
return;
rh->addr_callback (rh->cls, NULL, 0);
GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
GNUNET_free (rh);
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
reconnect ();
return;
(rh->timeout), GNUNET_YES,
&handle_response, rh))
{
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
reconnect ();
return;
msg.type = htons (MY_TYPE);
msg.size = htons (sizeof (struct GNUNET_MessageHeader));
GNUNET_assert (0 == memcmp (got, &msg, sizeof (struct GNUNET_MessageHeader)));
- GNUNET_CLIENT_disconnect (client, GNUNET_YES);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
GNUNET_SERVER_destroy (server);
server = NULL;
GNUNET_assert (ok == 6);
ok = 0;
GNUNET_SERVER_destroy (server);
- GNUNET_CLIENT_disconnect (cc, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (cc);
GNUNET_CONFIGURATION_destroy (cfg);
}
GNUNET_assert (ok == 5);
ok = 0;
GNUNET_SERVER_destroy (server);
- GNUNET_CLIENT_disconnect (cc, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (cc);
GNUNET_CONFIGURATION_destroy (cfg);
}
break;
case 4:
ok++;
- GNUNET_CLIENT_disconnect (client, GNUNET_YES);
+ GNUNET_CLIENT_disconnect (client);
GNUNET_SERVER_receive_done (argclient, GNUNET_OK);
break;
default:
break;
case 4:
ok++;
- GNUNET_CLIENT_disconnect (client, GNUNET_YES);
+ GNUNET_CLIENT_disconnect (client);
GNUNET_SERVER_receive_done (argclient, GNUNET_OK);
break;
default:
GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));
msg->type = htons (MY_TYPE);
msg->size = htons (sizeof (struct GNUNET_MessageHeader));
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
return sizeof (struct GNUNET_MessageHeader);
}
GNUNET_CLIENT_notify_transmit_ready_cancel (vh->th);
vh->th = NULL;
}
- GNUNET_CLIENT_disconnect (vh->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (vh->client);
vh->client = NULL;
vh->request_id_gen = 0;
for (rr = vh->rr_head; NULL != rr; rr = rr->next)
}
if (NULL != vh->client)
{
- GNUNET_CLIENT_disconnect (vh->client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (vh->client);
vh->client = NULL;
}
if (GNUNET_SCHEDULER_NO_TASK != vh->rt)