@@ -1798,7 +1798,6 @@ cdef class ConnectMessage(Message):
17981798 bytes connect_string_bytes
17991799 uint16_t connect_string_len, redirect_data_len
18001800 bint read_redirect_data_len
1801- ConnectionCookie cookie
18021801 Description description
18031802 uint8_t packet_flags
18041803 str redirect_data
@@ -1809,6 +1808,7 @@ cdef class ConnectMessage(Message):
18091808 cdef:
18101809 uint16_t protocol_version, protocol_options
18111810 const char_type * redirect_data
1811+ uint32_t flags
18121812 bytes db_uuid
18131813 if buf._current_packet.packet_type == TNS_PACKET_TYPE_REDIRECT:
18141814 if not self .read_redirect_data_len:
@@ -1825,11 +1825,11 @@ cdef class ConnectMessage(Message):
18251825 buf.read_uint16(& protocol_options)
18261826 buf.skip_raw_bytes(20 )
18271827 buf.read_uint32(& buf._caps.sdu)
1828- if protocol_version >= TNS_VERSION_MIN_UUID :
1829- buf.skip_raw_bytes(9 )
1830- db_uuid = buf.read_raw_bytes( 16 )[: 16 ]
1831- self .cookie = get_connection_cookie_by_uuid(db_uuid,
1832- self .description)
1828+ if protocol_version >= TNS_VERSION_MIN_OOB_CHECK :
1829+ buf.skip_raw_bytes(5 )
1830+ buf.read_uint32( & flags)
1831+ if flags & TNS_ACCEPT_FLAG_FAST_AUTH:
1832+ buf._caps.supports_fast_auth = True
18331833 buf._caps._adjust_for_protocol(protocol_version, protocol_options)
18341834 buf._transport._full_packet_size = True
18351835 elif buf._current_packet.packet_type == TNS_PACKET_TYPE_REFUSE:
@@ -2345,9 +2345,7 @@ cdef class ProtocolMessage(Message):
23452345
23462346 cdef int _process_protocol_info(self , ReadBuffer buf) except - 1 :
23472347 """
2348- Processes the response to the protocol request and stores the
2349- information that is used to identify the server in a connection cookie
2350- (which is used in 23c and higher to optimize the connection packets).
2348+ Processes the response to the protocol request.
23512349 """
23522350 cdef:
23532351 uint16_t num_elem, fdo_length
@@ -2380,12 +2378,12 @@ cdef class ProtocolMessage(Message):
23802378
23812379
23822380@cython.final
2383- cdef class ConnectionCookieMessage (Message):
2381+ cdef class FastAuthMessage (Message):
23842382 cdef:
23852383 DataTypesMessage data_types_message
23862384 ProtocolMessage protocol_message
23872385 AuthMessage auth_message
2388- ConnectionCookie cookie
2386+ bint renegotiate
23892387
23902388 cdef bint _has_more_data(self , ReadBuffer buf):
23912389 return not self .end_of_request
@@ -2396,8 +2394,7 @@ cdef class ConnectionCookieMessage(Message):
23962394 Processes the messages returned from the server response.
23972395 """
23982396 if message_type == TNS_MSG_TYPE_RENEGOTIATE:
2399- self .cookie.populated = False
2400- self .end_of_request = True
2397+ self .renegotiate = True
24012398 elif message_type == TNS_MSG_TYPE_PROTOCOL:
24022399 ProtocolMessage._process_message(self .protocol_message, buf,
24032400 message_type)
@@ -2410,21 +2407,24 @@ cdef class ConnectionCookieMessage(Message):
24102407
24112408 cdef int _write_message(self , WriteBuffer buf) except - 1 :
24122409 """
2413- Writes the message to the buffer. This includes not just the cookie but
2414- also the protocol, data types and auth message information as well!
2410+ Writes the message to the buffer. This includes not just this message
2411+ but also the protocol, data types and auth messages. This reduces the
2412+ number of round-trips to the database and thereby increases
2413+ performance.
24152414 """
2415+ buf.write_uint8(TNS_MSG_TYPE_FAST_AUTH)
2416+ buf.write_uint8(1 ) # fast auth version
2417+ buf.write_uint8(TNS_SERVER_CONVERTS_CHARS) # flag 1
2418+ buf.write_uint8(0 ) # flag 2
24162419 ProtocolMessage._write_message(self .protocol_message, buf)
2417- buf.write_uint8(TNS_MSG_TYPE_COOKIE)
2418- buf.write_uint8(1 ) # cookie version
2419- buf.write_uint8(self .cookie.protocol_version)
2420- buf.write_uint16(self .cookie.charset_id, BYTE_ORDER_LSB)
2421- buf.write_uint8(self .cookie.flags)
2422- buf.write_uint16(self .cookie.ncharset_id, BYTE_ORDER_LSB)
2423- buf.write_bytes_with_length(self .cookie.server_banner)
2424- buf.write_bytes_with_length(self .cookie.compile_caps)
2425- buf.write_bytes_with_length(self .cookie.runtime_caps)
2420+ buf.write_uint16(0 ) # server charset (unused)
2421+ buf.write_uint8(0 ) # server charset flag (unused)
2422+ buf.write_uint16(0 ) # server ncharset (unused)
2423+ buf._caps.ttc_field_version = TNS_CCAP_FIELD_VERSION_19_1_EXT_1
2424+ buf.write_uint8(buf._caps.ttc_field_version)
24262425 DataTypesMessage._write_message(self .data_types_message, buf)
24272426 AuthMessage._write_message(self .auth_message, buf)
2427+ buf._caps.ttc_field_version = TNS_CCAP_FIELD_VERSION_MAX
24282428
24292429
24302430@cython.final
0 commit comments