@@ -287,6 +287,7 @@ cdef class Protocol(BaseProtocol):
287287 DataTypesMessage data_types_message
288288 FastAuthMessage fast_auth_message
289289 ProtocolMessage protocol_message
290+ bint supports_end_of_response
290291 AuthMessage auth_message
291292
292293 # if we can use OOB, send an urgent message now followed by a reset
@@ -311,10 +312,15 @@ cdef class Protocol(BaseProtocol):
311312 fast_auth_message.auth_message = auth_message
312313 self ._process_message(fast_auth_message)
313314
314- # otherwise, do the normal authentication
315+ # otherwise, do the normal authentication; disable end of response for
316+ # the first two messages as the server does not send an end of response
317+ # for these messages
315318 else :
319+ supports_end_of_response = self ._caps.supports_end_of_response
320+ self ._caps.supports_end_of_response = False
316321 self ._process_message(protocol_message)
317322 self ._process_message(data_types_message)
323+ self ._caps.supports_end_of_response = supports_end_of_response
318324 self ._process_message(auth_message)
319325
320326 # send authorization message a second time, if needed, to respond to
@@ -637,6 +643,7 @@ cdef class BaseAsyncProtocol(BaseProtocol):
637643 DataTypesMessage data_types_message
638644 FastAuthMessage fast_auth_message
639645 ProtocolMessage protocol_message
646+ bint supports_end_of_response
640647 AuthMessage auth_message
641648
642649 # create the messages that need to be sent to the server
@@ -654,10 +661,15 @@ cdef class BaseAsyncProtocol(BaseProtocol):
654661 fast_auth_message.auth_message = auth_message
655662 await self ._process_message(fast_auth_message)
656663
657- # otherwise, do the normal authentication
664+ # otherwise, do the normal authentication; disable end of response for
665+ # the first two messages as the server does not send an end of response
666+ # for these messages
658667 else :
668+ supports_end_of_response = self ._caps.supports_end_of_response
669+ self ._caps.supports_end_of_response = False
659670 await self ._process_message(protocol_message)
660671 await self ._process_message(data_types_message)
672+ self ._caps.supports_end_of_response = supports_end_of_response
661673 await self ._process_message(auth_message)
662674
663675 # send authorization message a second time, if needed, to respond to
0 commit comments