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 <freerdp/log.h>
#include <freerdp/crypto/crypto.h>
#include <winpr/crypto.h>
#include "http.h"
Macros | |
#define | TAG FREERDP_TAG("core.gateway.http") |
#define | RESPONSE_SIZE_LIMIT 64 * 1024 * 1024 |
#define | WEBSOCKET_MAGIC_GUID "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" |
Functions | |
static char * | string_strnstr (char *str1, const char *str2, size_t slen) |
static BOOL | strings_equals_nocase (const void *obj1, const void *obj2) |
static void * | copy_string (const void *ptr) |
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) |
BOOL | http_context_set_pragma (HttpContext *context, const char *Pragma) |
BOOL | http_context_set_rdg_connection_id (HttpContext *context, const char *RdgConnectionId) |
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, 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) |
BOOL | http_response_print (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) |
HttpResponse * | http_response_recv (rdpTls *tls, BOOL readContentLength) |
const BYTE * | http_response_get_body (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 (HttpResponse *response) |
SSIZE_T | http_response_get_body_length (HttpResponse *response) |
const char * | http_response_get_auth_token (HttpResponse *response, const char *method) |
const char * | http_response_get_setcookie (HttpResponse *response, const char *cookie) |
TRANSFER_ENCODING | http_response_get_transfer_encoding (HttpResponse *response) |
BOOL | http_response_is_websocket (HttpContext *http, HttpResponse *response) |
const char * | http_status_string (long status) |
char * | http_status_string_format (long status, char *buffer, size_t size) |
#define RESPONSE_SIZE_LIMIT 64 * 1024 * 1024 |
#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_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, |
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 char * | RdgConnectionId | ||
) |
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 | ( | HttpResponse * | response, |
const char * | method | ||
) |
const BYTE* http_response_get_body | ( | HttpResponse * | response | ) |
SSIZE_T http_response_get_body_length | ( | HttpResponse * | response | ) |
const char* http_response_get_setcookie | ( | HttpResponse * | response, |
const char * | cookie | ||
) |
long http_response_get_status_code | ( | HttpResponse * | response | ) |
TRANSFER_ENCODING http_response_get_transfer_encoding | ( | HttpResponse * | response | ) |
BOOL http_response_is_websocket | ( | HttpContext * | http, |
HttpResponse * | response | ||
) |
HttpResponse* http_response_new | ( | void | ) |
|
static |
name end_of_header | | v v <header name> : <header value> ^ ^ | | colon_pos value
|
static |
|
static |
BOOL http_response_print | ( | HttpResponse * | response | ) |
HttpResponse* http_response_recv | ( | rdpTls * | tls, |
BOOL | readContentLength | ||
) |
const char* http_status_string | ( | long | status | ) |
char* http_status_string_format | ( | long | status, |
char * | buffer, | ||
size_t | size | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |