Skip to content

Commit ae47677

Browse files
committed
Change Client locks to pointer values
1 parent 0ac42a2 commit ae47677

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Diff for: client.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ type Client struct {
142142
proxyURL *url.URL
143143
beforeRequest []RequestMiddleware
144144
udBeforeRequest []RequestMiddleware
145-
udBeforeRequestLock sync.RWMutex
145+
udBeforeRequestLock *sync.RWMutex
146146
preReqHook PreRequestHook
147147
successHooks []SuccessHook
148148
afterResponse []ResponseMiddleware
149-
afterResponseLock sync.RWMutex
149+
afterResponseLock *sync.RWMutex
150150
requestLog RequestLogCallback
151151
responseLog ResponseLogCallback
152152
errorHooks []ErrorHook
@@ -1360,9 +1360,11 @@ func createClient(hc *http.Client) *Client {
13601360
XMLUnmarshal: xml.Unmarshal,
13611361
HeaderAuthorizationKey: http.CanonicalHeaderKey("Authorization"),
13621362

1363-
jsonEscapeHTML: true,
1364-
httpClient: hc,
1365-
debugBodySizeLimit: math.MaxInt32,
1363+
jsonEscapeHTML: true,
1364+
httpClient: hc,
1365+
debugBodySizeLimit: math.MaxInt32,
1366+
udBeforeRequestLock: &sync.RWMutex{},
1367+
afterResponseLock: &sync.RWMutex{},
13661368
}
13671369

13681370
// Logger

0 commit comments

Comments
 (0)