from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

210187

userrating:


May 25th. 2007:
Words

486

Views

259164

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

150528

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





NE_SET_REQUEST_BODY_

Section: neon API reference (3)
Updated: 23 November 2024
Index Return to Main Contents
 

NAME

ne_set_request_body_buffer, ne_set_request_body_fd, ne_set_request_body_provider - include a message body with a request  

SYNOPSIS

#include <ne_request.h>
void ne_set_request_body_buffer(ne_request *req, const char *buf, size_t count);
int ne_set_request_body_fd(ne_request *req, int fd, ne_off_t begin, ne_off_t length);
typedef ssize_t (*ne_provide_body)(void *userdata, char *data, size_t buflen);
int ne_set_request_body_provider(ne_request *req, ne_off_t length, ne_provide_body provider, void *userdata);
 

DESCRIPTION

The ne_set_request_body_buffer function specifies that a message body should be included with the body, which is stored in the count bytes buffer buf.

The ne_set_request_body_fd 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 fd, which must be a associated with a seekable file (not a pipe, socket, or FIFO). count bytes are read, beginning at offset begin (hence, passing begin as zero means the body is read from the beginning of the file).

For both above functions, the source of the request body must survive until the request has been dispatched; neither the memory buffer passed to ne_set_request_body_buffer nor the file descriptor passed to ne_set_request_body_fd are copied internally.

The ne_set_request_body_provider function can be used to include a message body with a request which is provided by a callback function. The body length passed in the length paramater must be positive, or if a chunked request body is required, as covered below, -1 can be used.

Before sending the body, the callback is invoked once with the buflen parameter as 0. The body is then read by invoking the callback repeatedly until it returns 0 indicating the end-of-body. The callback return value must be as follows:

less than 0

An error; the request will be aborted. The session error string must be set via ne_set_error.

0

End of body.

between 0 and buflen

Number of bytes of request body data.
 

Chunked request bodies

Chunked request bodies are only sent when ne_set_request_body_provider is used and -1 is passed as the length. In this case, the length of the request body does not have to be determined ahead of time. The end of the request body is indicated by returning 0 from the callback function.

Before using a chunked request body, the caller must determine that HTTP/1.1 is supported (by the origin server and any HTTP proxy server configured). This can be done by testing that ne_version_pre_http11 returns zero after performing an OPTIONS or HEAD request.  

SEE ALSO

ne_request_create, ne_set_error  

COPYRIGHT


Copyright © 200-2024 Joe Orton


 

Index

NAME
SYNOPSIS
DESCRIPTION
Chunked request bodies
SEE ALSO
COPYRIGHT





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 13.4 ms