You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3274db1
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: rpc/http.go
+17-23Lines changed: 17 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -18,21 +18,19 @@ package rpc
18
18
19
19
import (
20
20
"bufio"
21
+
"bytes"
22
+
"encoding/json"
23
+
"errors"
21
24
"fmt"
22
25
"io"
26
+
"io/ioutil"
23
27
"net"
24
28
"net/http"
29
+
"net/url"
25
30
"strconv"
26
31
"strings"
27
-
"time"
28
-
29
-
"errors"
30
32
"sync"
31
-
32
-
"bytes"
33
-
"encoding/json"
34
-
"io/ioutil"
35
-
"net/url"
33
+
"time"
36
34
37
35
"github.com/ethereum/go-ethereum/logger"
38
36
"github.com/ethereum/go-ethereum/logger/glog"
@@ -44,8 +42,8 @@ const (
44
42
)
45
43
46
44
var (
47
-
httpServerMu sync.Mutex// prevent concurrent access to the httpListener and httpServer
48
-
httpListener net.Listener// listener for the http server
45
+
httpServerMusync.Mutex// prevent concurrent access to the httpListener and httpServer
46
+
httpListenernet.Listener// listener for the http server
49
47
httpRPCServer*Server// the node can only start 1 HTTP RPC server instance
50
48
)
51
49
@@ -57,8 +55,7 @@ var (
57
55
typehttpMessageStreamstruct {
58
56
conn net.Conn// TCP connection
59
57
rw*bufio.ReadWriter// buffered where HTTP requests/responses are read/written from/to
60
-
currentReq*http.Request// pending request, codec can pass in a too small buffer for a single read
61
-
// we need to keep track of the current requests if it was not read at once
58
+
currentReq*http.Request// pending request, codec can pass in a too small buffer for a single read we need to keep track of the current requests if it was not read at once
62
59
payloadBytesReadint64// number of bytes which are read from the current request
0 commit comments