Class: LocalDevelopmentGateway::DatabaseRouter::Tds::TlsClientHello
- Inherits:
-
Object
- Object
- LocalDevelopmentGateway::DatabaseRouter::Tds::TlsClientHello
- Defined in:
- lib/local_development_gateway/database_router/tds/tls_client_hello.rb
Constant Summary collapse
- MAX_BYTES =
128 * 1024
- MAX_RECORD_BYTES =
(16 * 1024) + 2048
Instance Method Summary collapse
- #append(bytes) ⇒ Object
-
#initialize ⇒ TlsClientHello
constructor
A new instance of TlsClientHello.
Constructor Details
#initialize ⇒ TlsClientHello
Returns a new instance of TlsClientHello.
10 11 12 13 14 |
# File 'lib/local_development_gateway/database_router/tds/tls_client_hello.rb', line 10 def initialize @record_buffer = +"" @handshake = +"" @received = 0 end |
Instance Method Details
#append(bytes) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/local_development_gateway/database_router/tds/tls_client_hello.rb', line 16 def append(bytes) @received += bytes.bytesize raise Error, "TLS ClientHello is too large" if @received > MAX_BYTES @record_buffer << bytes consume_records server_name if complete? end |