aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/ws
diff options
context:
space:
mode:
authorPaweł Bylica <pawel.bylica@imapp.pl>2015-02-24 01:39:05 +0800
committerPaweł Bylica <pawel.bylica@imapp.pl>2015-02-24 01:39:05 +0800
commit114c3b4efe7f30ab7be0bec013210e7b4c3d08d7 (patch)
tree5230f6fee87dcbac36e1d71d6ab731b55eab8268 /rpc/ws
parentb9894c1d0979b9f3e8428b1dc230f1ece106f676 (diff)
parentdd086791acf477da7641c168f82de70ed0b2dca6 (diff)
downloaddexon-114c3b4efe7f30ab7be0bec013210e7b4c3d08d7.tar
dexon-114c3b4efe7f30ab7be0bec013210e7b4c3d08d7.tar.gz
dexon-114c3b4efe7f30ab7be0bec013210e7b4c3d08d7.tar.bz2
dexon-114c3b4efe7f30ab7be0bec013210e7b4c3d08d7.tar.lz
dexon-114c3b4efe7f30ab7be0bec013210e7b4c3d08d7.tar.xz
dexon-114c3b4efe7f30ab7be0bec013210e7b4c3d08d7.tar.zst
dexon-114c3b4efe7f30ab7be0bec013210e7b4c3d08d7.zip
Merge remote-tracking branch 'upstream/develop' into evmjit
Diffstat (limited to 'rpc/ws')
-rw-r--r--rpc/ws/server.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/rpc/ws/server.go b/rpc/ws/server.go
index 6be4e8ce9..b8cc2fa6b 100644
--- a/rpc/ws/server.go
+++ b/rpc/ws/server.go
@@ -21,10 +21,10 @@ import (
"net"
"net/http"
- "code.google.com/p/go.net/websocket"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/xeth"
+ "golang.org/x/net/websocket"
)
var wslogger = logger.NewLogger("RPC-WS")
@@ -94,9 +94,10 @@ func sockHandler(api *rpc.EthereumApi) websocket.Handler {
var jsonrpcver string = "2.0"
fn := func(conn *websocket.Conn) {
for {
- wslogger.Debugln("Handling request")
+ wslogger.Debugln("Handling connection")
var reqParsed rpc.RpcRequest
+ // reqParsed, reqerr := JSON.ParseRequestBody(conn.Request())
if err := websocket.JSON.Receive(conn, &reqParsed); err != nil {
jsonerr := &rpc.RpcErrorObject{-32700, rpc.ErrorParseRequest}
JSON.Send(conn, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: nil, Error: jsonerr})
@@ -108,7 +109,7 @@ func sockHandler(api *rpc.EthereumApi) websocket.Handler {
if reserr != nil {
wslogger.Warnln(reserr)
jsonerr := &rpc.RpcErrorObject{-32603, reserr.Error()}
- JSON.Send(conn, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: &reqParsed.ID, Error: jsonerr})
+ JSON.Send(conn, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: reqParsed.ID, Error: jsonerr})
continue
}