void qmgr_scan_request(QMGR_SCAN *scan_info, int flags) { /* * If a scan is in progress, just record the request. */ scan_info->nflags |= flags; if (scan_info->handle == 0 && (flags & QMGR_SCAN_START) != 0) { scan_info->nflags &= ~QMGR_SCAN_START; qmgr_scan_start(scan_info); } }
char *qmgr_scan_next(QMGR_SCAN *scan_info) { char *path = 0; /* * Restart the scan if we reach the end and a queue scan request has * arrived in the mean time. */ if (scan_info->handle && (path = mail_scan_dir_next(scan_info->handle)) == 0) { scan_info->handle = scan_dir_close(scan_info->handle); if (msg_verbose && (scan_info->nflags & QMGR_SCAN_START) == 0) msg_info("done %s queue scan", scan_info->queue); } if (!scan_info->handle && (scan_info->nflags & QMGR_SCAN_START)) { qmgr_scan_start(scan_info); path = mail_scan_dir_next(scan_info->handle); } return (path); }
void qmgr_scan_request(QMGR_SCAN *scan_info, int flags) { /* * Apply "forget all dead destinations" requests immediately. Throttle * dead transports and queues at the earliest opportunity: preferably * during an already ongoing queue scan, otherwise the throttling will * have to wait until a "start scan" trigger arrives. * * The QMGR_FLUSH_ONCE request always comes with QMGR_FLUSH_DFXP, and * sometimes it also comes with QMGR_SCAN_ALL. It becomes a completely * different story when a flush request is encoded in file permissions. */ if (flags & QMGR_FLUSH_ONCE) qmgr_enable_all(); /* * Apply "ignore time stamp" requests also towards the scan that is * already in progress. */ if (scan_info->handle != 0 && (flags & QMGR_SCAN_ALL)) scan_info->flags |= QMGR_SCAN_ALL; /* * Apply "override defer_transports" requests also towards the scan that * is already in progress. */ if (scan_info->handle != 0 && (flags & QMGR_FLUSH_DFXP)) scan_info->flags |= QMGR_FLUSH_DFXP; /* * If a scan is in progress, just record the request. */ scan_info->nflags |= flags; if (scan_info->handle == 0 && (flags & QMGR_SCAN_START) != 0) { scan_info->nflags &= ~QMGR_SCAN_START; qmgr_scan_start(scan_info); } }