| 1165 | } |
| 1166 | |
| 1167 | static int dist_send_error(int fd, const char *msg) { |
| 1168 | if (!msg) msg = "distributed protocol error"; |
| 1169 | size_t len = strlen(msg); |
| 1170 | if (len > UINT32_MAX) len = UINT32_MAX; |
| 1171 | if (dist_write_frame_header(fd, DS4_DIST_MSG_ERROR, (uint32_t)len) != 0) return -1; |
| 1172 | return dist_write_full(fd, msg, len); |
| 1173 | } |
| 1174 | |
| 1175 | static void dist_peer_name(int fd, char *host, size_t hostlen, char *port, size_t portlen) { |
| 1176 | if (hostlen) host[0] = '\0'; |
no test coverage detected