Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/mcp/mcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -11177,6 +11177,13 @@ static int poll_for_input_unix(cbm_mcp_server_t *srv, int fd, FILE *in) {
int cbm_mcp_server_run(cbm_mcp_server_t *srv, FILE *in, FILE *out) {
int fd = cbm_fileno(in);

#ifdef _WIN32
/* Ensure stdio is in binary mode to prevent CRLF translation from corrupting
* Content-Length byte counts and causing fread() to hang. */
_setmode(cbm_fileno(in), _O_BINARY);
_setmode(cbm_fileno(out), _O_BINARY);
#endif

for (;;) {
/* Poll with idle timeout so we can evict unused stores between requests.
*
Expand Down
Loading