Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
31ed46cd
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,发现更多精彩内容 >>
提交
31ed46cd
编写于
4月 24, 2018
作者:
K
Kevin Heifner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move message_buffer to fc library
上级
3816e47b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
9 deletion
+9
-9
libraries/fc/include/fc/network/message_buffer.hpp
libraries/fc/include/fc/network/message_buffer.hpp
+2
-2
plugins/net_plugin/net_plugin.cpp
plugins/net_plugin/net_plugin.cpp
+2
-2
unittests/message_buffer_tests.cpp
unittests/message_buffer_tests.cpp
+5
-5
未找到文件。
plugins/net_plugin/include/eosio/net_plugin
/message_buffer.hpp
→
libraries/fc/include/fc/network
/message_buffer.hpp
浏览文件 @
31ed46cd
...
...
@@ -9,7 +9,7 @@
#include <deque>
#include <array>
namespace
eosio
{
namespace
fc
{
template
<
uint32_t
buffer_len
>
class
mb_datastream
;
...
...
@@ -299,4 +299,4 @@ namespace eosio {
return
mb_datastream
<
buffer_len
>
(
*
this
);
}
}
// namespace
eosio
}
// namespace
fc
plugins/net_plugin/net_plugin.cpp
浏览文件 @
31ed46cd
...
...
@@ -6,7 +6,6 @@
#include <eosio/net_plugin/net_plugin.hpp>
#include <eosio/net_plugin/protocol.hpp>
#include <eosio/net_plugin/message_buffer.hpp>
#include <eosio/chain/chain_controller.hpp>
#include <eosio/chain/exceptions.hpp>
#include <eosio/chain/block.hpp>
...
...
@@ -14,6 +13,7 @@
#include <eosio/utilities/key_conversion.hpp>
#include <eosio/chain/contracts/types.hpp>
#include <fc/network/message_buffer.hpp>
#include <fc/network/ip.hpp>
#include <fc/io/json.hpp>
#include <fc/io/raw.hpp>
...
...
@@ -399,7 +399,7 @@ namespace eosio {
optional
<
sync_state
>
peer_requested
;
// this peer is requesting info from us
socket_ptr
socket
;
message_buffer
<
1024
*
1024
>
pending_message_buffer
;
fc
::
message_buffer
<
1024
*
1024
>
pending_message_buffer
;
vector
<
char
>
blk_buffer
;
struct
queued_write
{
...
...
unittests/message_buffer_tests.cpp
浏览文件 @
31ed46cd
...
...
@@ -3,7 +3,7 @@
* @copyright defined in eos/LICENSE.txt
*/
#include <
eosio/net_plugin
/message_buffer.hpp>
#include <
fc/network
/message_buffer.hpp>
#include <boost/test/unit_test.hpp>
#include <iostream>
...
...
@@ -36,7 +36,7 @@ constexpr auto def_buffer_size = 1024*1024*def_buffer_size_mb;
BOOST_AUTO_TEST_CASE
(
message_buffer_construction
)
{
try
{
eosio
::
message_buffer
<
def_buffer_size
>
mb
;
fc
::
message_buffer
<
def_buffer_size
>
mb
;
BOOST_CHECK_EQUAL
(
mb
.
total_bytes
(),
def_buffer_size
);
BOOST_CHECK_EQUAL
(
mb
.
bytes_to_write
(),
def_buffer_size
);
BOOST_CHECK_EQUAL
(
mb
.
bytes_to_read
(),
0
);
...
...
@@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE(message_buffer_construction)
BOOST_AUTO_TEST_CASE
(
message_buffer_growth
)
{
try
{
eosio
::
message_buffer
<
def_buffer_size
>
mb
;
fc
::
message_buffer
<
def_buffer_size
>
mb
;
mb
.
add_buffer_to_chain
();
BOOST_CHECK_EQUAL
(
mb
.
total_bytes
(),
2
*
def_buffer_size
);
BOOST_CHECK_EQUAL
(
mb
.
bytes_to_write
(),
2
*
def_buffer_size
);
...
...
@@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE(message_buffer_peek_read)
try
{
{
const
uint32_t
small
=
32
;
eosio
::
message_buffer
<
small
>
mb
;
fc
::
message_buffer
<
small
>
mb
;
BOOST_CHECK_EQUAL
(
mb
.
total_bytes
(),
small
);
BOOST_CHECK_EQUAL
(
mb
.
bytes_to_write
(),
small
);
BOOST_CHECK_EQUAL
(
mb
.
bytes_to_read
(),
0
);
...
...
@@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE(message_buffer_write_ptr_to_end)
try
{
{
const
uint32_t
small
=
32
;
eosio
::
message_buffer
<
small
>
mb
;
fc
::
message_buffer
<
small
>
mb
;
BOOST_CHECK_EQUAL
(
mb
.
total_bytes
(),
small
);
BOOST_CHECK_EQUAL
(
mb
.
bytes_to_write
(),
small
);
BOOST_CHECK_EQUAL
(
mb
.
bytes_to_read
(),
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录