Commit Graph

37 Commits

Author SHA1 Message Date
Michael Koch
24ce9c2d97 2003-12-31 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/http/Connection.java
	(sendRequest): Dont encode output in default character encoding,
	add correct version number to HTTP user agent string.

From-SVN: r75266
2003-12-31 11:27:09 +00:00
Michael Koch
f04f5b1fad 2003-12-30 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/http/Connection.java
	(outputStream): New field.
	(bufferedOutputStream): New field.
	(connect): Initialize outputStream and bufferedOutputStream.
	(sendRequest): Create PrintWriter object from outputStream,
	support HTTP 1.1, send missing HTTP headers and buffered output data
	for POST method.
	(getOutputStream): Set request method to POST if output stream is
	used, return bufferedOutputStream.
	(setRequestMethod): Allow HEAD and POST methods.
	This fixes libgcj PR/6302 and libgcj PR/7752.

From-SVN: r75233
2003-12-30 13:43:24 +00:00
Michael Koch
b976c2fc29 2003-12-30 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/http/Connection.java
	(requestProperties): New field.
	(addRequestProperty): New method.
	(getRequestProperty): New method.
	(setRequestProperty): New method.
	(getRequestProperties): New method.

From-SVN: r75228
2003-12-30 12:02:47 +00:00
Michael Koch
9f88b919e0 2003-12-28 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/http/Connection.java
	(inputStream): Made it a DataInputStream.
	(requestProperties): Removed.
	(hdrHash): Removed.
	(hdrVec): Removed.
	(headers): New field to store headers.
	(connect): Initialize inputStream.
	(receiveReply): Merged from classpath. The new algorithm is line based
	instead of character based.
	(getHeaderField): Use headers.
	(getHeaderFields): Use headers.
	(getKey): Removed.
	(getField): Removed.
	* gnu/java/net/HeaderFieldHelper.java: New file.
	* Makefile.am (ordinary_java_source_files):
	Added gnu/java/net/HeaderFieldHelper.java.
	* Makefile.in: Regenerated.

From-SVN: r75183
2003-12-28 21:30:45 +00:00
Michael Koch
bb6d84f38e 2003-12-27 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/http/Connection.java
	(getRequestProperty): Removed.
	(setRequestProperty): Removed.

From-SVN: r75175
2003-12-27 20:49:12 +00:00
Michael Koch
82ebe78b9e 2003-12-27 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/http/Connection.java
	(connect): Call receiveReply().
	(receiveReply): Renamed from getHttpHeaders().
	(getOutputStream): Moved check on doOutput before check for connection
	state.

From-SVN: r75172
2003-12-27 17:24:51 +00:00
Michael Koch
59bed4cab5 2003-12-21 Michael Koch <konqueror@gmx.de>
* gnu/java/net/PlainDatagramSocketImpl.java
	(mcastGrp): Added documentation.

From-SVN: r74896
2003-12-20 23:04:44 +00:00
Michael Koch
4e24f93733 2003-12-20 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/jar/Connection.java
	(connectionCache): New field.
	(connect): New method.
	(getInputStream): New method.
	(hdrHash): New field.
	(hdrVec): New field.
	(gotHeaders): New field.
	(getHeaderField): New method.
	(getHeaderFields): New method.
	(getHeaderFieldKey): New method.
	(getKey): New method.
	(getField): New method.
	(getHeaders): New method.
	* java/net/JarURLConnection.java
	(connectionCache): Removed.
	(connect): Removed.
	(getInputStream): Removed.
	(hdrHash): Removed.
	(hdrVec): Removed.
	(gotHeaders): Removed.
	(getHeaderField): Removed.
	(getHeaderFields): Removed.
	(getHeaderFieldKey): Removed.
	(getKey): Removed.
	(getField): Removed.
	(getHeaders): Removed.

From-SVN: r74895
2003-12-20 22:54:26 +00:00
Guilhem Lavaux
32ab41edd2 URLParseError.java: New file.
2003-12-20  Guilhem Lavaux <guilhem@kaffe.org>

	* gnu/java/net/URLParseError.java: New file.
	* gnu/java/net/protocol/jar/Handler.java
	(parseURL): Throw URLParseError if needed, fix '/' handling.
	* java/net/URL.java (URL): Catch URLParseError and
	transform it into a MalformedURLException.

From-SVN: r74877
2003-12-20 12:28:25 +00:00
Michael Koch
177dcc4bad 2003-12-19 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/jar/Handler.java
	(parseURL): New method.
	(toExternalForm): New method.

From-SVN: r74827
2003-12-19 09:48:28 +00:00
Mohan Embar
89c5711036 natPlainDatagramSocketImplWin32.cc: Removed unused InterruptedIOException.h include.
* gnu/java/net/natPlainDatagramSocketImplWin32.cc:
	Removed unused InterruptedIOException.h include.
	* gnu/java/net/natPlainSocketImplWin32.cc
	(connect): Reset and ignore our thread's interrupted
	flag instead of testing and throwing an InterruptedIOException
	if set.
	(accept): Likewise + changed case of SocketTimeoutException
	text.
	(write): Likewise (for both overloads).
	(doRead): Likewise.

From-SVN: r74716
2003-12-16 22:57:06 +00:00
Mohan Embar
027e655b6e * gnu/java/net/natPlainDatagramSocketImplPosix.cc
(peekData): Throw SocketTimeoutException instead of
	InterruptedIOException on timeout.
	(receive): Likewise.
	* gnu/java/net/natPlainSocketImplPosix.cc
	(read): Made a minor exception text case change.

From-SVN: r74714
2003-12-16 22:47:53 +00:00
Michael Koch
89231ff027 2003-12-04 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/http/Connection.java
	(sendRequest): Merged writing http headers with classpath.
	(getInputStream): Merged documentation from classpath.
	(getHeaderField): Likewise.
	(getHeaderFieldKey): Likewise.

From-SVN: r74283
2003-12-04 17:52:01 +00:00
Michael Koch
477913522a 2003-12-04 Michael Koch <konqueror@gmx.de>
* java/net/DatagramPacket.java
	(length): Made packge-private to make it accessible via CNI.
	(maxlen): New field.
	(DatagramPacket): Cleaned up.
	(setSocketAddress): Add message to exception.
	(setData): Call other setData().
	(setData): Call setLength().
	(setLength): Initialize maxlen too.
	* gnu/java/net/natPlainDatagramSocketImplPosix.cc (peekData):
	Get maximal length from maxlen field, set length field directly.
	(receive): Likewise.
	* gnu/java/net/natPlainDatagramSocketImplWin32.cc (peekData):
	Get maximal length from maxlen field, set length field directly.
	(receive): Likewise.

From-SVN: r74278
2003-12-04 10:59:56 +00:00
Michael Koch
a74e3b7707 2003-12-02 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/file/Connection.java
	(getLastModified): Implement for file connections.
	(getContentLength): Likewise.

From-SVN: r74180
2003-12-02 14:36:22 +00:00
Michael Koch
84ebbc6777 Connection.java: Some reformating.
2003-12-02  Michael Koch  <konqueror@gmx.de>

	* gnu/java/net/protocol/file/Connection.java:
	Some reformating.
	(file): Renamed from fileIn.
	(getPermission): Moved around.

From-SVN: r74179
2003-12-02 14:27:33 +00:00
Michael Koch
83f85f9c8d 2003-12-02 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/jar/Connection.java
	(Connection): Made class final, merged documentation with classpath.
	(file_cache): Made private.
	(jar_file): Renamed from jarfile.

From-SVN: r74178
2003-12-02 14:19:34 +00:00
Michael Koch
91305a1de9 2003-12-02 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/http/Connection.java
	(Connection): Initialize doOutput to false;
	(connect): Initialize inputStream, moved "send request" code to new
	method.
	(sendRequest): New method.
	(getHttpHeaders): Don't reinitialize inputStream.

From-SVN: r74177
2003-12-02 14:13:46 +00:00
Michael Koch
2b95402c94 2003-12-02 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol//http/Connection.java
	(defRequestProperties): Removed. This dont gets used since JDK 1.3.
	(requestProperties): Initialize, documentation added.
	(inputStream): Renamed from bufferedIn.
	(Connection): Dont initialize requestProperties.
	(setDefaultRequestProperty): Removed.
	(getDefaultRequestProperty): Removed.
	(usingProxy): Documentation added.
	(getHttpHeaders): Likewise.

From-SVN: r74176
2003-12-02 13:44:23 +00:00
Michael Koch
8325a4ec9c 2003-12-01 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/http/Connection.java
	(Connection): Merged class documentation.
	(socket): Renamed from sock.
	(Connection): Made protected, documentation added.
	(connect): Give URL'S host instead of InetAddress to Socket
	constructor.
	(disconnect): Documentation added.
	(getOutputStream): Rewrapped.

From-SVN: r74109
2003-12-01 16:35:45 +00:00
Michael Koch
1fa7e0fd52 2003-12-01 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/file/Connection.java
	(fileIn): Documentation added.
	(inputStream): Likewise.
	(outputStream): Likewise.
	(Connection): Likewise.
	(connect): Simplified.

From-SVN: r74106
2003-12-01 15:50:23 +00:00
Michael Koch
a1ff4c6478 natPlainSocketImplPosix.cc bind (): Dont set SockedImpl.address field on succesful bind.
2003-12-01  Michael Koch  <konqueror@gmx.de>

	* gnu/java/net/natPlainSocketImplPosix.cc
	bind(): Dont set SockedImpl.address field on succesful bind.
	* gnu/java/net/natPlainSocketImplWin32.cc
	bind(): Likewise.

From-SVN: r74102
2003-12-01 14:32:26 +00:00
Michael Koch
6cf0ea4b86 2003-11-26 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/file/Handler.java
	(Handler): New explicit constructor.
	(openConnection): Added documentation.
	* gnu/java/net/protocol/jar/Handler.java
	(Handler): New explicit constructor.
	(openConnection): Added documentation.

From-SVN: r73945
2003-11-26 10:17:51 +00:00
Michael Koch
539edbe025 * gnu/java/net/natPlainDatagramSocketImplWin32.cc
(peekData): Use offset and maximal free space in datagram packet.
	(receive): Likewise.
	(send): Use offset in datagram packet.

From-SVN: r73848
2003-11-23 01:38:31 +00:00
Michael Koch
343c49ce75 2003-11-22 Michael Koch <konqueror@gmx.de>
* gnu/java/net/natPlainDatagramSocketImplPosix.cc
	(peekData): Use offset and maximal free space in datagram packet.
	(receive): Likewise.
	(send): Use offset in datagram packet.

From-SVN: r73843
2003-11-22 16:49:47 +00:00
Mohan Embar
bbf76ec06c win32.h (_Jv_platform_close_on_exec): Changed signature and declared extern.
* include/win32.h (_Jv_platform_close_on_exec): Changed
	signature and declared extern.
	* win32.cc (_Jv_platform_close_on_exec): Implemented.
	* gnu/java/net/natPlainDatagramSocketImplWin32.cc
	(create): Use new signature of _Jv_platform_close_on_exec.
	* gnu/java/net/natPlainSocketImplWin32.cc
	(create): Eliminated a few typecasts
	Use new signature of _Jv_platform_close_on_exec.
	(accept): Eliminated a few typecasts
	Use new signature of _Jv_platform_close_on_exec.
	* java/io/natFileDescriptorWin32.cc (open): Use
	_Jv_platform_close_on_exec.

From-SVN: r73325
2003-11-07 03:13:56 +00:00
Mohan Embar
76506a3ee3 re PR libgcj/11521 ([win32] can install server socket on same port twice)
PR libgcj/11521:
	* gnu/java/net/natPlainSocketImplWin32.cc
	(bind): Don't use SO_REUSEADDR

From-SVN: r73116
2003-10-31 03:19:51 +00:00
Michael Koch
1d749ee003 2003-10-29 Michael Koch <konqueror@gmx.de>
* gnu/java/net/natPlainDatagramSocketImplPosix.cc
	(setOption): Directly return if no error occured.
	* gnu/java/net/natPlainSocketImplPosix.cc
	(setOption): Likewise.

From-SVN: r73033
2003-10-29 10:33:57 +00:00
Michael Koch
7c54b00335 PlainDatagramSocketImpl.java, [...]: Renamed fnum to native_fd to match classpath more.
2003-10-21  Michael Koch  <konqueror@gmx.de>

	* gnu/java/net/PlainDatagramSocketImpl.java,
	gnu/java/net/PlainSocketImpl.java,
	gnu/java/net/natPlainDatagramSocketImplPosix.cc,
	gnu/java/net/natPlainDatagramSocketImplWin32.cc,
	gnu/java/net/natPlainSocketImplPosix.cc,
	gnu/java/net/natPlainSocketImplWin32.cc:
	Renamed fnum to native_fd to match classpath more.

From-SVN: r72746
2003-10-21 12:29:43 +00:00
Michael Koch
807a4cfd73 Connection.java, [...]: Merged copyright text from classpath to make it possible to merge the classes.
2003-10-18  Michael Koch  <konqueror@gmx.de>

	* gnu/java/net/protocol/file/Connection.java,
	gnu/java/net/protocol/file/Handler.java,
	gnu/java/net/protocol/http/Connection.java,
	gnu/java/net/protocol/http/Handler.java,
	gnu/java/net/protocol/jar/Connection.java,
	gnu/java/net/protocol/jar/Handler.java:
	Merged copyright text from classpath to make
	it possible to merge the classes.

From-SVN: r72638
2003-10-18 12:24:57 +00:00
Taras Glek
c1783330fd re PR libgcj/12592 (Http requests use \n instead of \r\n)
2003-10-13  Taras Judge  <taras.judge@shaw.ca>

	PR libgcj/12592
	* gnu/java/net/protocol/http/Connection.java (connect): Use \r\n,
	not just \n.

From-SVN: r72443
2003-10-13 22:06:06 +00:00
Michael Koch
85aa13b287 Connection.java, [...]: Moved to gnu/java/net/protocol.
2003-10-08  Michael Koch  <konqueror@gmx.de>

	* gnu/gcj/protocol/core/Connection.java,
	gnu/gcj/protocol/core/CoreInputStream.java,
	gnu/gcj/protocol/core/Handler.java,
	gnu/gcj/protocol/core/natCoreInputStream.cc,
	gnu/gcj/protocol/file/Connection.java,
	gnu/gcj/protocol/file/Handler.java,
	gnu/gcj/protocol/gcjlib/Connection.java,
	gnu/gcj/protocol/gcjlib/Handler.java,
	gnu/gcj/protocol/http/Connection.java,
	gnu/gcj/protocol/http/Handler.java,
	gnu/gcj/protocol/jar/Connection.java,
	gnu/gcj/protocol/jar/Handler.java: Moved to gnu/java/net/protocol.
	* gnu/java/net/protocol/core/Connection.java,
	gnu/java/net/protocol/core/CoreInputStream.java,
	gnu/java/net/protocol/core/Handler.java,
	gnu/java/net/protocol/core/natCoreInputStream.cc,
	gnu/java/net/protocol/file/Connection.java,
	gnu/java/net/protocol/file/Handler.java,
	gnu/java/net/protocol/gcjlib/Connection.java,
	gnu/java/net/protocol/gcjlib/Handler.java,
	gnu/java/net/protocol/http/Connection.java,
	gnu/java/net/protocol/http/Handler.java,
	gnu/java/net/protocol/jar/Connection.java,
	gnu/java/net/protocol/jar/Handler.java: Moved from gnu/gcj/protocol.
	* gnu/gcj/runtime/FirstThread.java,
	java/net/URL.java: Use moved protocol handlers.
	* Makefile.am
	(ordinary_java_source_files): Moved files.
	(nat_source_files): Likewise.
	* Makefile.in: Regenerated.

From-SVN: r72233
2003-10-08 16:28:30 +00:00
Michael Koch
bf172f5467 2003-09-25 Michael Koch <konqueror@gmx.de>
* gnu/java/net/PlainDatagramSocketImpl.java
	(finalize): Moved to directly after constructor.
	(getNativeFD): New method.
	* gnu/java/net/PlainSocketImpl.java
	(getNativeFD): New method.

From-SVN: r71792
2003-09-25 19:22:32 +00:00
Bryce McKinlay
3d5cd60062 re PR libgcj/12388 (mingw32 target fails to build libjava)
* gnu/java/net/natPlainSocketImplWin32.cc: Add missing #includes.
	PR libgcj/12388.

From-SVN: r71750
2003-09-25 04:04:41 +01:00
Bryce McKinlay
9b7fe786e1 PlainSocketImpl.java (read): Remove declaration.
* gnu/java/net/PlainSocketImpl.java (read): Remove declaration.
	(write): Likewise.
	(SocketInputStream, SocketOutputStream): Declare `read' and `write'
	native. Remove implementations which called back into
	PlainSocketImpl.
	Remove unneccessary overridden methods.
	* gnu/java/net/natPlainSocketImplNoNet.cc (read): Move
	implementation
	to inner class PlainSocketImpl.SocketInputStream.
	(write): Likewise.
	* gnu/java/net/natPlainSocketImplPosix.cc: As above.
	* gnu/java/net/natPlainSocketImplWin32.cc: As above.
	* gnu/java/net/SocketInputStream.java: Remove unused file.
	* gnu/java/net/SocketOutputStream.java: Likewise.
	* Makefile.am: Build CNI headers for PlainSocketImpl.SocketInputStream
	and SocketOutputStream.
	* Makefile.in: Rebuilt.

From-SVN: r71724
2003-09-24 06:38:36 +01:00
Anthony Green
cda85569ad Fix mingw32 builds.
From-SVN: r71299
2003-09-11 12:30:05 +00:00
Michael Koch
4a503716e0 DatagramSocket.java, [...]: Use gnu.java.net.Plain*SocketImpl instead of java.net.PlainSocketImpl.
2003-09-10  Michael Koch  <konqueror@gmx.de>

	* java/net/DatagramSocket.java,
	java/net/MulticastSocket.java,
	java/net/ServerSocket.java,
	java/net/Socket.java:
	Use gnu.java.net.Plain*SocketImpl instead of
	java.net.PlainSocketImpl.
	* java/net/PlainDatagramSocketImpl.java,
	java/net/PlainSocketImpl.java,
	java/net/SocketInputStream.java,
	java/net/SocketOutputStream.java,
	java/net/natPlainDatagramSocketImplNoNet.cc,
	java/net/natPlainDatagramSocketImplPosix.cc,
	java/net/natPlainDatagramSocketImplWin32.cc,
	java/net/natPlainSocketImplNoNet.cc,
	java/net/natPlainSocketImplPosix.cc,
	java/net/natPlainSocketImplWin32.cc:
	Removed.
	* gnu/java/net/PlainDatagramSocketImpl.java,
	gnu/java/net/PlainSocketImpl.java,
	gnu/java/net/SocketInputStream.java,
	gnu/java/net/SocketOutputStream.java,
	gnu/java/net/natPlainDatagramSocketImplNoNet.cc,
	gnu/java/net/natPlainDatagramSocketImplPosix.cc,
	gnu/java/net/natPlainDatagramSocketImplWin32.cc,
	gnu/java/net/natPlainSocketImplNoNet.cc,
	gnu/java/net/natPlainSocketImplPosix.cc,
	gnu/java/net/natPlainSocketImplWin32.cc:
	New files (moved from java/net).
	* configure.in: Create links for gnu/java/net/natPlain*SocketImpl.cc
	instead of java/net/natPlain*SocketImpl.cc.
	* configure: Regenerated.
	* Makefile.am: Moved files from java/net to gnu/java/net.
	* Makefile.in: Regenerated.

From-SVN: r71274
2003-09-10 17:39:20 +00:00