Ignore:
Timestamp:
Jul 6, 2011, 8:21:13 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update trunk to 3.5.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/smbd/server.c

    r454 r599  
    542542}
    543543
     544static bool parent_housekeeping_fn(const struct timeval *now, void *private_data)
     545{
     546        DEBUG(5, ("houskeeping\n"));
     547        /* check if we need to reload services */
     548        check_reload(time(NULL));
     549        return true;
     550}
     551
    544552/****************************************************************************
    545553 Open the socket communication.
     
    601609                                }
    602610
     611                                /* Keep the first port for mDNS service
     612                                 * registration.
     613                                 */
     614                                if (dns_port == 0) {
     615                                        dns_port = port;
     616                                }
     617
    603618                                if (!smbd_open_one_socket(parent, ifss, port)) {
    604619                                        return false;
     
    668683        claim_connection(NULL,"",
    669684                         FLAG_MSG_GENERAL|FLAG_MSG_SMBD|FLAG_MSG_DBWRAP);
     685
     686        if (!(event_add_idle(smbd_event_context(), NULL,
     687                             timeval_set(SMBD_HOUSEKEEPING_INTERVAL, 0),
     688                             "parent_housekeeping", parent_housekeeping_fn,
     689                             parent))) {
     690                DEBUG(0, ("Could not add housekeeping event\n"));
     691                exit(1);
     692        }
    670693
    671694        /* Listen to messages */
     
    735758}
    736759
    737 /****************************************************************************
    738  Reload printers
    739 **************************************************************************/
     760/***************************************************************************
     761 purge stale printers and reload from pre-populated pcap cache
     762***************************************************************************/
    740763void reload_printers(void)
    741764{
     
    745768        const char *pname;
    746769
    747         pcap_cache_reload();
    748 
    749         /* remove stale printers */
     770        DEBUG(10, ("reloading printer services from pcap cache\n"));
    750771        for (snum = 0; snum < n_services; snum++) {
    751772                /* avoid removing PRINTERS_NAME or non-autoloaded printers */
     
    794815        ret = lp_load(get_dyn_CONFIGFILE(), False, False, True, True);
    795816
    796         reload_printers();
     817        pcap_cache_reload(&reload_printers);
    797818
    798819        /* perhaps the config filename is now set */
Note: See TracChangeset for help on using the changeset viewer.