/*
This file is part of GNUnet.
- Copyright (C) 2013, 2014 GNUnet e.V.
+ Copyright (C) 2013, 2014, 2016 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
*/
struct GNUNET_SET_OperationHandle *intersection_op;
+ /**
+ * CADET port we are listening on.
+ */
+ struct GNUNET_CADET_Port *port;
+
/**
* a(Alice)
*/
GNUNET_free (s->r_prime);
s->r_prime = NULL;
}
+ GNUNET_CADET_close_port (s->port);
GNUNET_free (s);
}
* preliminary initialization, more happens after we get Alice's first
* message.
*
- * @param cls closure
+ * @param cls closure with the `struct BobServiceSession`
* @param channel new handle to the channel
* @param initiator peer that started the channel
* @param port unused
GNUNET_SYSERR);
return;
}
- if (NULL != find_matching_client_session (&msg->session_key))
- {
- GNUNET_break (0);
- GNUNET_SERVER_receive_done (client,
- GNUNET_SYSERR);
- return;
- }
s = GNUNET_new (struct BobServiceSession);
s->status = GNUNET_SCALARPRODUCT_STATUS_ACTIVE;
s->total = total_count;
s->client_received_element_count = contained_count;
s->session_id = msg->session_key;
+ s->port = GNUNET_CADET_open_port (my_cadet,
+ &msg->session_key,
+ &cb_channel_incoming,
+ s);
+ if (NULL == s->port)
+ {
+ GNUNET_break (0);
+ GNUNET_SERVER_receive_done (client,
+ GNUNET_SYSERR);
+ GNUNET_free (s);
+ return;
+ }
+
GNUNET_break (GNUNET_YES ==
GNUNET_CONTAINER_multihashmap_put (client_sessions,
&s->session_id,
GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_TO_BOB,
0},
{ &GSS_handle_bob_client_message_multipart, NULL,
- GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_MUTLIPART_BOB,
+ GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_MULTIPART_BOB,
0},
{ NULL, NULL, 0, 0}
};
GNUNET_SCHEDULER_shutdown ();
return;
}
- GNUNET_CADET_open_port (my_cadet,
- GC_u2h (GNUNET_APPLICATION_TYPE_SCALARPRODUCT),
- &cb_channel_incoming, NULL);
GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
NULL);
}