Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#5951 closed defect (fixed)

Don't keep file_handle around on windows for mmap

Reported by: nickm Owned by:
Priority: Low Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

It looks as if the file_handle we keep around in our windows tor_mmap_t is needless. A pseudonymous person who has in the past asked not to be named, provides a patch (attached) to correct this.

I'm making a branch against 0.2.2.x. If this turns out to actually help with Kaspersky or something, let's backport it. Otherwise, I'd propose it for merge into 0.2.3.x.

Child Tickets

Attachments (1)

170806.txt (2.1 KB) - added by nickm 8 years ago.

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by nickm

Attachment: 170806.txt added

comment:1 Changed 8 years ago by nickm

Status: newneeds_review

Branch "close_file_mapping" in my public repo has the patch and a changes file.

Assuming that the author still doesn't like to be named. If you'd like credit, just let me know.

comment:2 in reply to:  description Changed 8 years ago by Shondoit

Replying to nickm:

If this turns out to actually help with Kaspersky or something, let's backport it.

It doesn't. At least not with TBB 2.2.35-12 and this patch applied.
It seems to not break stuff otherwise.

comment:3 Changed 8 years ago by arma

Patch looks plausible. Suggest 0.2.3 since shondoit says it doesn't help him.

As a minor fix,

-  res->file_handle = CreateFile(tfilename,
+  file_handle = CreateFile(tfilename,
                                 GENERIC_READ, FILE_SHARE_READ,
                                 ...

will want some reindenting.

comment:4 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Merging into master then, with reindentation fix. Thanks, everyone!

comment:5 Changed 7 years ago by nickm

Keywords: tor-client added

comment:6 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.