+/**
+ * Callback to transmit a start message to
+ * the DV service, once we can send
+ *
+ * @param cls struct StartContext
+ * @param size how much can we send
+ * @param buf where to copy the message
+ *
+ * @return number of bytes copied to buf
+ */
+static size_t
+transmit_start (void *cls, size_t size, void *buf)
+{
+ struct StartContext *start_context = cls;
+ struct GNUNET_DV_Handle *handle = start_context->handle;
+ size_t tsize;
+#if DEBUG_DV
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV API: sending start request to service\n");
+#endif
+ if (buf == NULL)
+ {
+ GNUNET_free(start_context->message);
+ GNUNET_free(start_context);
+ GNUNET_DV_disconnect(handle);
+ return 0;
+ }
+
+ tsize = ntohs(start_context->message->size);
+ if (size >= tsize)
+ {
+ memcpy(buf, start_context->message, tsize);
+ GNUNET_free(start_context->message);
+ GNUNET_free(start_context);
+ GNUNET_CLIENT_receive (handle->client,
+ &handle_message_receipt,
+ handle, GNUNET_TIME_UNIT_FOREVER_REL);
+
+
+ return tsize;
+ }
+
+ return 0;
+}
+