����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/*
+----------------------------------------------------------------------+
| Swoole |
+----------------------------------------------------------------------+
| Copyright (c) 2012-2015 The Swoole Group |
+----------------------------------------------------------------------+
| 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 "php_swoole_cxx.h"
#include "swoole_server.h"
#include <unordered_map>
#include <list>
#include <vector>
//--------------------------------------------------------
enum php_swoole_server_callback_type {
SW_SERVER_CB_onStart, // master
SW_SERVER_CB_onBeforeShutdown, // master
SW_SERVER_CB_onShutdown, // master
SW_SERVER_CB_onWorkerStart, // worker(event & task)
SW_SERVER_CB_onWorkerStop, // worker(event & task)
SW_SERVER_CB_onBeforeReload, // manager
SW_SERVER_CB_onAfterReload, // manager
SW_SERVER_CB_onTask, // worker(task)
SW_SERVER_CB_onFinish, // worker(event & task)
SW_SERVER_CB_onWorkerExit, // worker(event)
SW_SERVER_CB_onWorkerError, // manager
SW_SERVER_CB_onManagerStart, // manager
SW_SERVER_CB_onManagerStop, // manager
SW_SERVER_CB_onPipeMessage, // worker(event & task)
};
//--------------------------------------------------------
enum php_swoole_server_port_callback_type {
SW_SERVER_CB_onConnect, // stream, worker(event)
SW_SERVER_CB_onReceive, // stream, worker(event)
SW_SERVER_CB_onClose, // stream, worker(event)
SW_SERVER_CB_onPacket, // dgram, worker(event)
SW_SERVER_CB_onRequest, // http, worker(event)
SW_SERVER_CB_onHandshake, // websocket, worker(event)
SW_SERVER_CB_onBeforeHandshakeResponse, // websocket, worker(event)
SW_SERVER_CB_onOpen, // websocket, worker(event)
SW_SERVER_CB_onMessage, // websocket, worker(event)
SW_SERVER_CB_onDisconnect, // websocket (non websocket connection), worker(event)
SW_SERVER_CB_onBufferFull, // worker(event)
SW_SERVER_CB_onBufferEmpty, // worker(event)
};
#define PHP_SWOOLE_SERVER_CALLBACK_NUM (SW_SERVER_CB_onPipeMessage + 1)
#define PHP_SWOOLE_SERVER_PORT_CALLBACK_NUM (SW_SERVER_CB_onBufferEmpty + 1)
namespace swoole {
struct TaskCo;
struct ServerPortProperty {
zval *callbacks[PHP_SWOOLE_SERVER_PORT_CALLBACK_NUM];
zend_fcall_info_cache *caches[PHP_SWOOLE_SERVER_PORT_CALLBACK_NUM];
zval _callbacks[PHP_SWOOLE_SERVER_PORT_CALLBACK_NUM];
Server *serv;
ListenPort *port;
zval *zsetting;
};
struct ServerProperty {
std::vector<zval *> ports;
std::vector<zval *> user_processes;
ServerPortProperty *primary_port;
zend_fcall_info_cache *callbacks[PHP_SWOOLE_SERVER_CALLBACK_NUM];
std::unordered_map<TaskId, zend_fcall_info_cache> task_callbacks;
std::unordered_map<TaskId, TaskCo *> task_coroutine_map;
std::unordered_map<SessionId, std::list<Coroutine *> *> send_coroutine_map;
std::vector<zend_fcall_info_cache *> command_callbacks;
};
struct ServerObject {
Server *serv;
ServerProperty *property;
zend_object std;
zend_class_entry *get_ce() {
return Z_OBJCE_P(get_object());
}
zval *get_object() {
return (zval *) serv->private_data_2;
}
bool isset_callback(ListenPort *port, int event_type) {
ServerPortProperty *port_property = (ServerPortProperty *) port->ptr;
return (port_property->callbacks[event_type] || property->primary_port->callbacks[event_type]);
}
zend_bool is_websocket_server() {
return instanceof_function(get_ce(), swoole_websocket_server_ce);
}
zend_bool is_http_server() {
return instanceof_function(get_ce(), swoole_http_server_ce);
}
zend_bool is_redis_server() {
return instanceof_function(get_ce(), swoole_redis_server_ce);
}
void register_callback();
void on_before_start();
};
struct TaskCo {
Coroutine *co;
int *list;
uint32_t count;
zval *result;
};
void register_admin_server_commands(Server *serv);
} // namespace swoole
void php_swoole_server_register_callbacks(swServer *serv);
zend_fcall_info_cache *php_swoole_server_get_fci_cache(swServer *serv, int server_fd, int event_type);
int php_swoole_create_dir(const char *path, size_t length);
void php_swoole_server_before_start(swServer *serv, zval *zobject);
bool php_swoole_server_isset_callback(swServer *serv, swListenPort *port, int event_type);
void php_swoole_server_send_yield(swServer *serv, swoole::SessionId sesion_id, zval *zdata, zval *return_value);
void php_swoole_get_recv_data(swServer *serv, zval *zdata, swRecvData *req);
void php_swoole_server_onConnect(swServer *, swDataHead *);
int php_swoole_server_onReceive(swServer *, swRecvData *);
int php_swoole_http_server_onReceive(swServer *, swRecvData *);
void php_swoole_http_server_onClose(swServer *serv, swDataHead *info);
int php_swoole_redis_server_onReceive(swServer *serv, swRecvData *req);
int php_swoole_server_onPacket(swServer *, swRecvData *);
void php_swoole_server_onClose(swServer *, swDataHead *);
void php_swoole_server_onBufferFull(swServer *, swDataHead *);
void php_swoole_server_onBufferEmpty(swServer *, swDataHead *);
swServer *php_swoole_server_get_and_check_server(zval *zobject);
void php_swoole_server_port_deref(zend_object *object);
swoole::ServerObject *php_swoole_server_get_zend_object(swoole::Server *serv);
zval *php_swoole_server_get_zval_object(swoole::Server *serv);
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| php_swoole_call_stack.h | File | 1.82 KB | 0644 |
|
| php_swoole_client.h | File | 1.35 KB | 0644 |
|
| php_swoole_coroutine.h | File | 9.79 KB | 0644 |
|
| php_swoole_coroutine_system.h | File | 1.88 KB | 0644 |
|
| php_swoole_curl.h | File | 4.86 KB | 0644 |
|
| php_swoole_cxx.h | File | 20.89 KB | 0644 |
|
| php_swoole_http.h | File | 13.29 KB | 0644 |
|
| php_swoole_http_server.h | File | 3.75 KB | 0644 |
|
| php_swoole_library.h | File | 370.72 KB | 0644 |
|
| php_swoole_mysql_proto.h | File | 31.42 KB | 0644 |
|
| php_swoole_odbc.h | File | 5.67 KB | 0644 |
|
| php_swoole_oracle.h | File | 3.33 KB | 0644 |
|
| php_swoole_pgsql.h | File | 2.6 KB | 0644 |
|
| php_swoole_private.h | File | 43 KB | 0644 |
|
| php_swoole_process.h | File | 1.34 KB | 0644 |
|
| php_swoole_server.h | File | 6.3 KB | 0644 |
|
| php_swoole_sqlite.h | File | 2.58 KB | 0644 |
|