MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / th_send_all

Function th_send_all

tests/test_httpd.c:115–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115static int th_send_all(th_sock_t s, const char *data, size_t len) {
116 size_t off = 0;
117 while (off < len) {
118#ifdef _WIN32
119 int n = send(s, data + off, (int)(len - off), 0);
120#else
121 ssize_t n = send(s, data + off, len - off, 0);
122#endif
123 if (n <= 0)
124 return -1;
125 off += (size_t)n;
126 }
127 return 0;
128}
129
130/* Read until the server closes the connection (Connection: close model). */
131static int th_recv_until_close(th_sock_t s, char *buf, size_t bufsz) {

Callers 3

th_http_rawFunction · 0.85
test_httpd.cFile · 0.85
th_http_deadlineFunction · 0.85

Calls 1

sendFunction · 0.50

Tested by

no test coverage detected