Commit 976fe94d authored by Jeromy's avatar Jeromy

some more tweaks to the daemon code

parent b2a21881
......@@ -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)
}
......
......@@ -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.DialTimeout("tcp", server, time.Millisecond*300)
if err != nil {
return err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment