GNUnet  0.11.x
Data Structures | Macros | Functions
setu_api.c File Reference
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_setu_service.h"
#include "setu.h"
Include dependency graph for setu_api.c:

Go to the source code of this file.

Data Structures

struct  GNUNET_SETU_Handle
 Opaque handle to a set. More...
 
struct  GNUNET_SETU_Request
 Handle for a set operation request from another peer. More...
 
struct  GNUNET_SETU_OperationHandle
 Handle to an operation. More...
 
struct  GNUNET_SETU_ListenHandle
 Opaque handle to a listen operation. More...
 

Macros

#define LOG(kind, ...)   GNUNET_log_from (kind, "set-api", __VA_ARGS__)
 

Functions

static int check_result (void *cls, const struct GNUNET_SETU_ResultMessage *msg)
 Check that the given msg is well-formed. More...
 
static void handle_result (void *cls, const struct GNUNET_SETU_ResultMessage *msg)
 Handle result message for a set operation. More...
 
static void set_operation_destroy (struct GNUNET_SETU_OperationHandle *oh)
 Destroy the given set operation. More...
 
void GNUNET_SETU_operation_cancel (struct GNUNET_SETU_OperationHandle *oh)
 Cancel the given set operation. More...
 
static void handle_client_set_error (void *cls, enum GNUNET_MQ_Error error)
 We encountered an error communicating with the set service while performing a set operation. More...
 
struct GNUNET_SETU_HandleGNUNET_SETU_create (const struct GNUNET_CONFIGURATION_Handle *cfg)
 Create an empty set, supporting the specified operation. More...
 
int GNUNET_SETU_add_element (struct GNUNET_SETU_Handle *set, const struct GNUNET_SETU_Element *element, GNUNET_SCHEDULER_TaskCallback cb, void *cb_cls)
 Add an element to the given set. More...
 
void GNUNET_SETU_destroy (struct GNUNET_SETU_Handle *set)
 Destroy the set handle if no operations are left, mark the set for destruction otherwise. More...
 
struct GNUNET_SETU_OperationHandleGNUNET_SETU_prepare (const struct GNUNET_PeerIdentity *other_peer, const struct GNUNET_HashCode *app_id, const struct GNUNET_MessageHeader *context_msg, const struct GNUNET_SETU_Option options[], GNUNET_SETU_ResultIterator result_cb, void *result_cls)
 Prepare a set operation to be evaluated with another peer. More...
 
static void listen_connect (void *cls)
 Connect to the set service in order to listen for requests. More...
 
static int check_request (void *cls, const struct GNUNET_SETU_RequestMessage *msg)
 Check validity of request message for a listen operation. More...
 
static void handle_request (void *cls, const struct GNUNET_SETU_RequestMessage *msg)
 Handle request message for a listen operation. More...
 
static void handle_client_listener_error (void *cls, enum GNUNET_MQ_Error error)
 Our connection with the set service encountered an error, re-initialize with exponential back-off. More...
 
struct GNUNET_SETU_ListenHandleGNUNET_SETU_listen (const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_HashCode *app_id, GNUNET_SETU_ListenCallback listen_cb, void *listen_cls)
 Wait for set operation requests for the given application id. More...
 
void GNUNET_SETU_listen_cancel (struct GNUNET_SETU_ListenHandle *lh)
 Cancel the given listen operation. More...
 
struct GNUNET_SETU_OperationHandleGNUNET_SETU_accept (struct GNUNET_SETU_Request *request, const struct GNUNET_SETU_Option options[], GNUNET_SETU_ResultIterator result_cb, void *result_cls)
 Accept a request we got via GNUNET_SETU_listen. More...
 
int GNUNET_SETU_commit (struct GNUNET_SETU_OperationHandle *oh, struct GNUNET_SETU_Handle *set)
 Commit a set to be used with a set operation. More...
 
void GNUNET_SETU_element_hash (const struct GNUNET_SETU_Element *element, struct GNUNET_HashCode *ret_hash)
 Hash a set element. More...
 

Macro Definition Documentation

◆ LOG

#define LOG (   kind,
  ... 
)    GNUNET_log_from (kind, "set-api", __VA_ARGS__)

Function Documentation

◆ check_result()

static int check_result ( void *  cls,
const struct GNUNET_SETU_ResultMessage msg 
)
static

Check that the given msg is well-formed.

Parameters
clsclosure
msgmessage to check
Returns
GNUNET_OK if message is well-formed

Definition at line 196 of file setu_api.c.

References GNUNET_OK.

198 {
199  /* minimum size was already checked, everything else is OK! */
200  return GNUNET_OK;
201 }

◆ handle_result()

static void handle_result ( void *  cls,
const struct GNUNET_SETU_ResultMessage msg 
)
static

Handle result message for a set operation.

Parameters
clsthe set
mhthe message

Definition at line 211 of file setu_api.c.

References GNUNET_SETU_ResultMessage::current_size, GNUNET_SETU_Element::data, GNUNET_SETU_Element::element_type, GNUNET_SETU_ResultMessage::element_type, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_MQ_assoc_get(), GNUNET_MQ_assoc_remove(), GNUNET_ntohll(), GNUNET_SETU_destroy(), GNUNET_SETU_STATUS_ADD_LOCAL, GNUNET_SETU_STATUS_ADD_REMOTE, GNUNET_SETU_STATUS_DONE, GNUNET_SETU_STATUS_FAILURE, GNUNET_YES, GNUNET_SETU_ResultMessage::header, LOG, oh, GNUNET_SETU_ResultMessage::request_id, GNUNET_SETU_OperationHandle::result_cb, GNUNET_SETU_OperationHandle::result_cls, GNUNET_SETU_ResultMessage::result_status, GNUNET_SETU_Element::size, and GNUNET_MessageHeader::size.

213 {
214  struct GNUNET_SETU_Handle *set = cls;
216  struct GNUNET_SETU_Element e;
217  enum GNUNET_SETU_Status result_status;
218  int destroy_set;
219 
220  GNUNET_assert (NULL != set->mq);
221  result_status = (enum GNUNET_SETU_Status) ntohs (msg->result_status);
223  "Got result message with status %d\n",
224  result_status);
225  oh = GNUNET_MQ_assoc_get (set->mq,
226  ntohl (msg->request_id));
227  if (NULL == oh)
228  {
229  /* 'oh' can be NULL if we canceled the operation, but the service
230  did not get the cancel message yet. */
232  "Ignoring result from canceled operation\n");
233  return;
234  }
235 
236  switch (result_status)
237  {
240  e.data = &msg[1];
241  e.size = ntohs (msg->header.size)
242  - sizeof(struct GNUNET_SETU_ResultMessage);
243  e.element_type = ntohs (msg->element_type);
244  if (NULL != oh->result_cb)
245  oh->result_cb (oh->result_cls,
246  &e,
248  result_status);
249  return;
253  "Treating result as final status\n");
254  GNUNET_MQ_assoc_remove (set->mq,
255  ntohl (msg->request_id));
256  GNUNET_CONTAINER_DLL_remove (set->ops_head,
257  set->ops_tail,
258  oh);
259  /* Need to do this calculation _before_ the result callback,
260  as IF the application still has a valid set handle, it
261  may trigger destruction of the set during the callback. */
262  destroy_set = (GNUNET_YES == set->destroy_requested) &&
263  (NULL == set->ops_head);
264  if (NULL != oh->result_cb)
265  {
266  oh->result_cb (oh->result_cls,
267  NULL,
269  result_status);
270  }
271  else
272  {
274  "No callback for final status\n");
275  }
276  if (destroy_set)
277  GNUNET_SETU_destroy (set);
278  GNUNET_free (oh);
279  return;
280  }
281 }
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SETU_RESULT.
Definition: setu.h:294
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
static struct Experiment * e
void * result_cls
Closure for result_cb.
Definition: setu_api.c:105
uint32_t request_id
id the result belongs to
Definition: setu.h:304
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
uint16_t element_type
Type of the element attached to the message, if any.
Definition: setu.h:315
#define LOG(kind,...)
Definition: setu_api.c:34
The other peer refused to do the operation with us, or something went wrong.
GNUNET_SETU_Status
Status for the result callback.
Opaque handle to a set.
Definition: setu_api.c:39
static struct GNUNET_TRANSPORT_OfferHelloHandle * oh
Active HELLO offering to transport service.
Success, all elements have been sent (and received).
Element should be added to the result set of the local peer, i.e.
uint16_t result_status
Was the evaluation successful? Contains an enum GNUNET_SETU_Status in NBO.
Definition: setu.h:310
Handle to an operation.
Definition: setu_api.c:94
GNUNET_SETU_ResultIterator result_cb
Function to be called when we have a result, or an error.
Definition: setu_api.c:100
uint64_t current_size
Current set size.
Definition: setu.h:299
void GNUNET_SETU_destroy(struct GNUNET_SETU_Handle *set)
Destroy the set handle if no operations are left, mark the set for destruction otherwise.
Definition: setu_api.c:471
Message sent by the service to the client to indicate an element that is removed (set intersection) o...
Definition: setu.h:289
Element should be added to the result set of the remote peer, i.e.
void * GNUNET_MQ_assoc_remove(struct GNUNET_MQ_Handle *mq, uint32_t request_id)
Remove the association for a request_id.
Definition: mq.c:765
#define GNUNET_log(kind,...)
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
Definition: common_endian.c:53
#define GNUNET_free(ptr)
Wrapper around free.
void * GNUNET_MQ_assoc_get(struct GNUNET_MQ_Handle *mq, uint32_t request_id)
Get the data associated with a request_id in a queue.
Definition: mq.c:749
Element stored in a set.
Here is the call graph for this function:

◆ set_operation_destroy()

static void set_operation_destroy ( struct GNUNET_SETU_OperationHandle oh)
static

Destroy the given set operation.

Parameters
ohset operation to destroy

Definition at line 290 of file setu_api.c.

References GNUNET_SETU_OperationHandle::conclude_mqm, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_MQ_assoc_remove(), GNUNET_MQ_discard(), GNUNET_SETU_Handle::mq, GNUNET_SETU_Handle::ops_head, GNUNET_SETU_Handle::ops_tail, GNUNET_SETU_OperationHandle::request_id, and GNUNET_SETU_OperationHandle::set.

Referenced by GNUNET_SETU_operation_cancel(), and handle_client_set_error().

291 {
292  struct GNUNET_SETU_Handle *set = oh->set;
293  struct GNUNET_SETU_OperationHandle *h_assoc;
294 
295  if (NULL != oh->conclude_mqm)
297  /* is the operation already committed? */
298  if (NULL != set)
299  {
301  set->ops_tail,
302  oh);
303  h_assoc = GNUNET_MQ_assoc_remove (set->mq,
304  oh->request_id);
305  GNUNET_assert ((NULL == h_assoc) ||
306  (h_assoc == oh));
307  }
308  GNUNET_free (oh);
309 }
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
struct GNUNET_SETU_Handle * set
Local set used for the operation, NULL if no set has been provided by conclude yet.
Definition: setu_api.c:111
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_MQ_Handle * mq
Message queue for client.
Definition: setu_api.c:44
struct GNUNET_MQ_Envelope * conclude_mqm
Message sent to the server on calling conclude, NULL if conclude has been called. ...
Definition: setu_api.c:117
Opaque handle to a set.
Definition: setu_api.c:39
Handle to an operation.
Definition: setu_api.c:94
void GNUNET_MQ_discard(struct GNUNET_MQ_Envelope *mqm)
Discard the message queue message, free all allocated resources.
Definition: mq.c:323
void * GNUNET_MQ_assoc_remove(struct GNUNET_MQ_Handle *mq, uint32_t request_id)
Remove the association for a request_id.
Definition: mq.c:765
struct GNUNET_SETU_OperationHandle * ops_tail
Linked list of operations on the set.
Definition: setu_api.c:54
uint32_t request_id
Request ID to identify the operation within the set.
Definition: setu_api.c:138
#define GNUNET_free(ptr)
Wrapper around free.
struct GNUNET_SETU_OperationHandle * ops_head
Linked list of operations on the set.
Definition: setu_api.c:49
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_client_set_error()

static void handle_client_set_error ( void *  cls,
enum GNUNET_MQ_Error  error 
)
static

We encountered an error communicating with the set service while performing a set operation.

Report to the application.

Parameters
clsthe struct GNUNET_SETU_Handle
errorerror code

Definition at line 354 of file setu_api.c.

References GNUNET_ERROR_TYPE_ERROR, GNUNET_NO, GNUNET_SETU_STATUS_FAILURE, GNUNET_YES, LOG, and set_operation_destroy().

Referenced by GNUNET_SETU_create().

356 {
357  struct GNUNET_SETU_Handle *set = cls;
358 
360  "Handling client set error %d\n",
361  error);
362  while (NULL != set->ops_head)
363  {
364  if ((NULL != set->ops_head->result_cb) &&
365  (GNUNET_NO == set->destroy_requested))
366  set->ops_head->result_cb (set->ops_head->result_cls,
367  NULL,
368  0,
370  set_operation_destroy (set->ops_head);
371  }
372  set->invalid = GNUNET_YES;
373 }
#define LOG(kind,...)
Definition: setu_api.c:34
The other peer refused to do the operation with us, or something went wrong.
Opaque handle to a set.
Definition: setu_api.c:39
static void set_operation_destroy(struct GNUNET_SETU_OperationHandle *oh)
Destroy the given set operation.
Definition: setu_api.c:290
Here is the call graph for this function:
Here is the caller graph for this function:

◆ listen_connect()

static void listen_connect ( void *  cls)
static

Connect to the set service in order to listen for requests.

Parameters
clsthe struct GNUNET_SETU_ListenHandle * to connect

Definition at line 687 of file setu_api.c.

References GNUNET_SETU_ListenMessage::app_id, GNUNET_SETU_ListenHandle::app_id, GNUNET_SETU_ListenHandle::cfg, GNUNET_assert, GNUNET_CLIENT_connect(), GNUNET_MESSAGE_TYPE_SETU_LISTEN, GNUNET_MESSAGE_TYPE_SETU_REQUEST, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg, GNUNET_MQ_send(), handle_client_listener_error(), GNUNET_SETU_ListenHandle::mq, msg, GNUNET_SETU_ListenHandle::reconnect_task, and request.

Referenced by GNUNET_SETU_listen(), GNUNET_SETU_prepare(), and handle_client_listener_error().

688 {
689  struct GNUNET_SETU_ListenHandle *lh = cls;
690  struct GNUNET_MQ_MessageHandler mq_handlers[] = {
694  lh),
696  };
697  struct GNUNET_MQ_Envelope *mqm;
699 
700  lh->reconnect_task = NULL;
701  GNUNET_assert (NULL == lh->mq);
702  lh->mq = GNUNET_CLIENT_connect (lh->cfg,
703  "setu",
704  mq_handlers,
706  lh);
707  if (NULL == lh->mq)
708  return;
709  mqm = GNUNET_MQ_msg (msg,
711  msg->app_id = lh->app_id;
712  GNUNET_MQ_send (lh->mq,
713  mqm);
714 }
struct GNUNET_MQ_Handle * mq
Message queue for the client.
Definition: setu_api.c:150
Message sent by the client to the service to start listening for incoming requests to perform a certa...
Definition: setu.h:55
#define GNUNET_MESSAGE_TYPE_SETU_REQUEST
Notify the client of an incoming request from a remote peer.
struct GNUNET_SCHEDULER_Task * reconnect_task
Task for reconnecting when the listener fails.
Definition: setu_api.c:183
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
static struct GNUNET_VPN_RedirectionRequest * request
Opaque redirection request handle.
Definition: gnunet-vpn.c:41
struct GNUNET_MQ_Handle * GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *service_name, const struct GNUNET_MQ_MessageHandler *handlers, GNUNET_MQ_ErrorHandler error_handler, void *error_handler_cls)
Create a message queue to connect to a GNUnet service.
Definition: client.c:1063
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_HashCode app_id
Application ID we listen for.
Definition: setu_api.c:173
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
Opaque handle to a listen operation.
Definition: setu_api.c:145
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
Message handler for a specific message type.
A request for an operation with another client.
Definition: setu.h:174
static void handle_client_listener_error(void *cls, enum GNUNET_MQ_Error error)
Our connection with the set service encountered an error, re-initialize with exponential back-off...
Definition: setu_api.c:664
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration handle for the listener, stored here to be able to reconnect transparently on connectio...
Definition: setu_api.c:157
#define GNUNET_MESSAGE_TYPE_SETU_LISTEN
Listen for operation requests.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:355
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
struct GNUNET_HashCode app_id
application id
Definition: setu.h:70
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_request()

static int check_request ( void *  cls,
const struct GNUNET_SETU_RequestMessage msg 
)
static

Check validity of request message for a listen operation.

Parameters
clsthe listen handle
msgthe message
Returns
GNUNET_OK if the message is well-formed

Definition at line 596 of file setu_api.c.

References GNUNET_break_op, GNUNET_MQ_extract_nested_mh, GNUNET_OK, GNUNET_SYSERR, GNUNET_SETU_RequestMessage::header, and GNUNET_MessageHeader::size.

598 {
599  const struct GNUNET_MessageHeader *context_msg;
600 
601  if (ntohs (msg->header.size) == sizeof(*msg))
602  return GNUNET_OK; /* no context message is OK */
603  context_msg = GNUNET_MQ_extract_nested_mh (msg);
604  if (NULL == context_msg)
605  {
606  /* malformed context message is NOT ok */
607  GNUNET_break_op (0);
608  return GNUNET_SYSERR;
609  }
610  return GNUNET_OK;
611 }
#define GNUNET_MQ_extract_nested_mh(var)
Return a pointer to the message at the end of the given message.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SETU_REQUEST.
Definition: setu.h:179
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
Header for all communications.

◆ handle_request()

static void handle_request ( void *  cls,
const struct GNUNET_SETU_RequestMessage msg 
)
static

Handle request message for a listen operation.

Parameters
clsthe listen handle
msgthe message

Definition at line 621 of file setu_api.c.

References GNUNET_SETU_Request::accept_id, GNUNET_SETU_RequestMessage::accept_id, GNUNET_SETU_RejectMessage::accept_reject_id, GNUNET_SETU_Request::accepted, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MESSAGE_TYPE_SETU_REJECT, GNUNET_MQ_extract_nested_mh, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_NO, GNUNET_TIME_UNIT_MILLISECONDS, GNUNET_YES, GNUNET_SETU_ListenHandle::listen_cb, GNUNET_SETU_ListenHandle::listen_cls, LOG, GNUNET_SETU_ListenHandle::mq, GNUNET_SETU_RequestMessage::peer_id, and GNUNET_SETU_ListenHandle::reconnect_backoff.

623 {
624  struct GNUNET_SETU_ListenHandle *lh = cls;
625  struct GNUNET_SETU_Request req;
626  const struct GNUNET_MessageHeader *context_msg;
627  struct GNUNET_MQ_Envelope *mqm;
628  struct GNUNET_SETU_RejectMessage *rmsg;
629 
631  "Processing incoming operation request with id %u\n",
632  ntohl (msg->accept_id));
633  /* we got another valid request => reset the backoff */
635  req.accept_id = ntohl (msg->accept_id);
636  req.accepted = GNUNET_NO;
637  context_msg = GNUNET_MQ_extract_nested_mh (msg);
638  /* calling #GNUNET_SETU_accept() in the listen cb will set req->accepted */
639  lh->listen_cb (lh->listen_cls,
640  &msg->peer_id,
641  context_msg,
642  &req);
643  if (GNUNET_YES == req.accepted)
644  return; /* the accept-case is handled in #GNUNET_SETU_accept() */
646  "Rejected request %u\n",
647  ntohl (msg->accept_id));
648  mqm = GNUNET_MQ_msg (rmsg,
650  rmsg->accept_reject_id = msg->accept_id;
651  GNUNET_MQ_send (lh->mq,
652  mqm);
653 }
void * listen_cls
Closure for listen_cb.
Definition: setu_api.c:168
struct GNUNET_MQ_Handle * mq
Message queue for the client.
Definition: setu_api.c:150
Handle for a set operation request from another peer.
Definition: setu_api.c:74
uint32_t accept_reject_id
ID of the incoming request we want to reject.
Definition: setu.h:167
#define GNUNET_MQ_extract_nested_mh(var)
Return a pointer to the message at the end of the given message.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
struct GNUNET_TIME_Relative reconnect_backoff
Time to wait until we try to reconnect on failure.
Definition: setu_api.c:178
Opaque handle to a listen operation.
Definition: setu_api.c:145
#define LOG(kind,...)
Definition: setu_api.c:34
uint32_t accept_id
ID of the to identify the request when accepting or rejecting it.
Definition: setu.h:185
#define GNUNET_TIME_UNIT_MILLISECONDS
One millisecond.
GNUNET_SETU_ListenCallback listen_cb
Function to call on a new incoming request, or on error.
Definition: setu_api.c:163
struct GNUNET_PeerIdentity peer_id
Identity of the requesting peer.
Definition: setu.h:190
Header for all communications.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:355
#define GNUNET_MESSAGE_TYPE_SETU_REJECT
Reject a set request.
Message sent by a listening client to the service to reject performing the operation with the other p...
Definition: setu.h:157
Here is the call graph for this function:

◆ handle_client_listener_error()

static void handle_client_listener_error ( void *  cls,
enum GNUNET_MQ_Error  error 
)
static

Our connection with the set service encountered an error, re-initialize with exponential back-off.

Parameters
clsthe struct GNUNET_SETU_ListenHandle *
errorreason for the disconnect

Definition at line 664 of file setu_api.c.

References GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_STD_BACKOFF, listen_connect(), LOG, GNUNET_SETU_ListenHandle::mq, GNUNET_SETU_ListenHandle::reconnect_backoff, and GNUNET_SETU_ListenHandle::reconnect_task.

Referenced by listen_connect().

666 {
667  struct GNUNET_SETU_ListenHandle *lh = cls;
668 
670  "Listener broke down (%d), re-connecting\n",
671  (int) error);
672  GNUNET_MQ_destroy (lh->mq);
673  lh->mq = NULL;
676  lh);
678 }
struct GNUNET_MQ_Handle * mq
Message queue for the client.
Definition: setu_api.c:150
struct GNUNET_SCHEDULER_Task * reconnect_task
Task for reconnecting when the listener fails.
Definition: setu_api.c:183
struct GNUNET_TIME_Relative reconnect_backoff
Time to wait until we try to reconnect on failure.
Definition: setu_api.c:178
Opaque handle to a listen operation.
Definition: setu_api.c:145
#define LOG(kind,...)
Definition: setu_api.c:34
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1269
static void listen_connect(void *cls)
Connect to the set service in order to listen for requests.
Definition: setu_api.c:687
#define GNUNET_TIME_STD_BACKOFF(r)
Perform our standard exponential back-off calculation, starting at 1 ms and then going by a factor of...
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:837
Here is the call graph for this function:
Here is the caller graph for this function: