TS-2729: send server connection preface
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2a84c6b9 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2a84c6b9 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2a84c6b9 Branch: refs/heads/master Commit: 2a84c6b9f6bd700c7ba4e19d0c53d92842e4d9bd Parents: fc1ea62 Author: James Peach <[email protected]> Authored: Fri Oct 3 13:54:22 2014 -0700 Committer: James Peach <[email protected]> Committed: Fri Oct 3 13:54:22 2014 -0700 ---------------------------------------------------------------------- proxy/http2/Http2ClientSession.cc | 5 ----- proxy/http2/Http2ClientSession.h | 2 +- proxy/http2/Http2ConnectionState.cc | 7 +++++++ 3 files changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2a84c6b9/proxy/http2/Http2ClientSession.cc ---------------------------------------------------------------------- diff --git a/proxy/http2/Http2ClientSession.cc b/proxy/http2/Http2ClientSession.cc index da329dc..3929e2e 100644 --- a/proxy/http2/Http2ClientSession.cc +++ b/proxy/http2/Http2ClientSession.cc @@ -88,11 +88,6 @@ Http2ClientSession::start() read_vio = this->do_io_read(this, INT64_MAX, this->read_buffer); this->do_io_write(this, INT64_MAX, this->sm_writer); - // 3.5 HTTP/2 Connection Preface. Upon establishment of a TCP connection and - // determination that HTTP/2 will be used by both peers, each endpoint MUST - // send a connection preface as a final confirmation ... - //this->write_buffer->write(HTTP2_CONNECTION_PREFACE, HTTP2_CONNECTION_PREFACE_LEN); - send_connection_event(&this->connection_state, HTTP2_SESSION_EVENT_INIT, this); this->handleEvent(VC_EVENT_READ_READY, read_vio); } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2a84c6b9/proxy/http2/Http2ClientSession.h ---------------------------------------------------------------------- diff --git a/proxy/http2/Http2ClientSession.h b/proxy/http2/Http2ClientSession.h index e9fea9f..8648b43 100644 --- a/proxy/http2/Http2ClientSession.h +++ b/proxy/http2/Http2ClientSession.h @@ -49,7 +49,7 @@ public: this->ioreader = r; } - Http2Frame(Http2FrameType type, Http2StreamId streamid, uint8_t flags = 0) { + Http2Frame(Http2FrameType type, Http2StreamId streamid, uint8_t flags) { Http2FrameHeader hdr = { 0, (uint8_t)type, flags, streamid }; http2_write_frame_header(hdr, make_iovec(this->hdr.raw)); } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2a84c6b9/proxy/http2/Http2ConnectionState.cc ---------------------------------------------------------------------- diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc index cb9640e..5030e36 100644 --- a/proxy/http2/Http2ConnectionState.cc +++ b/proxy/http2/Http2ConnectionState.cc @@ -116,6 +116,13 @@ Http2ConnectionState::main_event_handler(int event, void * edata) ink_assert(this->ua_session == NULL); this->ua_session = (Http2ClientSession *)edata; + // 3.5 HTTP/2 Connection Preface. Upon establishment of a TCP connection and + // determination that HTTP/2 will be used by both peers, each endpoint MUST + // send a connection preface as a final confirmation ... The server connection + // preface consists of a potentially empty SETTINGS frame. + Http2Frame settings(HTTP2_FRAME_TYPE_SETTINGS, 0, 0); + this->ua_session->handleEvent(HTTP2_SESSION_EVENT_XMIT, &settings); + return 0; }
