Hi,
I am trying to hack unbound to support concurrent processing for queries from the same TCP connection.
My understanding of the current Unbound code:
Current Unbound code uses a data struct “comm_point” for each TCP connection.
Each “comm_point” corresponds to one TCP connection (to handle all queries from that connection). But each “comm_point” has only one buffer, which is used to store query and response at different time.
Current Unbound code restricts the concurrent processing for TCP. It reads only one query from the TCP connection each time, after that, it stops receiving queries until it sends back the response for the previously received query. In this way, all queries/responses are sequentialized, so there won’t be any conflict of using one buffer.
However, if we remove the restriction (let unbound keep reading queries without blocking from the same TCP connection, so that it can process queries concurrently), using only one buffer might cause problems. For example, buffer in the “comm_point” might get overwritten if queries and responses arrive at the same time.
I will really appreciate if someone can give me some hints about how to hack this : to support concurrent processing for queries from the same TCP connection.
Any ideas are welcomed.