You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/08/26 14:21:19 UTC
DO NOT REPLY [Bug 22726] New: -
SCP task fails with zero targets
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22726>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22726
SCP task fails with zero targets
Summary: SCP task fails with zero targets
Product: Ant
Version: 1.6Alpha (nightly)
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Optional Tasks
AssignedTo: dev@ant.apache.org
ReportedBy: uv@upaya.co.uk
When the SCP task receives an empty file set, it hangs permanently.
Looking in org.apache.tools.ant.taskdefs.optional.ssh.ScpToMessage.java, in the
method doMultipleTransfer, you'll see:
channel.connect();
waitForAck(in);
for (Iterator i = directoryList.iterator(); i.hasNext();) {
Directory current = (Directory) i.next();
sendDirectory(current, in, out);
}
waitForAck(in);
Now, to my mind, this will connect, and wait for an ack, then send all
directories, and wait for another ack. But what if directoryList is empty? We
effectively end up with waitForAck(in) called twice in succession, without any
actions in between. It would therefore appear that the SCP task is waiting for
an ack it wouldn't get.
Replacing the second ack with:
if (directoryList.size()!=0) {
waitForAck(in);
}
Should fix it.
[Note - I do not have an Ant development environment set up, so I am unable to
test this fix].
Upayavira
upayavira@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org