Commit 3b03992
committed
Refactor responsibility of releasing failed messages
APISendMessageToConnection, _APISendMessageToConnection, and SNP_SendMessage
now expect the *caller* to release the message if it changes. Since
there are many failure points but only a few call sites, this resulted
in a net reduction in lines of code and is imo simpler. But more
importantly it sets us up so that we can continue this one level higher,
into the public API, so that we can allow the app to retain failed
messages. For lots of app code, I anticipate that this will be useful
so that they can retry them later if they want. The most important and
legitimate failure case here is if the send buffer is full.1 parent 75451a0 commit 3b03992
5 files changed
Lines changed: 6 additions & 12 deletions
File tree
- src/steamnetworkingsockets/clientlib
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| 521 | + | |
521 | 522 | | |
522 | 523 | | |
523 | 524 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1364 | 1364 | | |
1365 | 1365 | | |
1366 | 1366 | | |
| 1367 | + | |
| 1368 | + | |
1367 | 1369 | | |
1368 | 1370 | | |
1369 | 1371 | | |
| |||
Lines changed: 1 addition & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2053 | 2053 | | |
2054 | 2054 | | |
2055 | 2055 | | |
| 2056 | + | |
2056 | 2057 | | |
2057 | 2058 | | |
2058 | 2059 | | |
| |||
2069 | 2070 | | |
2070 | 2071 | | |
2071 | 2072 | | |
2072 | | - | |
2073 | 2073 | | |
2074 | 2074 | | |
2075 | 2075 | | |
2076 | 2076 | | |
2077 | 2077 | | |
2078 | | - | |
2079 | | - | |
2080 | 2078 | | |
2081 | | - | |
2082 | 2079 | | |
2083 | 2080 | | |
2084 | 2081 | | |
2085 | 2082 | | |
2086 | 2083 | | |
2087 | 2084 | | |
2088 | 2085 | | |
2089 | | - | |
2090 | 2086 | | |
2091 | 2087 | | |
2092 | 2088 | | |
| |||
2095 | 2091 | | |
2096 | 2092 | | |
2097 | 2093 | | |
2098 | | - | |
2099 | 2094 | | |
2100 | 2095 | | |
2101 | 2096 | | |
| |||
2112 | 2107 | | |
2113 | 2108 | | |
2114 | 2109 | | |
2115 | | - | |
2116 | 2110 | | |
2117 | 2111 | | |
2118 | 2112 | | |
| |||
4069 | 4063 | | |
4070 | 4064 | | |
4071 | 4065 | | |
4072 | | - | |
4073 | 4066 | | |
4074 | 4067 | | |
4075 | 4068 | | |
4076 | 4069 | | |
4077 | 4070 | | |
4078 | | - | |
4079 | 4071 | | |
4080 | 4072 | | |
4081 | 4073 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
| 372 | + | |
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
316 | 315 | | |
317 | 316 | | |
318 | 317 | | |
| |||
321 | 320 | | |
322 | 321 | | |
323 | 322 | | |
324 | | - | |
325 | 323 | | |
326 | 324 | | |
327 | 325 | | |
| |||
0 commit comments