Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions proxy/http2/Http2ClientSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ Http2ClientSession::state_start_frame_read(int event, void *edata)

STATE_ENTER(&Http2ClientSession::state_start_frame_read, event);
ink_assert(event == VC_EVENT_READ_COMPLETE || event == VC_EVENT_READ_READY);
return state_process_frame_read(event, vio, false);
return do_process_frame_read(event, vio, false);
}

int
Expand Down Expand Up @@ -513,7 +513,7 @@ Http2ClientSession::state_complete_frame_read(int event, void *edata)
}
Http2SsnDebug("completed frame read, %" PRId64 " bytes available", this->_read_buffer_reader->read_avail());

return state_process_frame_read(event, vio, true);
return do_process_frame_read(event, vio, true);
}

int
Expand All @@ -539,7 +539,7 @@ Http2ClientSession::do_complete_frame_read()
}

int
Http2ClientSession::state_process_frame_read(int event, VIO *vio, bool inside_frame)
Http2ClientSession::do_process_frame_read(int event, VIO *vio, bool inside_frame)
{
if (inside_frame) {
do_complete_frame_read();
Expand Down
24 changes: 19 additions & 5 deletions proxy/http2/Http2ClientSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ enum class Http2SsnMilestone {

size_t const HTTP2_HEADER_BUFFER_SIZE_INDEX = CLIENT_CONNECTION_FIRST_READ_BUFFER_SIZE_INDEX;

/**
@startuml
title HTTP/2 Session Handler - state of reading HTTP/2 frame
hide empty description

[*] --> state_read_connection_preface : start()
state_read_connection_preface --> state_start_frame_read : receive connection preface
state_start_frame_read --> state_start_frame_read : do_complete_frame_read()
state_start_frame_read --> state_complete_frame_read : reading HTTP/2 frame is halfway but no data in the buffer
state_complete_frame_read --> state_start_frame_read : do_complete_frame_read()

@enduml
*/
class Http2ClientSession : public ProxySession
{
public:
Expand Down Expand Up @@ -123,15 +136,16 @@ class Http2ClientSession : public ProxySession
private:
int main_event_handler(int, void *);

// SessionHandler(s) - state of reading frame
int state_read_connection_preface(int, void *);
int state_start_frame_read(int, void *);
int do_start_frame_read(Http2ErrorCode &ret_error);
int state_complete_frame_read(int, void *);

// state_start_frame_read and state_complete_frame_read are set up as session event handler.
// Both feed into do_process_frame_read which may iterate if there are multiple frames ready on the wire
int do_process_frame_read(int event, VIO *vio, bool inside_frame);
int do_start_frame_read(Http2ErrorCode &ret_error);
int do_complete_frame_read();
// state_start_frame_read and state_complete_frame_read are set up as
// event handler. Both feed into state_process_frame_read which may iterate
// if there are multiple frames ready on the wire
int state_process_frame_read(int event, VIO *vio, bool inside_frame);

bool _should_do_something_else();

Expand Down