ELinks 0.18.0
|
State of reading POST data from connection.uri->post and related files. More...
#include <post.h>
Data Fields | |
off_t | total_upload_length |
Total size of the POST body to be uploaded. | |
off_t | uploaded |
Amount of POST body data uploaded so far. | |
const char * | post_data |
Points to the next byte to be read from connection.uri->post. | |
int | post_fd |
File descriptor from which data is being read, or -1 if none. | |
size_t | file_index |
Current position in the files array. | |
size_t | file_count |
Number of files to be uploaded, i.e. | |
off_t | file_read |
Number of bytes read from the current file so far. | |
struct http_post_file * | files |
Array of information about files to be uploaded. | |
Related Symbols | |
(Note that these are not member symbols.) | |
void | init_http_post (struct http_post *http_post) |
Initialize *http_post so that done_http_post() can be safely called. | |
void | done_http_post (struct http_post *http_post) |
Free all resources owned by *http_post, but do not free the structure itself. | |
int | open_http_post (struct http_post *http_post, const char *post_data, struct connection_state *error) |
Prepare to read POST data from a URI and possibly to upload files. | |
static int | read_http_post_inline (struct http_post *http_post, char buffer[], int max, struct connection_state *error) |
static int | read_http_post_fd (struct http_post *http_post, char buffer[], int max, struct connection_state *error) |
int | read_http_post (struct http_post *http_post, char buffer[], int max, struct connection_state *error) |
Read data from connection.uri->post or from the files to which it refers. | |
State of reading POST data from connection.uri->post and related files.
|
related |
Free all resources owned by *http_post, but do not free the structure itself.
It is safe to call this multiple times.
|
related |
Initialize *http_post so that done_http_post() can be safely called.
|
related |
Prepare to read POST data from a URI and possibly to upload files.
http_post | Must have been initialized with init_http_post(). | |
[in] | post_data | The body of the POST request as formatted by get_form_uri(). However, unlike uri.post, post_data must not contain any Content-Type. The caller must ensure that the post_data pointer remains valid until done_http_post(). |
[out] | error | If the function fails, it writes the error state here so that the caller can pass that on to abort_connection(). If the function succeeds, the value of *error is undefined. |
This function does not parse the Content-Type from uri.post; the caller must do that. This is because in local CGI, the child process handles the Content-Type (saving it to an environment variable before exec) but the parent process handles the body of the request (feeding it to the child process via a pipe).
|
related |
Read data from connection.uri->post or from the files to which it refers.
|
related |
|
related |
size_t http_post::file_count |
Number of files to be uploaded, i.e.
the number of elements in the files array.
size_t http_post::file_index |
Current position in the files array.
This is the file that is currently being read (when post_fd != -1) or would be read next (when post_fd == -1).
off_t http_post::file_read |
Number of bytes read from the current file so far.
The value makes sense only when post_fd != -1.
struct http_post_file* http_post::files |
Array of information about files to be uploaded.
const char* http_post::post_data |
Points to the next byte to be read from connection.uri->post.
int http_post::post_fd |
File descriptor from which data is being read, or -1 if none.
off_t http_post::total_upload_length |
Total size of the POST body to be uploaded.
off_t http_post::uploaded |
Amount of POST body data uploaded so far.
read_http_post() increments this.