ZlibOpenSsh.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. namespace Renci.SshNet.Compression
  2. {
  3. /// <summary>
  4. /// Represents "zlib@openssh.org" compression implementation
  5. /// </summary>
  6. public class ZlibOpenSsh : Compressor
  7. {
  8. /// <summary>
  9. /// Gets algorithm name.
  10. /// </summary>
  11. public override string Name
  12. {
  13. get { return "zlib@openssh.org"; }
  14. }
  15. /// <summary>
  16. /// Initializes the algorithm
  17. /// </summary>
  18. /// <param name="session">The session.</param>
  19. public override void Init(Session session)
  20. {
  21. base.Init(session);
  22. session.UserAuthenticationSuccessReceived += Session_UserAuthenticationSuccessReceived;
  23. }
  24. private void Session_UserAuthenticationSuccessReceived(object sender, MessageEventArgs<Messages.Authentication.SuccessMessage> e)
  25. {
  26. this.IsActive = true;
  27. this.Session.UserAuthenticationSuccessReceived -= Session_UserAuthenticationSuccessReceived;
  28. }
  29. }
  30. }