#include <afsconfig.h>
#include <afs/param.h>
-
-#include <sys/types.h>
-#include <stdio.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#include <time.h>
-#else
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/time.h>
-#include <unistd.h>
-#endif
-#include <errno.h>
-#include <afs/afs_assert.h>
-#include <signal.h>
-#include <string.h>
-
+#include <roken.h>
+#include <afs/opr.h>
#include <rx/xdr.h>
#include <afs/afsint.h>
-#include "nfs.h"
#include <afs/errors.h>
+
+#include "nfs.h"
#include "daemon_com.h"
#include "lwp.h"
#include "lock.h"
int
SYNC_disconnect(SYNC_client_state * state)
{
-#ifdef AFS_NT40_ENV
- closesocket(state->fd);
-#else
- close(state->fd);
-#endif
+ rk_closesocket(state->fd);
state->fd = OSI_NULLSOCKET;
return 0;
}
int tries;
afs_uint32 now, timeout, code=SYNC_OK;
- if (state->fatal_error) {
- return SYNC_COM_ERROR;
- }
-
if (state->fd == OSI_NULLSOCKET) {
SYNC_connect(state);
}
if (state->fd == OSI_NULLSOCKET) {
- state->fatal_error = 1;
return SYNC_COM_ERROR;
}
}
if (code == SYNC_COM_ERROR) {
- Log("SYNC_ask: fatal protocol error on circuit '%s'; disabling sync "
- "protocol until next server restart\n",
- state->proto_name);
- state->fatal_error = 1;
+ Log("SYNC_ask: too many / too latent fatal protocol errors on circuit "
+ "'%s'; giving up (tries %d timeout %d)\n",
+ state->proto_name, tries, timeout);
}
return code;
{
size_t s_len;
- s_len = afs_strnlen(buf, len);
+ s_len = strnlen(buf, len);
return (s_len == len) ? 1 : 0;
}