Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
eb5a6057
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
eb5a6057
编写于
1月 25, 2018
作者:
P
Phil Mesnier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bringing over changes from the dawn 2.x branch to ensure no pending fixes are lost.
上级
7a0d099d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
15 deletion
+35
-15
plugins/net_plugin/net_plugin.cpp
plugins/net_plugin/net_plugin.cpp
+35
-15
未找到文件。
plugins/net_plugin/net_plugin.cpp
浏览文件 @
eb5a6057
...
@@ -793,12 +793,10 @@ namespace eosio {
...
@@ -793,12 +793,10 @@ namespace eosio {
}
}
void
connection
::
send_handshake
(
)
{
void
connection
::
send_handshake
(
)
{
handshake_message
hello
;
handshake_initializer
::
populate
(
last_handshake_sent
);
handshake_initializer
::
populate
(
hello
);
last_handshake_sent
.
generation
=
++
sent_handshake_count
;
hello
.
generation
=
++
sent_handshake_count
;
last_handshake_sent
=
hello
;
fc_dlog
(
logger
,
"Sending handshake to ${ep}"
,
(
"ep"
,
peer_addr
));
fc_dlog
(
logger
,
"Sending handshake to ${ep}"
,
(
"ep"
,
peer_addr
));
enqueue
(
hello
);
enqueue
(
last_handshake_sent
);
}
}
char
*
connection
::
convert_tstamp
(
const
tstamp
&
t
)
char
*
connection
::
convert_tstamp
(
const
tstamp
&
t
)
...
@@ -857,7 +855,13 @@ namespace eosio {
...
@@ -857,7 +855,13 @@ namespace eosio {
conn
->
write_depth
--
;
conn
->
write_depth
--
;
if
(
ec
)
{
if
(
ec
)
{
elog
(
"Error sending to connection: ${i}"
,
(
"i"
,
ec
.
message
()));
string
pname
=
conn
?
conn
->
peer_name
()
:
"no connection name"
;
if
(
ec
.
value
()
!=
boost
::
asio
::
error
::
eof
)
{
elog
(
"Error sending to peer ${p}: ${i}"
,
(
"p"
,
pname
)(
"i"
,
ec
.
message
()));
}
else
{
ilog
(
"connection closure detected on write to ${p}"
,(
"p"
,
pname
));
}
my_impl
->
close
(
conn
);
my_impl
->
close
(
conn
);
return
;
return
;
}
}
...
@@ -865,13 +869,19 @@ namespace eosio {
...
@@ -865,13 +869,19 @@ namespace eosio {
conn
->
do_queue_write
();
conn
->
do_queue_write
();
}
}
catch
(
const
std
::
exception
&
ex
)
{
catch
(
const
std
::
exception
&
ex
)
{
elog
(
"Exception in do_queue_write ${s}"
,
(
"s"
,
ex
.
what
()));
auto
conn
=
c
.
lock
();
string
pname
=
conn
?
conn
->
peer_name
()
:
"no connection name"
;
elog
(
"Exception in do_queue_write to ${p} ${s}"
,
(
"p"
,
pname
)(
"s"
,
ex
.
what
()));
}
}
catch
(
const
fc
::
exception
&
ex
)
{
catch
(
const
fc
::
exception
&
ex
)
{
elog
(
"Exception in do_queue_write ${s}"
,
(
"s"
,
ex
.
to_string
()));
auto
conn
=
c
.
lock
();
string
pname
=
conn
?
conn
->
peer_name
()
:
"no connection name"
;
elog
(
"Exception in do_queue_write to ${p} ${s}"
,
(
"p"
,
pname
)(
"s"
,
ex
.
to_string
()));
}
}
catch
(...)
{
catch
(...)
{
elog
(
"Exception in do_queue_write"
);
auto
conn
=
c
.
lock
();
string
pname
=
conn
?
conn
->
peer_name
()
:
"no connection name"
;
elog
(
"Exception in do_queue_write to ${p}"
,
(
"p"
,
pname
)
);
}
}
});
});
}
}
...
@@ -1409,26 +1419,35 @@ namespace eosio {
...
@@ -1409,26 +1419,35 @@ namespace eosio {
}
}
start_read_message
(
conn
);
start_read_message
(
conn
);
}
else
{
}
else
{
elog
(
"Error reading message from connection: ${m}"
,(
"m"
,
ec
.
message
()
)
);
auto
pname
=
conn
->
peer_name
();
if
(
ec
.
value
()
!=
boost
::
asio
::
error
::
eof
)
{
elog
(
"Error reading message from ${p}: ${m}"
,(
"p"
,
pname
)(
"m"
,
ec
.
message
()
)
);
}
else
{
ilog
(
"Peer ${p} closed connection"
,(
"p"
,
pname
)
);
}
close
(
conn
);
close
(
conn
);
}
}
}
}
catch
(
const
std
::
exception
&
ex
)
{
catch
(
const
std
::
exception
&
ex
)
{
elog
(
"Exception in handling read data ${s}"
,
(
"s"
,
ex
.
what
()));
string
pname
=
conn
?
conn
->
peer_name
()
:
"no connection name"
;
elog
(
"Exception in handling read data from ${p} ${s}"
,(
"p"
,
pname
)(
"s"
,
ex
.
what
()));
close
(
conn
);
close
(
conn
);
}
}
catch
(
const
fc
::
exception
&
ex
)
{
catch
(
const
fc
::
exception
&
ex
)
{
elog
(
"Exception in handling read data ${s}"
,
(
"s"
,
ex
.
to_string
()));
string
pname
=
conn
?
conn
->
peer_name
()
:
"no connection name"
;
elog
(
"Exception in handling read data ${s}"
,
(
"p"
,
pname
)(
"s"
,
ex
.
to_string
()));
close
(
conn
);
close
(
conn
);
}
}
catch
(...)
{
catch
(...)
{
elog
(
"Undefined exception hanlding the read data from connection: ${m}"
,(
"m"
,
ec
.
message
()
)
);
string
pname
=
conn
?
conn
->
peer_name
()
:
"no connection name"
;
elog
(
"Undefined exception hanlding the read data from connection ${p}"
,(
"p"
,
pname
));
close
(
conn
);
close
(
conn
);
}
}
}
}
);
);
}
catch
(...)
{
}
catch
(...)
{
elog
(
"Undefined exception handling reading"
);
string
pname
=
conn
?
conn
->
peer_name
()
:
"no connection name"
;
elog
(
"Undefined exception handling reading ${p}"
,(
"p"
,
pname
)
);
close
(
conn
);
close
(
conn
);
}
}
}
}
...
@@ -1620,6 +1639,7 @@ namespace eosio {
...
@@ -1620,6 +1639,7 @@ namespace eosio {
void
net_plugin_impl
::
handle_message
(
connection_ptr
c
,
const
go_away_message
&
msg
)
{
void
net_plugin_impl
::
handle_message
(
connection_ptr
c
,
const
go_away_message
&
msg
)
{
string
rsn
=
reason_str
(
msg
.
reason
);
string
rsn
=
reason_str
(
msg
.
reason
);
ilog
(
"received a go away message, reason = ${r}"
,(
"r"
,
rsn
));
c
->
no_retry
=
msg
.
reason
;
c
->
no_retry
=
msg
.
reason
;
if
(
msg
.
reason
==
go_away_reason
::
duplicate
)
{
if
(
msg
.
reason
==
go_away_reason
::
duplicate
)
{
c
->
node_id
=
msg
.
node_id
;
c
->
node_id
=
msg
.
node_id
;
...
@@ -2300,7 +2320,7 @@ namespace eosio {
...
@@ -2300,7 +2320,7 @@ namespace eosio {
// If we couldn't sign, don't send a token.
// If we couldn't sign, don't send a token.
if
(
hello
.
sig
==
chain
::
signature_type
())
if
(
hello
.
sig
==
chain
::
signature_type
())
hello
.
token
=
sha256
();
hello
.
token
=
sha256
();
hello
.
p2p_address
=
my_impl
->
p2p_address
;
hello
.
p2p_address
=
my_impl
->
p2p_address
+
" - "
+
hello
.
node_id
.
str
().
substr
(
0
,
7
)
;
#if defined( __APPLE__ )
#if defined( __APPLE__ )
hello
.
os
=
"osx"
;
hello
.
os
=
"osx"
;
#elif defined( __linux__ )
#elif defined( __linux__ )
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录