add tcp-syncnt URL param to adjust TCP_SYNCNT sockopt
[deb_libnfs.git] / lib / init.c
index 09ab61c7ef50f9c7a64bc9df035bc05c9dc82cbd..bb2fe17bd00ef48306cb716df5b2f37d09580a81 100644 (file)
 
 #ifdef WIN32
 #include "win32_compat.h"
-#else
-#include <strings.h>
-#endif/*WIN32*/
+#endif
+
 #define _GNU_SOURCE
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
@@ -67,9 +70,10 @@ struct rpc_context *rpc_init_context(void)
                free(rpc);
                return NULL;
        }
-       rpc->xid = salt + time(NULL);
+       rpc->xid = salt + time(NULL) + getpid() << 16;
        salt += 0x01000000;
        rpc->fd = -1;
+       rpc->tcp_syncnt = RPC_PARAM_UNDEFINED;
 
        return rpc;
 }