Пример #1
0
static int mhdriver_cached_initialize(mailsession * session)
{
  struct mh_cached_session_state_data * data;

  data = malloc(sizeof(* data));
  if (data == NULL)
    goto err;

  data->mh_flags_store = mail_flags_store_new();
  if (data->mh_flags_store == NULL)
    goto free;

  data->mh_ancestor = mailsession_new(mh_session_driver);
  if (data->mh_ancestor == NULL)
    goto free_store;

  data->mh_quoted_mb = NULL;
  
  session->sess_data = data;
  
  return MAIL_NO_ERROR;

 free_store:
  mail_flags_store_free(data->mh_flags_store);
 free:
  free(data);
 err:
  return MAIL_ERROR_MEMORY;
}
Пример #2
0
static int pop3driver_cached_initialize(mailsession * session)
{
  struct pop3_cached_session_state_data * data;

  data = malloc(sizeof(* data));
  if (data == NULL)
    goto err;

  data->pop3_flags_store = mail_flags_store_new();
  if (data->pop3_flags_store == NULL)
    goto free_data;

  data->pop3_ancestor = mailsession_new(pop3_session_driver);
  if (data->pop3_ancestor == NULL)
    goto free_store;

  data->pop3_flags_hash = chash_new(128, CHASH_COPYNONE);
  if (data->pop3_flags_hash == NULL)
    goto free_session;

  session->sess_data = data;

  return MAIL_NO_ERROR;

 free_session:
  mailsession_free(data->pop3_ancestor);
 free_store:
  mail_flags_store_free(data->pop3_flags_store);
 free_data:
  free(data);
 err:
  return MAIL_ERROR_MEMORY;
}
Пример #3
0
static void uninitialize(mailsession * session)
{
  struct db_session_state_data * data;
  
  data = get_data(session);

  flags_store_process(session);
  
  mail_flags_store_free(data->db_flags_store);
  
  free(data);
  
  session->sess_data = NULL;
}
Пример #4
0
static void mhdriver_cached_uninitialize(mailsession * session)
{
  struct mh_cached_session_state_data * data;

  data = get_cached_data(session);

  mh_flags_store_process(data->mh_flags_directory, data->mh_quoted_mb,
			 data->mh_flags_store);

  mail_flags_store_free(data->mh_flags_store); 

  free_state(data);
  mailsession_free(data->mh_ancestor);
  free(data);
  
  session->sess_data = NULL;
}
Пример #5
0
static void uninitialize(mailsession * session)
{
  struct maildir_session_state_data * data;

  data = get_data(session);

  if (data->md_session != NULL)
    flags_store_process(data->md_session, data->md_flags_store);

  mail_flags_store_free(data->md_flags_store);
  if (data->md_session != NULL)
    maildir_free(data->md_session);

  free(data);

  session->sess_data = NULL;
}
Пример #6
0
static void pop3driver_cached_uninitialize(mailsession * session)
{
  struct pop3_cached_session_state_data * data;

  data = get_cached_data(session);

  pop3_flags_store_process(data->pop3_flags_directory,
      data->pop3_flags_store);

  mail_flags_store_free(data->pop3_flags_store); 

  chash_free(data->pop3_flags_hash);
  mailsession_free(data->pop3_ancestor);
  free(data);
  
  session->sess_data = NULL;
}
Пример #7
0
static void nntpdriver_cached_uninitialize(mailsession * session)
{
  struct nntp_cached_session_state_data * cached_data;
  struct nntp_session_state_data * ancestor_data;

  cached_data = get_cached_data(session);
  ancestor_data = get_ancestor_data(session);

  nntp_flags_store_process(cached_data->nntp_flags_directory,
      ancestor_data->nntp_group_name,
      cached_data->nntp_flags_store);

  mail_flags_store_free(cached_data->nntp_flags_store); 

  mailsession_free(cached_data->nntp_ancestor);
  free(cached_data);
  
  session->sess_data = NULL;
}