Project

General

Profile

GitHub #1113

Fix sequence checking logic

Added by Anonymous 5 months ago.

Status:
Feedback
Priority:
Normal
Assignee:
Target version:
-
Start date:
Due date:
% Done:

0%


Description

Issue:
- Sequence checking logic is currently broken.
- When getNextSequence() is called, it returns ascii character equivalent to this.sequence-1.
- This sequence character is used in the request sent to library ACS.
- When StrictSequenceChecking is enabled, response sequence number character should be same as
the request sequence number character.
- Current implementation checks the response sequence character against the incremented
sequence number character (to be used for next request) and results in exception.

SIP2 Error Handling using Sequence Number:
- the sequence number field’s value of the response should match the sequence number value from the message being responded to.

Solution:
- Increment and return the incremented sequence number character.
- Now equality holds for sequence number characters of request and subsequent response.

Bonus: SocketConnection.java
- use StringBuilder; recommended for single threaded operations.
- do not convert string buffer to String every time to check the lastIndexOf, use the method provided
by StringBuffer/StringBuilder class.
- Make SocketConnection autoclosable, so that it could be closed automatically when used with try-with-resource block.

History

#1 Updated by Anonymous 5 months ago

Merged commit into upstream git repository

Also available in: Atom PDF