summaryrefslogtreecommitdiff
path: root/test/quic_test_plug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/quic_test_plug.cpp')
-rw-r--r--test/quic_test_plug.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/quic_test_plug.cpp b/test/quic_test_plug.cpp
index 2d93e7f..2c2ff6b 100644
--- a/test/quic_test_plug.cpp
+++ b/test/quic_test_plug.cpp
@@ -36,10 +36,10 @@ struct quic_gtest_context
cJSON *json_root;
};
-static void cJSON_Add_QStringToObject(cJSON * object, const char *name, const struct qstring * qstring)
+static void cJSON_Add_QStringToObject(cJSON * object, const char *name, const qstring * qstring)
{
- char *tmp = (char *)calloc(1, qstring->str_len + 1);
- memcpy(tmp, qstring->str, qstring->str_len);
+ char *tmp = (char *)calloc(1, qstring->iov_len + 1);
+ memcpy(tmp, qstring->iov_base, qstring->iov_len);
cJSON_AddStringToObject(object, name, tmp);
}
@@ -71,7 +71,7 @@ extern "C" void QUIC_TEST_PLUG_ENTRY(struct session *sess, int topic_id, const v
case QUIC_SNI:
{
- struct qstring result = {};
+ qstring result = {};
quic_message_get_sni(qmsg, &result);
cJSON_Add_QStringToObject(qctx->json_root, "SNI", &result);
DEBUG_PRINT("### QUIC_TEST_PLUG_ENTRY: len=%d, SNI=%p, %.*s\n", (int)result.str_len, result.str, (int)result.str_len, result.str);
@@ -80,7 +80,7 @@ extern "C" void QUIC_TEST_PLUG_ENTRY(struct session *sess, int topic_id, const v
case QUIC_USER_AGENT:
{
- struct qstring result = {};
+ qstring result = {};
quic_message_get_user_agent(qmsg, &result);
cJSON_Add_QStringToObject(qctx->json_root, "UA", &result);
DEBUG_PRINT("### QUIC_TEST_PLUG_ENTRY: len=%d, UA=%p, %.*s\n", (int)result.str_len, result.str, (int)result.str_len, result.str);