diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-26 17:17:19 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-26 17:17:19 +0000 |
commit | 08b6c96ea8a7a4c16c3674bd8edcdc0e509568b1 (patch) | |
tree | e4f225d9ecb26e0658693a69299b14b6f20dca2d /libjava/gnu/java | |
parent | 9b9ac242c3101870714fe87cc2c69db5bd69dd16 (diff) | |
download | ppe42-gcc-08b6c96ea8a7a4c16c3674bd8edcdc0e509568b1.tar.gz ppe42-gcc-08b6c96ea8a7a4c16c3674bd8edcdc0e509568b1.zip |
2004-02-26 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/DatagramChannelImpl.java
(send): Check if target address is resolved.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78508 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java')
-rw-r--r-- | libjava/gnu/java/nio/DatagramChannelImpl.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libjava/gnu/java/nio/DatagramChannelImpl.java b/libjava/gnu/java/nio/DatagramChannelImpl.java index baeac19deb6..68535e62769 100644 --- a/libjava/gnu/java/nio/DatagramChannelImpl.java +++ b/libjava/gnu/java/nio/DatagramChannelImpl.java @@ -1,5 +1,5 @@ /* DatagramChannelImpl.java -- - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,10 +38,11 @@ exception statement from your version. */ package gnu.java.nio; +import gnu.java.net.PlainDatagramSocketImpl; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; -import gnu.java.net.PlainDatagramSocketImpl; +import java.net.InetSocketAddress; import java.net.SocketAddress; import java.net.SocketTimeoutException; import java.nio.ByteBuffer; @@ -256,6 +257,10 @@ public final class DatagramChannelImpl extends DatagramChannel if (!isOpen()) throw new ClosedChannelException(); + if (target instanceof InetSocketAddress + && ((InetSocketAddress) target).isUnresolved()) + throw new IOException("Target address not resolved"); + byte[] buffer; int offset = 0; int len = src.remaining(); |