33#ifndef GENLIB_NET_HTTP_HTTPREADWRITE_H
34#define GENLIB_NET_HTTP_HTTPREADWRITE_H
46#define HTTP_DEFAULT_TIMEOUT 30
53 #define http_gmtime_r(clock, result) \
54 (gmtime_s(result, clock) ? NULL : result)
56 #define http_gmtime_r gmtime_r
59int http_CancelHttpGet(
void *Handle);
125 http_method_t request_method,
127 int *http_error_code);
183int http_RequestAndResponse(
uri_type *destination,
185 size_t request_length,
186 http_method_t req_method,
221int http_Download(
const char *url,
242int http_HttpGetProgress(
void *Handle,
size_t *length,
size_t *total);
307 Upnp_HttpMethod method,
319 const char *contentType,
500int http_SendStatusResponse(
SOCKINFO *info,
501 int http_status_code,
502 int request_major_version,
503 int request_minor_version);
549 int http_major_version,
551 int http_minor_version,
571void http_CalcResponseVersion(
int request_major_vers,
572 int request_minor_vers,
573 int *response_major_vers,
574 int *response_minor_vers);
601int http_OpenHttpGetEx(
const char *url_str,
623void get_sdk_info(
char *info,
size_t infoSize);
#define UPNP_EXPORT_SPEC
Export functions on WIN32 DLLs.
Definition UpnpGlobal.h:105
int SOCKET
Definition UpnpInet.h:50
struct s_UpnpString UpnpString
Type of the string objects inside libupnp.
Definition UpnpString.h:33
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.
Definition httpreadwrite.c:1487
int http_OpenHttpConnection(const char *url_str, void **Handle, int timeout)
Opens a connection to the server.
Definition httpreadwrite.c:1259
int http_CloseHttpConnection(void *Handle)
Closes the connection created with UpnpOpenHttpConnection and frees any memory associated with the co...
Definition httpreadwrite.c:1592
int http_SendMessage(SOCKINFO *info, int *TimeOut, const char *fmt,...)
Sends a message to the destination based on the format parameter.
Definition httpreadwrite.c:478
SOCKET http_Connect(uri_type *destination_url, uri_type *url)
Gets destination address from URL and then connects to the remote end.
Definition httpreadwrite.c:287
int http_FixUrl(uri_type *url, uri_type *fixed_url)
Validates URL.
Definition httpreadwrite.c:234
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 content ...
Definition httpreadwrite.c:1357
int http_EndHttpRequest(void *Handle, int timeout)
Indicates the end of a HTTP request previously made by UpnpMakeHttpRequest.
Definition httpreadwrite.c:1403
int http_FixStrUrl(const char *url_str, size_t url_str_len, uri_type *fixed_url)
Parses URL and then validates URL.
Definition httpreadwrite.c:261
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.
Definition httpreadwrite.c:1424
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.
Definition httpreadwrite.c:1319
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...
Definition httpreadwrite.c:350
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.
Definition httpreadwrite.c:1657
Definition httpparser.h:216
Definition membuffer.h:58
struct URI uri_type
Represents a URI used in parse_uri and elsewhere.