Repository navigation
Commit 481e560
* Fixed #952.
Conditional flush `outgoing` on close.
Scenario:
1. The client connect to the server.
2. The client sends subscribe to the server.
3. The server destroys the client connection before suback sending.
4. The client detect `close` event, then reconnects to the server.
At the step4, `outgoing` still stored the callback for
subscribe. However, it has never called because server doen't send
corresponding suback.
The same thing happens on unsubscribe.
So I defined subscribe/unsubscribe as volatile.
The volatile type of `outgoing` entries should be cleared when `close`
from the server is detected.
On the contrary, QoS1 and QoS2 publish is not volatile. Because they are
resent after reconnection. And then, callback in the `store` is
called. This behavior shouldn't be changed.
So I added `volatile` flag to `outgoing` element.
* Fixed cb accessing code.
If `outgoing[mid]` doesn't match, then accessing `outgoing[mid].cb`
causes `Cannot read property` error. So added checking code.
Fixed outgoing assignment at `_onConnect` function.
1 parent 84ca344 commit 481e560
2 files changed
Lines changed: 96 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
95 | 106 | | |
96 | 107 | | |
97 | 108 | | |
| |||
290 | 301 | | |
291 | 302 | | |
292 | 303 | | |
| 304 | + | |
293 | 305 | | |
294 | 306 | | |
295 | 307 | | |
| |||
447 | 459 | | |
448 | 460 | | |
449 | 461 | | |
450 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
451 | 466 | | |
452 | 467 | | |
453 | 468 | | |
| |||
606 | 621 | | |
607 | 622 | | |
608 | 623 | | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
614 | 632 | | |
615 | | - | |
616 | 633 | | |
617 | | - | |
| 634 | + | |
| 635 | + | |
618 | 636 | | |
619 | 637 | | |
620 | 638 | | |
| |||
678 | 696 | | |
679 | 697 | | |
680 | 698 | | |
681 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
682 | 703 | | |
683 | 704 | | |
684 | 705 | | |
| |||
772 | 793 | | |
773 | 794 | | |
774 | 795 | | |
775 | | - | |
| 796 | + | |
776 | 797 | | |
777 | 798 | | |
778 | 799 | | |
| |||
957 | 978 | | |
958 | 979 | | |
959 | 980 | | |
960 | | - | |
| 981 | + | |
961 | 982 | | |
962 | 983 | | |
963 | 984 | | |
| |||
1172 | 1193 | | |
1173 | 1194 | | |
1174 | 1195 | | |
1175 | | - | |
| 1196 | + | |
1176 | 1197 | | |
1177 | 1198 | | |
1178 | 1199 | | |
| |||
1395 | 1416 | | |
1396 | 1417 | | |
1397 | 1418 | | |
1398 | | - | |
1399 | | - | |
1400 | | - | |
1401 | | - | |
1402 | | - | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
1403 | 1429 | | |
1404 | | - | |
1405 | | - | |
1406 | 1430 | | |
1407 | 1431 | | |
1408 | 1432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2682 | 2682 | | |
2683 | 2683 | | |
2684 | 2684 | | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
2685 | 2736 | | |
2686 | 2737 | | |
2687 | 2738 | | |
| |||
0 commit comments