| 216 | } |
| 217 | |
| 218 | static struct command_result *json_spamcommand(struct command *cmd, |
| 219 | const char *buf, |
| 220 | const jsmntok_t *params) |
| 221 | { |
| 222 | u64 *iterations; |
| 223 | struct request_batch *batch; |
| 224 | |
| 225 | if (!param(cmd, buf, params, |
| 226 | p_req("iterations", param_u64, &iterations), |
| 227 | NULL)) |
| 228 | return command_param_failed(); |
| 229 | |
| 230 | batch = request_batch_new(cmd, NULL, spam_errcb, spam_done, NULL); |
| 231 | for (size_t i = 0; i < *iterations; i++) { |
| 232 | struct out_req *req = add_to_batch(cmd, batch, "batching"); |
| 233 | json_add_bool(req->js, "enable", true); |
| 234 | send_outreq(req); |
| 235 | } |
| 236 | return batch_done(cmd, batch); |
| 237 | } |
| 238 | |
| 239 | static struct command_result *json_spamlistcommand(struct command *cmd, |
| 240 | const char *buf, |
nothing calls this directly
no test coverage detected