Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ public Optional<Tag> onSave() {

@Override
public void onStop() {
for (final SessionBase session : sessions.values()) {
// Avoid concurrent modifications
final HashMap<SessionDiscriminator<?>, SessionBase> clone = new HashMap<>(sessions);
for (final SessionBase session : clone.values()) {
session.expire();
sessionLayer.sendSession(session, null);
closeSession(session);
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/li/cil/oc2/common/inet/StreamSessionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,13 @@ SessionActions send(final StreamSessionImpl session, final ByteBuffer segment) {
}
}
session.vmWindow = header.window;
if (header.psh) {
// Data to be sent
session.vmSequence += length;
final ByteBuffer sendBuffer = session.sendBuffer;
sendBuffer.compact();
sendBuffer.put(segment);
sendBuffer.flip();
// Data to be sent
session.vmSequence += length;
final ByteBuffer sendBuffer = session.sendBuffer;
sendBuffer.compact();
sendBuffer.put(segment);
sendBuffer.flip();
if (header.psh || length > 0) {
session.needsAcknowledgment = true;
}
if (header.fin) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/li/cil/oc2/common/inet/TcpHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void acceptConnection(final int sequence, final int acknowledgment, final
}

public boolean isAcceptanceOrRejectionAcknowledged() {
return !syn && !urg && ack && !psh && !rst && !fin;
return !syn && !urg && ack && !rst && !fin;
}

public void rejectConnection(final int sequence, final int acknowledgment) {
Expand Down