winlin

refine the log for mw and mr. 2.0.55

... ... @@ -434,16 +434,20 @@ void SrsPublishRecvThread::set_socket_buffer(int sleep_ms)
int kbps = 5000;
int socket_buffer_size = sleep_ms * kbps / 8;
int fd = mr_fd;
int onb_rbuf = 0;
socklen_t sock_buf_size = sizeof(int);
getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &onb_rbuf, &sock_buf_size);
// socket recv buffer, system will double it.
int nb_rbuf = socket_buffer_size / 2;
socklen_t sock_buf_size = sizeof(int);
if (setsockopt(mr_fd, SOL_SOCKET, SO_RCVBUF, &nb_rbuf, sock_buf_size) < 0) {
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &nb_rbuf, sock_buf_size) < 0) {
srs_warn("set sock SO_RCVBUF=%d failed.", nb_rbuf);
}
getsockopt(mr_fd, SOL_SOCKET, SO_RCVBUF, &nb_rbuf, &sock_buf_size);
getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &nb_rbuf, &sock_buf_size);
srs_trace("merged read sockbuf=%d, actual=%d, sleep %d when nread<=%d",
socket_buffer_size, nb_rbuf, sleep_ms, SRS_MR_SMALL_BYTES);
srs_trace("mr change sleep %d=>%d, erbuf=%d, rbuf %d=>%d, sbytes=%d",
mr_sleep, sleep_ms, socket_buffer_size, onb_rbuf, nb_rbuf, SRS_MR_SMALL_BYTES);
rtmp->set_recv_buffer(nb_rbuf);
}
... ...
... ... @@ -1023,7 +1023,7 @@ void SrsRtmpConn::change_mw_sleep(int sleep_ms)
}
getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &nb_sbuf, &sock_buf_size);
srs_trace("mw changed %d=>%d, max_msgs=%d, esbuf=%d, sbuf %d=>%d",
srs_trace("mw change sleep %d=>%d, max_msgs=%d, esbuf=%d, sbuf %d=>%d",
mw_sleep, sleep_ms, SRS_PERF_MW_MSGS, socket_buffer_size,
onb_sbuf, nb_sbuf);
... ...