Daniel Stenberg d7934b8bd4 curl_multi_fdset: correct fdset with FTP PORT use
After a PORT has been issued, and the multi handle would switch to the
CURLM_STATE_DO_MORE state (which is unique for FTP), libcurl would
return the wrong fdset to wait for when curl_multi_fdset() is
called. The code would blindly assume that it was waiting for a connect
of the second connection, while that isn't true immediately after the
PORT command.

Also, the function multi.c:domore_getsock() was highly FTP-centric and
therefore ugly to keep in protocol-agnostic code. I solved this problem
by introducing a new function pointer in the Curl_handler struct called
domore_getsock() which is only called during the DOMORE state for
protocols that set that pointer.

The new ftp.c:ftp_domore_getsock() function now returns fdset info about
the control connection's command/response handling while such a state is
in use, and goes over to waiting for a writable second connection first
once the commands are done.

The original problem could be seen by running test 525 and checking the
time stamps in the FTP server log. I can verify that this fix at least
fixes this problem.

Bug: http://curl.haxx.se/mail/lib-2011-10/0250.html
Reported by: Gokhan Sengun
2011-10-21 23:36:54 +02:00
..
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2011-09-03 16:07:09 +02:00
2011-03-10 12:04:33 +01:00
2011-09-03 16:07:09 +02:00
2010-11-08 08:56:21 +01:00
2010-06-30 13:12:25 +02:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2011-10-03 23:28:17 +02:00
2011-08-28 07:15:46 +02:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2010-12-21 22:39:56 +01:00
2011-09-03 16:07:09 +02:00
2010-03-24 11:02:54 +01:00
2011-10-12 21:32:10 +02:00
2011-04-20 00:50:07 +02:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2011-10-16 01:09:56 +02:00
2010-10-20 14:57:43 +02:00
2010-03-24 11:02:54 +01:00
2011-10-11 19:41:30 +02:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2011-05-24 15:42:02 +02:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2011-08-24 13:58:37 +02:00
2011-09-03 16:07:09 +02:00
2011-09-22 14:35:49 +02:00
2010-03-24 11:02:54 +01:00
2010-08-10 11:07:38 +02:00
2011-06-01 21:40:09 +02:00
2011-04-07 15:17:58 +02:00
2011-04-16 00:11:43 +02:00
2010-08-15 13:16:39 +02:00
2010-03-24 11:02:54 +01:00
2011-09-03 16:07:09 +02:00
2011-06-03 19:31:32 +02:00
2011-09-13 18:46:09 +02:00
2010-03-24 11:02:54 +01:00
2011-09-03 16:07:09 +02:00
2010-03-24 11:02:54 +01:00
2005-01-14 13:43:29 +00:00
2010-03-24 11:02:54 +01:00
2006-10-29 09:11:44 +00:00
2011-05-05 16:53:05 +02:00
2011-08-24 14:00:42 +02:00
2011-09-03 16:07:09 +02:00
2011-09-04 17:10:51 +02:00
2010-03-24 11:02:54 +01:00
2011-09-04 17:10:51 +02:00
2011-10-07 20:50:57 +02:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2011-08-08 11:23:31 +02:00
2011-08-08 11:23:31 +02:00
2011-08-08 11:23:31 +02:00
2010-03-24 11:02:54 +01:00
2011-06-10 20:19:35 +02:00
2011-09-03 16:07:09 +02:00
2011-05-01 23:02:39 +02:00
2011-10-07 20:50:57 +02:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2011-10-03 22:35:04 +02:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2010-12-21 22:39:56 +01:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2010-03-24 11:02:54 +01:00
2011-09-03 16:07:09 +02:00
2009-05-08 19:09:36 +00:00
2007-01-29 19:08:04 +00:00

HTTP Pipelining with libcurl
============================

Background

Since pipelining implies that one or more requests are sent to a server before
the previous response(s) have been received, we only support it for multi
interface use.

Considerations

When using the multi interface, you create one easy handle for each transfer.
Bascially any number of handles can be created, added and used with the multi
interface - simultaneously. It is an interface designed to allow many
simultaneous transfers while still using a single thread. Pipelining does not
change any of these details.

API

We've added a new option to curl_multi_setopt() called CURLMOPT_PIPELINING
that enables "attempted pipelining" and then all easy handles used on that
handle will attempt to use an existing pipeline.

Details

- A pipeline is only created if a previous connection exists to the same IP
  address that the new request is being made to use.

- Pipelines are only supported for HTTP(S) as no other currently supported
  protocol has features resemembling this, but we still name this feature
  plain 'pipelining' to possibly one day support it for other protocols as
  well.

- HTTP Pipelining is for GET and HEAD requests only.

- When a pipeline is in use, we must take precautions so that when used easy
  handles (i.e those who still wait for a response) are removed from the multi
  handle, we must deal with the outstanding response nicely.

- Explicitly asking for pipelining handle X and handle Y won't be supported.
  It isn't easy for an app to do this association. The lib should probably
  still resolve the second one properly to make sure that they actually _can_
  be considered for pipelining. Also, asking for explicit pipelining on handle
  X may be tricky when handle X get a closed connection.

- We need options to control max pipeline length, and probably how to behave
  if we reach that limit. As was discussed on the list, it can probably be
  made very complicated, so perhaps we can think of a way to pass all
  variables involved to a callback and let the application decide how to act
  in specific situations. Either way, these fancy options are only interesting
  to work on when everything is working and we have working apps to test with.