1#ifdef COMPA_HAVE_WEBSERVER
3#ifndef COMPA_GENLIB_NET_HTTP_HTTPREADWRITE_HPP
4#define COMPA_GENLIB_NET_HTTP_HTTPREADWRITE_HPP
48#define HTTP_DEFAULT_TIMEOUT 30
50#if defined(_WIN32) || defined(DOXYGEN_RUN)
54#define http_gmtime_r gmtime_r
188 size_t request_length,
303 const char* contentType,
463 int http_status_code,
465 int request_major_version,
466 int request_minor_version
517 int http_major_version,
518 int http_minor_version,
527 int request_major_vers,
528 int request_minor_vers,
529 int* response_major_vers,
530 int* response_minor_vers
http_method_t
Method in a HTTP request.
Structure of an HTTP parser object.
int http_ReadHttpResponse(void *Handle, char *buf, size_t *size, int timeout)
Reads the content of a response using a connection previously created by UpnpOpenHttpConnection().
int http_OpenHttpConnection(const char *url_str, void **Handle, int timeout)
Opens a connection to the server.
int http_RequestAndResponse(uri_type *destination, const char *request, size_t request_length, http_method_t req_method, int timeout_secs, http_parser_t *response)
Initiates socket, connects to the remote host, sends a request and waits for the response from the re...
int http_CloseHttpConnection(void *Handle)
Closes the connection created with UpnpOpenHttpConnection() and frees any memory associated with the ...
int http_FixStrUrl(const char *urlstr, size_t urlstrlen, uri_type *fixed_url)
Parses URL and then validates URL.
int http_SendMessage(SOCKINFO *info, int *TimeOut, const char *fmt,...)
Sends a message to the destination based on the format parameter.
SOCKET http_Connect(uri_type *destination_url, uri_type *url)
Gets destination address from URL and then connects to the remote end.
void get_sdk_info(char *info, size_t infoSize)
Returns the server information for the operating system.
int http_Download(const char *url_str, int timeout_secs, char **document, size_t *doc_length, char *content_type)
Download the document message and extract the document from the message.
int http_FixUrl(uri_type *url, uri_type *fixed_url)
Validates URL.
int http_CancelHttpGet(void *Handle)
Set the cancel flag of the HttpGet handle.
int http_WriteHttpRequest(void *Handle, char *buf, size_t *size, int timeout)
Writes the content of a HTTP request initiated by a UpnpMakeHttpRequest() call. The end of the conten...
void http_CalcResponseVersion(int request_major_vers, int request_minor_vers, int *response_major_vers, int *response_minor_vers)
Calculate HTTP response versions based on the request versions.
tm * http_gmtime_r(const time_t *clock, tm *result)
Portable gmtime_r for Microsoft Windows.
int http_EndHttpRequest(void *Handle, int timeout)
Indicates the end of a HTTP request previously made by UpnpMakeHttpRequest().
int http_SendStatusResponse(SOCKINFO *info, int http_status_code, int request_major_version, int request_minor_version)
Generate a response message for the status query and send the status response.
int http_OpenHttpGetEx(const char *url_str, void **Handle, char **contentType, int *contentLength, int *httpStatus, int lowRange, int highRange, int timeout)
Makes the HTTP GET message, connects to the peer, sends the HTTP GET request, gets the response and p...
int http_GetHttpResponse(void *Handle, UpnpString *headers, char **contentType, int *contentLength, int *httpStatus, int timeout)
Gets the response from the server using a connection previously created by UpnpOpenHttpConnection().
int http_MakeHttpRequest(Upnp_HttpMethod method, const char *url_str, void *Handle, UpnpString *headers, const char *contentType, int contentLength, int timeout)
Makes a HTTP request using a connection previously created by UpnpOpenHttpConnection().
int http_RecvMessage(SOCKINFO *info, http_parser_t *parser, http_method_t request_method, int *timeout_secs, int *http_error_code)
Get the data on the socket and take actions based on the read data to modify the parser objects buffe...
int http_HttpGetProgress(void *Handle, size_t *length, size_t *total)
Extracts information from the Handle to the HTTP get object.
int http_MakeMessage(membuffer *buf, int http_major_version, int http_minor_version, const char *fmt,...)
Generate an HTTP message based on the format that is specified in the input parameters.
Represents a URI used in parse_uri and elsewhere.
Functions to parse UPnP messages like requests and responses.
Internal implementation of the class UpnpString.
Upnp_HttpMethod
Different HTTP methods.
Maintains a block of dynamically allocated memory.
Manage network sockets and connections.
Additional socket information for connections and ssl.