Пример #1
0
 private void initInflater(string method)
 {
     if (method.Equals("none"))
     {
         inflater = null;
         return;
     }
     string foo = getConfig(method);
     if (foo != null)
     {
         if (method.Equals("zlib") ||
            (isAuthed && method.Equals("*****@*****.**")))
         {
             try
             {
                 Type c = Type.GetType(foo);
                 inflater = (Compression)(c.newInstance());
                 inflater.init(Compression.INFLATER, 0);
             }
             catch (Exception ee)
             {
                 throw new JSchException(ee.ToString(), ee);
                 //Console.Error.WriteLine(foo+" isn't accessible.");
             }
         }
     }
 }
Пример #2
0
 private void initDeflater(string method)
 {
     if (method.Equals("none"))
     {
         deflater = null;
         return;
     }
     string foo = getConfig(method);
     if (foo != null)
     {
         if (method.Equals("zlib") ||
            (isAuthed && method.Equals("*****@*****.**")))
         {
             try
             {
                 Type c = Type.GetType(foo);
                 deflater = (Compression)(c.newInstance());
                 int level = 6;
                 try { level = int.Parse(getConfig("compression_level")); }
                 catch /*(Exception ee)*/ { }
                 deflater.init(Compression.DEFLATER, level);
             }
             catch (Exception ee)
             {
                 throw new JSchException(ee.ToString(), ee);
                 //Console.Error.WriteLine(foo+" isn't accessible.");
             }
         }
     }
 }