dtrace: simplify the content-length encoder
@@ -110,9 +110,8 @@ static inline void h2o_probe_log_response(h2o_req_t *req, uint64_t req_index)
if (H2O_CONN_IS_PROBED(SEND_RESPONSE_HEADER, req->conn)) {
if (req->res.content_length != SIZE_MAX) {
char buf[sizeof(H2O_UINT64_LONGEST_STR)];
- h2o_iovec_t cl_buf = {.base = buf};
- cl_buf.len = sprintf(cl_buf.base, "%" PRIu64, req->res.content_length);
- h2o_probe_response_header(req, req_index, H2O_TOKEN_CONTENT_LENGTH->buf, cl_buf);
+ size_t len = sprintf(buf, "%" PRIu64, req->res.content_length);
+ h2o_probe_response_header(req, req_index, H2O_TOKEN_CONTENT_LENGTH->buf, h2o_iovec_init(buf, len));
}
size_t i;
for (i = 0; i != req->res.headers.size; ++i) {
