aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/http.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 06:06:26 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 06:06:26 +0800
commitabc3d8d50a8691d9b4c2bd047807908d157e223c (patch)
tree9e62d9987e9d92b43b92c0e8cfdd94ab8a0703b0 /rpc/http.go
parentc7b616ac14a6e349b57bad6511085d7189a19e3e (diff)
downloadgo-tangerine-abc3d8d50a8691d9b4c2bd047807908d157e223c.tar.gz
go-tangerine-abc3d8d50a8691d9b4c2bd047807908d157e223c.tar.zst
go-tangerine-abc3d8d50a8691d9b4c2bd047807908d157e223c.zip
Make send internal
Diffstat (limited to 'rpc/http.go')
-rw-r--r--rpc/http.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/rpc/http.go b/rpc/http.go
index bf281efc3..3dfb67781 100644
--- a/rpc/http.go
+++ b/rpc/http.go
@@ -28,7 +28,7 @@ func JSONRPC(pipe *xeth.XEth, dataDir string) http.Handler {
// Limit request size to resist DoS
if req.ContentLength > maxSizeReqLength {
jsonerr := &RpcErrorObject{-32700, "Request too large"}
- Send(w, &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: nil, Error: jsonerr})
+ send(w, &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: nil, Error: jsonerr})
return
}
@@ -37,14 +37,14 @@ func JSONRPC(pipe *xeth.XEth, dataDir string) http.Handler {
body, err := ioutil.ReadAll(req.Body)
if err != nil {
jsonerr := &RpcErrorObject{-32700, "Could not read request body"}
- Send(w, &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: nil, Error: jsonerr})
+ send(w, &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: nil, Error: jsonerr})
}
// Try to parse the request as a single
var reqSingle RpcRequest
if err := json.Unmarshal(body, &reqSingle); err == nil {
response := RpcResponse(api, &reqSingle)
- Send(w, &response)
+ send(w, &response)
return
}
@@ -57,13 +57,13 @@ func JSONRPC(pipe *xeth.XEth, dataDir string) http.Handler {
response := RpcResponse(api, &request)
resBatch[i] = response
}
- Send(w, resBatch)
+ send(w, resBatch)
return
}
// Not a batch or single request, error
jsonerr := &RpcErrorObject{-32600, "Could not decode request"}
- Send(w, &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: nil, Error: jsonerr})
+ send(w, &RpcErrorResponse{Jsonrpc: jsonrpcver, Id: nil, Error: jsonerr})
})
}
@@ -88,7 +88,7 @@ func RpcResponse(api *EthereumApi, request *RpcRequest) *interface{} {
return &response
}
-func Send(writer io.Writer, v interface{}) (n int, err error) {
+func send(writer io.Writer, v interface{}) (n int, err error) {
var payload []byte
payload, err = json.MarshalIndent(v, "", "\t")
if err != nil {