- struct GNUNET_MessageHeader msg;
- msg.size=htons(sizeof(struct GNUNET_MessageHeader));
- msg.type = htons(60);
- api->send(api->cls, &my_identity, (const char *) &msg, sizeof(struct GNUNET_MessageHeader), 0, TIMEOUT, NULL, NULL, 0, GNUNET_NO, &task_send_cont, NULL);
-
- msg.type = htons(61);
- api->send(api->cls, &my_identity, (const char *) &msg, sizeof(struct GNUNET_MessageHeader), 0, TIMEOUT, NULL, NULL, 0, GNUNET_SYSERR, &task_send_cont, NULL);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("\nPhase 2: session selection\n\n"));
+ size = sizeof(struct GNUNET_MessageHeader);
+ msg->size=htons(size);
+ msg->type = htons(20);
+ api->send(api->cls, &my_identity, (const char *) msg, size, 0, TIMEOUT, NULL, NULL, 0, GNUNET_NO, &task_send_cont, NULL);
+
+ msg->type = htons(21);
+ api->send(api->cls, &my_identity, (const char *) msg, size, 0, TIMEOUT, NULL, NULL, 0, GNUNET_SYSERR, &task_send_cont, NULL);
+
+ /* answer on session*/
+ size = sizeof( struct GNUNET_MessageHeader);
+ msg->size = htons(size);
+ msg->type = htons(22);
+ api->send(api->cls, &my_identity, (const char *) msg, size, 0, TIMEOUT, session, NULL, 0, GNUNET_SYSERR, &task_send_cont, NULL);
+
+ GNUNET_free(msg);
+
+ /* answer on session with big message not fitting in mhd send buffer*/
+ size = GNUNET_SERVER_MAX_MESSAGE_SIZE-1;
+ msg = GNUNET_malloc (size);
+ msg->size=htons(size);
+ msg->type = htons(23);
+ api->send(api->cls, &my_identity, (const char *) msg, size, 0, TIMEOUT, session, NULL, 0, GNUNET_NO, &task_send_cont, NULL);
+ GNUNET_free(msg);
+ return;