Changeset 2478
- Timestamp:
- 07/19/07 09:18:50
- Files:
-
- devel/jdapena/guadec-week/ChangeLog (modified) (1 diff)
- devel/jdapena/guadec-week/libtinymail-camel/camel-lite/camel/camel-private.h (modified) (1 diff)
- devel/jdapena/guadec-week/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c (modified) (2 diffs)
- devel/jdapena/guadec-week/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c (modified) (4 diffs)
- devel/jdapena/guadec-week/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/jdapena/guadec-week/ChangeLog
r2477 r2478 1 2007-07-19 Jose Dapena Paz <jdapena@igalia.com> 2 3 * libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c: 4 (imap_refresh_info): now we lock the folder also, before locking the 5 service, in order to respect better the lock order. This should avoid 6 some locks. 7 * libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.[ch]: 8 now we store a reference to the struct addrinfo used for connections. When 9 we are successful getting a valid addrinfo, it's stored and reused. This 10 way we prevent doing lots of calls to getaddrinfo and subsequent name 11 resolutions. As we're currently blocking while name resolution is running, 12 this should make the application more reponsive in general and avoid 13 flooding the connection. 14 We also removed the method (camel_imap_service_connect) as it's not used. 15 * libtinymail-camel/camel-lite/camel/camel-private.h: 16 added parenthesis to some lock macros. 17 1 18 2007-07-17 Jose Dapena Paz <jdapena@igalia.com> 2 19 devel/jdapena/guadec-week/libtinymail-camel/camel-lite/camel/camel-private.h
r1943 r2478 78 78 79 79 #define CAMEL_SERVICE_LOCK(f, l) \ 80 (g_static_mutex_lock(&((CamelService *) f)->priv->l))80 (g_static_mutex_lock(&((CamelService *)(f))->priv->l)) 81 81 #define CAMEL_SERVICE_UNLOCK(f, l) \ 82 (g_static_mutex_unlock(&((CamelService *) f)->priv->l))82 (g_static_mutex_unlock(&((CamelService *)(f))->priv->l)) 83 83 #define CAMEL_SERVICE_REC_LOCK(f, l) \ 84 (g_static_rec_mutex_lock(&((CamelService *) f)->priv->l))84 (g_static_rec_mutex_lock(&((CamelService *)(f))->priv->l)) 85 85 #define CAMEL_SERVICE_REC_UNLOCK(f, l) \ 86 (g_static_rec_mutex_unlock(&((CamelService *) f)->priv->l))86 (g_static_rec_mutex_unlock(&((CamelService *)(f))->priv->l)) 87 87 #define CAMEL_SERVICE_REC_TRYLOCK(f, l) \ 88 (g_static_rec_mutex_trylock(&((CamelService *) f)->priv->l))88 (g_static_rec_mutex_trylock(&((CamelService *)(f))->priv->l)) 89 89 90 90 devel/jdapena/guadec-week/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r2338 r2478 814 814 * us with a NOOP of new messages, so force a reselect which 815 815 * should do it. */ 816 CAMEL_FOLDER_REC_LOCK(folder, lock); 816 817 CAMEL_SERVICE_REC_LOCK (imap_store, connect_lock); 817 818 … … 861 862 done: 862 863 CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock); 864 CAMEL_FOLDER_REC_UNLOCK(folder, lock); 863 865 864 866 camel_folder_summary_save(folder->summary); devel/jdapena/guadec-week/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
r2422 r2478 350 350 camel_service_disconnect((CamelService *)imap_store, TRUE, NULL); 351 351 352 if (imap_store->addrinfo) { 353 freeaddrinfo (imap_store->addrinfo); 354 imap_store->addrinfo = NULL; 355 } 356 352 357 if (imap_store->summary) { 353 358 camel_store_summary_save((CamelStoreSummary *)imap_store->summary); … … 404 409 imap_store->connected = FALSE; 405 410 imap_store->preauthed = FALSE; 411 412 imap_store->addrinfo = NULL; 406 413 ((CamelStore *)imap_store)->flags |= CAMEL_STORE_SUBSCRIPTIONS; 407 414 … … 1182 1189 char *serv; 1183 1190 const char *port; 1191 CamelImapStore *store = (CamelImapStore *) service; 1184 1192 1185 1193 #ifndef G_OS_WIN32 … … 1236 1244 hints.ai_family = PF_UNSPEC; 1237 1245 1238 ai = camel_getaddrinfo(service->url->host, serv, &hints, ex); 1239 1240 if (ai == NULL && port != NULL && camel_exception_get_id(ex) != CAMEL_EXCEPTION_USER_CANCEL) 1246 if (store->addrinfo == NULL) 1247 store->addrinfo = camel_getaddrinfo(service->url->host, serv, &hints, ex); 1248 1249 if (store->addrinfo == NULL && port != NULL && 1250 camel_exception_get_id(ex) != CAMEL_EXCEPTION_USER_CANCEL) 1241 1251 { 1242 1252 camel_exception_clear (ex); 1243 ai= camel_getaddrinfo(service->url->host, port, &hints, ex);1244 } 1245 1246 if ( ai== NULL)1253 store->addrinfo = camel_getaddrinfo(service->url->host, port, &hints, ex); 1254 } 1255 1256 if (store->addrinfo == NULL) 1247 1257 return FALSE; 1248 1258 1249 ret = connect_to_server (service, ai, mode, must_tls, ex); 1250 camel_freeaddrinfo (ai); 1259 ret = connect_to_server (service, store->addrinfo, mode, must_tls, ex); 1251 1260 1252 1261 return ret; 1253 }1254 1255 gboolean1256 camel_imap_service_connect (CamelService *service, CamelException *ex)1257 {1258 return connect_to_server_wrapper (service, ex);1259 1262 } 1260 1263 devel/jdapena/guadec-week/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.h
r2351 r2478 166 166 guint idle_sleep, getsrv_sleep; 167 167 gboolean courier_crap; 168 169 struct addrinfo *addrinfo; 168 170 }; 169 171 … … 184 186 ssize_t camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *ex); 185 187 ssize_t camel_imap_store_readline_idle (CamelImapStore *store, char **dest, CamelException *ex); 186 gboolean camel_imap_service_connect (CamelService *service, CamelException *ex);187 188 188 189 gboolean camel_imap_store_restore_stream_buffer (CamelImapStore *store);
