Commit 77dd210
committed
go: avoid possible read/modify/write of the Write window
The Write window is used to keep track of how much buffer space is
free in the remote to avoid one connection blocking the rest.
Previously we checked the window and decided how much to write, then
dropped the metadata mutex before performing the write. In theory
another Write call on the same connection could see that buffer
size is free, send too much and block the connection.
Therefore Write should take ownership of the space by bumping the
`current` window before dropping the lock.
Signed-off-by: David Scott <[email protected]>1 parent ecc9379 commit 77dd210
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
169 | | - | |
170 | 173 | | |
171 | 174 | | |
172 | 175 | | |
| |||
0 commit comments