|
XenevaOS
|
#include "https.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <strings.h>#include <time.h>#include <sys/socket.h>#include <sys/netdb.h>#include <arpa/inet.h>#include <sys/_kefile.h>#include <sys/_keproc.h>#include <sys/_ketime.h>#include "mbedtls/build_info.h"#include "mbedtls/ssl.h"#include "mbedtls/entropy.h"#include "mbedtls/ctr_drbg.h"#include "mbedtls/x509_crt.h"
Classes | |
| struct | xe_url |
| struct | xe_tls_slot |
| struct | xe_reader |
| struct | xe_cookie |
| struct | xe_many |
| struct | xe_warm_conn |
Macros | |
| #define | XE_CLOCK_MIN 1577836800 /* 2020-01-01; epoch means the clock was never set */ |
| #define | XE_IDLE_MAX 150 /* 100 ms sleeps: 15 s */ |
| #define | XE_HDR_RAW 8192 |
| #define | XE_MAX_REDIRECTS 5 |
| #define | XE_CONNECT_PENDING 119 |
| #define | XE_COOKIE_MAX 32 |
| #define | XE_COOKIE_NAME 48 |
| #define | XE_COOKIE_VALUE 2048 |
| #define | XE_COOKIE_DOMAIN 128 |
| #define | XE_COOKIE_PATH 160 |
| #define | XE_JS_COOKIE_BUDGET 2032 |
| #define | XE_MANY_IDLE_MS 20000 |
| #define | XE_MANY_WAITS 750 |
| #define | XE_STEP_BUDGET 16384 |
| #define | XE_COLD_PER_HOST 2 |
| #define | XE_WARM_MAX 2 |
Enumerations | |
| enum | { XJ_FREE = 0 , XJ_CONNECT , XJ_TLS , XJ_SEND , XJ_HDR , XJ_BODY , XJ_DONE , XJ_FAIL , XJ_WARM } |
| enum | { XB_RAW = 0 , XB_LINE , XB_DATA , XB_CRLF } |
Functions | |
| void | xe_http_response_free (xe_http_response *out) |
| void | xe_http_set_referer (const char *url) |
| void | xe_http_set_body (const char *content_type, const void *body, size_t len) |
| void | xe_http_last_url (char *dst, size_t dstsz) |
| void | xe_cookie_set (const char *page_url, const char *set_cookie, int from_http) |
| int | xe_cookie_header (const char *url, char *dst, size_t dstsz) |
| int | xe_cookie_document (const char *url, char *dst, size_t dstsz) |
| int | xe_http_get_many (const char **urls, int n, const char *user_agent, xe_http_response *outs, const size_t *max_body, int *rcs) |
| int | xe_http_get (const char *url, const char *method, const char *user_agent, xe_http_response *out, size_t max_body) |
Variables | |
| const unsigned char | xe_cacert_pem [] |
| const unsigned int | xe_cacert_pem_len |
| #define XE_CLOCK_MIN 1577836800 /* 2020-01-01; epoch means the clock was never set */ |
| #define XE_COLD_PER_HOST 2 |
| #define XE_CONNECT_PENDING 119 |
| #define XE_COOKIE_DOMAIN 128 |
| #define XE_COOKIE_MAX 32 |
| #define XE_COOKIE_NAME 48 |
| #define XE_COOKIE_PATH 160 |
| #define XE_COOKIE_VALUE 2048 |
| #define XE_HDR_RAW 8192 |
| #define XE_IDLE_MAX 150 /* 100 ms sleeps: 15 s */ |
| #define XE_JS_COOKIE_BUDGET 2032 |
| #define XE_MANY_IDLE_MS 20000 |
| #define XE_MANY_WAITS 750 |
| #define XE_MAX_REDIRECTS 5 |
| #define XE_STEP_BUDGET 16384 |
| #define XE_WARM_MAX 2 |
| int xe_cookie_document | ( | const char * | url, |
| char * | dst, | ||
| size_t | dstsz | ||
| ) |
| int xe_cookie_header | ( | const char * | url, |
| char * | dst, | ||
| size_t | dstsz | ||
| ) |
| void xe_cookie_set | ( | const char * | page_url, |
| const char * | set_cookie, | ||
| int | from_http | ||
| ) |
| int xe_http_get | ( | const char * | url, |
| const char * | method, | ||
| const char * | user_agent, | ||
| xe_http_response * | out, | ||
| size_t | max_body | ||
| ) |
| int xe_http_get_many | ( | const char ** | urls, |
| int | n, | ||
| const char * | user_agent, | ||
| xe_http_response * | outs, | ||
| const size_t * | max_body, | ||
| int * | rcs | ||
| ) |
| void xe_http_last_url | ( | char * | dst, |
| size_t | dstsz | ||
| ) |
| void xe_http_response_free | ( | xe_http_response * | out | ) |
| void xe_http_set_body | ( | const char * | content_type, |
| const void * | body, | ||
| size_t | len | ||
| ) |
| void xe_http_set_referer | ( | const char * | url | ) |
|
extern |
BSD 2-Clause License
Copyright (c) 2026, Manas Kamal Choudhury All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
extern |