aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-12-04 10:59:56 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2003-12-04 10:59:56 +0000
commit477913522a0768c5653299757a06e8de0a8a7f7a (patch)
treeda9d9cde6113f511230666f5365023e8ee3caa08 /libjava/gnu
parent7f1156ed35e4f5a14cea93e42137302eb1d1f07a (diff)
downloadgcc-477913522a0768c5653299757a06e8de0a8a7f7a.zip
gcc-477913522a0768c5653299757a06e8de0a8a7f7a.tar.gz
gcc-477913522a0768c5653299757a06e8de0a8a7f7a.tar.bz2
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
Diffstat (limited to 'libjava/gnu')
-rw-r--r--libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc8
-rw-r--r--libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc8
2 files changed, 8 insertions, 8 deletions
diff --git a/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc b/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc
index f0e7ed7..f296d12 100644
--- a/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc
+++ b/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc
@@ -209,7 +209,7 @@ gnu::java::net::PlainDatagramSocketImpl::peekData (::java::net::DatagramPacket *
union SockAddr u;
socklen_t addrlen = sizeof(u);
jbyte *dbytes = elements (p->getData()) + p->getOffset();
- jint maxlen = p->getData()->length - p->getOffset();
+ jint maxlen = p->maxlen - p->getOffset();
ssize_t retlen = 0;
// Do timeouts via select since SO_RCVTIMEO is not always available.
@@ -255,7 +255,7 @@ gnu::java::net::PlainDatagramSocketImpl::peekData (::java::net::DatagramPacket *
p->setAddress (new ::java::net::InetAddress (raddr, NULL));
p->setPort (rport);
- p->setLength ((jint) retlen);
+ p->length = (int) retlen;
return rport;
error:
@@ -329,7 +329,7 @@ gnu::java::net::PlainDatagramSocketImpl::receive (::java::net::DatagramPacket *p
union SockAddr u;
socklen_t addrlen = sizeof(u);
jbyte *dbytes = elements (p->getData()) + p->getOffset();
- jint maxlen = p->getData()->length - p->getOffset();
+ jint maxlen = p->maxlen - p->getOffset();
ssize_t retlen = 0;
// Do timeouts via select since SO_RCVTIMEO is not always available.
@@ -375,7 +375,7 @@ gnu::java::net::PlainDatagramSocketImpl::receive (::java::net::DatagramPacket *p
p->setAddress (new ::java::net::InetAddress (raddr, NULL));
p->setPort (rport);
- p->setLength ((jint) retlen);
+ p->length = (jint) retlen;
return;
error:
diff --git a/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc b/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc
index 15105b96..18906a0 100644
--- a/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc
+++ b/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc
@@ -203,7 +203,7 @@ gnu::java::net::PlainDatagramSocketImpl::peekData(::java::net::DatagramPacket *p
union SockAddr u;
socklen_t addrlen = sizeof(u);
jbyte *dbytes = elements (p->getData()) + p->getOffset();
- jint maxlen = p->getData()->length - p->getOffset();
+ jint maxlen = p->maxlen - p->getOffset();
ssize_t retlen = 0;
if (timeout > 0)
@@ -241,7 +241,7 @@ gnu::java::net::PlainDatagramSocketImpl::peekData(::java::net::DatagramPacket *p
p->setAddress (new ::java::net::InetAddress (raddr, NULL));
p->setPort (rport);
- p->setLength ((jint) retlen);
+ p->length = (jint) retlen;
return rport;
error:
@@ -318,7 +318,7 @@ gnu::java::net::PlainDatagramSocketImpl::receive (::java::net::DatagramPacket *p
union SockAddr u;
socklen_t addrlen = sizeof(u);
jbyte *dbytes = elements (p->getData()) + p->getOffset();
- jint maxlen = p->getData()->length - p->getOffset();
+ jint maxlen = p->maxlen - p->getOffset();
ssize_t retlen = 0;
if (timeout > 0)
@@ -359,7 +359,7 @@ gnu::java::net::PlainDatagramSocketImpl::receive (::java::net::DatagramPacket *p
p->setAddress (new ::java::net::InetAddress (raddr, NULL));
p->setPort (rport);
- p->setLength ((jint) retlen);
+ p->length = (jint) retlen;
return;
error: