wspr/nacl: Fixes to get nacl working with wspr with new tests
Change-Id: I3fffe4bd670e3b7607434fdef0f13db7a0ab4664
diff --git a/services/wsprd/app/app.go b/services/wsprd/app/app.go
index 47ea6a5..c1e404a 100644
--- a/services/wsprd/app/app.go
+++ b/services/wsprd/app/app.go
@@ -282,6 +282,8 @@
for _, server := range c.servers {
server.Stop()
}
+
+ c.RT().Cleanup()
}
func (c *Controller) setup() {
diff --git a/services/wsprd/app/stream.go b/services/wsprd/app/stream.go
index 74819b6..85db1b9 100644
--- a/services/wsprd/app/stream.go
+++ b/services/wsprd/app/stream.go
@@ -46,11 +46,16 @@
}
func (os *outstandingStream) send(data string, w lib.ClientWriter) {
- os.messages <- &message{data, w}
+ if os.messages != nil {
+ os.messages <- &message{data, w}
+ }
}
func (os *outstandingStream) end() {
- close(os.messages)
+ if os.messages != nil {
+ close(os.messages)
+ }
+ os.messages = nil
}
// Waits until the stream has been closed and all the messages
diff --git a/services/wsprd/wspr_nacl/main_nacl.go b/services/wsprd/wspr_nacl/main_nacl.go
index 69f055f..fdb4921 100644
--- a/services/wsprd/wspr_nacl/main_nacl.go
+++ b/services/wsprd/wspr_nacl/main_nacl.go
@@ -86,7 +86,7 @@
rt.Init()
- veyronProxy, err := message.LookupStringValuedKey("proxy")
+ veyronProxy, err := message.LookupStringValuedKey("proxyName")
if err != nil {
panic(err.Error())
}
@@ -94,7 +94,7 @@
panic("Empty proxy")
}
- mounttable, err := message.LookupStringValuedKey("mounttable")
+ mounttable, err := message.LookupStringValuedKey("namespaceRoot")
if err != nil {
panic(err.Error())
}
@@ -130,11 +130,11 @@
// A message is of the form {"type": "typeName", "body": { stuff here }},
// where the body is passed to the message handler.
func (inst wsprInstance) HandleMessage(message ppapi.Var) {
+ fmt.Printf("Entered HandleMessage")
type handlerType func(ppapi.Var)
handlerMap := map[string]handlerType{
"start": inst.StartWSPR,
}
- fmt.Printf("Got to HandleMessage(%v)", message)
ty, err := message.LookupStringValuedKey("type")
if err != nil {
panic(err.Error())