dnsproxy: Handle partial TCP messages from client
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Fri, 5 Apr 2013 09:33:08 +0000 (12:33 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 5 Apr 2013 13:05:53 +0000 (16:05 +0300)
commit385694bb737157ca1b0b9dd153dde516b2ce0b7a
tree0c7557b85a745fe2e7d47530ab35d679ef930a4a
parentd7d0fce192a2cae1b8e3d4354cc8fe40a0c4451f
dnsproxy: Handle partial TCP messages from client

We were not handling client sent partial TCP messages correctly.
This meant that ConnMan would block if the client using TCP would
not send full DNS request.

When a new TCP client connects in tcp_listener_event(), a new
TCP channel is created to handle a partial client message if
all of the message is not already available. The partial TCP
message is patched together in tcp_client_event(). When all of
the TCP message has been received, the message is processed in
read_tcp_data(). The client has to send the DNS request within two
seconds before the connection is closed by ConnMan.
src/dnsproxy.c