| 1654 | } th_httpd_large_reply_t; |
| 1655 | |
| 1656 | static void *th_httpd_large_reply(void *opaque) { |
| 1657 | th_httpd_large_reply_t *reply = opaque; |
| 1658 | cbm_http_conn_t *connection = cbm_httpd_accept(reply->listener, 3000); |
| 1659 | if (!connection) { |
| 1660 | atomic_store(&reply->finished, 1); |
| 1661 | return NULL; |
| 1662 | } |
| 1663 | atomic_store(&reply->accepted, 1); |
| 1664 | size_t response_size = 8U * 1024U * 1024U; |
| 1665 | char *response = malloc(response_size); |
| 1666 | if (response) { |
| 1667 | memset(response, 'R', response_size); |
| 1668 | cbm_http_reply_buf(connection, 200, "Content-Type: application/octet-stream\r\n", response, |
| 1669 | response_size); |
| 1670 | free(response); |
| 1671 | } |
| 1672 | cbm_httpd_conn_close(connection); |
| 1673 | atomic_store(&reply->finished, 1); |
| 1674 | return NULL; |
| 1675 | } |
| 1676 | |
| 1677 | TEST(httpd_interrupt_unblocks_nonreading_large_response_within_one_second) { |
| 1678 | cbm_httpd_t *listener = cbm_httpd_listen(0); |
nothing calls this directly
no test coverage detected