We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a02cbef commit 81afa8aCopy full SHA for 81afa8a
netconn.go
@@ -141,6 +141,19 @@ func (nc *netConn) Read(p []byte) (int, error) {
141
nc.readMu.forceLock()
142
defer nc.readMu.unlock()
143
144
+ for {
145
+ n, err := nc.read(p)
146
+ if err != nil {
147
+ return n, err
148
+ }
149
+ if n == 0 {
150
+ continue
151
152
+ return n, nil
153
154
+}
155
+
156
+func (nc *netConn) read(p []byte) (int, error) {
157
if atomic.LoadInt64(&nc.readExpired) == 1 {
158
return 0, fmt.Errorf("failed to read: %w", context.DeadlineExceeded)
159
}
0 commit comments