* A list of subsidiary connections for DFS.
*/
struct cli_state *prev, *next;
- int fd;
int protocol;
int sec_mode;
int rap_error;
char *dfs_mountpoint;
struct {
+ int fd;
struct tevent_queue *outgoing;
struct tevent_req **pending;
} conn;
* We're the first ones, add the read_smb request that waits for the
* answer from the server
*/
- subreq = read_smb_send(cli->conn.pending, state->ev, cli->fd);
+ subreq = read_smb_send(cli->conn.pending, state->ev, cli->conn.fd);
if (subreq == NULL) {
cli_smb_req_unset_pending(req);
return false;
iov_count = 1;
}
subreq = writev_send(state, state->ev, state->cli->conn.outgoing,
- state->cli->fd, false, iov, iov_count);
+ state->cli->conn.fd, false, iov, iov_count);
if (subreq == NULL) {
return NT_STATUS_NO_MEMORY;
}
*/
state = tevent_req_data(cli->conn.pending[0],
struct cli_smb_state);
- subreq = read_smb_send(cli->conn.pending, state->ev, cli->fd);
+ subreq = read_smb_send(cli->conn.pending, state->ev, cli->conn.fd);
if (subreq == NULL) {
status = NT_STATUS_NO_MEMORY;
goto fail;
if (!cli->dfs_mountpoint) {
goto error;
}
- cli->fd = -1;
cli->raw_status = NT_STATUS_INTERNAL_ERROR;
cli->protocol = PROTOCOL_NT1;
cli->timeout = 20000; /* Timeout is in milliseconds. */
goto error;
}
- cli->fd = fd;
+ cli->conn.fd = fd;
ss_length = sizeof(cli->src_ss);
ret = getsockname(fd,
void cli_sockopt(struct cli_state *cli, const char *options)
{
- set_socket_options(cli->fd, options);
+ set_socket_options(cli->conn.fd, options);
}
uint16_t cli_state_get_vc_num(struct cli_state *cli)
return false;
}
- if (cli->fd == -1) {
+ if (cli->conn.fd == -1) {
return false;
}
void cli_state_disconnect(struct cli_state *cli)
{
- if (cli->fd != -1) {
- close(cli->fd);
+ if (cli->conn.fd != -1) {
+ close(cli->conn.fd);
}
- cli->fd = -1;
+ cli->conn.fd = -1;
}
* We're the first ones, add the read_smb request that waits for the
* answer from the server
*/
- subreq = read_smb_send(cli->conn.pending, state->ev, cli->fd);
+ subreq = read_smb_send(cli->conn.pending, state->ev, cli->conn.fd);
if (subreq == NULL) {
smb2cli_req_unset_pending(req);
return false;
static void smb2cli_notify_pending(struct cli_state *cli, NTSTATUS status)
{
- if (cli->fd != -1) {
- close(cli->fd);
- cli->fd = -1;
+ if (cli->conn.fd != -1) {
+ close(cli->conn.fd);
}
+ cli->conn.fd = -1;
/*
* Cancel all pending requests. We don't do a for-loop walking
iov[0].iov_len = sizeof(state->nbt);
subreq = writev_send(state, state->ev, state->cli->conn.outgoing,
- state->cli->fd, false, iov, num_iov);
+ state->cli->conn.fd, false, iov, num_iov);
if (subreq == NULL) {
return NT_STATUS_NO_MEMORY;
}
* add the read_smb request that waits for the
* next answer from the server
*/
- subreq = read_smb_send(cli->conn.pending, state->ev, cli->fd);
+ subreq = read_smb_send(cli->conn.pending, state->ev, cli->conn.fd);
if (subreq == NULL) {
smb2cli_notify_pending(cli, NT_STATUS_NO_MEMORY);
return;