Repository navigation
Commit 1be335d
committed
gh-160622: Fix socket recv() and recvfrom() with MSG_TRUNC
With MSG_TRUNC, recv() and recvfrom() can return the real length of
the datagram, which may be larger than the requested size. Since
PyBytesWriter_FinishWithSize() now rejects a size larger than the
allocated one, this raised ValueError after the datagram had already
been consumed. Return only the bytes actually received instead.1 parent bb7e16a commit 1be335d
3 files changed
Lines changed: 34 additions & 0 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3286 | 3286 | | |
3287 | 3287 | | |
3288 | 3288 | | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
| 3296 | + | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
3289 | 3309 | | |
3290 | 3310 | | |
3291 | 3311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4066 | 4066 | | |
4067 | 4067 | | |
4068 | 4068 | | |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
4069 | 4075 | | |
4070 | 4076 | | |
4071 | 4077 | | |
| |||
4242 | 4248 | | |
4243 | 4249 | | |
4244 | 4250 | | |
| 4251 | + | |
| 4252 | + | |
| 4253 | + | |
| 4254 | + | |
4245 | 4255 | | |
4246 | 4256 | | |
4247 | 4257 | | |
| |||
0 commit comments