~ubuntu-branches/ubuntu/wily/trafficserver/wily

« back to all changes in this revision

Viewing changes to proxy/DiagsConfig.cc

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-12-17 22:28:16 UTC
  • mfrom: (5.1.8 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20121217222816-7xwjsx5k76zkb63d
Tags: 3.2.0-1ubuntu1
* Revert FreeBSD strerror_r() fixes that give errors with glibc 2.16.
* Apply patch from Konstantinos Margaritis to define barriers on ARM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
    all_found = all_found && found;
119
119
    if (found) {
120
120
      parse_output_string(p, &(c.outputs[l]));
121
 
      xfree(p);
 
121
      ats_free(p);
122
122
    } else {
123
 
      SrcLoc loc(__FILE__, __FUNCTION__, __LINE__);
124
 
      diags->print(NULL, DL_Error, NULL, &loc, "can't find config variable '%s'\n", record_name);
 
123
      diags->print(NULL, DTA(DL_Error), "can't find config variable '%s'\n", record_name);
125
124
    }
126
125
  }
127
126
 
139
138
  ///////////////////////////////////////////////////////////////////
140
139
 
141
140
  if (!all_found) {
142
 
    SrcLoc loc(__FILE__, __FUNCTION__, __LINE__);
143
 
    diags->print(NULL, DL_Error, NULL, &loc, "couldn't fetch all proxy.config.diags values");
 
141
    diags->print(NULL, DTA(DL_Error), "couldn't fetch all proxy.config.diags values");
144
142
  } else {
145
143
    //////////////////////////////
146
144
    // clear out old tag tables //
164
162
#else
165
163
    memcpy(((void *) &diags->config), ((void *) &c), sizeof(DiagsConfigState));
166
164
#endif
167
 
    diags->print(NULL, DL_Note, NULL, NULL, "updated diags config");
 
165
    diags->print(NULL, DTA(DL_Note), "updated diags config");
168
166
  }
169
167
 
170
168
  ////////////////////////////////////
171
169
  // free the record.config strings //
172
170
  ////////////////////////////////////
173
 
 
174
 
  if (dt)
175
 
    xfree(dt);
176
 
  if (at)
177
 
    xfree(at);
 
171
  ats_free(dt);
 
172
  ats_free(at);
178
173
}
179
174
 
180
175
 
344
339
 
345
340
  diags = NEW(new Diags(bdt, bat, diags_log_fp));
346
341
  if (diags_log_fp == NULL) {
347
 
    SrcLoc loc(__FILE__, __FUNCTION__, __LINE__);
348
342
 
349
 
    diags->print(NULL, DL_Warning, NULL, &loc,
 
343
    diags->print(NULL, DTA(DL_Warning),
350
344
                 "couldn't open diags log file '%s', " "will not log to this file", diags_logpath);
351
345
  }
352
 
  diags->print(NULL, DL_Status, "STATUS", NULL, "opened %s", diags_logpath);
 
346
  diags->print(NULL, DTA(DL_Status), "opened %s", diags_logpath);
353
347
 
354
348
  register_diags_callbacks();
355
349
 
400
394
  for (i = 0; config_record_names[i] != NULL; i++) {
401
395
    status = (REC_RegisterConfigUpdateFunc(config_record_names[i], diags_config_callback, o) == REC_ERR_OKAY);
402
396
    if (!status) {
403
 
      diags->print(NULL, DL_Warning, NULL, NULL,
 
397
      diags->print(NULL, DTA(DL_Warning),
404
398
                   "couldn't register variable '%s', is records.config up to date?", config_record_names[i]);
405
399
    }
406
400
    total_status = total_status && status;
407
401
  }
408
402
 
409
403
  if (total_status == FALSE) {
410
 
    diags->print(NULL, DL_Error, NULL, NULL, "couldn't setup all diags callbacks, diagnostics may misbehave");
 
404
    diags->print(NULL, DTA(DL_Error), "couldn't setup all diags callbacks, diagnostics may misbehave");
411
405
    callbacks_established = false;
412
406
  } else {
413
407
    callbacks_established = true;
422
416
    diags_log_fp = NULL;
423
417
  }
424
418
  delete diags;
425
 
//  xfree(diags);
426
419
}