| 147 | PRINTF_FMT(4,5); |
| 148 | |
| 149 | static struct io_plan *bad_req_fmt(struct io_conn *conn, |
| 150 | struct client *c, |
| 151 | const u8 *msg_in, |
| 152 | const char *fmt, ...) |
| 153 | { |
| 154 | va_list ap; |
| 155 | char *str; |
| 156 | |
| 157 | va_start(ap, fmt); |
| 158 | str = tal_vfmt(tmpctx, fmt, ap); |
| 159 | va_end(ap); |
| 160 | |
| 161 | report_bad_req(c, msg_in, str); |
| 162 | |
| 163 | /*~ The way ccan/io works is that you return the "plan" for what to do |
| 164 | * next (eg. io_read). io_close() is special: it means to close the |
| 165 | * connection. */ |
| 166 | return io_close(conn); |
| 167 | } |
| 168 | |
| 169 | /* Convenience wrapper for when we simply can't parse. */ |
| 170 | static struct io_plan *bad_req(struct io_conn *conn, |
no test coverage detected