sepalani / MH3SP

Monster Hunter 3 (~tri) Server Project
GNU Affero General Public License v3.0
195 stars 19 forks source link

Workaround to prevent TLS handshakes to hang the server #121

Closed sepalani closed 1 year ago

sepalani commented 1 year ago

Generic alternative to https://github.com/sepalani/MH3SP/pull/120.

sepalani commented 1 year ago

As per the stackoverflow's post that you linked. We have to timeout non-responsive TCP connections. I suppose that's handled by the previous client_socket.settimeout which is nice.

@InusualZ Yeah, we've already used the settimeout to handle ill-formed packets. If we find another way to handle them, we'd have to restore the previous timeout setting after calling the SSL wrap function. I also addressed your comment.

Code seems good to me, I still need to test in on real hardware to make sure it doesn't introduce regressions.

sepalani commented 1 year ago

Tested and working on real hardware.