EpicEric / sandhole

Expose HTTP/SSH/TCP services through SSH port forwarding
https://epiceric.github.io/sandhole/
MIT License
0 stars 0 forks source link

Try to optimize ServerHandler's memory usage #8

Closed EpicEric closed 1 day ago

EpicEric commented 2 days ago

The ServerHandler struct currently (as of this writing) sits at 408 bytes, which gets created for every SSH connection that comes in. Perhaps it might be worth shaving off some extra bytes, especially as this could lead to DoS from too many unauthenticated sessions.

EpicEric commented 1 day ago

One possibility is to have fields that are exclusive to authenticated users (User, Admin) moved to an Option<Box<...>>