RE: [JSch-users] Data loss when transferring multiple files using ant/scp
Status: Alpha
Brought to you by:
ymnk
From: STEELE E. <Edw...@rt...> - 2003-11-28 05:51:19
|
Well done. This patch seems to fix the problem. I've had it running continuously for about an hour without a glitch. In addition to the standard testcase, I tried a larger, deeper tree many times without problems. (The patch didn't apply cleanly to a stock 1.6b2 tree but that's not a problem :-) ) Thank you so much for your help. Edwin. > -----Original Message----- > From: ym...@jc... [mailto:ym...@jc...] > Sent: Friday, 28 November 2003 1:20 PM > To: STEELE Edwin > Cc: jsc...@li...; ste...@fr... > Subject: Re: [JSch-users] Data loss when transferring multiple files > using ant/scp > > > Hi, > > At last, I could reproduce that problem on my environment and > I found a problem in ant's scp task. > Please try the following patch. > > It seems ant's scp task had missed to get responses from the > remote scp. > By that patch, for example, I could transfer some directory, > which includes 7 thousands files and is sized 160M bytes in total, > to the remote host without broken files. > > Stefan, please review this patch. > I think that it should be merged before its formal release 1.6. > > Thanks, > -- > ymnk > > /*****************************************/ > diff -Naur > apache-ant-1.6beta2/src/main/org/apache/tools/ant/taskdefs/opt > ional/ssh/ScpToMessage.java > apache-ant-1.6beta2.scp/src/main/org/apache/tools/ant/taskdefs > /optional/ssh/ScpToMessage.java > --- > apache-ant-1.6beta2/src/main/org/apache/tools/ant/taskdefs/opt > ional/ssh/ScpToMessage.java 2003-10-16 21:54:08.000000000 +0000 > +++ > apache-ant-1.6beta2.scp/src/main/org/apache/tools/ant/taskdefs > /optional/ssh/ScpToMessage.java 2003-11-28 > 00:28:26.000000000 +0000 > @@ -113,7 +113,7 @@ > > waitForAck(in); > sendFileToRemote(localFile, in, out); > - waitForAck(in); > + //waitForAck(in); > } finally { > if (channel != null) { > channel.disconnect(); > @@ -134,7 +134,7 @@ > Directory current = (Directory) i.next(); > sendDirectory(current, in, out); > } > - waitForAck(in); > + //waitForAck(in); > } finally { > if (channel != null) { > channel.disconnect(); > @@ -167,6 +167,7 @@ > waitForAck(in); > sendDirectory(directory, in, out); > out.write("E\n".getBytes()); > + waitForAck(in); > } > > private void sendFileToRemote(File localFile, > @@ -200,6 +201,7 @@ > } > out.flush(); > sendAck(out); > + waitForAck(in); > } finally { > long endTime = System.currentTimeMillis(); > logStats(startTime, endTime, totalLength); > IMPORTANT NOTICE: This e-mail and any attachment to it is intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. If you receive this e-mail in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient. The RTA is not responsible for any unauthorised alterations to this e-mail or attachment to it. |