Assume there is whatever module that does whatever Ajax stuff and, without page reload, frequently fires "Drupal.attachBehaviors".

What comes up?

var messageTimer = setInterval(pmGrowlCheckNew, Drupal.settings.pmGrowlInterval);

Is executed ever and ever again which multiplicates the intervals totals excessively and (I had this by accident while testing some other ajax stuff) leads to pmgrowls every 0.x seconds. Best way to DOS.

IMO, there should be a check to prevent that. Someting like

if (!messageTimer) {
  var messageTimer = setInterval(pmGrowlCheckNew, Drupal.settings.pmGrowlInterval);
}

Comments

doitDave’s picture

After some more tweaking I now have a) some more grey hair b) this code:

// make the initial call on page load
if (!Drupal.settings.pmgrowlInit) {
  pmGrowlCheckNew();
  Drupal.settings.pmgrowlInit = true;
  // set the timer to check for new messages on a given interval
  if (Drupal.settings.pmGrowlInterval > 0) {
    Drupal.settings.pmgrowltimer = setInterval(pmGrowlCheckNew, Drupal.settings.pmGrowlInterval);
  }
}

which works and only works at the defined growl times.

Berdir’s picture

Please provide that as a patch, thanks :)