Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-unixfs
Commits
976fe94d
Commit
976fe94d
authored
Sep 10, 2014
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some more tweaks to the daemon code
parent
b2a21881
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
daemon/daemon.go
daemon/daemon.go
+14
-0
daemon/daemon_client.go
daemon/daemon_client.go
+2
-1
No files found.
daemon/daemon.go
View file @
976fe94d
...
...
@@ -124,6 +124,20 @@ func ExecuteCommand(com *Command, n *core.IpfsNode, out io.Writer) {
fmt
.
Fprintf
(
out
,
"%s %d %s
\n
"
,
link
.
Hash
.
B58String
(),
link
.
Size
,
link
.
Name
)
}
}
case
"pin"
:
for
_
,
fn
:=
range
com
.
Args
{
nd
,
err
:=
n
.
Resolver
.
ResolvePath
(
fn
)
if
err
!=
nil
{
fmt
.
Fprintf
(
out
,
"pin: %v
\n
"
,
err
)
return
}
err
=
n
.
PinDagNode
(
nd
)
if
err
!=
nil
{
fmt
.
Fprintf
(
out
,
"pin: %v
\n
"
,
err
)
return
}
}
default
:
fmt
.
Fprintf
(
out
,
"Invalid Command: '%s'
\n
"
,
com
.
Command
)
}
...
...
daemon/daemon_client.go
View file @
976fe94d
...
...
@@ -5,10 +5,11 @@ import (
"io"
"net"
"os"
"time"
)
func
SendCommand
(
com
*
Command
,
server
string
)
error
{
con
,
err
:=
net
.
Dial
(
"tcp"
,
server
)
con
,
err
:=
net
.
Dial
Timeout
(
"tcp"
,
server
,
time
.
Millisecond
*
300
)
if
err
!=
nil
{
return
err
}
...
...
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