mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-24 16:23:12 +09:00
Handle virtual links in Link._clearPendingRequests
When a request is forwarded from a virtual link to a WebSocket link as is the case when an instance sends a request to the controller the origin for the request is a virtual link. Handle this case in _clearPendingRequests instead of throwing an assertion error.
This commit is contained in:
1 parent
123148e277
commit
96bd5fb1c2
2 files changed
+12
-5
No files matched your search
@@ -14,6 +14,7 @@
|
|||||||
- Fixed controller only plugins throwing an error about missing a config field on startup out when added to hosts.
|
- Fixed controller only plugins throwing an error about missing a config field on startup out when added to hosts.
|
||||||
- Fixed installer incorrectly claiming the options --factorio-dir and --no-download-headless conflicts with each other.
|
- Fixed installer incorrectly claiming the options --factorio-dir and --no-download-headless conflicts with each other.
|
||||||
- Fixed a memory leak on every request sent over the WebSocket.
|
- Fixed a memory leak on every request sent over the WebSocket.
|
||||||
|
- Fixed assertion error on closing or invalidating a link with messages forwarded from a virtual link.
|
||||||
|
|
||||||
|
|
||||||
## Version 2.0.0-alpha.14
|
## Version 2.0.0-alpha.14
|
||||||
|
|||||||
@@ -153,12 +153,18 @@ export class Link {
|
|||||||
pending.reject(err);
|
pending.reject(err);
|
||||||
}
|
}
|
||||||
for (let pending of this._forwardedRequests.values()) {
|
for (let pending of this._forwardedRequests.values()) {
|
||||||
assert(pending.origin.connector instanceof WebSocketBaseConnector);
|
// Drop response if the origin is a WebSocket and the session
|
||||||
if (pending.origin.connector.hasSession) {
|
// has expired. The other end of the link will have sent an
|
||||||
pending.origin.connector.sendResponseError(
|
// error response to the request in this case.
|
||||||
new libData.ResponseError(err.message, err.code), pending.src, pending.dst
|
if (
|
||||||
);
|
pending.origin.connector instanceof WebSocketBaseConnector
|
||||||
|
&& !pending.origin.connector.hasSession
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
pending.origin.connector.sendResponseError(
|
||||||
|
new libData.ResponseError(err.message, err.code), pending.src, pending.dst
|
||||||
|
);
|
||||||
}
|
}
|
||||||
this._pendingRequests.clear();
|
this._pendingRequests.clear();
|
||||||
this._forwardedRequests.clear();
|
this._forwardedRequests.clear();
|
||||||
|
|||||||
Reference in new issue
Block a user