DoH: Change Network to use try_send
As send() blocks until channel has capacity, Dispatcher gets blocked at sending commands to a Network object if the Network's mpsc channel has no capacity. This happens when there are excess DNS requests while the connection has not been established. Therefore, change all the DoH code to use try_send() that returns an error immediate if the channel is full. If a Network's mpsc channel has no capacity, DNS query threads that called doh_query() with the associated net_id will get DOH_RESULT_CAN_NOT_SEND error immediately. Since it's not a timeout error, they will try DoT. Bug: 207301204 Test: cd packages/modules/DnsResolver && atest Change-Id: I9575e6f410b8b552c07af15284b67b305ecce6b9
Loading
Please register or sign in to comment