bulkmail_get_current_host

one of the documented procedures in this installation of the ACS
Usage:
bulkmail_get_current_host
What it does:
Retrieves the smtp host to use and increments the index.
Defined in: /web/philip/tcl/bulkmail-utils.tcl

Source code:


    ns_share bulkmail_hosts_mutex
    ns_share bulkmail_hosts
    ns_share bulkmail_current_host_mutex
    ns_share bulkmail_current_host

    ns_mutex lock $bulkmail_hosts_mutex
    catch {
	set current_host [lindex $bulkmail_hosts $bulkmail_current_host]
	if {[llength $bulkmail_hosts] == 0} {
	    ns_log Error "bulkmail_get_current_host: bulkmail_hosts is an empty list"
	    spam_set_email_sending_p 0
	}
    }

    ns_mutex unlock $bulkmail_hosts_mutex

    ns_mutex lock $bulkmail_current_host_mutex
    catch {
	incr bulkmail_current_host
	if { $bulkmail_current_host >= [llength $bulkmail_hosts] } {
	    set bulkmail_current_host 0
	}
    }
    ns_mutex unlock $bulkmail_current_host_mutex

    return $current_host


philg@mit.edu