This repository was archived by the owner on Jan 20, 2025. It is now read-only.
Commit 8607ac1
committed
Stop accept()-ing connections if already at max connection limit
The constant CONFIG_LWIP_MAX_SOCKETS, if available, tells how many
sockets can be opened at once. If already at this limit, and an attempt
is made to accept() an additional incoming connection from a listening
socket, the accept() call will fail. Fix this by checking the socket
list and refusing to add the listening socket to the set of readable
sockets to check in the select() call. This will cause connections to
remain in the listening backlog until some other socket is closed.1 parent 2895bb8 commit 8607ac1
2 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
96 | 103 | | |
97 | 104 | | |
| 105 | + | |
98 | 106 | | |
99 | 107 | | |
100 | | - | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
| |||
0 commit comments