Enable Netty on a big endian platform
Motivation: We would like to enable Netty also on a big endian platform such as s390_64. We need to fix a function which assumes that the target platform is little endian. Modifications: Modify netty_unix_socket_accept() to write an address length as jbyte instead of jsize. Result: Netty can be enabled on a big endian platform. Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
This commit is contained in:
parent
e1317db328
commit
3fbec92221
@ -540,6 +540,7 @@ static jint netty_unix_socket_disconnect(JNIEnv* env, jclass clazz, jint fd, jbo
|
|||||||
static jint netty_unix_socket_accept(JNIEnv* env, jclass clazz, jint fd, jbyteArray acceptedAddress) {
|
static jint netty_unix_socket_accept(JNIEnv* env, jclass clazz, jint fd, jbyteArray acceptedAddress) {
|
||||||
jint socketFd;
|
jint socketFd;
|
||||||
jsize len;
|
jsize len;
|
||||||
|
jbyte len_b;
|
||||||
int err;
|
int err;
|
||||||
struct sockaddr_storage addr;
|
struct sockaddr_storage addr;
|
||||||
socklen_t address_len = sizeof(addr);
|
socklen_t address_len = sizeof(addr);
|
||||||
@ -564,9 +565,10 @@ static jint netty_unix_socket_accept(JNIEnv* env, jclass clazz, jint fd, jbyteAr
|
|||||||
}
|
}
|
||||||
|
|
||||||
len = addressLength(&addr);
|
len = addressLength(&addr);
|
||||||
|
len_b = (jbyte) len;
|
||||||
|
|
||||||
// Fill in remote address details
|
// Fill in remote address details
|
||||||
(*env)->SetByteArrayRegion(env, acceptedAddress, 0, 4, (jbyte*) &len);
|
(*env)->SetByteArrayRegion(env, acceptedAddress, 0, 1, (jbyte*) &len_b);
|
||||||
initInetSocketAddressArray(env, &addr, acceptedAddress, 1, len);
|
initInetSocketAddressArray(env, &addr, acceptedAddress, 1, len);
|
||||||
|
|
||||||
if (accept4) {
|
if (accept4) {
|
||||||
|
Loading…
Reference in New Issue
Block a user