@@ -324,14 +324,14 @@ cdef class ReadBuffer:
324324 """
325325 cdef:
326326 ssize_t num_bytes_left, num_bytes_split, max_split_data
327+ uint8_t packet_type, packet_flags
327328 const char_type * source_ptr
328- uint8_t packet_type
329329 char_type * dest_ptr
330330
331331 # if no bytes are left in the buffer, a new packet needs to be fetched
332332 # before anything else can take place
333333 if self ._offset == self ._size:
334- self .receive_packet(& packet_type)
334+ self .receive_packet(& packet_type, & packet_flags )
335335 self .skip_raw_bytes(2 ) # skip data flags
336336
337337 # if there is enough room in the buffer to satisfy the number of bytes
@@ -367,7 +367,7 @@ cdef class ReadBuffer:
367367 while num_bytes > 0 :
368368
369369 # acquire new packet
370- self .receive_packet(& packet_type)
370+ self .receive_packet(& packet_type, & packet_flags )
371371 self .skip_raw_bytes(2 ) # skip data flags
372372
373373 # copy data into the chunked buffer or split buffer, as appropriate
@@ -405,7 +405,8 @@ cdef class ReadBuffer:
405405 errors._raise_err(errors.ERR_UNSUPPORTED_INBAND_NOTIFICATION,
406406 err_num = error_num)
407407
408- cdef int _receive_packet_helper(self , uint8_t * packet_type) except - 1 :
408+ cdef int _receive_packet_helper(self , uint8_t * packet_type,
409+ uint8_t * packet_flags) except - 1 :
409410 """
410411 Receives a packet and updates the pointers appropriately. Note that
411412 multiple packets may be received if they are small enough or a portion
@@ -475,7 +476,8 @@ cdef class ReadBuffer:
475476 if self ._caps.protocol_version < TNS_VERSION_MIN_LARGE_SDU:
476477 self .skip_raw_bytes(2 ) # skip packet checksum
477478 self .read_ub1(packet_type)
478- self .skip_raw_bytes(3 ) # skip reserved byte, header checksum
479+ self .read_ub1(packet_flags)
480+ self .skip_raw_bytes(2 ) # header checksum
479481
480482 # display packet if requested
481483 if DEBUG_PACKETS:
@@ -1079,14 +1081,15 @@ cdef class ReadBuffer:
10791081
10801082 return bytes(output_value).decode()
10811083
1082- cdef int receive_packet(self , uint8_t * packet_type) except - 1 :
1084+ cdef int receive_packet(self , uint8_t * packet_type,
1085+ uint8_t * packet_flags) except - 1 :
10831086 """
10841087 Calls _receive_packet_helper() and checks the packet type. If a
10851088 control packet is received, it is processed and the next packet is
10861089 received.
10871090 """
10881091 while True :
1089- self ._receive_packet_helper(packet_type)
1092+ self ._receive_packet_helper(packet_type, packet_flags )
10901093 if packet_type[0 ] == TNS_PACKET_TYPE_CONTROL:
10911094 self ._process_control_packet()
10921095 continue
0 commit comments