unbreak socket comms
This commit is contained in:
parent
02bd84893d
commit
13cad25620
|
@ -30,6 +30,7 @@ func runRun(cmd *Command, args ...string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
s, err := net.Dial(warren.CmdSockType(), warren.CmdSockAddr())
|
s, err := net.Dial(warren.CmdSockType(), warren.CmdSockAddr())
|
||||||
|
defer s.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error connecting to warrend:", err)
|
log.Fatal("Error connecting to warrend:", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ func ReadStringz(c net.Conn) (string, error) {
|
||||||
data := ""
|
data := ""
|
||||||
buf := make([]byte, 1024) // Max size of buff based on?
|
buf := make([]byte, 1024) // Max size of buff based on?
|
||||||
|
|
||||||
for len(data) > 0 && data[len(data)-1] == 0 {
|
for len(data) == 0 || byte(data[len(data)-1]) != 0 {
|
||||||
nr, err := c.Read(buf)
|
nr, err := c.Read(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("readStringz read error:", err)
|
fmt.Println("readStringz read error:", err)
|
||||||
|
|
Loading…
Reference in New Issue