diff --git a/include/uvgrtp/socket.hh b/include/uvgrtp/socket.hh index 54355e2..ad136c4 100644 --- a/include/uvgrtp/socket.hh +++ b/include/uvgrtp/socket.hh @@ -143,6 +143,8 @@ namespace uvgrtp { std::string get_socket_path_string() const; + std::string sockaddr_to_string(const sockaddr_in& addr) const; + /* Get reference to the actual socket object */ socket_t& get_raw_socket(); @@ -164,8 +166,6 @@ namespace uvgrtp { private: - std::string sockaddr_to_string(const sockaddr_in& addr) const; - /* helper function for sending UPD packets, see documentation for sendto() above */ rtp_error_t __sendto(sockaddr_in& addr, uint8_t *buf, size_t buf_len, int send_flags, int *bytes_sent); rtp_error_t __recv(uint8_t *buf, size_t buf_len, int recv_flags, int *bytes_read); diff --git a/src/frame.cc b/src/frame.cc index 33ab726..9f665fa 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -82,7 +82,7 @@ uvgrtp::frame::zrtp_frame *uvgrtp::frame::alloc_zrtp_frame(size_t size) return nullptr; } - UVG_LOG_DEBUG("Allocate ZRTP frame, packet size %zu", size); + //UVG_LOG_DEBUG("Allocate ZRTP frame, packet size %zu", size); uvgrtp::frame::zrtp_frame *frame = (uvgrtp::frame::zrtp_frame *)new uint8_t[size]; diff --git a/src/socket.cc b/src/socket.cc index 69d85a3..ce85100 100644 --- a/src/socket.cc +++ b/src/socket.cc @@ -308,7 +308,7 @@ rtp_error_t uvgrtp::socket::__sendtov( #endif #ifndef NDEBUG - sent_packets_ += buffers.size(); + ++sent_packets_; #endif // !NDEBUG set_bytes(bytes_sent, sent_bytes); diff --git a/src/zrtp.cc b/src/zrtp.cc index ece0357..9f72e0c 100644 --- a/src/zrtp.cc +++ b/src/zrtp.cc @@ -676,6 +676,8 @@ rtp_error_t uvgrtp::zrtp::init_dhm(uint32_t ssrc, std::shared_ptrsockaddr_to_string(addr).c_str()); + /* TODO: set all fields initially to zero */ memset(session_.hash_ctx.o_hvi, 0, sizeof(session_.hash_ctx.o_hvi)); @@ -779,6 +781,8 @@ rtp_error_t uvgrtp::zrtp::init_msm(uint32_t ssrc, std::shared_ptr int nread = 0; rlen_ = 0; - UVG_LOG_DEBUG("Waiting for ZRTP messages with timeout of %i ms", timeout); + if (timeout > 0) + { + UVG_LOG_DEBUG("Waiting for ZRTP messages with timeout of %i ms", timeout); + } + else + { + UVG_LOG_DEBUG("Checking if there is a ZRTP message in buffer"); + } #ifdef _WIN32 if ((ret = uvgrtp::poll::blocked_recv(socket, mem_, len_, timeout, &nread)) != RTP_OK) {