diff --git a/src/ice_transport.cpp b/src/ice_transport.cpp index 2614e355ee5bfa6cd56003512873d256daf9e39b..3ec8061e4ab35303591ebc381b3ede684ded9290 100644 --- a/src/ice_transport.cpp +++ b/src/ice_transport.cpp @@ -1230,7 +1230,7 @@ IceTransport::send(int comp_id, const unsigned char* buf, size_t len) } pj_ssize_t sent_size = 0; auto status = pj_ice_strans_sendto2(pimpl_->icest_.get(), comp_id+1, buf, len, remote.pjPtr(), remote.getLength(), &sent_size); - if (status == PJ_EPENDING) { + if (status == PJ_EPENDING && isTCPEnabled()) { auto current_size = sent_size; // NOTE; because we are in TCP, the sent size will count the header (2 // bytes length).