This function is called after preparing a frame, in order to update the
frame's size in the frame header. It takes the frame payload length in
argument.
It simply writes a 24-bit frame size into a buffer, making use of the
net_helper functions which try to optimize per platform (this is a
frequently used operation).
#include <common/config.h>
#include <common/h2.h>
#include <common/hpack-tbl.h>
+#include <common/net_helper.h>
#include <proto/applet.h>
#include <proto/connection.h>
#include <proto/stream.h>
}
}
+/* writes the 24-bit frame size <len> at address <frame> */
+static inline void h2_set_frame_size(void *frame, uint32_t len)
+{
+ uint8_t *out = frame;
+
+ *out = len >> 16;
+ write_n16(out + 1, len);
+}
+
/*********************************************************/
/* functions below are I/O callbacks from the connection */