Handle RequestInfo in handleRequest

This commit is contained in:
Jae Kwon
2015-11-09 18:17:00 -08:00
parent 5aec38bdc6
commit e8505a714b

View File

@@ -58,7 +58,7 @@ func handleRequests(app types.Application, connClosed chan struct{}, conn net.Co
var req types.Request
wire.ReadBinaryPtr(&req, bufReader, &n, &err)
if err != nil {
fmt.Println(err.Error())
fmt.Println("Error in handleRequests:", err.Error())
connClosed <- struct{}{}
return
}
@@ -74,6 +74,9 @@ func handleRequest(app types.Application, req types.Request, responses chan<- ty
responses <- types.ResponseEcho{msg}
case types.RequestFlush:
responses <- types.ResponseFlush{}
case types.RequestInfo:
data := app.Info()
responses <- types.ResponseInfo{data}
case types.RequestAppendTx:
retCode := app.AppendTx(req.TxBytes)
responses <- types.ResponseAppendTx{retCode}