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