| 179 | }; |
| 180 | |
| 181 | static void record_message(const char *buf, const jsmntok_t *toks, struct handler_ctx *hc) |
| 182 | { |
| 183 | size_t obj_len = (size_t)(toks[0].end - toks[0].start); |
| 184 | if (obj_len > sizeof(hc->last_buf)) obj_len = sizeof(hc->last_buf); |
| 185 | memcpy(hc->last_buf, buf + toks[0].start, obj_len); |
| 186 | hc->last_len = obj_len; |
| 187 | hc->called++; |
| 188 | } |
| 189 | |
| 190 | /* ---------- pump that drives read -> parse -> (maybe) read again ---------- */ |
| 191 |