Hi,

   +-From: "Jerome Lacoste" <[EMAIL PROTECTED]> --
   |_Date: Thu, 24 Jan 2008 12:00:59 +0100 ______________
   |
   |This happened once:
   |Caused by: java.lang.NullPointerException
   |        at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2313)
   |        at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2339)
   |        at com.jcraft.jsch.ChannelSftp.checkStatus(ChannelSftp.java:1920)
   |        at com.jcraft.jsch.ChannelSftp.access$200(ChannelSftp.java:36)
   |        at com.jcraft.jsch.ChannelSftp$1.flush(ChannelSftp.java:708)
   ...

Thank you for feedback.
I have fxed it.

Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
    +1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/

--- jsch-0.1.37/src/com/jcraft/jsch/ChannelSftp.java    Wed Jan 23 01:55:25 2008
+++ jsch-0.1.38/src/com/jcraft/jsch/ChannelSftp.java    Wed Jan 23 02:16:43 2008
@@ -139,6 +139,7 @@
   private String version=String.valueOf(client_version);
 
   private java.util.Hashtable extensions=null;
+  private InputStream io_in=null;
 
 /*
 10. Changes from previous protocol versions
@@ -179,6 +180,8 @@
       PipedInputStream pis=new MyPipedInputStream(pos, 32*1024);
       io.setInputStream(pis);
 
+      io_in=io.in;
+
       Request request=new RequestSftp();
       request.request(session, this);
 
@@ -528,8 +531,8 @@
         while(_i>0){
           _i-=sendWRITE(handle, offset, data, 0, _i);
           if((seq-1)==startid ||
-             io.in.available()>=1024){
-            while(io.in.available()>0){
+             io_in.available()>=1024){
+            while(io_in.available()>0){
               if(checkStatus(ackid, header)){
                 _ackid=ackid[0];
                 if(startid>_ackid || _ackid>seq-1){
@@ -665,8 +668,8 @@
               s+=sent;
               _len-=sent;
               if((seq-1)==startid ||
-                 io.in.available()>=1024){
-                while(io.in.available()>0){
+                 io_in.available()>=1024){
+                while(io_in.available()>0){
                   if(checkStatus(ackid, header)){
                     _ackid=ackid[0];
                     if(startid>_ackid || _ackid>seq-1){
@@ -928,7 +931,7 @@
           if(bar>buf.buffer.length){
             bar=buf.buffer.length;
           }
-          i=io.in.read(buf.buffer, 0, bar);
+          i=io_in.read(buf.buffer, 0, bar);
           if(i<0){
             break loop;
          }
@@ -941,7 +944,7 @@
           if(monitor!=null){
             if(!monitor.count(data_len)){
               while(foo>0){
-                i=io.in.read(buf.buffer, 
+                i=io_in.read(buf.buffer, 
                              0, 
                              (buf.buffer.length<foo?buf.buffer.length:foo));
                 if(i<=0) break;
@@ -1105,7 +1108,7 @@
                if(bar>len){
                  bar=len;
                }
-               i=io.in.read(d, s, bar);
+               i=io_in.read(d, s, bar);
                if(i<0){
                  return -1;
                }
@@ -1119,7 +1122,7 @@
                  int _len=rest_length;
                  int j;
                  while(_len>0){
-                   j=io.in.read(rest_byte, _s, _len);
+                   j=io_in.read(rest_byte, _s, _len);
                    if(j<=0)break;
                    _s+=j;
                    _len-=j;
@@ -1146,7 +1149,7 @@
                if(foo>buf.buffer.length){
                  foo=buf.buffer.length;
                }
-               io.in.read(buf.buffer, 0, foo);
+               io_in.read(buf.buffer, 0, foo);
                rest_length-=foo;
              }
              */
@@ -1910,7 +1913,7 @@
   private void read(byte[] buf, int s, int l) throws IOException, 
SftpException{
     int i=0;
     while(l>0){
-      i=io.in.read(buf, s, l);
+      i=io_in.read(buf, s, l);
       if(i<=0){
         throw new SftpException(SSH_FX_FAILURE, "");
       }
@@ -2157,7 +2160,7 @@
        if(length>0){
          buf.shift();
           int j=(buf.buffer.length>(buf.index+length)) ? length : 
(buf.buffer.length-buf.index);
-         i=io.in.read(buf.buffer, buf.index, j);
+         i=io_in.read(buf.buffer, buf.index, j);
          if(i<=0)break;
          buf.index+=i;
          length-=i;
@@ -2321,7 +2324,7 @@
     int i=0;
     int foo=s;
     while(len>0){
-      i=io.in.read(buf, s, len);
+      i=io_in.read(buf, s, len);
       if(i<=0){
         throw new IOException("inputstream is closed");
         //return (s-foo)==0 ? i : s-foo;
@@ -2333,7 +2336,7 @@
   }
   private void skip(long foo) throws IOException{
     while(foo>0){
-      long bar=io.in.skip(foo);
+      long bar=io_in.skip(foo);
       if(bar<=0) 
         break;
       foo-=bar;
@@ -2408,6 +2411,19 @@
     return (String)extensions.get(key);
   }
 
+  public String realpath(String path) throws SftpException{
+    try{
+      byte[] _path=_realpath(remoteAbsolutePath(path));
+      return Util.byte2str(_path, fEncoding);
+    }
+    catch(Exception e){
+      if(e instanceof SftpException) throw (SftpException)e;
+      if(e instanceof Throwable)
+        throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
+      throw new SftpException(SSH_FX_FAILURE, "");
+    }
+  }
+
   public class LsEntry {
     private  String filename;
     private  String longname;

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to