public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/27163] New: FTP directory listing doesn't work
@ 2006-04-14 17:28 r_ovidius at eml dot cc
2006-04-19 18:39 ` [Bug classpath/27163] " tromey at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: r_ovidius at eml dot cc @ 2006-04-14 17:28 UTC (permalink / raw)
To: java-prs
GCJ 4.1.0
The following prints the ftp directory list when using Sun's java. With gcj it
does not.
(The first url (microsoft) prints nothing, the second (gcc.gnu.org) results in
gnu.java.net.protocol.ftp.FTPException: Invalid number of arguments.
at gnu.java.net.protocol.ftp.FTPConnection.changeWorkingDirectory
(libgcj.so.7)
at gnu.java.net.protocol.ftp.FTPURLConnection.getInputStream (libgcj.so.7)
at java.net.URL.openStream (libgcj.so.7)
at Ftest.main (Ftest)
)
---
import java.net.*;
import java.util.*;
import java.io.*;
public class Ftest {
public static void main(String[] args) {
String url = "ftp://ftp.microsoft.com/ResKit/y2kfix/";
// String url = ftp://gcc.gnu.org/";
try {
InputStream input = (new URL(url)).openStream();
BufferedReader file = new BufferedReader(new InputStreamReader(input));
System.err.println("START");
while (file.ready()) {
String line = file.readLine();
System.err.println(">" + line + "<");
}
System.err.println("DONE");
} catch (Exception e) {
e.printStackTrace();
}
}
}
--
Summary: FTP directory listing doesn't work
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: r_ovidius at eml dot cc
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27163
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug classpath/27163] FTP directory listing doesn't work
2006-04-14 17:28 [Bug libgcj/27163] New: FTP directory listing doesn't work r_ovidius at eml dot cc
@ 2006-04-19 18:39 ` tromey at gcc dot gnu dot org
2006-04-19 18:56 ` tromey at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-04-19 18:39 UTC (permalink / raw)
To: java-prs
------- Comment #1 from tromey at gcc dot gnu dot org 2006-04-19 18:39 -------
I spent some time looking into this bug today.
I am not certain that it is a bug, but I'm also not convinced
that it isn't.
I tracked it down to the ftp data socket's available() method
returning 0. This causes the 'file.ready()' condition on the loop
to return false.
The test case does work for me on occasion... if the timing is right,
data will be available on the socket for reading, and the ready() test
will succeed.
If this is a bug it is a rather obscure one, as in, perhaps the ftp
code should ensure that some bytes are available before returning the
input stream.
It is probably more usual for loops like this to simply call
readLine and then break out if it returns null. When I change the
test case to do this, it works all the time.
I only see the exception with gij 4.1 (not trunk) and the gcc.gnu.org site.
I haven't looked into this yet.
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-04-19 18:39:12
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27163
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug classpath/27163] FTP directory listing doesn't work
2006-04-14 17:28 [Bug libgcj/27163] New: FTP directory listing doesn't work r_ovidius at eml dot cc
2006-04-19 18:39 ` [Bug classpath/27163] " tromey at gcc dot gnu dot org
@ 2006-04-19 18:56 ` tromey at gcc dot gnu dot org
2006-04-20 17:20 ` r_ovidius at eml dot cc
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-04-19 18:56 UTC (permalink / raw)
To: java-prs
------- Comment #2 from tromey at gcc dot gnu dot org 2006-04-19 18:56 -------
Subject: Bug 27163
Author: tromey
Date: Wed Apr 19 18:56:10 2006
New Revision: 113091
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113091
Log:
PR classpath/27163:
* gnu/java/net/protocol/ftp/ActiveModeDTP.java: Replaced with
latest classpath version.
* gnu/java/net/protocol/ftp/FTPURLConnection.java: Likewise.
Modified:
branches/gcc-4_1-branch/libjava/classpath/ChangeLog.gcj
branches/gcc-4_1-branch/libjava/classpath/gnu/java/net/protocol/ftp/ActiveModeDTP.java
branches/gcc-4_1-branch/libjava/classpath/gnu/java/net/protocol/ftp/FTPURLConnection.java
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27163
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug classpath/27163] FTP directory listing doesn't work
2006-04-14 17:28 [Bug libgcj/27163] New: FTP directory listing doesn't work r_ovidius at eml dot cc
2006-04-19 18:39 ` [Bug classpath/27163] " tromey at gcc dot gnu dot org
2006-04-19 18:56 ` tromey at gcc dot gnu dot org
@ 2006-04-20 17:20 ` r_ovidius at eml dot cc
2006-04-21 19:05 ` tromey at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: r_ovidius at eml dot cc @ 2006-04-20 17:20 UTC (permalink / raw)
To: java-prs
------- Comment #3 from r_ovidius at eml dot cc 2006-04-20 17:20 -------
Try with
String url = "ftp://gcc.gnu.org";
(notice the missing "/" at the end). This results in
gnu.java.net.protocol.ftp.FTPException: Invalid number of arguments.
at gnu.java.net.protocol.ftp.FTPConnection.changeWorkingDirectory
(libgcj.so.7)
at gnu.java.net.protocol.ftp.FTPURLConnection.getInputStream (libgcj.so.7)
at java.net.URL.openStream (libgcj.so.7)
with gcj (GCC) 4.2.0 20060419 (experimental).
Further, the "while (file.ready())" never seems to return false in Sun's java,
while it does with gcj, so I'd wager on the "obscure bug".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27163
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug classpath/27163] FTP directory listing doesn't work
2006-04-14 17:28 [Bug libgcj/27163] New: FTP directory listing doesn't work r_ovidius at eml dot cc
` (2 preceding siblings ...)
2006-04-20 17:20 ` r_ovidius at eml dot cc
@ 2006-04-21 19:05 ` tromey at gcc dot gnu dot org
2006-04-21 21:44 ` cvs-commit at developer dot classpath dot org
2006-04-21 21:53 ` tromey at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-04-21 19:05 UTC (permalink / raw)
To: java-prs
------- Comment #4 from tromey at gcc dot gnu dot org 2006-04-21 19:05 -------
Ok, I have a fix for the /-less URL bug.
It appears that the JDK somehow waits for some data to be available
on the socket. I'm not sure exactly what mechanism it uses, however.
It does not appear to buffer all the data; in my tests, a request for
a large file will still only show a few thousand bytes as available().
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27163
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug classpath/27163] FTP directory listing doesn't work
2006-04-14 17:28 [Bug libgcj/27163] New: FTP directory listing doesn't work r_ovidius at eml dot cc
` (3 preceding siblings ...)
2006-04-21 19:05 ` tromey at gcc dot gnu dot org
@ 2006-04-21 21:44 ` cvs-commit at developer dot classpath dot org
2006-04-21 21:53 ` tromey at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at developer dot classpath dot org @ 2006-04-21 21:44 UTC (permalink / raw)
To: java-prs
------- Comment #5 from cvs-commit at developer dot classpath dot org 2006-04-21 21:44 -------
Subject: Bug 27163
CVSROOT: /cvsroot/classpath
Module name: classpath
Branch:
Changes by: Tom Tromey <tromey@savannah.gnu.org> 06/04/21 21:43:10
Modified files:
. : ChangeLog
gnu/java/net/protocol/ftp: FTPConnection.java
Log message:
PR classpath/27163:
* gnu/java/net/protocol/ftp/FTPConnection.java
(changeWorkingDirectory): Do nothing if path is empty.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.7184&tr2=1.7185&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/net/protocol/ftp/FTPConnection.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27163
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug classpath/27163] FTP directory listing doesn't work
2006-04-14 17:28 [Bug libgcj/27163] New: FTP directory listing doesn't work r_ovidius at eml dot cc
` (4 preceding siblings ...)
2006-04-21 21:44 ` cvs-commit at developer dot classpath dot org
@ 2006-04-21 21:53 ` tromey at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-04-21 21:53 UTC (permalink / raw)
To: java-prs
------- Comment #6 from tromey at gcc dot gnu dot org 2006-04-21 21:53 -------
Subject: Bug 27163
Author: tromey
Date: Fri Apr 21 21:53:27 2006
New Revision: 113151
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113151
Log:
PR classpath/27163:
* gnu/java/net/protocol/ftp/FTPConnection.java
(changeWorkingDirectory): Do nothing if path is empty.
Modified:
branches/gcc-4_1-branch/libjava/classpath/ChangeLog.gcj
branches/gcc-4_1-branch/libjava/classpath/gnu/java/net/protocol/ftp/FTPConnection.java
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27163
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-04-21 21:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-14 17:28 [Bug libgcj/27163] New: FTP directory listing doesn't work r_ovidius at eml dot cc
2006-04-19 18:39 ` [Bug classpath/27163] " tromey at gcc dot gnu dot org
2006-04-19 18:56 ` tromey at gcc dot gnu dot org
2006-04-20 17:20 ` r_ovidius at eml dot cc
2006-04-21 19:05 ` tromey at gcc dot gnu dot org
2006-04-21 21:44 ` cvs-commit at developer dot classpath dot org
2006-04-21 21:53 ` tromey at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).