diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-08-07 17:21:20 -0700 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-08-07 17:21:20 -0700 |
commit | 4e8feaf569e6ca2bcd23167eaec2f4805a8ab41b (patch) | |
tree | 589980030acf9acec8f4cbcd6af315232cba0b8c /ipfs.dpi.go | |
parent | 498bb4517a080caafba950198a787dd2893b2a37 (diff) |
Handle DpiBye
Diffstat (limited to 'ipfs.dpi.go')
-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' '> - |