Exemple #1
0
static void stop(struct mwServiceFileTransfer *srvc) {
  while(srvc->transfers) {
    mwFileTransfer_free(srvc->transfers->data);
  }

  mwService_stopped(MW_SERVICE(srvc));
}
Exemple #2
0
static void start(struct mwServiceDirectory *srvc) {
  struct mwChannel *chan;

  chan = make_channel(srvc);
  if(chan) {
    srvc->channel = chan;
  } else {
    mwService_stopped(MW_SERVICE(srvc));
    return;
  }
}
Exemple #3
0
static void start(struct mwService *srvc) {
  struct mwServiceStorage *srvc_store;
  struct mwChannel *chan;

  g_return_if_fail(srvc != NULL);
  srvc_store = (struct mwServiceStorage *) srvc;

  chan = make_channel(srvc_store);
  if(chan) {
    srvc_store->channel = chan;
  } else {
    mwService_stopped(srvc);
  }
}
Exemple #4
0
void mwService_stop(struct mwService *srvc) {
  g_return_if_fail(srvc != NULL);

  if(MW_SERVICE_IS_DEAD(srvc))
    return;

  srvc->state = mwServiceState_STOPPING;
  g_message("stopping service %s", NSTR(mwService_getName(srvc)));

  if(srvc->stop) {
    srvc->stop(srvc);
  } else {
    mwService_stopped(srvc);
  }
}
Exemple #5
0
static void stop(struct mwService *srvc) {

  struct mwServiceStorage *srvc_store;
  GList *l;

  g_return_if_fail(srvc != NULL);
  srvc_store = (struct mwServiceStorage *) srvc;

  if(srvc_store->channel) {
    mwChannel_destroy(srvc_store->channel, ERR_SUCCESS, NULL);
    srvc_store->channel = NULL;
  }

#if 1
  /* the new way */
  /* remove pending requests. Sometimes we can crash the storage
     service, and when that happens, we end up resending the killer
     request over and over again, and the service never stays up */
  for(l = srvc_store->pending; l; l = l->next)
    request_free(l->data);

  g_list_free(srvc_store->pending);
  srvc_store->pending = NULL;

  srvc_store->id_counter = 0;

#else
  /* the old way */
  /* reset all of the started requests to their unstarted states */
  for(l = srvc_store->pending; l; l = l->next) {
    struct mwStorageReq *req = l->data;

    if(req->action == action_loaded) {
      req->action = action_load;
    } else if(req->action == action_saved) {
      req->action = action_save;
    }
  }
#endif

  mwService_stopped(srvc);
}
Exemple #6
0
static void stop(struct mwServicePlace *srvc) {
  while(srvc->places)
    mwPlace_destroy(srvc->places->data, ERR_SUCCESS);

  mwService_stopped(MW_SERVICE(srvc));
}
Exemple #7
0
static void stop(struct mwServiceConference *srvc) {
  while(srvc->confs)
    mwConference_destroy(srvc->confs->data, ERR_SUCCESS, NULL);

  mwService_stopped(MW_SERVICE(srvc));
}