~ps10gel/ubuntu/xenial/trafficserver/6.2.0

« back to all changes in this revision

Viewing changes to mgmt/api/CoreAPI.cc

  • Committer: Package Import Robot
  • Author(s): Aron Xu
  • Date: 2013-05-09 01:00:04 UTC
  • mto: (1.1.11) (5.3.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: package-import@ubuntu.com-20130509010004-9fqq9n0adseg3f8w
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
256
256
    // this will kill TM completely;traffic_cop will restart TM/TS
257
257
    lmgmt->ccom->sendClusterMessage(CLUSTER_MSG_SHUTDOWN_MANAGER);
258
258
  } else {                      // just bounce local proxy
259
 
    lmgmt->mgmtShutdown(0);
 
259
    lmgmt->mgmtShutdown();
260
260
  }
261
261
 
262
262
  return TS_ERR_OKAY;
534
534
TSError
535
535
ReadFile(TSFileNameT file, char **text, int *size, int *version)
536
536
{
537
 
  char *fname;
 
537
  const char *fname;
538
538
  Rollback *file_rb;
539
539
  int ret, old_file_len;
540
540
  textBuffer *old_file_content;
551
551
  ret = configFiles->getRollbackObj(fname, &file_rb);
552
552
  if (ret != TRUE) {
553
553
    Debug("FileOp", "[get_lines_from_file] Can't get Rollback for file: %s\n", fname);
554
 
    ats_free(fname);
555
554
    return TS_ERR_READ_FILE;
556
555
  }
557
 
  ats_free(fname);
558
556
  ver = file_rb->getCurrentVersion();
559
557
  file_rb->getVersion(ver, &old_file_content);
560
558
  *version = ver;
586
584
TSError
587
585
WriteFile(TSFileNameT file, char *text, int size, int version)
588
586
{
589
 
  char *fname;
 
587
  const char *fname;
590
588
  Rollback *file_rb;
591
589
  textBuffer *file_content;
592
590
  int ret;
603
601
    mgmt_log(stderr, "[CfgFileIO::WriteFile] ERROR getting rollback object\n");
604
602
    //goto generate_error_msg;
605
603
  }
606
 
  ats_free(fname);
607
604
 
608
605
  // if version < 0 then, just use next version in sequence;
609
606
  // otherwise check if trying to commit an old version
889
886
 * (type PROCESS, NODE, CLUSTER), sets them back to their default value
890
887
 * If one stat fails to be set correctly, then continues onto next one,
891
888
 * but will return TS_ERR_FAIL. Only returns TS_ERR_OKAY if all
892
 
 * stats are set back to defaults succesfully.
 
889
 * stats are set back to defaults successfully.
893
890
 */
894
891
TSError
895
 
StatsReset(bool cluster)
 
892
StatsReset(bool cluster, const char *name)
896
893
{
897
894
  if (cluster)
898
 
    lmgmt->ccom->sendClusterMessage(CLUSTER_MSG_CLEAR_STATS);
 
895
    lmgmt->ccom->sendClusterMessage(CLUSTER_MSG_CLEAR_STATS, name);
899
896
  else
900
 
    lmgmt->clearStats();
 
897
    lmgmt->clearStats(name);
901
898
  return TS_ERR_OKAY;
902
899
}
903
900