Add a rpc_set_fd() fucntion which can be used to swap the underlying socket file...
[deb_libnfs.git] / lib / socket.c
index 1676084f21dfad95b764c74cef4997af46cc303d..b750d6f16d275c1faee7a1d2a300ea0fa1cba296 100644 (file)
@@ -399,6 +399,10 @@ void rpc_set_tcp_syncnt(struct rpc_context *rpc, int v)
        rpc->tcp_syncnt = v;
 }
 
+#ifndef TCP_SYNCNT
+#define TCP_SYNCNT        7
+#endif
+
 static int rpc_connect_sockaddr_async(struct rpc_context *rpc, struct sockaddr_storage *s)
 {
        int socksize;
@@ -703,3 +707,10 @@ int rpc_queue_length(struct rpc_context *rpc)
        }
        return i;
 }
+
+void rpc_set_fd(struct rpc_context *rpc, int fd)
+{
+       assert(rpc->magic == RPC_CONTEXT_MAGIC);
+
+       rpc->fd = fd;
+}