Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#234 closed defect (invalid)

Receive of partial DNS message on TCP does not buffer properly

Reported by: shane Owned by: vorner
Priority: medium Milestone:
Component: b10-auth Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: 0.0 Add Hours to Ticket: 0
Total Hours: 0.25 Internal?: no

Description

When we receive TCP data in the auth-srv, we parse it right away. If we only have a partial DNS message, the query fails. We should handle this properly, by buffering the data somehow.

The code which does this is in auth_srv.cc, in the AuthSrv::processMessage() function.

Subtickets

Change History (5)

comment:1 in reply to: ↑ description Changed 10 years ago by jinmei

Replying to shane:

When we receive TCP data in the auth-srv, we parse it right away. If we only have a partial DNS message, the query fails. We should handle this properly, by buffering the data somehow.

Is that true? From a quick look at the TCPClient class implementation
it doesn't seem to call AuthSrv::processMessage() until it receives a
complete message. (At least that was my intent of the
implementation).

(Yeah we need an abstract layer and unit tests for such cases,
regardless)

comment:2 Changed 9 years ago by vorner

  • billable set to 0
  • Estimated Difficulty set to 0.0
  • Internal? unset
  • Owner set to vorner
  • Status changed from new to assigned

I'll have a look at what happens there.

comment:3 Changed 9 years ago by vorner

I read the code and tried sending lenght and then less data to a TCP connection and holding it open. Both suggests that it keeps waiting for more data to come until there's enough.

Shane, do you have any way to trigger this? Or I can close it as invalid? Or, should some tests be written for the TCPServer and TCPClient? They do not seem to be tested.

comment:4 Changed 9 years ago by shane

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Resolution set to invalid
  • Status changed from assigned to closed
  • Total Hours changed from 0.0 to 0.25

Okay, I misunderstood how async_read() works. I spent some time reading the documentation:

http://opendownloadmanager.org/docs/1.x/group__async__read.html

And looking at the code, and there is no error here. Sorry for the noise!

comment:5 Changed 9 years ago by stephen

  • Milestone feature backlog item deleted

Milestone feature backlog item deleted

Note: See TracTickets for help on using tickets.