Changeset 3423
- Timestamp:
- 02/20/08 17:48:24
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-operation.c (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-operation.h (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c (modified) (6 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c (modified) (4 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3416 r3423 1 2008-02-20 Philip Van Hoof <pvanhoof@gnome.org> 2 3 * Improvement for cancel's their reconnection 4 1 5 2008-02-18 Philip Van Hoof <pvanhoof@gnome.org> 2 6 trunk/libtinymail-camel/camel-lite/camel/camel-operation.c
r3256 r3423 25 25 #endif 26 26 27 #include <pthread.h>28 #include <stdio.h>29 #include <unistd.h>30 #include <sys/time.h>31 32 #ifdef HAVE_NSS33 #include <nspr.h>34 #endif35 36 #include <glib.h>37 38 #include <libedataserver/e-msgport.h>39 27 40 28 #include "camel-operation.h" … … 51 39 }; 52 40 53 struct _CamelOperation { 54 struct _CamelOperation *next; 55 struct _CamelOperation *prev; 56 57 pthread_t id; /* id of running thread */ 58 guint32 flags; /* cancelled ? */ 59 int blocked; /* cancellation blocked depth */ 60 int refcount; 61 62 CamelOperationStatusFunc status; 63 void *status_data; 64 unsigned int status_update; 65 66 /* stack of status messages (struct _status_stack *) */ 67 GSList *status_stack; 68 struct _status_stack *lastreport; 69 70 EMsgPort *cancel_port; 71 int cancel_fd; 72 #ifdef HAVE_NSS 73 PRFileDesc *cancel_prfd; 41 42 #ifndef CAMEL_OPERATION_CANCELLED 43 #define CAMEL_OPERATION_CANCELLED (1<<0) 74 44 #endif 75 };76 77 #define CAMEL_OPERATION_CANCELLED (1<<0)78 45 #define CAMEL_OPERATION_TRANSIENT (1<<1) 79 46 trunk/libtinymail-camel/camel-lite/camel/camel-operation.h
r2950 r3423 23 23 #define CAMEL_OPERATION_H 1 24 24 25 #include <pthread.h> 26 #include <stdio.h> 27 #include <unistd.h> 28 #include <sys/time.h> 29 30 31 #include <glib.h> 32 33 #include <libedataserver/e-msgport.h> 34 35 #ifdef HAVE_NSS 36 #include <nspr.h> 37 #endif 38 25 39 G_BEGIN_DECLS 26 40 … … 30 44 31 45 typedef void (*CamelOperationStatusFunc)(struct _CamelOperation *op, const char *what, int sofar, int oftotal, void *data); 46 47 #ifndef CAMEL_OPERATION_CANCELLED 48 #define CAMEL_OPERATION_CANCELLED (1<<0) 49 #endif 50 51 52 struct _CamelOperation { 53 struct _CamelOperation *next; 54 struct _CamelOperation *prev; 55 56 pthread_t id; /* id of running thread */ 57 guint32 flags; /* cancelled ? */ 58 int blocked; /* cancellation blocked depth */ 59 int refcount; 60 61 CamelOperationStatusFunc status; 62 void *status_data; 63 unsigned int status_update; 64 65 /* stack of status messages (struct _status_stack *) */ 66 GSList *status_stack; 67 struct _status_stack *lastreport; 68 69 EMsgPort *cancel_port; 70 int cancel_fd; 71 #ifdef HAVE_NSS 72 PRFileDesc *cancel_prfd; 73 #endif 74 }; 32 75 33 76 typedef enum _camel_operation_status_t { trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c
r3280 r3423 370 370 371 371 372 camel_imap_recon (store, &mex );372 camel_imap_recon (store, &mex, FALSE); 373 373 imap_debug ("Recon in start: %s\n", camel_exception_get_description (&mex)); 374 374 … … 412 412 camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, 413 413 _("Operation cancelled")); 414 camel_imap_recon (store, &mex );414 camel_imap_recon (store, &mex, TRUE); 415 415 imap_debug ("Recon in cont: %s\n", camel_exception_get_description (&mex)); 416 416 CAMEL_SERVICE_REC_UNLOCK (store, connect_lock); … … 711 711 camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, 712 712 _("Operation cancelled")); 713 camel_imap_recon (store, &mex );713 camel_imap_recon (store, &mex, TRUE); 714 714 imap_debug ("Recon in untagged: %s\n", camel_exception_get_description (&mex)); 715 715 camel_exception_clear (&mex); … … 731 731 camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, 732 732 _("Operation cancelled")); 733 camel_imap_recon (store, &mex );733 camel_imap_recon (store, &mex, TRUE); 734 734 imap_debug ("Recon in untagged idle: %s\n", camel_exception_get_description (&mex)); 735 735 camel_exception_clear (&mex); … … 876 876 camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, 877 877 _("Operation cancelled")); 878 camel_imap_recon (store, &mex );878 camel_imap_recon (store, &mex, TRUE); 879 879 imap_debug ("Recon in untagged: %s\n", camel_exception_get_description (&mex)); 880 880 camel_exception_clear (&mex); … … 896 896 camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, 897 897 _("Operation cancelled")); 898 camel_imap_recon (store, &mex );898 camel_imap_recon (store, &mex, TRUE); 899 899 imap_debug ("Recon in untagged idle: %s\n", camel_exception_get_description (&mex)); 900 900 camel_exception_clear (&mex); trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
r3398 r3423 160 160 161 161 void 162 camel_imap_recon (CamelImapStore *store, CamelException *mex )162 camel_imap_recon (CamelImapStore *store, CamelException *mex, gboolean was_cancel) 163 163 { 164 164 if (store->not_recon) { 165 165 camel_exception_set (mex, CAMEL_EXCEPTION_SERVICE_LOST_CONNECTION, 166 166 _("Connection lost during operation")); 167 return;168 167 } else { 169 168 CamelService *service = CAMEL_SERVICE (store); … … 195 194 196 195 service->reconnecting = FALSE; 196 } 197 198 if (was_cancel) { 199 CamelOperation *cc = camel_operation_registered (); 200 errno = EINTR; 201 cc->flags |= CAMEL_OPERATION_CANCELLED; 202 camel_operation_unref (cc); 197 203 } 198 204 } … … 4212 4218 CamelException mex = CAMEL_EXCEPTION_INITIALISER; 4213 4219 camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled")); 4214 camel_imap_recon (store, &mex );4220 camel_imap_recon (store, &mex, TRUE); 4215 4221 imap_debug ("Recon: %s\n", camel_exception_get_description (&mex)); 4216 4222 camel_exception_clear (&mex); … … 4288 4294 CamelException mex = CAMEL_EXCEPTION_INITIALISER; 4289 4295 camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled")); 4290 camel_imap_recon (store, &mex );4296 camel_imap_recon (store, &mex, TRUE); 4291 4297 imap_debug ("Recon in nl: %s\n", camel_exception_get_description (&mex)); 4292 4298 camel_exception_clear (&mex); trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.h
r3235 r3423 198 198 void camel_imap_store_stop_idle (CamelImapStore *store); 199 199 void camel_imap_store_start_idle (CamelImapStore *store); 200 void camel_imap_recon (CamelImapStore *store, CamelException *mex );200 void camel_imap_recon (CamelImapStore *store, CamelException *mex, gboolean was_cancel); 201 201 202 202 G_END_DECLS
