@@ -52,8 +52,6 @@ type session struct {
5252 sentReset bool
5353 stopOnce sync.Once
5454
55- isResendRequestActive bool
56-
5755 targetDefaultApplVerID string
5856
5957 admin chan interface {}
@@ -297,10 +295,6 @@ func (s *session) notifyMessageOut() {
297295
298296// send will validate, persist, queue the message. If the session is logged on, send all messages in the queue.
299297func (s * session ) send (msg * Message ) error {
300- if err := s .isResendRequestBlocking (msg ); err != nil {
301- return err
302- }
303-
304298 return s .sendInReplyTo (msg , nil )
305299}
306300func (s * session ) sendInReplyTo (msg * Message , inReplyTo * Message ) error {
@@ -322,20 +316,6 @@ func (s *session) sendInReplyTo(msg *Message, inReplyTo *Message) error {
322316 return nil
323317}
324318
325- func (s * session ) isResendRequestBlocking (msg * Message ) error {
326- msgType , err := msg .Header .GetBytes (tagMsgType )
327- if err != nil {
328- return err
329- }
330-
331- if s .isResendRequestActive && ! bytes .Equal (msgType , msgTypeResendRequest ) {
332- s .log .OnEvent ("Message blocked: resend request in progress" )
333- return errors .New ("cannot send message while resend request is active" )
334- }
335-
336- return nil
337- }
338-
339319// dropAndReset will drop the send queue and reset the message store.
340320func (s * session ) dropAndReset () error {
341321 s .sendMutex .Lock ()
@@ -463,12 +443,12 @@ func (s *session) sendBytes(msg []byte, blockUntilSent bool) bool {
463443 }
464444}
465445
466- func (s * session ) doTargetTooHigh (reject targetTooHigh , isReject bool ) (nextState resendState , err error ) {
446+ func (s * session ) doTargetTooHigh (reject targetTooHigh ) (nextState resendState , err error ) {
467447 s .log .OnEventf ("MsgSeqNum too high, expecting %v but received %v" , reject .ExpectedTarget , reject .ReceivedTarget )
468- return s .sendResendRequest (reject .ExpectedTarget , reject .ReceivedTarget - 1 , isReject )
448+ return s .sendResendRequest (reject .ExpectedTarget , reject .ReceivedTarget - 1 )
469449}
470450
471- func (s * session ) sendResendRequest (beginSeq , endSeq int , isReject bool ) (nextState resendState , err error ) {
451+ func (s * session ) sendResendRequest (beginSeq , endSeq int ) (nextState resendState , err error ) {
472452 nextState .resendRangeEnd = endSeq
473453
474454 resend := NewMessage ()
@@ -497,9 +477,6 @@ func (s *session) sendResendRequest(beginSeq, endSeq int, isReject bool) (nextSt
497477 return
498478 }
499479 s .log .OnEventf ("Sent ResendRequest FROM: %v TO: %v" , beginSeq , endSeqNo )
500- if ! isReject {
501- s .isResendRequestActive = true
502- }
503480
504481 return
505482}
0 commit comments