Commit 5071cee
committed
extmod/modlwip: Store a chain of incoming pbufs, instead of only one.
Storing a chain of pbuf was an original design of @pfalcon's lwIP socket
module. The problem with storing just one, like modlwip does is that
"peer closed connection" notification is completely asynchronous and out of
band. So, there may be following sequence of actions:
1. pbuf adafruit#1 arrives, and stored in a socket.
2. pbuf adafruit#2 arrives, and rejected, which causes lwIP to put it into a
queue to re-deliver later.
3. "Peer closed connection" is signaled, and socket is set at such status.
4. pbuf adafruit#1 is processed.
5. There's no stored pbufs in teh socket, and socket status is "peer closed
connection", so EOF is returned to a client.
6. pbuf adafruit#2 gets redelivered.
Apparently, there's no easy workaround for this, except to queue all
incoming pbufs in a socket. This may lead to increased memory pressure,
as number of pending packets would be regulated only by TCP/IP flow
control, whereas with previous setup lwIP had a global overlook of number
packets waiting for redelivery and could regulate them centrally.1 parent c7fba52 commit 5071cee
1 file changed
Lines changed: 31 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
358 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
359 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
360 | 367 | | |
361 | | - | |
362 | 368 | | |
363 | 369 | | |
364 | 370 | | |
| |||
536 | 542 | | |
537 | 543 | | |
538 | 544 | | |
539 | | - | |
540 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
541 | 548 | | |
542 | 549 | | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
548 | 559 | | |
549 | | - | |
550 | | - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
551 | 563 | | |
| 564 | + | |
552 | 565 | | |
553 | | - | |
554 | | - | |
| 566 | + | |
555 | 567 | | |
556 | 568 | | |
557 | 569 | | |
| |||
561 | 573 | | |
562 | 574 | | |
563 | 575 | | |
564 | | - | |
565 | | - | |
| 576 | + | |
| 577 | + | |
566 | 578 | | |
567 | 579 | | |
568 | 580 | | |
| |||
612 | 624 | | |
613 | 625 | | |
614 | 626 | | |
615 | | - | |
| 627 | + | |
616 | 628 | | |
617 | 629 | | |
618 | 630 | | |
| |||
749 | 761 | | |
750 | 762 | | |
751 | 763 | | |
752 | | - | |
| 764 | + | |
753 | 765 | | |
754 | 766 | | |
755 | 767 | | |
| |||
0 commit comments