We don't need smbd_server_connection there.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
TALLOC_FREE(cliprotos);
if (lp_async_smb_echo_handler() && (chosen_level < PROTOCOL_SMB2_02) &&
TALLOC_FREE(cliprotos);
if (lp_async_smb_echo_handler() && (chosen_level < PROTOCOL_SMB2_02) &&
- !fork_echo_handler(sconn)) {
+ !fork_echo_handler(xconn)) {
exit_server("Failed to fork echo handler");
}
exit_server("Failed to fork echo handler");
}
struct smbd_echo_read_state {
struct tevent_context *ev;
struct smbd_echo_read_state {
struct tevent_context *ev;
- struct smbd_server_connection *sconn;
+ struct smbXsrv_connection *xconn;
char *buf;
size_t buflen;
char *buf;
size_t buflen;
static struct tevent_req *smbd_echo_read_send(
TALLOC_CTX *mem_ctx, struct tevent_context *ev,
static struct tevent_req *smbd_echo_read_send(
TALLOC_CTX *mem_ctx, struct tevent_context *ev,
- struct smbd_server_connection *sconn)
+ struct smbXsrv_connection *xconn)
{
struct tevent_req *req, *subreq;
struct smbd_echo_read_state *state;
{
struct tevent_req *req, *subreq;
struct smbd_echo_read_state *state;
- struct smbXsrv_connection *xconn = sconn->conn;
req = tevent_req_create(mem_ctx, &state,
struct smbd_echo_read_state);
req = tevent_req_create(mem_ctx, &state,
struct smbd_echo_read_state);
return NULL;
}
state->ev = ev;
return NULL;
}
state->ev = ev;
subreq = wait_for_read_send(state, ev, xconn->transport.sock);
if (tevent_req_nomem(subreq, req)) {
subreq = wait_for_read_send(state, ev, xconn->transport.sock);
if (tevent_req_nomem(subreq, req)) {
subreq, struct tevent_req);
struct smbd_echo_read_state *state = tevent_req_data(
req, struct smbd_echo_read_state);
subreq, struct tevent_req);
struct smbd_echo_read_state *state = tevent_req_data(
req, struct smbd_echo_read_state);
- struct smbd_server_connection *sconn = state->sconn;
- struct smbXsrv_connection *xconn = sconn->conn;
+ struct smbXsrv_connection *xconn = state->xconn;
bool ok;
NTSTATUS status;
size_t unread = 0;
bool ok;
NTSTATUS status;
size_t unread = 0;
static void smbd_echo_got_packet(struct tevent_req *req);
static void smbd_echo_got_packet(struct tevent_req *req);
-static void smbd_echo_loop(struct smbd_server_connection *sconn,
+static void smbd_echo_loop(struct smbXsrv_connection *xconn,
- struct smbXsrv_connection *xconn = sconn->conn;
struct smbd_echo_state *state;
struct tevent_req *read_req;
struct smbd_echo_state *state;
struct tevent_req *read_req;
- state = talloc_zero(sconn, struct smbd_echo_state);
+ state = talloc_zero(xconn, struct smbd_echo_state);
if (state == NULL) {
DEBUG(1, ("talloc failed\n"));
return;
}
if (state == NULL) {
DEBUG(1, ("talloc failed\n"));
return;
}
state->xconn = xconn;
state->parent_pipe = parent_pipe;
state->ev = s3_tevent_context_init(state);
state->xconn = xconn;
state->parent_pipe = parent_pipe;
state->ev = s3_tevent_context_init(state);
- read_req = smbd_echo_read_send(state, state->ev, sconn);
+ read_req = smbd_echo_read_send(state, state->ev, xconn);
if (read_req == NULL) {
DEBUG(1, ("smbd_echo_read_send failed\n"));
TALLOC_FREE(state);
if (read_req == NULL) {
DEBUG(1, ("smbd_echo_read_send failed\n"));
TALLOC_FREE(state);
smbd_echo_activate_writer(state);
}
smbd_echo_activate_writer(state);
}
- req = smbd_echo_read_send(state, state->ev, state->sconn);
+ req = smbd_echo_read_send(state, state->ev, state->xconn);
if (req == NULL) {
DEBUG(1, ("smbd_echo_read_send failed\n"));
exit(1);
if (req == NULL) {
DEBUG(1, ("smbd_echo_read_send failed\n"));
exit(1);
/*
* Handle SMBecho requests in a forked child process
*/
/*
* Handle SMBecho requests in a forked child process
*/
-bool fork_echo_handler(struct smbd_server_connection *sconn)
+bool fork_echo_handler(struct smbXsrv_connection *xconn)
- struct smbXsrv_connection *xconn = sconn->conn;
int listener_pipe[2];
int res;
pid_t child;
int listener_pipe[2];
int res;
pid_t child;
close(listener_pipe[0]);
set_blocking(listener_pipe[1], false);
close(listener_pipe[0]);
set_blocking(listener_pipe[1], false);
- status = reinit_after_fork(sconn->msg_ctx,
- sconn->ev_ctx,
+ status = reinit_after_fork(xconn->msg_ctx,
+ xconn->ev_ctx,
true);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("reinit_after_fork failed: %s\n",
nt_errstr(status)));
exit(1);
}
true);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("reinit_after_fork failed: %s\n",
nt_errstr(status)));
exit(1);
}
- smbd_echo_loop(sconn, listener_pipe[1]);
+ smbd_echo_loop(xconn, listener_pipe[1]);
exit(0);
}
close(listener_pipe[1]);
exit(0);
}
close(listener_pipe[1]);
struct messaging_context *msg_ctx,
int sock_fd,
bool interactive);
struct messaging_context *msg_ctx,
int sock_fd,
bool interactive);
-bool fork_echo_handler(struct smbd_server_connection *sconn);
+bool fork_echo_handler(struct smbXsrv_connection *xconn);
/* The following definitions come from smbd/quotas.c */
/* The following definitions come from smbd/quotas.c */