Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
accel-ppp
提交
e95fc28b
A
accel-ppp
项目概览
Achou.Wang
/
accel-ppp
通知
6
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
accel-ppp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e95fc28b
编写于
11月 16, 2010
作者:
K
Kozlov Dmitry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
log-tcp: fixed incorrect queue overflow handling
ppp: fixed memory leak when ipcp raises error at ConfReq
上级
50881d86
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
36 addition
and
15 deletion
+36
-15
accel-pptpd/cli/std_cmd.c
accel-pptpd/cli/std_cmd.c
+2
-2
accel-pptpd/cli/tcp.c
accel-pptpd/cli/tcp.c
+1
-0
accel-pptpd/cli/telnet.c
accel-pptpd/cli/telnet.c
+1
-0
accel-pptpd/logs/log_tcp.c
accel-pptpd/logs/log_tcp.c
+5
-1
accel-pptpd/ppp/ppp.c
accel-pptpd/ppp/ppp.c
+7
-1
accel-pptpd/ppp/ppp.h
accel-pptpd/ppp/ppp.h
+1
-0
accel-pptpd/ppp/ppp_ipcp.c
accel-pptpd/ppp/ppp_ipcp.c
+3
-1
accel-pptpd/triton/triton.c
accel-pptpd/triton/triton.c
+14
-10
accel-pptpd/triton/triton.h
accel-pptpd/triton/triton.h
+1
-0
accel-pptpd/triton/triton_p.h
accel-pptpd/triton/triton_p.h
+1
-0
未找到文件。
accel-pptpd/cli/std_cmd.c
浏览文件 @
e95fc28b
...
...
@@ -112,12 +112,12 @@ static void show_ses_help(char * const *fields, int fields_cnt, void *client)
static
void
ppp_terminate_soft
(
struct
ppp_t
*
ppp
)
{
ppp_terminate
(
ppp
,
0
,
TERM_ADMIN_RESET
);
ppp_terminate
(
ppp
,
TERM_ADMIN_RESET
,
0
);
}
static
void
ppp_terminate_hard
(
struct
ppp_t
*
ppp
)
{
ppp_terminate
(
ppp
,
1
,
TERM_ADMIN_RESET
);
ppp_terminate
(
ppp
,
TERM_ADMIN_RESET
,
1
);
}
static
void
terminate_help
(
char
*
const
*
fields
,
int
fields_cnt
,
void
*
client
);
...
...
accel-pptpd/cli/tcp.c
浏览文件 @
e95fc28b
...
...
@@ -332,6 +332,7 @@ static void start_server(const char *host, int port)
addr
.
sin_addr
.
s_addr
=
inet_addr
(
host
);
triton_context_register
(
&
serv_ctx
,
NULL
);
triton_context_set_priority
(
&
serv_ctx
,
1
);
triton_md_register_handler
(
&
serv_ctx
,
&
serv_hnd
);
triton_md_enable_handler
(
&
serv_hnd
,
MD_MODE_READ
);
triton_context_wakeup
(
&
serv_ctx
);
...
...
accel-pptpd/cli/telnet.c
浏览文件 @
e95fc28b
...
...
@@ -621,6 +621,7 @@ static void start_server(const char *host, int port)
addr
.
sin_addr
.
s_addr
=
inet_addr
(
host
);
triton_context_register
(
&
serv_ctx
,
NULL
);
triton_context_set_priority
(
&
serv_ctx
,
1
);
triton_md_register_handler
(
&
serv_ctx
,
&
serv_hnd
);
triton_md_enable_handler
(
&
serv_hnd
,
MD_MODE_READ
);
triton_context_wakeup
(
&
serv_ctx
);
...
...
accel-pptpd/logs/log_tcp.c
浏览文件 @
e95fc28b
...
...
@@ -111,6 +111,7 @@ static void queue_log(struct tcp_target_t *t, struct log_msg_t *msg)
if
(
t
->
queue_len
==
conf_queue_len
)
{
spin_unlock
(
&
t
->
lock
);
log_free_msg
(
msg
);
return
;
}
list_add_tail
(
&
msg
->
entry
,
&
t
->
queue
);
t
->
queue_len
++
;
...
...
@@ -182,7 +183,8 @@ static int log_tcp_connect(struct triton_md_handler_t *h)
t
->
wait
=
1
;
spin_unlock
(
&
t
->
lock
);
send_log
(
t
);
if
(
send_log
(
t
))
triton_md_enable_handler
(
&
t
->
hnd
,
MD_MODE_WRITE
);
return
0
;
}
...
...
@@ -258,6 +260,8 @@ static int start_log(const char *_opt)
INIT_LIST_HEAD
(
&
t
->
queue
);
spinlock_init
(
&
t
->
lock
);
start_connect
(
t
);
log_register_target
(
&
t
->
target
);
...
...
accel-pptpd/ppp/ppp.c
浏览文件 @
e95fc28b
...
...
@@ -210,6 +210,8 @@ static void destablish_ppp(struct ppp_t *ppp)
_free_layers
(
ppp
);
ppp
->
terminated
=
1
;
log_ppp_debug
(
"ppp destablished
\n
"
);
triton_event_fire
(
EV_PPP_FINISHED
,
ppp
);
...
...
@@ -411,7 +413,11 @@ void __export ppp_terminate(struct ppp_t *ppp, int cause, int hard)
struct
ppp_layer_data_t
*
d
;
int
s
=
0
;
time
(
&
ppp
->
stop_time
);
if
(
ppp
->
terminated
)
return
;
if
(
!
ppp
->
stop_time
)
time
(
&
ppp
->
stop_time
);
if
(
!
ppp
->
terminate_cause
)
ppp
->
terminate_cause
=
cause
;
...
...
accel-pptpd/ppp/ppp.h
浏览文件 @
e95fc28b
...
...
@@ -98,6 +98,7 @@ struct ppp_t
struct
ppp_ctrl_t
*
ctrl
;
int
terminating
:
1
;
int
terminated
:
1
;
int
terminate_cause
;
void
*
chan_buf
;
...
...
accel-pptpd/ppp/ppp_ipcp.c
浏览文件 @
e95fc28b
...
...
@@ -579,8 +579,10 @@ static void ipcp_recv(struct ppp_handler_t*h)
switch
(
hdr
->
code
)
{
case
CONFREQ
:
r
=
ipcp_recv_conf_req
(
ipcp
,(
uint8_t
*
)(
hdr
+
1
),
ntohs
(
hdr
->
len
)
-
PPP_HDRLEN
);
if
(
ipcp
->
ppp
->
stop_time
)
if
(
ipcp
->
ppp
->
stop_time
)
{
ipcp_free_conf_req
(
ipcp
);
return
;
}
switch
(
r
)
{
case
IPCP_OPT_ACK
:
ppp_fsm_recv_conf_req_ack
(
&
ipcp
->
fsm
);
...
...
accel-pptpd/triton/triton.c
浏览文件 @
e95fc28b
...
...
@@ -205,7 +205,10 @@ int triton_queue_ctx(struct _triton_context_t *ctx)
spin_lock
(
&
threads_lock
);
if
(
list_empty
(
&
sleep_threads
))
{
list_add_tail
(
&
ctx
->
entry2
,
&
ctx_queue
);
if
(
ctx
->
priority
)
list_add
(
&
ctx
->
entry2
,
&
ctx_queue
);
else
list_add_tail
(
&
ctx
->
entry2
,
&
ctx_queue
);
spin_unlock
(
&
threads_lock
);
ctx
->
queued
=
1
;
//printf("ctx %p: queued\n", ctx);
...
...
@@ -318,6 +321,13 @@ void __export triton_context_unregister(struct triton_context_t *ud)
}
}
void
__export
triton_context_set_priority
(
struct
triton_context_t
*
ud
,
int
prio
)
{
struct
_triton_context_t
*
ctx
=
(
struct
_triton_context_t
*
)
ud
->
tpd
;
ctx
->
priority
=
prio
>
0
;
}
void
__export
triton_context_schedule
(
struct
triton_context_t
*
ud
)
{
struct
_triton_context_t
*
ctx
=
(
struct
_triton_context_t
*
)
ud
->
tpd
;
...
...
@@ -333,16 +343,10 @@ void __export triton_context_schedule(struct triton_context_t *ud)
ctx
->
thread
=
NULL
;
spin_unlock
(
&
ctx
->
lock
);
while
(
1
)
{
if
(
swapcontext
(
&
ctx
->
uctx
,
uctx
))
{
if
(
errno
==
EINTR
)
continue
;
triton_log_error
(
"swaswpntext: %s
\n
"
,
strerror
(
errno
));
}
else
break
;
}
__sync_fetch_and_add
(
&
triton_stat
.
context_sleeping
,
1
);
if
(
swapcontext
(
&
ctx
->
uctx
,
uctx
))
triton_log_error
(
"swaswpntext: %s
\n
"
,
strerror
(
errno
));
}
void
triton_context_print
(
void
)
...
...
accel-pptpd/triton/triton.h
浏览文件 @
e95fc28b
...
...
@@ -68,6 +68,7 @@ struct triton_stat_t
extern
struct
triton_stat_t
triton_stat
;
int
triton_context_register
(
struct
triton_context_t
*
,
void
*
arg
);
void
triton_context_unregister
(
struct
triton_context_t
*
);
void
triton_context_set_priority
(
struct
triton_context_t
*
,
int
);
void
triton_context_schedule
(
struct
triton_context_t
*
);
int
triton_context_wakeup
(
struct
triton_context_t
*
);
int
triton_context_call
(
struct
triton_context_t
*
,
void
(
*
func
)(
void
*
),
void
*
arg
);
...
...
accel-pptpd/triton/triton_p.h
浏览文件 @
e95fc28b
...
...
@@ -44,6 +44,7 @@ struct _triton_context_t
int
need_close
:
1
;
int
need_free
:
1
;
int
pending
:
1
;
int
priority
:
1
;
struct
triton_context_t
*
ud
;
void
*
bf_arg
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录