Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
350b8333
提交
350b8333
authored
11月 07, 2014
作者:
Juan Batiz-Benet
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #277 from jbenet/fuse-fix
Fix buffer size bug in fuse mounts
上级
3155fa2c
387d0a93
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
22 行增加
和
10 行删除
+22
-10
ipns_test.go
fuse/ipns/ipns_test.go
+0
-5
ipns_unix.go
fuse/ipns/ipns_unix.go
+3
-0
readonly_unix.go
fuse/readonly/readonly_unix.go
+9
-2
t0040-add-and-cat.sh
test/t0040-add-and-cat.sh
+3
-3
dagmodifier.go
unixfs/io/dagmodifier.go
+7
-0
没有找到文件。
fuse/ipns/ipns_test.go
浏览文件 @
350b8333
...
...
@@ -5,7 +5,6 @@ import (
"crypto/rand"
"io/ioutil"
"os"
"runtime"
"strings"
"testing"
"time"
...
...
@@ -300,10 +299,6 @@ func TestFastRepublish(t *testing.T) {
// Test writing a medium sized file one byte at a time
func
TestMultiWrite
(
t
*
testing
.
T
)
{
if
runtime
.
GOOS
==
"darwin"
{
link
:=
"https://github.com/jbenet/go-ipfs/issues/147"
t
.
Skipf
(
"Skipping as is broken in OSX. See %s"
,
link
)
}
_
,
mnt
:=
setupIpnsTest
(
t
,
nil
)
defer
mnt
.
Close
()
...
...
fuse/ipns/ipns_unix.go
浏览文件 @
350b8333
...
...
@@ -232,6 +232,9 @@ func (s *Node) Attr() fuse.Attr {
log
.
Errorf
(
"Error getting size of file: %s"
,
err
)
size
=
0
}
if
size
==
0
{
size
=
s
.
dagMod
.
Size
()
}
return
fuse
.
Attr
{
Mode
:
0666
,
Size
:
size
,
...
...
fuse/readonly/readonly_unix.go
浏览文件 @
350b8333
...
...
@@ -98,13 +98,20 @@ func (s *Node) Attr() fuse.Attr {
switch
s
.
cached
.
GetType
()
{
case
ftpb
.
Data_Directory
:
return
fuse
.
Attr
{
Mode
:
os
.
ModeDir
|
0555
}
case
ftpb
.
Data_File
,
ftpb
.
Data_Raw
:
size
,
_
:=
s
.
Nd
.
S
ize
()
case
ftpb
.
Data_File
:
size
:=
s
.
cached
.
GetFiles
ize
()
return
fuse
.
Attr
{
Mode
:
0444
,
Size
:
uint64
(
size
),
Blocks
:
uint64
(
len
(
s
.
Nd
.
Links
)),
}
case
ftpb
.
Data_Raw
:
return
fuse
.
Attr
{
Mode
:
0444
,
Size
:
uint64
(
len
(
s
.
cached
.
GetData
())),
Blocks
:
uint64
(
len
(
s
.
Nd
.
Links
)),
}
default
:
log
.
Error
(
"Invalid data type."
)
return
fuse
.
Attr
{}
...
...
test/t0040-add-and-cat.sh
浏览文件 @
350b8333
...
...
@@ -48,7 +48,7 @@ test_expect_success "generate 100MB file using go-random" '
test_expect_success
"sha1 of the file looks ok"
'
echo "54dc0dbbc353b2ffb745285793f89af0c9d98449 mountdir/bigfile" >sha1_expected &&
sha
1
sum mountdir/bigfile >sha1_actual &&
shasum mountdir/bigfile >sha1_actual &&
test_cmp sha1_expected sha1_actual
'
...
...
@@ -63,7 +63,7 @@ test_expect_success "ipfs add bigfile output looks good" '
'
test_expect_success
"ipfs cat succeeds"
'
ipfs cat $HASH | sha
1
sum >sha1_actual
ipfs cat $HASH | shasum >sha1_actual
'
test_expect_success
"ipfs cat output looks good"
'
...
...
@@ -72,7 +72,7 @@ test_expect_success "ipfs cat output looks good" '
'
test_expect_success
"cat ipfs/bigfile succeeds"
'
cat ipfs/$HASH | sha
1
sum >sha1_actual
cat ipfs/$HASH | shasum >sha1_actual
'
test_expect_success
"cat ipfs/bigfile looks good"
'
...
...
unixfs/io/dagmodifier.go
浏览文件 @
350b8333
...
...
@@ -173,6 +173,13 @@ func (dm *DagModifier) WriteAt(b []byte, offset uint64) (int, error) {
return
origlen
,
nil
}
func
(
dm
*
DagModifier
)
Size
()
uint64
{
if
dm
==
nil
{
return
0
}
return
dm
.
pbdata
.
GetFilesize
()
}
// splitBytes uses a splitterFunc to turn a large array of bytes
// into many smaller arrays of bytes
func
splitBytes
(
b
[]
byte
,
spl
chunk
.
BlockSplitter
)
[][]
byte
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论