ZlibOpenSsh.cs 1.0 KB

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