cURL / Mailing Lists / curl-library / Single Mail

curl-library

two problems with FTP in last CVS version

From: Dmitriy Sergeyev <dsergeyev_at_issart.com>
Date: Thu, 5 Oct 2006 19:59:58 +0700

Hello, Danniel.

I have discovered two more use cases that don't work with last
CVS version. Both of them works fine with 7.15.5.

test02.c:
Is almost the same as my previous example but at this time first
transfer tries to use non-existent server and it fails.
The second transfer is correct but it fails too.

test03.c:
In this case the first request is CUSTOMREQUEST. Actually my program
uses DELE command, but NOOP is enough to catch this bug.
NOOP request passes great. But the subsequent transfer request is
hangs.
It happened because of easy->easy_conn->writechannel_inuse remains
TRUE after performing custom requests such as DELE or NOOP those
returns no data to transfer. And when we try to perform something
else on this easy handle, easy->state goes to CURLM_STATE_WAITDO and
remains there forever.
The bug can be fixed by resetting writechannel_inuse if any error
appeared.
I mean to modify following in multi.c(1229):

    if(CURLM_STATE_COMPLETED != easy->state) {
      if(CURLE_OK != easy->result) {
        /*
         * If an error was returned, and we aren't in completed state now,
         * then we go to completed and consider this transfer aborted.
         */
        multistate(easy, CURLM_STATE_COMPLETED);
        if (easy->easy_conn) {
          easy->easy_conn->writechannel_inuse = FALSE;
          easy->easy_conn->readchannel_inuse = FALSE; /* just in case */
        }
      }
    }

But I have no clue about correctness of this solution.

-- 
Best regards,
Dmitriy Sergeyev
C++ Developer of
ISS Art, Ltd., Omsk, Russia.
http://issart.com
http://issart.com/index/Portfolio/cpp&lang=eng


Received on 2006-10-05