Skip to content

Commit

Permalink
removed method TCPConnection.on_passive_close()
Browse files Browse the repository at this point in the history
Even though this method is conceptually correct, it is useless because neither WISP nor fetch() support closing only our half of the TCP connection.
  • Loading branch information
chschnell authored and copy committed Nov 26, 2024
1 parent 0e98beb commit 5a3b77d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
5 changes: 1 addition & 4 deletions src/browser/fake_network.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ TCPConnection.prototype.process = function(packet) {
// dbg_log(`TCP[${this.tuple}]: received FIN in state "${this.state}, next "${TCP_STATE_CLOSE_WAIT}""`, LOG_FETCH);
reply.tcp.ack = true;
this.state = TCP_STATE_CLOSE_WAIT;
this.on_passive_close();
// NOTE that we should forward the CLOSE event from the guest here, but neither WISP nor fetch() support that
}
else if(this.state === TCP_STATE_FIN_WAIT_1) {
if(packet.tcp.ack) {
Expand Down Expand Up @@ -1237,9 +1237,6 @@ TCPConnection.prototype.close = function() {
this.pump();
};

TCPConnection.prototype.on_passive_close = function() {
};

TCPConnection.prototype.release = function() {
if(this.net.tcp_conn[this.tuple]) {
// dbg_log(`TCP[${this.tuple}]: connection closed in state "${this.state}"`, LOG_FETCH);
Expand Down
8 changes: 0 additions & 8 deletions src/browser/wisp_network.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,6 @@ WispNetworkAdapter.prototype.send = function(data)
}
};

tcp_conn.on_passive_close = () => {
this.send_wisp_frame({
type: "CLOSE",
stream_id: tcp_conn.stream_id,
reason: 0x02 // 0x02: Voluntary stream closure
});
};

this.send_wisp_frame({
type: "CONNECT",
stream_id: tcp_conn.stream_id,
Expand Down

0 comments on commit 5a3b77d

Please sign in to comment.