mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-10-27 06:53:11 +08:00
Merge pull request #1424 from ahmadgamal15-art/fix/windows-stdio-binary-mode
fix(mcp): set stdio to binary mode on Windows
This commit is contained in:
@@ -11652,6 +11652,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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user