debug: 增加终端日志测试连通性
This commit is contained in:
@@ -1541,6 +1541,7 @@ int kcp_conn_send(kcp_conn_t *conn, const message_t *msg) {
|
||||
uint8_t *frame = NULL;
|
||||
size_t frame_len = 0;
|
||||
int send_errno = 0;
|
||||
int kcp_send_rc = 0;
|
||||
if (conn == NULL || msg == NULL) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
@@ -1554,9 +1555,10 @@ int kcp_conn_send(kcp_conn_t *conn, const message_t *msg) {
|
||||
pthread_mutex_lock(&conn->kcp_mu);
|
||||
atomic_store(&conn->sock_state->last_send_errno, 0);
|
||||
conn->kcp->current = omni_now_millis32();
|
||||
if (ikcp_send(conn->kcp, (const char *) frame, (int) frame_len) != 0) {
|
||||
kcp_send_rc = ikcp_send(conn->kcp, (const char *) frame, (int) frame_len);
|
||||
if (kcp_send_rc < 0) {
|
||||
pthread_mutex_unlock(&conn->kcp_mu);
|
||||
errno = EIO;
|
||||
errno = kcp_send_rc == -2 ? EMSGSIZE : EINVAL;
|
||||
free(frame);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user