summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author李佳 <[email protected]>2024-04-12 11:41:14 +0000
committer李佳 <[email protected]>2024-04-12 11:41:14 +0000
commitf40db506ee7570e836ac97b7806a679bc36da155 (patch)
treee4483ca1d2a28079c57ab6f0ac055dfe08c47915 /src
parent55ac6e270ae37299e2bce3a47a3d784e29dcae14 (diff)
parent094d0f8e45931b195e358989d2843a298e9fd567 (diff)
Merge branch 'api-unit-test' into 'develop'
Add unit tests. See merge request stellar/http_decoder!5
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)