~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to docs/libcurl/curl_easy_pause.3

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-02-08 11:20:41 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20080208112041-hed7sb5r6ghmjf8v
Tags: upstream-7.18.0
ImportĀ upstreamĀ versionĀ 7.18.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" $Id: curl_easy_pause.3,v 1.1 2008-01-08 14:52:07 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>
 
8
 
 
9
.BI "CURLcode curl_easy_pause(CURL *"handle ", int "bitmask " );"
 
10
 
 
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.
 
14
 
 
15
A connection can made to pause 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).
 
18
 
 
19
NOTE: while it may feel tempting, take care and notice that you cannot call
 
20
this function from another thread.
 
21
 
 
22
When this function is called to unpause reading, the chance is high that you
 
23
will get your write callback called before this function returns.
 
24
 
 
25
The \fBhandle\fP argument is of course identifying the handle that operates on
 
26
the connection you want to pause or unpause.
 
27
 
 
28
The \fBbitmask\fP argument is a set of bits that sets the new state of the
 
29
connection. The following bits can be used:
 
30
.IP CURLPAUSE_RECV
 
31
Pause receiving data. There will be no data received on this conneciton until
 
32
this function is called again without this bit set. Thus, the write callback
 
33
(\fICURLOPT_WRITEFUNCTION\fP) won't be called.
 
34
.IP CURLPAUSE_SEND
 
35
Pause sending data. There will be no data sent on this connection until this
 
36
function is called again without this bit set. Thus, the read callback
 
37
(\fICURLOPT_READFUNCTION\fP) won't be called.
 
38
.IP CURLPAUSE_ALL
 
39
Convenience define that pauses both directions.
 
40
.IP CURLPAUSE_CONT
 
41
Convenience define that unpauses both directions
 
42
.SH RETURN VALUE
 
43
CURLE_OK (zero) means that the option was set properly, and a non-zero return
 
44
code means something wrong occurred after the new state was set.  See the
 
45
\fIlibcurl-errors(3)\fP man page for the full list with descriptions.
 
46
.SH AVAILABILITY
 
47
This function was added in libcurl 7.18.0. Before this version, there was no
 
48
explicit support for pausing transfers.
 
49
.SH "MEMORY USE"
 
50
When pausing a read by returning the magic return code from a write callback,
 
51
the read data is already in libcurl's internal buffers so it'll have to keep
 
52
it in an allocated buffer until the reading is again unpaused using this
 
53
function.
 
54
 
 
55
If the downloaded data is compressed and is asked to get uncompressed
 
56
automatially on download, libcurl will continue to uncompress the entire
 
57
downloaded chunk and it will cache the data uncompressed. This has the side-
 
58
effect that if you download something that is compressed a lot, it can result
 
59
in a very large data amount needing to be allocated to save the data during
 
60
the pause. This said, you should probably consider not using paused reading if
 
61
you allow libcurl to uncompress data automatically.
 
62
.SH "SEE ALSO"
 
63
.BR curl_easy_cleanup "(3), " curl_easy_reset "(3)"