| 1105 | } |
| 1106 | |
| 1107 | static int ui_log_post(int port, const char *body, char *resp, size_t respsz) { |
| 1108 | size_t cap = strlen(body) + 512; |
| 1109 | char *req = malloc(cap); |
| 1110 | if (!req) |
| 1111 | return 0; |
| 1112 | snprintf(req, cap, |
| 1113 | "POST /api/ui-log HTTP/1.1\r\nHost: 127.0.0.1:%d\r\n" |
| 1114 | "Content-Type: application/json\r\nContent-Length: %zu\r\n\r\n%s", |
| 1115 | port, strlen(body), body); |
| 1116 | int n = th_http(port, req, resp, respsz); |
| 1117 | free(req); |
| 1118 | return n; |
| 1119 | } |
| 1120 | |
| 1121 | static int activity_interrupt_rows(unsigned kind, void *database, void *statement, void *unused) { |
| 1122 | (void)kind; |