Skip to content

Commit

Permalink
Fix for usnistgov#53 Issue usnistgov#53
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirralev committed Jan 6, 2020
1 parent 79e3788 commit b586569
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/gov/nist/javax/sip/header/SIPHeaderList.java
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,22 @@ protected String encodeBody() {

protected StringBuilder encodeBody(StringBuilder buffer) {
ListIterator<HDR> iterator = this.listIterator();

while (true) {
SIPHeader sipHeader = (SIPHeader) iterator.next();
if ( sipHeader == this ) throw new RuntimeException ("Unexpected circularity in SipHeaderList");
int buffPosDelta = buffer.length();
sipHeader.encodeBody(buffer);
buffPosDelta -= buffer.length();
// if (body.equals("")) System.out.println("BODY == ");
if (iterator.hasNext()) {
if (!this.headerName.equals(PrivacyHeader.NAME))
buffer.append(Separators.COMMA);
else
buffer.append(Separators.SEMICOLON);
continue;
if(buffPosDelta != 0) {
if (!this.headerName.equals(PrivacyHeader.NAME))
buffer.append(Separators.COMMA);
else
buffer.append(Separators.SEMICOLON);
continue;
}
} else
break;

Expand Down

0 comments on commit b586569

Please sign in to comment.