summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-07-26 15:39:58 +0200
committerVolker Lendecke <vlendec@samba.org>2011-07-28 17:42:23 +0200
commit4dd0a3b5e29e3a39e90a425a827d6a17b9868ced (patch)
treeddba021a718f63f6c8abec6220ce83ba3988d570
parent710e5d92562b2f43a20a33575ea0ec44e9b49a0a (diff)
downloadsamba-4dd0a3b5e29e3a39e90a425a827d6a17b9868ced.tar.gz
samba-4dd0a3b5e29e3a39e90a425a827d6a17b9868ced.tar.bz2
samba-4dd0a3b5e29e3a39e90a425a827d6a17b9868ced.zip
s3: Remove unused smbd_echo_reader()
-rw-r--r--source3/smbd/process.c97
1 files changed, 0 insertions, 97 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 38682ff2ce..5e9392bddb 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -2730,103 +2730,6 @@ static void smbd_echo_exit(struct tevent_context *ev,
exit(0);
}
-static void smbd_echo_reader(struct tevent_context *ev,
- struct tevent_fd *fde, uint16_t flags,
- void *private_data)
-{
- struct smbd_echo_state *state = talloc_get_type_abort(
- private_data, struct smbd_echo_state);
- struct smbd_server_connection *sconn = state->sconn;
- size_t unread, num_pending;
- NTSTATUS status;
- struct iovec *tmp;
- size_t iov_len;
- uint32_t seqnum = 0;
- bool reply;
- bool ok;
- bool encrypted = false;
-
- smb_msleep(1000);
-
- ok = smbd_lock_socket_internal(sconn);
- if (!ok) {
- DEBUG(0, ("%s: failed to lock socket\n",
- __location__));
- exit(1);
- }
-
- if (!fd_is_readable(sconn->sock)) {
- DEBUG(10,("echo_handler[%d] the parent smbd was faster\n",
- (int)sys_getpid()));
- ok = smbd_unlock_socket_internal(sconn);
- if (!ok) {
- DEBUG(1, ("%s: failed to unlock socket in\n",
- __location__));
- exit(1);
- }
- return;
- }
-
- num_pending = talloc_array_length(state->pending);
- tmp = talloc_realloc(state, state->pending, struct iovec,
- num_pending+1);
- if (tmp == NULL) {
- DEBUG(1, ("talloc_realloc failed\n"));
- exit(1);
- }
- state->pending = tmp;
-
- DEBUG(10,("echo_handler[%d]: reading pdu\n", (int)sys_getpid()));
-
- status = receive_smb_talloc(state->pending, sconn, sconn->sock,
- (char **)(void *)&state->pending[num_pending].iov_base,
- 0 /* timeout */,
- &unread,
- &encrypted,
- &iov_len,
- &seqnum,
- false /* trusted_channel*/);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(1, ("echo_handler[%d]: receive_smb_raw_talloc failed: %s\n",
- (int)sys_getpid(), nt_errstr(status)));
- exit(1);
- }
- state->pending[num_pending].iov_len = iov_len;
-
- ok = smbd_unlock_socket_internal(sconn);
- if (!ok) {
- DEBUG(1, ("%s: failed to unlock socket in\n",
- __location__));
- exit(1);
- }
-
- reply = smbd_echo_reply((uint8_t *)state->pending[num_pending].iov_base,
- state->pending[num_pending].iov_len,
- seqnum);
- if (reply) {
- DEBUG(10,("echo_handler[%d]: replied to client\n", (int)sys_getpid()));
- /* no check, shrinking by some bytes does not fail */
- state->pending = talloc_realloc(state, state->pending,
- struct iovec,
- num_pending);
- return;
- }
-
- if (state->pending[num_pending].iov_len >= smb_size) {
- /*
- * place the seqnum in the packet so that the main process
- * can reply with signing
- */
- SIVAL((uint8_t *)state->pending[num_pending].iov_base,
- smb_ss_field, seqnum);
- SIVAL((uint8_t *)state->pending[num_pending].iov_base,
- smb_ss_field+4, NT_STATUS_V(NT_STATUS_OK));
- }
-
- DEBUG(10,("echo_handler[%d]: forward to main\n", (int)sys_getpid()));
- smbd_echo_activate_writer(state);
-}
-
static void smbd_echo_got_packet(struct tevent_req *req);
static void smbd_echo_loop(struct smbd_server_connection *sconn,