Revert "WORKS BUT NOT NEEDED s3:smbd: allow cancelling deferred SMB1 opens"
[metze/samba/wip.git] / source3 / smbd / process.c
index 7a12dc11f6a5dd15c3bc1d55a9efd50c7a3af2b9..99693ed1315b98360ca164439b33d061d703b9a2 100644 (file)
@@ -855,76 +855,6 @@ bool schedule_deferred_open_message_smb(struct smbXsrv_connection *xconn,
        return false;
 }
 
-/****************************************************************************
- Function to cancel a sharing violation open message by mid.
-****************************************************************************/
-
-void cancel_deferred_open_message_smb(struct smbXsrv_connection *xconn,
-                                     uint64_t mid)
-{
-       struct smbd_server_connection *sconn = xconn->client->sconn;
-       struct pending_message_list *pml;
-       int i = 0;
-
-       if (sconn->using_smb2) {
-               return;
-       }
-
-       for (pml = sconn->deferred_open_queue; pml; pml = pml->next) {
-               uint64_t msg_mid = (uint64_t)SVAL(pml->buf.data,smb_mid);
-               struct tevent_timer *te = NULL;
-               bool ok;
-
-               DBG_DEBUG("[%d] msg_mid = %llu\n",
-                         i++, (unsigned long long)msg_mid);
-
-               if (mid != msg_mid) {
-                       continue;
-               }
-
-               if (pml->processed) {
-                       /* A processed message should not be
-                        * rescheduled. */
-                       DBG_WARNING("LOGIC ERROR message mid %llu was "
-                                   "already processed\n",
-                                   (unsigned long long)msg_mid);
-                       return;
-               }
-
-               ok = cancel_open_async(pml->open_rec);
-               if (!ok) {
-                       DBG_DEBUG("Request not cancelable, "
-                                 "skipping mid %llu\n",
-                                 (unsigned long long)msg_mid);
-                       return;
-               }
-
-               DBG_DEBUG("canceling deferred open mid %llu\n",
-                         (unsigned long long)mid);
-
-               te = tevent_add_timer(pml->sconn->ev_ctx,
-                                     pml,
-                                     timeval_zero(),
-                                     smbd_deferred_open_timer,
-                                     pml);
-               if (te == NULL) {
-                       DBG_ERR("tevent_add_timer() failed, "
-                               "skipping mid %llu\n",
-                               (unsigned long long)msg_mid);
-                       return;
-               }
-
-               TALLOC_FREE(pml->te);
-               pml->te = te;
-               DLIST_PROMOTE(sconn->deferred_open_queue, pml);
-               return;
-       }
-
-       DBG_DEBUG("failed to find message mid %llu\n",
-                 (unsigned long long)mid);
-       return;
-}
-
 /****************************************************************************
  Return true if this mid is on the deferred queue and was not yet processed.
 ****************************************************************************/