~ubuntu-branches/ubuntu/wily/evolution-data-server/wily

« back to all changes in this revision

Viewing changes to camel/providers/imapx/camel-imapx-conn-manager.c

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2015-07-20 13:34:59 UTC
  • mfrom: (1.1.126) (1.2.48 sid)
  • Revision ID: package-import@ubuntu.com-20150720133459-g6y46hnu5ewtoz08
Tags: 3.16.4-0ubuntu2
debian/patches/0001-Bug-752373-Monthly-events-do-not-recur-correctly.patch:
Cherry-pick patch from upstream to fix events not recurring correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
        GMutex pending_connections_lock;
52
52
        GSList *pending_connections; /* GCancellable * */
 
53
 
 
54
        gchar last_tagprefix;
53
55
};
54
56
 
55
57
struct _ConnectionInfo {
474
476
        g_rw_lock_init (&con_man->priv->rw_lock);
475
477
        g_mutex_init (&con_man->priv->pending_connections_lock);
476
478
        g_weak_ref_init (&con_man->priv->store, NULL);
 
479
 
 
480
        con_man->priv->last_tagprefix = 'A' - 1;
477
481
}
478
482
 
479
483
static void
721
725
imapx_conn_manager_get_next_free_tagprefix_unlocked (CamelIMAPXConnManager *con_man)
722
726
{
723
727
        gchar adept;
 
728
        gint ii;
724
729
        GList *iter;
725
730
 
 
731
        adept = con_man->priv->last_tagprefix + 1;
 
732
 
726
733
        /* the 'Z' is dedicated to auth types query */
727
 
        adept = 'A';
728
 
        while (adept < 'Z') {
 
734
        if (adept >= 'Z')
 
735
                adept = 'A';
 
736
        else if (adept < 'A')
 
737
                adept = 'A';
 
738
 
 
739
        for (ii = 0; ii < 26; ii++) {
729
740
                for (iter = con_man->priv->connections; iter; iter = g_list_next (iter)) {
730
741
                        ConnectionInfo *cinfo = iter->data;
731
742
 
741
752
                        break;
742
753
 
743
754
                adept++;
 
755
                if (adept >= 'Z')
 
756
                        adept = 'A';
744
757
        }
745
758
 
746
759
        g_return_val_if_fail (adept >= 'A' && adept < 'Z', 'Z');
747
760
 
 
761
        con_man->priv->last_tagprefix = adept;
 
762
 
748
763
        return adept;
749
764
}
750
765