Author: mturk
Date: Fri Jul 15 18:38:16 2011
New Revision: 1147274

URL: http://svn.apache.org/viewvc?rev=1147274&view=rev
Log:
Axe duplicate code

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/win32/inetsock.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/inetsock.c
URL: 
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/inetsock.c?rev=1147274&r1=1147273&r2=1147274&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/inetsock.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/inetsock.c Fri Jul 
15 18:38:16 2011
@@ -28,19 +28,6 @@
 #define SOCKADDR_RELEASE(BA, SA) \
     AcrReleaseArrayCritical(env, (BA), (SA))
 
-ACR_NET_EXPORT(jboolean, SocketAddress, haveipv6)(JNI_STDARGS)
-{
-    SOCKET sock;
-
-    sock = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
-    if (sock != INVALID_SOCKET) {
-        closesocket(sock);
-        return JNI_TRUE;
-    }
-    else
-        return JNI_FALSE;
-}
-
 ACR_NET_EXPORT(jint, SocketDescriptor, close0)(JNI_STDARGS, jlong fp)
 {
     int rc = 0;
@@ -148,47 +135,6 @@ ACR_NET_EXPORT(jboolean, SocketDescripto
         return JNI_TRUE;
 }
 
-ACR_NET_EXPORT(jint, SocketDescriptor, tmset0)(JNI_STDARGS, jlong fp, jint 
timeout)
-{
-    int rc = 0;
-    acr_sd_t *fd = J2P(fp, acr_sd_t *);
-
-    if (timeout == 0) {
-        if (!ACR_HASFLAG(fd, ACR_SO_NONBLOCK)) {
-            if ((rc = AcrNonblock(fd->s, 1)) != 0)
-                return rc;
-            ACR_SETFLAG(fd, ACR_SO_NONBLOCK);
-        }
-    }
-    else if (timeout > 0) {
-        if (!ACR_HASFLAG(fd, ACR_SO_NONBLOCK)) {
-            if ((rc = AcrNonblock(fd->s, 1)) != 0)
-                return rc;
-            ACR_SETFLAG(fd, ACR_SO_NONBLOCK);
-        }
-        if (fd->timeout != timeout) {
-            setsockopt(fd->s, SOL_SOCKET, SO_RCVTIMEO,
-                      (char *)&timeout, (socklen_t)sizeof(timeout));
-            setsockopt(fd->s, SOL_SOCKET, SO_SNDTIMEO,
-                      (char *)&timeout, (socklen_t)sizeof(timeout));
-        }
-    }
-    else if (timeout < 0) {
-        int zero = 0;
-        if (ACR_HASFLAG(fd, ACR_SO_NONBLOCK)) {
-            if ((rc = AcrNonblock(fd->s, 0)) != 0)
-                return rc;
-            ACR_CLRFLAG(fd, ACR_SO_NONBLOCK);
-        }
-        setsockopt(fd->s, SOL_SOCKET, SO_RCVTIMEO,
-                    (char *)&zero, (socklen_t)sizeof(zero));
-        setsockopt(fd->s, SOL_SOCKET, SO_SNDTIMEO,
-                    (char *)&zero, (socklen_t)sizeof(zero));
-    }
-    fd->timeout = timeout;
-    return 0;
-}
-
 ACR_NET_EXPORT(jlong, SocketDescriptor, socket0)(JNI_STDARGS, jint saf,
                                                  jint stype, jboolean block)
 {


Reply via email to