Skip to content

Commit

Permalink
Fix debug related crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
steely-glint committed Aug 2, 2024
1 parent 04f35a1 commit c688921
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/main/java/pe/pi/sctp4j/sctp/SCTPMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ private void dcepMessageDeal(byte[] data) {
}
} catch (Exception x) {
Log.error("Problem with DCOpen " + x.getMessage());
if (Log.getLevel() >= Log.DEBUG) {x.printStackTrace();}

}
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/pe/pi/sctp4j/sctp/SCTPStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public SCTPStreamListener getSCTPStreamListener() {
return _sl;
}

@Override
public String toString() {
return this.getClass().getSimpleName()
+ "[" + this._sno + "]"
Expand Down Expand Up @@ -132,7 +133,7 @@ public void setLabel(String l) {
}

public Integer getNum() {
return new Integer(_sno);
return _sno;
}

public Chunk[] append(DataChunk dc) {
Expand All @@ -158,7 +159,7 @@ public void setBehave(SCTPStreamBehaviour behave) {
* @param chunk
*/
public void outbound(DataChunk chunk) {
chunk.setStreamId(_sno.intValue());
chunk.setStreamId(_sno);
// roll seqno here.... hopefully....
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/pe/pi/sctp4j/sctp/dataChannel/DECP/DCOpen.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ public boolean isAck() {
}

public SCTPStreamBehaviour mkStreamBehaviour() {
Log.debug("Making a behaviour for dcep stream " + new String(_label));
String loglab = _label == null?"_null_":new String(_label);
Log.debug("Making a behaviour for dcep stream " + loglab);
SCTPStreamBehaviour behave = null;
switch (_chanType) {
case RELIABLE:
Expand All @@ -205,7 +206,7 @@ public SCTPStreamBehaviour mkStreamBehaviour() {
break;
}
if (behave != null) {
Log.debug(new String(_label) + " behaviour is " + behave.getClass().getSimpleName());
Log.debug(loglab + " behaviour is " + behave.getClass().getSimpleName());
}

return behave;
Expand Down

0 comments on commit c688921

Please sign in to comment.