blob: 58f307e00c1fc2364dd3b9af3e80382894cb3a09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
<refentry id="refreqbody">
<refmeta>
<refentrytitle>ne_set_request_body_buffer</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname id="ne_set_request_body_buffer">ne_set_request_body_buffer</refname>
<refname id="ne_set_request_body_fd">ne_set_request_body_fd</refname>
<refname id="ne_set_request_body_fd64">ne_set_request_body_fd64</refname>
<refpurpose>include a message body with a request</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include <ne_request.h></funcsynopsisinfo>
<funcprototype>
<funcdef>void <function>ne_set_request_body_buffer</function></funcdef>
<paramdef>ne_request *<parameter>req</parameter></paramdef>
<paramdef>const char *<parameter>buf</parameter></paramdef>
<paramdef>size_t <parameter>count</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>ne_set_request_body_fd</function></funcdef>
<paramdef>ne_request *<parameter>req</parameter></paramdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>off_t <parameter>begin</parameter></paramdef>
<paramdef>off_t <parameter>length</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>ne_set_request_body_fd64</function></funcdef>
<paramdef>ne_request *<parameter>req</parameter></paramdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>off64_t <parameter>begin</parameter></paramdef>
<paramdef>off64_t <parameter>length</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>The <function>ne_set_request_body_buffer</function>
function specifies that a message body should be included with the
body, which is stored in the <parameter>count</parameter> bytes buffer
<parameter>buf</parameter>.</para>
<para>The <function>ne_set_request_body_fd</function> function
can be used to include a message body with a request which is read
from a file descriptor. The body is read from the file descriptor
<parameter>fd</parameter>, which must be a associated with a seekable
file (not a pipe, socket, or FIFO). <parameter>count</parameter>
bytes are read, beginning at offset <parameter>begin</parameter>
(hence, passing <parameter>begin</parameter> as zero means the body is read
from the beginning of the file).</para>
<para>If the <literal>NE_LFS</literal> macro is defined, then
the <function>ne_set_request_body_fd64</function> function is
also available, to provide large file support. This function
can be used on 32-bit platforms supporting the LFS standard;
the <parameter>offset</parameter> and
<parameter>length</parameter> parameters can then be passed as
64-bit values. When using large files,
<parameter>fd</parameter> must be opened using
<function>open64</function> or by passing the
<literal>O_LARGEFILE</literal> flag to
<function>open</function>.</para>
<para>For all the above functions, the source of the request
body must survive until the request has been dispatched;
neither the memory buffer passed to
<function>ne_set_request_body_buffer</function> nor the file
descriptor passed to
<function>ne_set_request_body_fd</function> or
<function>ne_set_request_body_fd64</function> are copied
internally.</para>
</refsect1>
<refsect1>
<title>See also</title>
<para><xref linkend="ne_request_create"/></para>
</refsect1>
</refentry>
|