Callisto82 / tftp.net

Implements the TFTP (Trivial File Transfer) protocol (client/server) in an easy-to-use C#/.NET library.
Microsoft Public License
81 stars 38 forks source link

Fixes unhandled exception #31

Closed robeving closed 3 years ago

robeving commented 3 years ago

Fixes https://github.com/Callisto82/tftp.net/issues/30

Callisto82 commented 3 years ago

I wouldn't have thought that such a race condition can be easily reproduced, but obviously I was wrong :) Thanks for your PR! I will gladly merge it. Perhaps we could even add some logging in the exception-handler that you added?

robeving commented 3 years ago

I couldn't see any centralised logging in this class so wasn't sure what to use

Callisto82 commented 3 years ago

It's probably not obvious, because there is not too much logging going on.

Have a look at this function: https://github.com/Callisto82/tftp.net/blob/bc70ff993471946dfbe4ceb0dbba499759136a8d/Tftp.Net/Trace/TftpTrace.cs#L24

It's used in all the places where the library logs stuff.