public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/14009] New: libgcj HttpURLConnection does not handle situation where retrieving url without training slash after domain.
@ 2004-02-04  1:44 k dot allan-gcc at au dot darkbluesea dot com
  2004-02-04  1:47 ` [Bug libgcj/14009] " k dot allan-gcc at au dot darkbluesea dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: k dot allan-gcc at au dot darkbluesea dot com @ 2004-02-04  1:44 UTC (permalink / raw)
  To: gcc-bugs

gnu.java.net.protocol.http.Connection.sendRequest() does not handle situation
where a URL like "http://www.apache.org" (without trailing slash) is specified.

For the attached example, the following is executed via Sun Java:
  [ken@deviation spider]$ /usr/j2sdk1.4.2_01/bin/javac test.java
  [ken@deviation spider]$ java test apache.org
  Retrieveing: http://apache.org/
  Got: 8613 bytes
  Retrieveing: http://apache.org
  Got: 8613 bytes

When compiled and run with GCJ, the following happens:
  [ken@deviation spider]$ CLASSPATH=/opt/gcc/share/java/libgcj-3.5.0.jar
/opt/gcc/bin/gcj -ggdb -O --main=test test.java -o test &&
LD_LIBRARY_PATH=/opt/gcc/lib ./test apache.org
  Retrieveing: http://apache.org/
  Got: 8613 bytes
  Retrieveing: http://apache.org
  Exception in thread "main" java.io.IOException: Server reply was unparseable:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   at gnu.java.net.protocol.http.Connection.receiveReply()
(/opt/gcc/lib/libgcj.so.6.0.0)
   at gnu.java.net.protocol.http.Connection.connect() (/opt/gcc/lib/libgcj.so.6.0.0)
   at gnu.java.net.protocol.http.Connection.getInputStream()
(/opt/gcc/lib/libgcj.so.6.0.0)
   at test.main(java.lang.String[]) (/home/ken/workspace/spider/test.java:27)

The server-reply-unparseable error is due to the fact that the request was sent
out as "GET  HTTP/1.1", and the webserver just sends back an HTMLified error
page sans the HTTP response headers.

What GCJ should be doing in this case is sending the request as "GET / HTTP/1.1"
and not "GET  HTTP/1.0". One could probably get caught up in the argument
whether the original URL is syntactically correct, but the Sun implementation
works as expected, so the GCJ one should probably try to emulate that behaviour.

-- 
           Summary: libgcj HttpURLConnection does not handle situation where
                    retrieving url without training slash after domain.
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: k dot allan-gcc at au dot darkbluesea dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14009


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-12-18  2:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-04  1:44 [Bug libgcj/14009] New: libgcj HttpURLConnection does not handle situation where retrieving url without training slash after domain k dot allan-gcc at au dot darkbluesea dot com
2004-02-04  1:47 ` [Bug libgcj/14009] " k dot allan-gcc at au dot darkbluesea dot com
2004-02-04  1:51 ` [Bug libgcj/14009] libgcj HttpURLConnection does not handle situation where retrieving url without trailing " bangerth at dealii dot org
2004-02-04  1:55 ` k dot allan-gcc at au dot darkbluesea dot com
2004-02-04  2:27 ` k dot allan-gcc at au dot darkbluesea dot com
2004-02-04  6:58 ` pinskia at gcc dot gnu dot org
2004-03-19  1:34 ` pinskia at gcc dot gnu dot org
2004-06-27 16:20 ` mckinlay at redhat dot com
2004-10-22 20:23 ` cvs-commit at gcc dot gnu dot org
2004-10-22 20:30 ` konqueror at gmx dot de
2004-10-22 20:35 ` konqueror at gmx dot de
2004-11-06 15:49 ` pinskia at gcc dot gnu dot org
2004-12-18  2:29 ` pinskia 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).