* @param type type of the message
*/
void
-GNUNET_SERVER_transmit_context_append (struct GNUNET_SERVER_TransmitContext
- *tc, const void *data, size_t length,
- uint16_t type)
+GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext
+ *tc, const void *data, size_t length,
+ uint16_t type)
{
struct GNUNET_MessageHeader *msg;
size_t size;
}
+/**
+ * Append a message to the transmission context.
+ * All messages in the context will be sent by
+ * the transmit_context_run method.
+ *
+ * @param tc context to use
+ * @param msg message to append
+ */
+void
+GNUNET_SERVER_transmit_context_append_message(struct GNUNET_SERVER_TransmitContext
+ *tc, const struct GNUNET_MessageHeader *msg)
+{
+ struct GNUNET_MessageHeader *m;
+ uint16_t size;
+
+ size = ntohs (msg->size);
+ tc->buf = GNUNET_realloc (tc->buf, tc->total + size);
+ m = (struct GNUNET_MessageHeader *) &tc->buf[tc->total];
+ tc->total += size;
+ memcpy (m, msg, size);
+}
+
+
/**
* Execute a transmission context. If there is
* an error in the transmission, the receive_done