| 120 | } |
| 121 | |
| 122 | static void enter_ping_state(h2_proxy_session *session, h2_ping_state_t state) |
| 123 | { |
| 124 | if (session->ping_state == state) return; |
| 125 | switch (session->ping_state) { |
| 126 | case H2_PING_ST_NONE: |
| 127 | /* leaving NONE, enforce timeout, send frame maybe */ |
| 128 | if (H2_PING_ST_AWAIT_PING == state) { |
| 129 | unset_ping_timeout(session); |
| 130 | nghttp2_submit_ping(session->ngh2, 0, (const uint8_t *)"nevergonnagiveyouup"); |
| 131 | } |
| 132 | set_ping_timeout(session); |
| 133 | session->ping_state = state; |
| 134 | break; |
| 135 | default: |
| 136 | /* no switching between the != NONE states */ |
| 137 | if (H2_PING_ST_NONE == state) { |
| 138 | session->ping_state = state; |
| 139 | unset_ping_timeout(session); |
| 140 | ping_arrived(session); |
| 141 | } |
| 142 | break; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | static void ping_new_session(h2_proxy_session *session, proxy_conn_rec *p_conn) |
| 147 | { |
no test coverage detected