|
18 | 18 | #include <string.h> |
19 | 19 | #include <signal.h> |
20 | 20 |
|
21 | | -static int interrupted, tests, tests_pass, tests_fail; |
| 21 | +static int interrupted, tests, tests_pass, tests_fail, doing_a_retry; |
22 | 22 | static lws_sorted_usec_list_t sul_next_test; |
23 | 23 | static lws_state_notify_link_t nl; |
24 | 24 | struct lws_context *context; |
@@ -642,6 +642,18 @@ myss_state(void *userobj, void *sh, lws_ss_constate_t state, |
642 | 642 | lws_ss_state_name((int)state), state, (unsigned int)ack); |
643 | 643 |
|
644 | 644 | if (curr_test->mask_unexpected & (1u << state)) { |
| 645 | + |
| 646 | + if (state == LWSSSCS_QOS_NACK_REMOTE) { |
| 647 | + |
| 648 | + lwsl_user("%s: retrying it due to getting NACK\n", __func__); |
| 649 | + |
| 650 | + doing_a_retry = 1; |
| 651 | + /* Since this can be the remote server denying it, retry it */ |
| 652 | + lws_sul_schedule(context, 0, &sul_next_test, tests_start_next, 1000); |
| 653 | + |
| 654 | + return LWSSSSRET_OK; |
| 655 | + } |
| 656 | + |
645 | 657 | /* |
646 | 658 | * We have definitively failed on an unexpected state received |
647 | 659 | */ |
@@ -690,7 +702,7 @@ myss_state(void *userobj, void *sh, lws_ss_constate_t state, |
690 | 702 | return lws_ss_client_connect(m->ss); |
691 | 703 |
|
692 | 704 | case LWSSSCS_DESTROYING: |
693 | | - if (!m->result_reported) { |
| 705 | + if (!m->result_reported && !doing_a_retry) { |
694 | 706 | lwsl_user("%s: failing on unexpected destruction\n", |
695 | 707 | __func__); |
696 | 708 |
|
@@ -721,6 +733,8 @@ tests_start_next(lws_sorted_usec_list_t *sul) |
721 | 733 | lws_ss_destroy(&h); |
722 | 734 | } |
723 | 735 |
|
| 736 | + doing_a_retry = 0; |
| 737 | + |
724 | 738 | if ((unsigned int)tests >= LWS_ARRAY_SIZE(tests_seq)) { |
725 | 739 | lwsl_notice("Completed all tests\n"); |
726 | 740 | interrupted = 1; |
|
0 commit comments