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