Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing recording file descriptors on more occasions #415

Merged
merged 2 commits into from
Oct 28, 2022
Merged
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
2 changes: 1 addition & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
* Fixed `pyrdp-player` on macOS platforms ({uri-issue}362[#362])
* Fixed `pyrdp-convert` pcap processing when victim IP and MITM IP are the same ({uri-issue}366[#366])
* Fixed NLA redirection problems if original target and NLA redirection target are the same ({uri-issue}342[#342], {uri-issue}343[#343])
* Fixed leak of file descriptors due to missing close on replay file recording ({uri-issue}392[#392], {uri-issue}413[#413])
* Fixed leak of file descriptors due to missing close on replay file recording ({uri-issue}392[#392], {uri-issue}413[#413], {uri-issue}415[#415])
* Added a missing dependency for the GUI on Ubuntu 20.04 LTS ({uri-issue}348[#348], {uri-issue}351[#351], {uri-issue}355[#355])
* No longer assuming every connection will have VirtualChannels ({uri-issue}375[#375])
* Some minor protocol-level fixes ({uri-issue}408[#408])
Expand Down
3 changes: 2 additions & 1 deletion pyrdp/mitm/TCPMITM.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ def onClientDisconnection(self, reason):
if self.recorder.recordFilename:
self.statCounter.logReport(self.log, {"replayFilename":
self.recorder.recordFilename})
self.recorder.finalize()
else:
self.statCounter.logReport(self.log)

self.recorder.finalize()
self.server.disconnect(True)
self.state.clientIp = None

Expand All @@ -123,6 +123,7 @@ def onServerDisconnection(self, reason):
"""

self.recordConnectionClose()
self.recorder.finalize()
self.log.info("Server connection closed. %(reason)s", {"reason": reason.value})
self.client.disconnect(True)

Expand Down