| 1503 | } |
| 1504 | |
| 1505 | int |
| 1506 | Http2ConnectionState::main_event_handler(int event, void *edata) |
| 1507 | { |
| 1508 | if (edata == zombie_event) { |
| 1509 | // zombie session is still around. Assert |
| 1510 | ink_release_assert(zombie_event == nullptr); |
| 1511 | } else if (edata == fini_event) { |
| 1512 | fini_event = nullptr; |
| 1513 | } else if (edata == _priority_event) { |
| 1514 | _priority_event = nullptr; |
| 1515 | } else if (edata == _data_event) { |
| 1516 | _data_event = nullptr; |
| 1517 | } else if (edata == retransmit_event) { |
| 1518 | retransmit_event = nullptr; |
| 1519 | } |
| 1520 | ++recursion; |
| 1521 | |
| 1522 | switch (event) { |
| 1523 | // Finalize HTTP/2 Connection |
| 1524 | case HTTP2_SESSION_EVENT_FINI: { |
| 1525 | SCOPED_MUTEX_LOCK(lock, this->mutex, this_ethread()); |
| 1526 | REMEMBER(event, this->recursion); |
| 1527 | |
| 1528 | ink_assert(this->fini_received == false); |
| 1529 | this->fini_received = true; |
| 1530 | cleanup_streams(); |
| 1531 | release_stream(); |
| 1532 | SET_HANDLER(&Http2ConnectionState::state_closed); |
| 1533 | } break; |
| 1534 | |
| 1535 | case HTTP2_SESSION_EVENT_PRIO: { |
| 1536 | REMEMBER(event, this->recursion); |
| 1537 | SCOPED_MUTEX_LOCK(lock, this->mutex, this_ethread()); |
| 1538 | send_data_frames_depends_on_priority(); |
| 1539 | } break; |
| 1540 | |
| 1541 | case HTTP2_SESSION_EVENT_DATA: { |
| 1542 | REMEMBER(event, this->recursion); |
| 1543 | SCOPED_MUTEX_LOCK(lock, this->mutex, this_ethread()); |
| 1544 | // mark the retry flag here so if the writes fail again we will |
| 1545 | // backoff the next attempt |
| 1546 | _data_event_retry = true; |
| 1547 | this->restart_streams(); |
| 1548 | _data_event_retry = false; |
| 1549 | } break; |
| 1550 | |
| 1551 | case HTTP2_SESSION_EVENT_XMIT: { |
| 1552 | REMEMBER(event, this->recursion); |
| 1553 | SCOPED_MUTEX_LOCK(lock, this->mutex, this_ethread()); |
| 1554 | this->session->flush(); |
| 1555 | } break; |
| 1556 | |
| 1557 | case HTTP2_SESSION_EVENT_ERROR: { |
| 1558 | REMEMBER(event, this->recursion); |
| 1559 | |
| 1560 | Http2ErrorCode error_code = Http2ErrorCode::HTTP2_ERROR_INTERNAL_ERROR; |
| 1561 | if (edata != nullptr) { |
| 1562 | Http2Error *error = static_cast<Http2Error *>(edata); |
nothing calls this directly
no test coverage detected