@@ -49,15 +49,13 @@ cdef class Message:
4949 uint8_t function_code
5050 uint32_t call_status
5151 uint16_t end_to_end_seq_num
52+ bint end_of_response
5253 bint error_occurred
5354 bint flush_out_binds
5455 bint resend
5556 bint retry
5657 object warning
5758
58- cdef bint _has_more_data(self , ReadBuffer buf):
59- return buf.bytes_left() > 0 and not self .flush_out_binds
60-
6159 cdef int _initialize(self , BaseThinConnImpl conn_impl) except - 1 :
6260 """
6361 Initializes the message to contain the connection and a place to store
@@ -117,7 +115,6 @@ cdef class Message:
117115 buf.read_ub4(& num_bytes) # oerrdd (logical rowid)
118116 if num_bytes > 0 :
119117 buf.skip_raw_bytes_chunked()
120- buf._in_request = False
121118
122119 # batch error codes
123120 buf.read_ub2(& num_errors) # batch error codes array
@@ -173,6 +170,9 @@ cdef class Message:
173170 info.pos = error_pos
174171 info.message = buf.read_str(CS_FORM_IMPLICIT).rstrip()
175172
173+ # an error message always marks the end of a response!
174+ self .end_of_response = True
175+
176176 cdef int _process_message(self , ReadBuffer buf,
177177 uint8_t message_type) except - 1 :
178178 if message_type == TNS_MSG_TYPE_ERROR:
@@ -187,7 +187,7 @@ cdef class Message:
187187 elif message_type == TNS_MSG_TYPE_SERVER_SIDE_PIGGYBACK:
188188 self ._process_server_side_piggyback(buf)
189189 elif message_type == TNS_MSG_TYPE_END_OF_REQUEST:
190- buf._in_request = False
190+ self .end_of_response = True
191191 else :
192192 errors._raise_err(errors.ERR_MESSAGE_TYPE_UNKNOWN,
193193 message_type = message_type,
@@ -301,10 +301,10 @@ cdef class Message:
301301
302302 cdef int process(self , ReadBuffer buf) except - 1 :
303303 cdef uint8_t message_type
304+ self .end_of_response = False
304305 self .flush_out_binds = False
305- buf._in_request = True
306306 self ._preprocess()
307- while self ._has_more_data(buf) :
307+ while not self .end_of_response :
308308 buf.save_point()
309309 buf.read_ub1(& message_type)
310310 self ._process_message(buf, message_type)
@@ -391,9 +391,6 @@ cdef class MessageWithData(Message):
391391 self .bit_vector = < const char_type* > self .bit_vector_buf.data.as_chars
392392 memcpy(< void * > self .bit_vector, ptr, num_bytes)
393393
394- cdef bint _has_more_data(self , ReadBuffer buf):
395- return buf._in_request and not self .flush_out_binds
396-
397394 cdef bint _is_duplicate_data(self , uint32_t column_num):
398395 """
399396 Returns a boolean indicating if the given column contains data
@@ -848,6 +845,7 @@ cdef class MessageWithData(Message):
848845 self ._process_row_data(buf)
849846 elif message_type == TNS_MSG_TYPE_FLUSH_OUT_BINDS:
850847 self .flush_out_binds = True
848+ self .end_of_response = True
851849 elif message_type == TNS_MSG_TYPE_DESCRIBE_INFO:
852850 buf.skip_raw_bytes_chunked()
853851 self ._process_describe_info(buf, self .cursor, self .cursor_impl)
@@ -1929,6 +1927,7 @@ cdef class DataTypesMessage(Message):
19291927 buf.read_uint16(& conv_data_type)
19301928 if conv_data_type != 0 :
19311929 buf.skip_raw_bytes(4 )
1930+ self .end_of_response = True
19321931
19331932 cdef int _write_message(self , WriteBuffer buf) except - 1 :
19341933 cdef:
@@ -2225,9 +2224,6 @@ cdef class LobOpMessage(Message):
22252224 bint bool_flag
22262225 object data
22272226
2228- cdef bint _has_more_data(self , ReadBuffer buf):
2229- return buf._in_request
2230-
22312227 cdef int _initialize_hook(self ) except - 1 :
22322228 """
22332229 Perform initialization.
@@ -2367,6 +2363,7 @@ cdef class ProtocolMessage(Message):
23672363 uint8_t message_type) except - 1 :
23682364 if message_type == TNS_MSG_TYPE_PROTOCOL:
23692365 self ._process_protocol_info(buf)
2366+ self .end_of_response = True
23702367 else :
23712368 Message._process_message(self , buf, message_type)
23722369
@@ -2410,27 +2407,23 @@ cdef class FastAuthMessage(Message):
24102407 DataTypesMessage data_types_message
24112408 ProtocolMessage protocol_message
24122409 AuthMessage auth_message
2413- bint renegotiate
2414-
2415- cdef bint _has_more_data(self , ReadBuffer buf):
2416- return buf._in_request
24172410
24182411 cdef int _process_message(self , ReadBuffer buf,
24192412 uint8_t message_type) except - 1 :
24202413 """
24212414 Processes the messages returned from the server response.
24222415 """
2423- if message_type == TNS_MSG_TYPE_RENEGOTIATE:
2424- self .renegotiate = True
2425- elif message_type == TNS_MSG_TYPE_PROTOCOL:
2416+ if message_type == TNS_MSG_TYPE_PROTOCOL:
24262417 ProtocolMessage._process_message(self .protocol_message, buf,
24272418 message_type)
2419+ self .end_of_response = False
24282420 elif message_type == TNS_MSG_TYPE_DATA_TYPES:
24292421 DataTypesMessage._process_message(self .data_types_message, buf,
24302422 message_type)
2423+ self .end_of_response = False
24312424 else :
24322425 AuthMessage._process_message(self .auth_message, buf, message_type)
2433- buf._in_request = False
2426+ self .end_of_response = True
24342427
24352428 cdef int _write_message(self , WriteBuffer buf) except - 1 :
24362429 """
0 commit comments