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

« back to all changes in this revision

Viewing changes to camel/providers/nntp/camel-nntp-store.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:
1
1
/*ed.txtcamel-unused.txt-*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
2
/*
3
 
 *
4
3
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
5
4
 *
6
 
 * Authors: Christopher Toshok <toshok@ximian.com>
7
 
 *          Michael Zucchi <notzed@ximian.com>
8
 
 *
9
 
 * This library is free software you can redistribute it and/or modify it
 
5
 * This library is free software: you can redistribute it and/or modify it
10
6
 * under the terms of the GNU Lesser General Public License as published by
11
7
 * the Free Software Foundation.
12
8
 *
13
9
 * This library is distributed in the hope that it will be useful, but
14
10
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
 
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16
 
 *for more details.
 
11
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 
12
 * for more details.
17
13
 *
18
14
 * You should have received a copy of the GNU Lesser General Public License
19
 
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 
15
 * along with this library. If not, see <http://www.gnu.org/licenses/>.
 
16
 *
 
17
 * Authors: Christopher Toshok <toshok@ximian.com>
 
18
 *          Michael Zucchi <notzed@ximian.com>
20
19
 */
21
20
 
22
21
#ifdef HAVE_CONFIG_H
460
459
{
461
460
        CamelNNTPStore *nntp_store;
462
461
 
 
462
        /* Chain up to parent's method. */
 
463
        if (!CAMEL_SERVICE_CLASS (camel_nntp_store_parent_class)->connect_sync (service, cancellable, error))
 
464
                return FALSE;
 
465
 
463
466
        nntp_store = CAMEL_NNTP_STORE (service);
464
467
 
465
468
        if (!connect_to_server (service, cancellable, error))
492
495
 
493
496
        nntp_store_reset_state (nntp_store, NULL);
494
497
 
495
 
        return TRUE;
 
498
        /* Chain up to parent's method. */
 
499
        return CAMEL_SERVICE_CLASS (camel_nntp_store_parent_class)->disconnect_sync (service, clean, cancellable, error);
496
500
}
497
501
 
498
502
extern CamelServiceAuthType camel_nntp_anonymous_authtype;
2011
2015
 
2012
2016
exit:
2013
2017
        g_clear_object (&nntp_stream);
 
2018
        g_string_free (buffer, TRUE);
2014
2019
 
2015
2020
        return u;
2016
2021
}
2159
2164
                        if (ret == 211) {
2160
2165
                                camel_nntp_store_set_current_group (
2161
2166
                                        nntp_store, full_name);
2162
 
                                if (camel_nntp_folder_selected (folder, *line, NULL, &local_error) < 0) {
 
2167
                                if (camel_nntp_folder_selected (folder, *line, cancellable, &local_error) < 0) {
2163
2168
                                        ret = -1;
2164
2169
                                        goto error;
2165
2170
                                }
2203
2208
                case 400:       /* service discontinued */
2204
2209
                case 401:       /* wrong client state - this should quit but this is what the old code did */
2205
2210
                case 503:       /* information not available - this should quit but this is what the old code did (?) */
2206
 
                        if (camel_service_get_connection_status (service) != CAMEL_SERVICE_CONNECTING)
 
2211
                        if (camel_service_get_connection_status (service) != CAMEL_SERVICE_CONNECTING) {
 
2212
                                /* Reset the cancellable, thus the disconnect attempt can succeed. */
 
2213
                                if (g_cancellable_is_cancelled (cancellable))
 
2214
                                        g_cancellable_reset (cancellable);
 
2215
 
2207
2216
                                camel_service_disconnect_sync (
2208
2217
                                        service, FALSE, cancellable, NULL);
 
2218
                        }
2209
2219
                        ret = -1;
2210
2220
                        continue;
2211
2221
                case -1:        /* i/o error */
2212
 
                        if (camel_service_get_connection_status (service) != CAMEL_SERVICE_CONNECTING)
 
2222
                        if (camel_service_get_connection_status (service) != CAMEL_SERVICE_CONNECTING) {
 
2223
                                /* Reset the cancellable, thus the disconnect attempt can succeed. */
 
2224
                                if (g_cancellable_is_cancelled (cancellable))
 
2225
                                        g_cancellable_reset (cancellable);
 
2226
 
2213
2227
                                camel_service_disconnect_sync (
2214
2228
                                        service, FALSE, cancellable, NULL);
 
2229
                        }
2215
2230
                        if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED) || retry >= 3) {
2216
2231
                                g_propagate_error (error, local_error);
2217
2232
                                ret = -1;