53 JsonBuilder *js_resplist = NULL;
55 js_resplist = jb_new_array();
61 jb_open_object(jb,
"ftp");
65 jb_set_string_from_bytes(jb,
67 (
const uint8_t *)tx->
request + min_length,
76 bool reply_truncated =
false;
81 bool is_cc_array_open =
false;
84 uint8_t *where = response->
str;
87 if (response->
len > 0 && response->
len <= UINT16_MAX) {
88 length = (uint16_t)response->
len - 1;
89 }
else if (response->
len > UINT16_MAX) {
92 if (!reply_truncated && response->
truncated) {
93 reply_truncated =
true;
100 if (isdigit(where[0]) && isdigit(where[1]) && isdigit(where[2])) {
101 if (!is_cc_array_open) {
102 jb_open_array(jb,
"completion_code");
103 is_cc_array_open =
true;
105 jb_append_string_from_bytes(jb, (
const uint8_t *)where, 3);
111 jb_append_string_from_bytes(js_resplist, (
const uint8_t *)where +
offset, pos -
offset);
120 if (is_cc_array_open) {
124 jb_close(js_resplist);
125 jb_set_object(jb,
"reply", js_resplist);
127 jb_free(js_resplist);
131 jb_set_uint(jb,
"dynamic_port", tx->
dyn_port);
149 if (reply_truncated) {