commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1099112 - in /commons/sandbox/runtime/trunk/src/main/native/shared: psockimpl.c ssock.c
Date Tue, 03 May 2011 16:20:12 GMT
Author: mturk
Date: Tue May  3 16:20:12 2011
New Revision: 1099112

URL: http://svn.apache.org/viewvc?rev=1099112&view=rev
Log:
Axe two stack hacks. The solution just doesn't work

Modified:
    commons/sandbox/runtime/trunk/src/main/native/shared/psockimpl.c
    commons/sandbox/runtime/trunk/src/main/native/shared/ssock.c

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/psockimpl.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/psockimpl.c?rev=1099112&r1=1099111&r2=1099112&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/psockimpl.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/psockimpl.c Tue May  3 16:20:12 2011
@@ -40,56 +40,13 @@ J_DECLARE_F_ID(0000) = {
     "Ljava/io/FileDescriptor;"
 };
 
-J_DECLARE_F_ID(0001) = {
-    INVALID_FIELD_OFFSET,
-    INVALID_FIELD_OFFSET,
-    0,
-    "fd1",
-    "Ljava/io/FileDescriptor;"
-};
-
-static jclass TwoStacksPlainSocketImplClass = 0;
-
 ACR_CLASS_CTOR(SocketImpl)
 {
-    jclass tsc;
-
     if (AcrLoadClass(env, &_clazzn, 0) == JNI_FALSE)
         return JNI_FALSE;
     J_LOAD_IFIELD(0000);
     UNSAFE_IFIELD(0000);
     _clazzn.u = 1;
-#if defined(WINDOWS)
-    /* Try to load the TwoStacksPlainSocketImpl
-     */
-    tsc = (*env)->FindClass(env, "java/net/TwoStacksPlainSocketImpl");
-    if (tsc == 0 || IS_EXCEPTION_PENDING(env)) {
-        (*env)->ExceptionClear(env);
-        printf("TwoStacksPlainSocketImplClass not found %p\n", tsc);
-        fflush(stdout);
-        tsc = 0;
-    }
-    else {
-        J4FID(0001) = (*env)->GetFieldID(env, tsc, _f0001n.n, _f0001n.s);
-        if (J4FID(0001) == 0) {
-            (*env)->ExceptionClear(env);                            
-        }
-        else {
-            TwoStacksPlainSocketImplClass = (jclass)(*env)->NewGlobalRef(env, tsc);
-            (*env)->DeleteLocalRef(env, tsc);
-            if (TwoStacksPlainSocketImplClass == 0) {
-                (*env)->ExceptionClear(env);
-                /* Reference failed */
-                J4FID(0001) = 0;
-            }
-            else {
-                _f0001n.o = AcrUnsafeObjectFieldIdOffset(env, TwoStacksPlainSocketImplClass,
J4FID(0001));                 
-                printf("TwoStacksPlainSocketImplClass loaded\n");
-                fflush(stdout);
-            }
-        }
-    }
-#endif
     return JNI_TRUE;
 }
 
@@ -112,22 +69,3 @@ jobject AcrGetSocketImplFd(JNI_STDARGS)
     }
     return o;
 }
-
-#if defined(WINDOWS)
-jobject AcrGetSocketImplFa(JNI_STDARGS)
-{
-    jobject o = 0;
-
-    if ((*env)->IsInstanceOf(env, obj, TwoStacksPlainSocketImplClass) == JNI_FALSE)
-        return 0;
-    if (J4FLD_OFF(0001) != INVALID_FIELD_OFFSET) {
-        char *oa = *(char **)obj;
-        if (oa != 0)
-            o = (jobject)(oa + J4FLD_PTR(0001));
-    }
-    else {
-        o = GET_IFIELD_O(0001, obj);
-    }
-    return o;
-}
-#endif

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/ssock.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/ssock.c?rev=1099112&r1=1099111&r2=1099112&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/ssock.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/ssock.c Tue May  3 16:20:12 2011
@@ -95,30 +95,6 @@ AcrGetServerSocketFd(JNI_STDARGS)
     }
     return -1;
 }
-#if defined(WINDOWS)
-extern jobject AcrGetSocketImplFa(JNI_STDARGS);
-static int
-AcrGetServerSocketFa(JNI_STDARGS)
-{
-    jobject impl = 0;
-    jobject fd;
-
-    if (J4FLD_OFF(0000) != INVALID_FIELD_OFFSET) {
-        char *oa = *(char **)obj;
-        if (oa != 0)
-            impl = (jobject)(oa + J4FLD_PTR(0000));
-    }
-    else if (CLAZZ_LOADED) {
-        impl = GET_IFIELD_O(0000, obj);
-    }
-    if (impl != 0) {
-        fd = AcrGetSocketImplFa(env, impl);
-        if (fd != 0)
-            return AcrGetFileDescriptorFd(env, fd);
-    }
-    return -1;
-}
-#endif
 
 ACR_NET_EXPORT(jint, SocketInstance, nd1)(JNI_STDARGS, jobject sock)
 {
@@ -160,11 +136,6 @@ ACR_NET_EXPORT(jint, SocketInstance, nb1
         impl = GET_IFIELD_O(0000, sock);
     }
     if (impl != 0) {
-#if defined(WINDOWS)
-        jobject fa = AcrGetSocketImplFa(env, impl);
-        if (fa != 0)
-            AcrNonblock(AcrGetFileDescriptorFd(env, fa), on);
-#endif
         fd = AcrGetSocketImplFd(env, impl);
         if (fd != 0) {
             /* Set socket to nonblocking mode if on == JNI_TRUE*/



Mime
View raw message