![]() |
C library for SOAP (Simple Object Access Protocol) |
Go to the source code of this file.
These are not regular streams. They will care about transfer styles while sending/receiving data.
Supported transfer styles are
A stream will set its transfer style from the header information, which must be given while creating a stream.
A stream will start sending/receiving data "after" sending/receiving header information (After CR LF CR LF)."
| typedef enum http_transfer_type http_transfer_type_t |
Transfer types supported while sending/receiving data.
| enum http_transfer_type |
Transfer types supported while sending/receiving data.
| void http_input_stream_free | ( | struct http_input_stream_t * | stream | ) |
Free input stream. Note that the socket will not be closed by this functions.
| stream | the input stream to free. |
| int http_input_stream_is_ready | ( | struct http_input_stream_t * | stream | ) |
This function returns the actual status of the stream.
| stream | the stream to check its status |
| struct http_input_stream_t* http_input_stream_new | ( | struct hsocket_t * | sock, | |
| hpair_t * | header | |||
| ) | [read] |
This function creates a new input stream. The transfer style will be choosen from the given header.
| sock | the socket to receive data from | |
| header | the http header. This must be received before creating a http_input_stream_t. |
| struct http_input_stream_t* http_input_stream_new_from_file | ( | const char * | filename | ) | [read] |
This function creates a new input stream from file. It was added for MIME messages and for debugging purposes. The transfer style is always HTTP_TRANSFER_FILE.
| filename | the name of the file to open and read. |
| int http_input_stream_read | ( | struct http_input_stream_t * | stream, | |
| unsigned char * | dest, | |||
| int | size | |||
| ) |
This function tries to read 'size' bytes from the stream. Check always with http_input_stream_is_ready() if there are some data to read. If it returns 0, no more data is available on stream.
On error this function will return -1. In this case the "err" field of stream will be set to the actual error. This can be one of the followings:
| stream | the stream to read data from | |
| dest | destination memory to store read bytes | |
| size | maximum size of 'dest' (size to read) |
| herror_t http_output_stream_flush | ( | struct http_output_stream_t * | stream | ) |
This function sends finish flags if nesseccary (like in chunked transport). Call always this function before closing the connections.
| stream | the stream to send post data. |
| void http_output_stream_free | ( | struct http_output_stream_t * | stream | ) |
This function frees the given output stream. Note that this function will not close any socket connections.
| stream | The stream to free. |
| struct http_output_stream_t* http_output_stream_new | ( | struct hsocket_t * | sock, | |
| hpair_t * | header | |||
| ) | [read] |
Creates a new output stream. Transfer style will be found from the given header.
| sock | the socket to to send data to | |
| header | the header which must be sent before |
| herror_t http_output_stream_write | ( | struct http_output_stream_t * | stream, | |
| const unsigned char * | bytes, | |||
| int | size | |||
| ) |
This function writes 'size' bytes of 'bytes' into stream.
| stream | the stream to use to send data | |
| bytes | bytes to send | |
| size | size of bytes to send |
| herror_t http_output_stream_write_string | ( | struct http_output_stream_t * | stream, | |
| const char * | str | |||
| ) |
This function writes a null terminated string to the stream.
| stream | the stream to use to send data | |
| str | a null terminated string to send |