Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
a9d18e32
Commit
a9d18e32
authored
Dec 28, 2010
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
For debugging, print size in bytes of response instead.
parent
92f7e9a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
fuse/fuse.go
fuse/fuse.go
+16
-15
No files found.
fuse/fuse.go
View file @
a9d18e32
...
@@ -247,7 +247,7 @@ func (self *MountState) handle(in_data []byte) {
...
@@ -247,7 +247,7 @@ func (self *MountState) handle(in_data []byte) {
func
dispatch
(
state
*
MountState
,
h
*
InHeader
,
arg
*
bytes
.
Buffer
)
(
outBytes
[][]
byte
)
{
func
dispatch
(
state
*
MountState
,
h
*
InHeader
,
arg
*
bytes
.
Buffer
)
(
outBytes
[][]
byte
)
{
input
:=
newInput
(
h
.
Opcode
)
input
:=
newInput
(
h
.
Opcode
)
if
input
!=
nil
&&
!
parseLittleEndian
(
arg
,
input
)
{
if
input
!=
nil
&&
!
parseLittleEndian
(
arg
,
input
)
{
return
serialize
(
h
,
EIO
,
nil
)
return
serialize
(
h
,
EIO
,
nil
,
false
)
}
}
var
out
Empty
var
out
Empty
...
@@ -368,24 +368,13 @@ func dispatch(state *MountState, h *InHeader, arg *bytes.Buffer) (outBytes [][]b
...
@@ -368,24 +368,13 @@ func dispatch(state *MountState, h *InHeader, arg *bytes.Buffer) (outBytes [][]b
// case FUSE_INTERRUPT
// case FUSE_INTERRUPT
default
:
default
:
state
.
Error
(
os
.
NewError
(
fmt
.
Sprintf
(
"Unsupported OpCode: %d"
,
h
.
Opcode
)))
state
.
Error
(
os
.
NewError
(
fmt
.
Sprintf
(
"Unsupported OpCode: %d"
,
h
.
Opcode
)))
return
serialize
(
h
,
ENOSYS
,
nil
)
return
serialize
(
h
,
ENOSYS
,
nil
,
false
)
}
}
if
state
.
Debug
{
return
serialize
(
h
,
status
,
out
,
state
.
Debug
)
val
:=
fmt
.
Sprintf
(
"%v"
,
out
)
max
:=
1024
if
len
(
val
)
>
max
{
val
=
val
[
:
max
]
+
fmt
.
Sprintf
(
" ...dropped %d bytes"
,
len
(
val
)
-
max
)
}
log
.
Printf
(
"Serialize: %v code: %v value: %v
\n
"
,
operationName
(
h
.
Opcode
),
errorString
(
status
),
val
)
}
return
serialize
(
h
,
status
,
out
)
}
}
func
serialize
(
h
*
InHeader
,
res
Status
,
out
interface
{})
(
data
[][]
byte
)
{
func
serialize
(
h
*
InHeader
,
res
Status
,
out
interface
{}
,
debug
bool
)
(
data
[][]
byte
)
{
out_data
:=
make
([]
byte
,
0
)
out_data
:=
make
([]
byte
,
0
)
b
:=
new
(
bytes
.
Buffer
)
b
:=
new
(
bytes
.
Buffer
)
if
out
!=
nil
&&
res
==
OK
{
if
out
!=
nil
&&
res
==
OK
{
...
@@ -408,6 +397,18 @@ func serialize(h *InHeader, res Status, out interface{}) (data [][]byte) {
...
@@ -408,6 +397,18 @@ func serialize(h *InHeader, res Status, out interface{}) (data [][]byte) {
}
}
_
,
_
=
b
.
Write
(
out_data
)
_
,
_
=
b
.
Write
(
out_data
)
data
=
[][]
byte
{
b
.
Bytes
()}
data
=
[][]
byte
{
b
.
Bytes
()}
if
debug
{
val
:=
fmt
.
Sprintf
(
"%v"
,
out
)
max
:=
1024
if
len
(
val
)
>
max
{
val
=
val
[
:
max
]
+
fmt
.
Sprintf
(
" ...trimmed (response size %d)"
,
len
(
b
.
Bytes
()))
}
log
.
Printf
(
"Serialize: %v code: %v value: %v
\n
"
,
operationName
(
h
.
Opcode
),
errorString
(
res
),
val
)
}
return
data
return
data
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment