ZlibOpenSsh.cs 1.1 KB

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