2
0

README.pipelining 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. HTTP Pipelining with libcurl
  2. ============================
  3. Background
  4. Since pipelining implies that one or more requests are sent to a server before
  5. the previous response(s) have been received, we only support it for multi
  6. interface use.
  7. Considerations
  8. When using the multi interface, you create one easy handle for each transfer.
  9. Bascially any number of handles can be created, added and used with the multi
  10. interface - simultaneously. It is an interface designed to allow many
  11. simultaneous transfers while still using a single thread. Pipelining does not
  12. change any of these details.
  13. API
  14. We've added a new option to curl_multi_setopt() called CURLMOPT_PIPELINING
  15. that enables "attempted pipelining" and then all easy handles used on that
  16. handle will attempt to use an existing pipeline.
  17. Details
  18. - A pipeline is only created if a previous connection exists to the same IP
  19. address that the new request is being made to use.
  20. - Pipelines are only supported for HTTP(S) as no other currently supported
  21. protocol has features resemembling this, but we still name this feature
  22. plain 'pipelining' to possibly one day support it for other protocols as
  23. well.
  24. - HTTP Pipelining is for GET and HEAD requests only.
  25. - When a pipeline is in use, we must take precautions so that when used easy
  26. handles (i.e those who still wait for a response) are removed from the multi
  27. handle, we must deal with the outstanding response nicely.
  28. - Explicitly asking for pipelining handle X and handle Y won't be supported.
  29. It isn't easy for an app to do this association. The lib should probably
  30. still resolve the second one properly to make sure that they actually _can_
  31. be considered for pipelining. Also, asking for explicit pipelining on handle
  32. X may be tricky when handle X get a closed connection.
  33. - We need options to control max pipeline length, and probably how to behave
  34. if we reach that limit. As was discussed on the list, it can probably be
  35. made very complicated, so perhaps we can think of a way to pass all
  36. variables involved to a callback and let the application decide how to act
  37. in specific situations. Either way, these fancy options are only interesting
  38. to work on when everything is working and we have working apps to test with.