summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlijia <[email protected]>2024-04-12 19:33:59 +0800
committerlijia <[email protected]>2024-04-12 19:33:59 +0800
commit094d0f8e45931b195e358989d2843a298e9fd567 (patch)
treee4483ca1d2a28079c57ab6f0ac055dfe08c47915 /src
parent55ac6e270ae37299e2bce3a47a3d784e29dcae14 (diff)
Add unit tests.
Diffstat (limited to 'src')
-rw-r--r--src/http_decoder.c5
-rw-r--r--src/http_decoder_table.c7
2 files changed, 5 insertions, 7 deletions
diff --git a/src/http_decoder.c b/src/http_decoder.c
index b9d43d6..9dcffe2 100644
--- a/src/http_decoder.c
+++ b/src/http_decoder.c
@@ -710,9 +710,8 @@ void *http_decoder_init(struct stellar *st)
goto failed;
}
- printf("http_decoder_init: ex_data_idx:%d, plugin_id:%d, topic_id:%d\n",
- ctx->ex_data_idx, ctx->plugin_id, ctx->topic_id);
-
+ // printf("http_decoder_init: ex_data_idx:%d, plugin_id:%d, topic_id:%d\n",
+ // ctx->ex_data_idx, ctx->plugin_id, ctx->topic_id);
return ctx;
failed:
diff --git a/src/http_decoder_table.c b/src/http_decoder_table.c
index e999bd7..cc3e7cb 100644
--- a/src/http_decoder_table.c
+++ b/src/http_decoder_table.c
@@ -487,7 +487,7 @@ int http_decoder_table_iter_header(struct http_decoder_table *table,
}
if (table->header_iter >= table->header_cnt) {
- return 0;
+ return -1;
}
struct http_decoder_header *tmp_header = &table->headers[table->header_iter];
@@ -498,8 +498,7 @@ int http_decoder_table_iter_header(struct http_decoder_table *table,
http_decoder_string_get(&tmp_header->key, &hdr->key);
http_decoder_string_get(&tmp_header->val, &hdr->val);
table->header_iter++;
-
- return 1;
+ return 0;
}
}
@@ -509,7 +508,7 @@ int http_decoder_table_iter_header(struct http_decoder_table *table,
hdr->val.str = NULL;
hdr->val.str_len = 0;
- return 0;
+ return -1;
}
int http_decoder_table_reset_header_iter(struct http_decoder_table *table)