FreeRDP
|
#include <freerdp/config.h>
#include <errno.h>
#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/stream.h>
#include <winpr/string.h>
#include <winpr/rpc.h>
#include <winpr/sysinfo.h>
#include <freerdp/log.h>
#include <freerdp/crypto/crypto.h>
#include <winpr/crypto.h>
#include "http.h"
#include "../tcp.h"
Macros | |
#define | TAG FREERDP_TAG("core.gateway.http") |
#define | RESPONSE_SIZE_LIMIT (64ULL * 1024ULL * 1024ULL) |
#define | WEBSOCKET_MAGIC_GUID "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" |
#define | sleep_or_timeout(tls, startMS, timeoutMS) sleep_or_timeout_((tls), (startMS), (timeoutMS), __FILE__, __func__, __LINE__) |
Functions | |
static char * | string_strnstr (char *str1, const char *str2, size_t slen) |
static BOOL | strings_equals_nocase (const void *obj1, const void *obj2) |
HttpContext * | http_context_new (void) |
BOOL | http_context_set_method (HttpContext *context, const char *Method) |
BOOL | http_request_set_content_type (HttpRequest *request, const char *ContentType) |
const char * | http_context_get_uri (HttpContext *context) |
BOOL | http_context_set_uri (HttpContext *context, const char *URI) |
BOOL | http_context_set_user_agent (HttpContext *context, const char *UserAgent) |
BOOL | http_context_set_x_ms_user_agent (HttpContext *context, const char *X_MS_UserAgent) |
BOOL | http_context_set_host (HttpContext *context, const char *Host) |
BOOL | http_context_set_accept (HttpContext *context, const char *Accept) |
BOOL | http_context_set_cache_control (HttpContext *context, const char *CacheControl) |
BOOL | http_context_set_connection (HttpContext *context, const char *Connection) |
static BOOL | list_append (HttpContext *context, WINPR_FORMAT_ARG const char *str, va_list ap) |
BOOL | http_context_set_pragma (HttpContext *context, WINPR_FORMAT_ARG const char *Pragma,...) |
BOOL | http_context_append_pragma (HttpContext *context, const char *Pragma,...) |
static char * | guid2str (const GUID *guid) |
BOOL | http_context_set_rdg_connection_id (HttpContext *context, const GUID *RdgConnectionId) |
BOOL | http_context_set_rdg_correlation_id (HttpContext *context, const GUID *RdgCorrelationId) |
BOOL | http_context_enable_websocket_upgrade (HttpContext *context, BOOL enable) |
BOOL | http_context_is_websocket_upgrade_enabled (HttpContext *context) |
BOOL | http_context_set_rdg_auth_scheme (HttpContext *context, const char *RdgAuthScheme) |
BOOL | http_context_set_cookie (HttpContext *context, const char *CookieName, const char *CookieValue) |
void | http_context_free (HttpContext *context) |
BOOL | http_request_set_method (HttpRequest *request, const char *Method) |
BOOL | http_request_set_uri (HttpRequest *request, const char *URI) |
BOOL | http_request_set_auth_scheme (HttpRequest *request, const char *AuthScheme) |
BOOL | http_request_set_auth_param (HttpRequest *request, const char *AuthParam) |
BOOL | http_request_set_transfer_encoding (HttpRequest *request, TRANSFER_ENCODING TransferEncoding) |
static BOOL | http_encode_print (wStream *s, WINPR_FORMAT_ARG const char *fmt,...) |
static BOOL | http_encode_body_line (wStream *s, const char *param, const char *value) |
static BOOL | http_encode_content_length_line (wStream *s, size_t ContentLength) |
static BOOL | http_encode_header_line (wStream *s, const char *Method, const char *URI) |
static BOOL | http_encode_authorization_line (wStream *s, const char *AuthScheme, const char *AuthParam) |
static BOOL | http_encode_cookie_line (wStream *s, wListDictionary *cookies) |
wStream * | http_request_write (HttpContext *context, HttpRequest *request) |
HttpRequest * | http_request_new (void) |
void | http_request_free (HttpRequest *request) |
static BOOL | http_response_parse_header_status_line (HttpResponse *response, const char *status_line) |
static BOOL | http_response_parse_header_field (HttpResponse *response, const char *name, const char *value) |
static BOOL | http_response_parse_header (HttpResponse *response) |
static void | http_response_print (wLog *log, DWORD level, const HttpResponse *response) |
static BOOL | http_use_content_length (const char *cur) |
static int | print_bio_error (const char *str, size_t len, void *bp) |
int | http_chuncked_read (BIO *bio, BYTE *pBuffer, size_t size, http_encoding_chunked_context *encodingContext) |
static BOOL | sleep_or_timeout_ (rdpTls *tls, UINT64 startMS, UINT32 timeoutMS, const char *file, const char *fkt, size_t line) |
static SSIZE_T | http_response_recv_line (rdpTls *tls, HttpResponse *response) |
static BOOL | http_response_recv_body (rdpTls *tls, HttpResponse *response, BOOL readContentLength, size_t payloadOffset, size_t bodyLength) |
HttpResponse * | http_response_recv (rdpTls *tls, BOOL readContentLength) |
const BYTE * | http_response_get_body (const HttpResponse *response) |
static BOOL | set_compare (wListDictionary *dict) |
HttpResponse * | http_response_new (void) |
void | http_response_free (HttpResponse *response) |
const char * | http_request_get_uri (HttpRequest *request) |
SSIZE_T | http_request_get_content_length (HttpRequest *request) |
BOOL | http_request_set_content_length (HttpRequest *request, size_t length) |
long | http_response_get_status_code (const HttpResponse *response) |
size_t | http_response_get_body_length (const HttpResponse *response) |
const char * | http_response_get_auth_token (const HttpResponse *response, const char *method) |
const char * | http_response_get_setcookie (const HttpResponse *response, const char *cookie) |
TRANSFER_ENCODING | http_response_get_transfer_encoding (const HttpResponse *response) |
BOOL | http_response_is_websocket (const HttpContext *http, const HttpResponse *response) |
void | http_response_log_error_status (wLog *log, DWORD level, const HttpResponse *response) |
#define RESPONSE_SIZE_LIMIT (64ULL * 1024ULL * 1024ULL) |
#define sleep_or_timeout | ( | tls, | |
startMS, | |||
timeoutMS | |||
) | sleep_or_timeout_((tls), (startMS), (timeoutMS), __FILE__, __func__, __LINE__) |
#define TAG FREERDP_TAG("core.gateway.http") |
FreeRDP: A Remote Desktop Protocol Implementation Hypertext Transfer Protocol (HTTP)
Copyright 2012 Marc-Andre Moreau marca ndre .more au@g mail. com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
#define WEBSOCKET_MAGIC_GUID "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" |
|
static |
int http_chuncked_read | ( | BIO * | bio, |
BYTE * | pBuffer, | ||
size_t | size, | ||
http_encoding_chunked_context * | encodingContext | ||
) |
BOOL http_context_append_pragma | ( | HttpContext * | context, |
const char * | Pragma, | ||
... | |||
) |
BOOL http_context_enable_websocket_upgrade | ( | HttpContext * | context, |
BOOL | enable | ||
) |
void http_context_free | ( | HttpContext * | context | ) |
const char* http_context_get_uri | ( | HttpContext * | context | ) |
BOOL http_context_is_websocket_upgrade_enabled | ( | HttpContext * | context | ) |
HttpContext* http_context_new | ( | void | ) |
BOOL http_context_set_accept | ( | HttpContext * | context, |
const char * | Accept | ||
) |
BOOL http_context_set_cache_control | ( | HttpContext * | context, |
const char * | CacheControl | ||
) |
BOOL http_context_set_connection | ( | HttpContext * | context, |
const char * | Connection | ||
) |
BOOL http_context_set_cookie | ( | HttpContext * | context, |
const char * | CookieName, | ||
const char * | CookieValue | ||
) |
BOOL http_context_set_host | ( | HttpContext * | context, |
const char * | Host | ||
) |
BOOL http_context_set_method | ( | HttpContext * | context, |
const char * | Method | ||
) |
BOOL http_context_set_pragma | ( | HttpContext * | context, |
WINPR_FORMAT_ARG const char * | Pragma, | ||
... | |||
) |
BOOL http_context_set_rdg_auth_scheme | ( | HttpContext * | context, |
const char * | RdgAuthScheme | ||
) |
BOOL http_context_set_rdg_connection_id | ( | HttpContext * | context, |
const GUID * | RdgConnectionId | ||
) |
BOOL http_context_set_rdg_correlation_id | ( | HttpContext * | context, |
const GUID * | RdgCorrelationId | ||
) |
BOOL http_context_set_uri | ( | HttpContext * | context, |
const char * | URI | ||
) |
BOOL http_context_set_user_agent | ( | HttpContext * | context, |
const char * | UserAgent | ||
) |
BOOL http_context_set_x_ms_user_agent | ( | HttpContext * | context, |
const char * | X_MS_UserAgent | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void http_request_free | ( | HttpRequest * | request | ) |
SSIZE_T http_request_get_content_length | ( | HttpRequest * | request | ) |
const char* http_request_get_uri | ( | HttpRequest * | request | ) |
HttpRequest* http_request_new | ( | void | ) |
BOOL http_request_set_auth_param | ( | HttpRequest * | request, |
const char * | AuthParam | ||
) |
BOOL http_request_set_auth_scheme | ( | HttpRequest * | request, |
const char * | AuthScheme | ||
) |
BOOL http_request_set_content_length | ( | HttpRequest * | request, |
size_t | length | ||
) |
BOOL http_request_set_content_type | ( | HttpRequest * | request, |
const char * | ContentType | ||
) |
BOOL http_request_set_method | ( | HttpRequest * | request, |
const char * | Method | ||
) |
BOOL http_request_set_transfer_encoding | ( | HttpRequest * | request, |
TRANSFER_ENCODING | TransferEncoding | ||
) |
BOOL http_request_set_uri | ( | HttpRequest * | request, |
const char * | URI | ||
) |
wStream* http_request_write | ( | HttpContext * | context, |
HttpRequest * | request | ||
) |
void http_response_free | ( | HttpResponse * | response | ) |
const char* http_response_get_auth_token | ( | const HttpResponse * | response, |
const char * | method | ||
) |
const BYTE* http_response_get_body | ( | const HttpResponse * | response | ) |
size_t http_response_get_body_length | ( | const HttpResponse * | response | ) |
const char* http_response_get_setcookie | ( | const HttpResponse * | response, |
const char * | cookie | ||
) |
long http_response_get_status_code | ( | const HttpResponse * | response | ) |
TRANSFER_ENCODING http_response_get_transfer_encoding | ( | const HttpResponse * | response | ) |
BOOL http_response_is_websocket | ( | const HttpContext * | http, |
const HttpResponse * | response | ||
) |
void http_response_log_error_status | ( | wLog * | log, |
DWORD | level, | ||
const HttpResponse * | response | ||
) |
HttpResponse* http_response_new | ( | void | ) |
|
static |
name end_of_header | | v v <header name> : <header value> ^ ^ | | colon_pos value
|
static |
|
static |
|
static |
HttpResponse* http_response_recv | ( | rdpTls * | tls, |
BOOL | readContentLength | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |