cURL / Mailing Lists / curl-library / Single Mail


Re: [PATCH] TFTP client's bad behaviour when unexpected block isreceived and not optimal timeouts

From: Marcin Adamski <>
Date: Wed, 05 Oct 2011 11:39:46 +0200

I am attaching the patch.

Btw I set ACK timeout to 5 seconds in this patch, but maybe we should consider 1second or even less (there is 1second resolution so it may be a problem).

In tftp_set_timeouts(...) function there is also a conditional statement that possibly is not needed:

  if(start) {
  else {
    if(timeout_ms > 0)
      maxtime = (time_t)(timeout_ms + 500) / 1000;
      maxtime = 3600;

As far as I understand, condition (timeout_ms > 0) is checked before "if (start)", because Curl_timeleft(...) function never returns 0.

> BTW, this change calls for a test case to verify that it does the right thing.
> Have you looked into how we can make one?

I don't really know how to write such test. Basically we need to simulate reception of unexpected blocks. Test for timeouts would be useful as well.

Marcin Adamski

List admin:

Received on 2011-10-05