diff options
-rw-r--r-- | ipfs.dpi.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ipfs.dpi.go b/ipfs.dpi.go index 85ce02e..1c4b443 100644 --- a/ipfs.dpi.go +++ b/ipfs.dpi.go @@ -63,6 +63,7 @@ func handleTag(conn net.Conn, reader *bufio.Reader) error { switch cmd { case "auth": return handleAuth(conn, tag.Props["msg"]) case "open_url": return handleOpenUrl(conn, tag.Props["url"]) + case "DpiBye": return handleDpiBye(conn) default: return fmt.Errorf("unhandled cmd \"%s\"\n", cmd) } } @@ -102,6 +103,12 @@ func handleOpenUrl(conn net.Conn, url_str string) error { } } +func handleDpiBye(conn net.Conn) error { + fmt.Fprintf(os.Stderr, "[ipfs dpi]: Stopping\n") + os.Exit(0) + return nil +} + func escapeDpiValue(str string) string { return strings.Replace(str, "'", "''", -1) } @@ -261,7 +268,3 @@ func readProperty(reader *bufio.Reader) (string, string, error) { return string(key_bytes), string(value_bytes), nil } - -// <cmd='auth' msg='a20a4710' '> -// <cmd='open_url' url='ipfs://asdasdas/''asdasd/asdad>aasd' '> - |