Commit 1a5f36c
committed
client: fix double-close condition for connections
Currently, to avoid double-close of a connection we check for the `SS_DEAD`
status on its stream. However, the `SS_DEAD` status can be set for a
multitude of reasons without the connection being closed or even connected.
For instance, we set it if a send/recv failed unrecoverably.
To fix this, let's rely on the fact that a connection is open iff the file
descriptor of its stream is a valid (i.e., not -1). This approach seems to
be portable to the Windows platform too.
Closes #1421 parent 8d70145 commit 1a5f36c
3 files changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
185 | 187 | | |
186 | 188 | | |
187 | 189 | | |
| |||
235 | 237 | | |
236 | 238 | | |
237 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
238 | 243 | | |
239 | 244 | | |
240 | 245 | | |
| |||
1065 | 1070 | | |
1066 | 1071 | | |
1067 | 1072 | | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
1068 | 1077 | | |
1069 | 1078 | | |
1070 | 1079 | | |
| |||
0 commit comments