Install curl-7.21.1.tar.bz2
[msysgit.git] / mingw / share / man / man3 / curl_easy_pause.3
blob4d16ecffe3346b44998bd2d75bf5c870d0b42aa2
1 .\"
2 .TH curl_easy_pause 3 "17 Dec 2007" "libcurl 7.18.0" "libcurl Manual"
3 .SH NAME
4 curl_easy_pause - pause and unpause a connection
5 .SH SYNOPSIS
6 .B #include <curl/curl.h>
8 .BI "CURLcode curl_easy_pause(CURL *"handle ", int "bitmask " );"
10 .SH DESCRIPTION
11 Using this function, you can explicitly mark a running connection to get
12 paused, and you can unpause a connection that was previously paused.
14 A connection can be paused by using this function or by letting the read
15 or the write callbacks return the proper magic return code
16 (\fICURL_READFUNC_PAUSE\fP and \fICURL_WRITEFUNC_PAUSE\fP). A write callback
17 that returns pause signals to the library that it couldn't take care of any
18 data at all, and that data will then be delivered again to the callback when
19 the writing is later unpaused.
21 NOTE: while it may feel tempting, take care and notice that you cannot call
22 this function from another thread.
24 When this function is called to unpause reading, the chance is high that you
25 will get your write callback called before this function returns.
27 The \fBhandle\fP argument is of course identifying the handle that operates on
28 the connection you want to pause or unpause.
30 The \fBbitmask\fP argument is a set of bits that sets the new state of the
31 connection. The following bits can be used:
32 .IP CURLPAUSE_RECV
33 Pause receiving data. There will be no data received on this connection until
34 this function is called again without this bit set. Thus, the write callback
35 (\fICURLOPT_WRITEFUNCTION\fP) won't be called.
36 .IP CURLPAUSE_SEND
37 Pause sending data. There will be no data sent on this connection until this
38 function is called again without this bit set. Thus, the read callback
39 (\fICURLOPT_READFUNCTION\fP) won't be called.
40 .IP CURLPAUSE_ALL
41 Convenience define that pauses both directions.
42 .IP CURLPAUSE_CONT
43 Convenience define that unpauses both directions
44 .SH RETURN VALUE
45 CURLE_OK (zero) means that the option was set properly, and a non-zero return
46 code means something wrong occurred after the new state was set.  See the
47 \fIlibcurl-errors(3)\fP man page for the full list with descriptions.
48 .SH AVAILABILITY
49 This function was added in libcurl 7.18.0. Before this version, there was no
50 explicit support for pausing transfers.
51 .SH "MEMORY USE"
52 When pausing a read by returning the magic return code from a write callback,
53 the read data is already in libcurl's internal buffers so it'll have to keep
54 it in an allocated buffer until the reading is again unpaused using this
55 function.
57 If the downloaded data is compressed and is asked to get uncompressed
58 automatically on download, libcurl will continue to uncompress the entire
59 downloaded chunk and it will cache the data uncompressed. This has the side-
60 effect that if you download something that is compressed a lot, it can result
61 in a very large data amount needing to be allocated to save the data during
62 the pause. This said, you should probably consider not using paused reading if
63 you allow libcurl to uncompress data automatically.
64 .SH "SEE ALSO"
65 .BR curl_easy_cleanup "(3), " curl_easy_reset "(3)"