curl_multi_info_read.3 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. .\" $Id$
  2. .\"
  3. .TH curl_multi_info_read 3 "18 Dec 2004" "libcurl 7.10.3" "libcurl Manual"
  4. .SH NAME
  5. curl_multi_info_read - read multi stack informationals
  6. .SH SYNOPSIS
  7. #include <curl/curl.h>
  8. CURLMsg *curl_multi_info_read( CURLM *multi_handle,
  9. int *msgs_in_queue);
  10. .ad
  11. .SH DESCRIPTION
  12. Ask the multi handle if there are any messages/informationals from the
  13. individual transfers. Messages may include informationals such as an error
  14. code from the transfer or just the fact that a transfer is completed. More
  15. details on these should be written down as well.
  16. Repeated calls to this function will return a new struct each time, until a
  17. NULL is returned as a signal that there is no more to get at this point. The
  18. integer pointed to with \fImsgs_in_queue\fP will contain the number of
  19. remaining messages after this function was called.
  20. When you fetch a message using this function, it is removed from the internal
  21. queue so calling this function again will not return the same message
  22. again. It will instead return new messages at each new invoke until the queue
  23. is emptied.
  24. \fBWARNING:\fP The data the returned pointer points to will not survive
  25. calling \fIcurl_multi_cleanup(3)\fP, \fIcurl_multi_remove_handle(3)\fP or
  26. \fIcurl_easy_cleanup(3)\fP.
  27. The 'CURLMsg' struct is very simple and only contains very basic information.
  28. If more involved information is wanted, the particular "easy handle" in
  29. present in that struct and can thus be used in subsequent regular
  30. \fIcurl_easy_getinfo(3)\fP calls (or similar):
  31. .nf
  32. struct CURLMsg {
  33. CURLMSG msg; /* what this message means */
  34. CURL *easy_handle; /* the handle it concerns */
  35. union {
  36. void *whatever; /* message-specific data */
  37. CURLcode result; /* return code for transfer */
  38. } data;
  39. };
  40. .fi
  41. When \fBmsg\fP is \fICURLMSG_DONE\fP, the message identifies a transfer that
  42. is done, and then \fBresult\fP contains the return code for the easy handle
  43. that just completed.
  44. At this point, there are no other \fBmsg\fP types defined.
  45. .SH "RETURN VALUE"
  46. A pointer to a filled-in struct, or NULL if it failed or ran out of
  47. structs. It also writes the number of messages left in the queue (after this
  48. read) in the integer the second argument points to.
  49. .SH "SEE ALSO"
  50. .BR curl_multi_cleanup "(3), " curl_multi_init "(3), " curl_multi_perform "(3)"