diff --git a/client/assist/assist.go b/client/assist/assist.go index 7c3b6de..0b091b6 100644 --- a/client/assist/assist.go +++ b/client/assist/assist.go @@ -185,7 +185,7 @@ func (t *ticketMan) Dump(w io.Writer) (err error) { return } } - _, err = fmt.Fprintf(w, "\nConnections\ndigraph edges {\n") + _, err = fmt.Fprintf(w, "}\n\nConnections\ndigraph edges {\n") if err != nil { return } @@ -195,8 +195,7 @@ func (t *ticketMan) Dump(w io.Writer) (err error) { return } } - _, err = fmt.Fprintf(w, "}\n") - _, err = fmt.Fprintf(w, "\nPast Connections\ndigraph past_edges {\n") + _, err = fmt.Fprintf(w, "}\n\nPast Connections\ndigraph past_edges {\n") if err != nil { return } diff --git a/client/client2client.go b/client/client2client.go index 5965f8c..e2c5e5e 100644 --- a/client/client2client.go +++ b/client/client2client.go @@ -284,8 +284,10 @@ func (receiver *endpointReceiver) handleRequest(w http.ResponseWriter, r *http.R return fmt.Errorf("don't know how to handle message (Content-Type: %v)", r.Header.Get("Content-Type")) } - if (receiver.workFile == nil && receiver.builder == nil) || receiver.buyerSecret == ZEROHASH { - return fmt.Errorf("incomplete work message (work file: %v, chunk hashes: %v. buyer secret: %v)", receiver.workFile != nil, receiver.builder != nil, receiver.buyerSecret != ZEROHASH) + if todo.mustHandleReceipt || todo.mustWriteWishList || todo.mustHandleWork { + if (receiver.workFile == nil && receiver.builder == nil) || receiver.buyerSecret == ZEROHASH { + return fmt.Errorf("incomplete work message (work file: %v, chunk hashes: %v. buyer secret: %v)", receiver.workFile != nil, receiver.builder != nil, receiver.buyerSecret != ZEROHASH) + } } if todo.mustHandleReceipt { @@ -314,9 +316,9 @@ func (receiver *endpointReceiver) handleRequest(w http.ResponseWriter, r *http.R return fmt.Errorf("error sending work result back to buyer: %v", err) } return reader.Close() - } else { - panic("Shouldn't get here") } + + return nil } // Function sendCreatedAssistiveDownloadURLs communicates tickets back to the buyer by