repositories
/
deb_libnfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MOUNT: describe mount version 1
[deb_libnfs.git]
/
lib
/
socket.c
diff --git
a/lib/socket.c
b/lib/socket.c
index 00c65ddbc146aadb2270795cca102789c4eef154..0f12697388779cd3f819bcf39c22227c0ddf225d 100644
(file)
--- a/
lib/socket.c
+++ b/
lib/socket.c
@@
-90,7
+90,7
@@
int rpc_which_events(struct rpc_context *rpc)
static int rpc_write_to_socket(struct rpc_context *rpc)
{
static int rpc_write_to_socket(struct rpc_context *rpc)
{
-
ssize
_t count;
+
int64
_t count;
if (rpc == NULL) {
return -1;
if (rpc == NULL) {
return -1;
@@
-101,7
+101,7
@@
static int rpc_write_to_socket(struct rpc_context *rpc)
}
while (rpc->outqueue != NULL) {
}
while (rpc->outqueue != NULL) {
-
ssize
_t total;
+
int64
_t total;
total = rpc->outqueue->outdata.size;
total = rpc->outqueue->outdata.size;
@@
-134,7
+134,7
@@
static int rpc_read_from_socket(struct rpc_context *rpc)
int available;
int size;
int pdu_size;
int available;
int size;
int pdu_size;
-
ssize
_t count;
+
int64
_t count;
#if defined(WIN32)
if (ioctlsocket(rpc->fd, FIONREAD, &available) != 0) {
#if defined(WIN32)
if (ioctlsocket(rpc->fd, FIONREAD, &available) != 0) {
@@
-278,12
+278,16
@@
int rpc_service(struct rpc_context *rpc, int revents)
rpc_set_error(rpc, "rpc_service: POLLERR, "
"Unknown socket error.");
}
rpc_set_error(rpc, "rpc_service: POLLERR, "
"Unknown socket error.");
}
- rpc->connect_cb(rpc, RPC_STATUS_ERROR, rpc->error_string, rpc->connect_data);
+ if (rpc->connect_cb != NULL) {
+ rpc->connect_cb(rpc, RPC_STATUS_ERROR, rpc->error_string, rpc->connect_data);
+ }
return -1;
}
if (revents & POLLHUP) {
rpc_set_error(rpc, "Socket failed with POLLHUP");
return -1;
}
if (revents & POLLHUP) {
rpc_set_error(rpc, "Socket failed with POLLHUP");
- rpc->connect_cb(rpc, RPC_STATUS_ERROR, rpc->error_string, rpc->connect_data);
+ if (rpc->connect_cb != NULL) {
+ rpc->connect_cb(rpc, RPC_STATUS_ERROR, rpc->error_string, rpc->connect_data);
+ }
return -1;
}
return -1;
}
@@
-299,13
+303,17
@@
int rpc_service(struct rpc_context *rpc, int revents)
rpc_set_error(rpc, "rpc_service: socket error "
"%s(%d) while connecting.",
strerror(err), err);
rpc_set_error(rpc, "rpc_service: socket error "
"%s(%d) while connecting.",
strerror(err), err);
- rpc->connect_cb(rpc, RPC_STATUS_ERROR,
+ if (rpc->connect_cb != NULL) {
+ rpc->connect_cb(rpc, RPC_STATUS_ERROR,
NULL, rpc->connect_data);
NULL, rpc->connect_data);
+ }
return -1;
}
rpc->is_connected = 1;
return -1;
}
rpc->is_connected = 1;
- rpc->connect_cb(rpc, RPC_STATUS_SUCCESS, NULL, rpc->connect_data);
+ if (rpc->connect_cb != NULL) {
+ rpc->connect_cb(rpc, RPC_STATUS_SUCCESS, NULL, rpc->connect_data);
+ }
return 0;
}
return 0;
}
@@
-480,6
+488,7
@@
static void reconnect_cb(struct rpc_context *rpc, int status, void *data _U_, vo
}
rpc->is_connected = 1;
}
rpc->is_connected = 1;
+ rpc->connect_cb = NULL;
}
/* disconnect but do not error all PDUs, just move pdus in-flight back to the outqueue and reconnect */
}
/* disconnect but do not error all PDUs, just move pdus in-flight back to the outqueue and reconnect */