s3: Remove unused smbd_echo_reader()
authorVolker Lendecke <vl@samba.org>
Tue, 26 Jul 2011 13:39:58 +0000 (15:39 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 11 Oct 2011 13:20:59 +0000 (15:20 +0200)
source3/smbd/process.c

index 84312fe24f157d43a8683492e8bee676f3317f14..28f9a3d0a5b93ac757552ec3b4583e85a55f1966 100644 (file)
@@ -2806,103 +2806,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,