Skip to content

Commit a6b66ed

Browse files
Only look at the end of response byte in version 23c in order to
simplify the code.
1 parent 697a38b commit a6b66ed

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/oracledb/impl/thin/capabilities.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ cdef class Capabilities:
5959
if server_caps[TNS_CCAP_FIELD_VERSION] < self.ttc_field_version:
6060
self.ttc_field_version = server_caps[TNS_CCAP_FIELD_VERSION]
6161
self.compile_caps[TNS_CCAP_FIELD_VERSION] = self.ttc_field_version
62-
if self.ttc_field_version < TNS_CCAP_FIELD_VERSION_19_1 \
62+
if self.ttc_field_version < TNS_CCAP_FIELD_VERSION_23_4 \
6363
or not server_caps[TNS_CCAP_TTC4] & TNS_CCAP_END_OF_REQUEST:
6464
self.compile_caps[TNS_CCAP_TTC4] ^= TNS_CCAP_END_OF_REQUEST
6565

src/oracledb/impl/thin/messages.pyx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,10 @@ cdef class Message:
170170
info.pos = error_pos
171171
info.message = buf.read_str(CS_FORM_IMPLICIT).rstrip()
172172

173-
# an error message always marks the end of a response!
174-
self.end_of_response = True
173+
# an error message marks the end of a response if no explicit end of
174+
# response is available
175+
if not buf._caps.supports_end_of_request:
176+
self.end_of_response = True
175177

176178
cdef int _process_message(self, ReadBuffer buf,
177179
uint8_t message_type) except -1:
@@ -182,6 +184,8 @@ cdef class Message:
182184
elif message_type == TNS_MSG_TYPE_STATUS:
183185
buf.read_ub4(&self.call_status)
184186
buf.read_ub2(&self.end_to_end_seq_num)
187+
if not buf._caps.supports_end_of_request:
188+
self.end_of_response = True
185189
elif message_type == TNS_MSG_TYPE_PARAMETER:
186190
self._process_return_parameters(buf)
187191
elif message_type == TNS_MSG_TYPE_SERVER_SIDE_PIGGYBACK:
@@ -1927,7 +1931,8 @@ cdef class DataTypesMessage(Message):
19271931
buf.read_uint16(&conv_data_type)
19281932
if conv_data_type != 0:
19291933
buf.skip_raw_bytes(4)
1930-
self.end_of_response = True
1934+
if not buf._caps.supports_end_of_request:
1935+
self.end_of_response = True
19311936

19321937
cdef int _write_message(self, WriteBuffer buf) except -1:
19331938
cdef:
@@ -2363,7 +2368,8 @@ cdef class ProtocolMessage(Message):
23632368
uint8_t message_type) except -1:
23642369
if message_type == TNS_MSG_TYPE_PROTOCOL:
23652370
self._process_protocol_info(buf)
2366-
self.end_of_response = True
2371+
if not buf._caps.supports_end_of_request:
2372+
self.end_of_response = True
23672373
else:
23682374
Message._process_message(self, buf, message_type)
23692375

@@ -2416,14 +2422,12 @@ cdef class FastAuthMessage(Message):
24162422
if message_type == TNS_MSG_TYPE_PROTOCOL:
24172423
ProtocolMessage._process_message(self.protocol_message, buf,
24182424
message_type)
2419-
self.end_of_response = False
24202425
elif message_type == TNS_MSG_TYPE_DATA_TYPES:
24212426
DataTypesMessage._process_message(self.data_types_message, buf,
24222427
message_type)
2423-
self.end_of_response = False
24242428
else:
24252429
AuthMessage._process_message(self.auth_message, buf, message_type)
2426-
self.end_of_response = True
2430+
self.end_of_response = self.auth_message.end_of_response
24272431

24282432
cdef int _write_message(self, WriteBuffer buf) except -1:
24292433
"""

0 commit comments

Comments
 (0)