mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-02 20:08:21 +08:00
fixed some compile error
This commit is contained in:
parent
a8ffa2a556
commit
643609a33a
@ -63,7 +63,7 @@ void service_exit(void *arg acl_unused)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 协议处理函数入口 */
|
/* 协议处理函数入口 */
|
||||||
int service_main(ACL_VSTREAM *client, void *run_ctx acl_unused)
|
int service_main(void *run_ctx acl_unused, ACL_VSTREAM *client)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -39,10 +39,10 @@ extern void service_exit(void *exit_ctx);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 协议处理函数入口
|
* 协议处理函数入口
|
||||||
* @param stream {ACL_VSTREAM*} 客户端数据连接流
|
|
||||||
* @param run_ctx {void*} 用户自定义类型指针
|
* @param run_ctx {void*} 用户自定义类型指针
|
||||||
|
* @param stream {ACL_VSTREAM*} 客户端数据连接流
|
||||||
*/
|
*/
|
||||||
extern int service_main(ACL_VSTREAM *stream, void *run_ctx);
|
extern int service_main(void *run_ctx, ACL_VSTREAM *stream);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ static void on_close(ACL_VSTREAM *client, void *arg)
|
|||||||
acl_myfree(ctx);
|
acl_myfree(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
int service_on_accept(ACL_VSTREAM *client)
|
int service_on_accept(void *arg acl_unused, ACL_VSTREAM *client)
|
||||||
{
|
{
|
||||||
MY_CTX *ctx = (MY_CTX*) client->context;
|
MY_CTX *ctx = (MY_CTX*) client->context;
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ int service_on_accept(ACL_VSTREAM *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 协议处理函数入口 */
|
/* 协议处理函数入口 */
|
||||||
int service_main(ACL_VSTREAM *client, void *run_ctx acl_unused)
|
int service_main(void *run_ctx acl_unused, ACL_VSTREAM *client)
|
||||||
{
|
{
|
||||||
const char *myname = "service_main";
|
const char *myname = "service_main";
|
||||||
int ret, ready;
|
int ret, ready;
|
||||||
|
@ -25,14 +25,14 @@ extern void service_exit(void *exit_ctx);
|
|||||||
* @param stream {ACL_VSTREAM*} 客户端数据连接流
|
* @param stream {ACL_VSTREAM*} 客户端数据连接流
|
||||||
* @return {int} 如果返回值 < 0, 则表示服务器希望关闭该连接
|
* @return {int} 如果返回值 < 0, 则表示服务器希望关闭该连接
|
||||||
*/
|
*/
|
||||||
extern int service_on_accept(ACL_VSTREAM *client);
|
extern int service_on_accept(void *ctx, ACL_VSTREAM *client);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 协议处理函数入口
|
* 协议处理函数入口
|
||||||
* @param stream {ACL_VSTREAM*} 客户端数据连接流
|
* @param stream {ACL_VSTREAM*} 客户端数据连接流
|
||||||
* @param run_ctx {void*} 用户自定义类型指针
|
* @param run_ctx {void*} 用户自定义类型指针
|
||||||
*/
|
*/
|
||||||
extern int service_main(ACL_VSTREAM *stream, void *run_ctx);
|
extern int service_main(void *run_ctx, ACL_VSTREAM *stream);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ void service_exit(void *arg acl_unused)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 协议处理函数入口 */
|
/* 协议处理函数入口 */
|
||||||
int service_main(ACL_VSTREAM *client, void *run_ctx acl_unused)
|
int service_main(void *run_ctx acl_unused, ACL_VSTREAM *client)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -39,10 +39,10 @@ extern void service_exit(void *exit_ctx);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 协议处理函数入口
|
* 协议处理函数入口
|
||||||
* @param stream {ACL_VSTREAM*} 客户端数据连接流
|
|
||||||
* @param run_ctx {void*} 用户自定义类型指针
|
* @param run_ctx {void*} 用户自定义类型指针
|
||||||
|
* @param stream {ACL_VSTREAM*} 客户端数据连接流
|
||||||
*/
|
*/
|
||||||
extern int service_main(ACL_VSTREAM *stream, void *run_ctx);
|
extern int service_main(void *run_ctx, ACL_VSTREAM *stream);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,7 @@ static ACL_CONFIG_STR_TABLE __conf_str_tab[] = {
|
|||||||
{ 0, 0, 0 },
|
{ 0, 0, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void __service(ACL_VSTREAM *stream, char *service acl_unused,
|
static void __service(void *ctx acl_unused, ACL_VSTREAM *stream)
|
||||||
char **argv acl_unused)
|
|
||||||
{
|
{
|
||||||
const char *myname = "__service";
|
const char *myname = "__service";
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
@ -107,24 +107,17 @@ static void __proxy_handle_fn(int type acl_unused, ACL_EVENT *event acl_unused,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __service(ACL_VSTREAM *stream, char *service, char **argv)
|
static void __service(void *ctx acl_unused, ACL_VSTREAM *stream)
|
||||||
{
|
{
|
||||||
const char *myname = "__service";
|
const char *myname = "__service";
|
||||||
char buf[64];
|
char buf[64];
|
||||||
int connect_retries = var_proxy_retries;
|
int connect_retries = var_proxy_retries;
|
||||||
|
|
||||||
/*
|
|
||||||
* Sanity check. This service takes no command-line arguments.
|
|
||||||
*/
|
|
||||||
if (argv[0])
|
|
||||||
acl_msg_fatal("%s(%d)->%s: unexpected command-line argument: %s",
|
|
||||||
__FILE__, __LINE__, myname, argv[0]);
|
|
||||||
|
|
||||||
__front_stream = stream;
|
__front_stream = stream;
|
||||||
|
|
||||||
if (var_proxy_log_level > 3)
|
if (var_proxy_log_level > 3)
|
||||||
acl_msg_info("%s(%d)->%s: service name = %s, rw_timeout = %d",
|
acl_msg_info("%s(%d)->%s: rw_timeout = %d",
|
||||||
__FILE__, __LINE__, myname, service, stream->rw_timeout);
|
__FILE__, __LINE__, myname, stream->rw_timeout);
|
||||||
|
|
||||||
(void) acl_getpeername(ACL_VSTREAM_SOCK(__front_stream),
|
(void) acl_getpeername(ACL_VSTREAM_SOCK(__front_stream),
|
||||||
buf, sizeof(buf));
|
buf, sizeof(buf));
|
||||||
|
@ -17,21 +17,10 @@ static ACL_CONFIG_STR_TABLE __conf_str_tab[] = {
|
|||||||
{ 0, 0, 0 },
|
{ 0, 0, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void __service(char *buf acl_unused, int len acl_unused,
|
static void __service(void *ctx acl_unused)
|
||||||
char *service, char **argv acl_unused)
|
|
||||||
{
|
{
|
||||||
const char *myname = "__service";
|
const char *myname = "__service";
|
||||||
|
|
||||||
/*
|
|
||||||
* Sanity check. This service takes no command-line arguments.
|
|
||||||
*/
|
|
||||||
if (argv[0])
|
|
||||||
acl_msg_fatal("%s(%d)->%s: unexpected command-line argument: %s",
|
|
||||||
__FILE__, __LINE__, myname, argv[0]);
|
|
||||||
|
|
||||||
acl_msg_info("%s(%d), %s: service name = %s, sleep %d, info: %s seconds now---",
|
|
||||||
__FILE__, __LINE__, myname, service,
|
|
||||||
var_cfg_sleep_time, var_cfg_dummy);
|
|
||||||
sleep(var_cfg_sleep_time);
|
sleep(var_cfg_sleep_time);
|
||||||
acl_msg_info("%s: wakeup now", myname);
|
acl_msg_info("%s: wakeup now", myname);
|
||||||
if (var_cfg_create_core)
|
if (var_cfg_create_core)
|
||||||
|
@ -24,21 +24,20 @@ ACL_CONFIG_STR_TABLE __conf_str_tab[] = {
|
|||||||
{ 0, 0, 0 },
|
{ 0, 0, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void __pre_jail_init(char *name acl_unused, char **argv acl_unused)
|
static void __pre_jail_init(void *ctx acl_unused)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __post_jail_init(char *name acl_unused, char **argv acl_unused)
|
static void __post_jail_init(void *ctx acl_unused)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void service_exit(char *service acl_unused, char **argv acl_unused)
|
static void service_exit(void *ctx acl_unused)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 协议处理函数入口 */
|
/* 协议处理函数入口 */
|
||||||
static void service_main(ACL_VSTREAM *client, char *service acl_unused,
|
static void service_main(void *ctx acl_unused, ACL_VSTREAM *client)
|
||||||
char **argv acl_unused)
|
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
int ret;
|
int ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user