Prefix is usually a cmd->id */
| 340 | |
| 341 | /* Prefix is usually a cmd->id */ |
| 342 | static const char *json_id(const tal_t *ctx, struct plugin *plugin, |
| 343 | const char *method, const char *prefix) |
| 344 | { |
| 345 | const char *rawid; |
| 346 | int rawidlen; |
| 347 | |
| 348 | /* Strip quotes! */ |
| 349 | if (strstarts(prefix, "\"")) { |
| 350 | assert(strlen(prefix) >= 2); |
| 351 | assert(strends(prefix, "\"")); |
| 352 | rawid = prefix + 1; |
| 353 | rawidlen = strlen(prefix) - 2; |
| 354 | } else { |
| 355 | rawid = prefix; |
| 356 | rawidlen = strlen(prefix); |
| 357 | } |
| 358 | |
| 359 | return tal_fmt(ctx, "\"%.*s/%s:%s#%"PRIu64"\"", |
| 360 | rawidlen, rawid, plugin->id, method, plugin->next_outreq_id++); |
| 361 | } |
| 362 | |
| 363 | static void destroy_out_req(struct out_req *out_req, struct plugin *plugin) |
| 364 | { |
no test coverage detected