]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
push-notification-driver-ox: Wait for http requests to finish in deinit
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Wed, 29 Mar 2017 17:04:47 +0000 (20:04 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 30 Mar 2017 17:56:24 +0000 (20:56 +0300)
This is to make sure mail_user is still usable in http response
callback.

src/plugins/push-notification/push-notification-driver-ox.c

index fff48495a42a4cdc0e197c7bff4a535b332bf45a..9acea261f1cfba69d1b8dffcd201463794822d0b 100644 (file)
@@ -422,6 +422,7 @@ static void push_notification_driver_ox_deinit
 
     i_free(dconfig->cached_ox_metadata);
     if (ox_global != NULL) {
+        http_client_wait(ox_global->http_client);
         i_assert(ox_global->refcount > 0);
         --ox_global->refcount;
     }
@@ -431,7 +432,6 @@ static void push_notification_driver_ox_cleanup(void)
 {
     if ((ox_global != NULL) && (ox_global->refcount <= 0)) {
         if (ox_global->http_client != NULL) {
-            http_client_wait(ox_global->http_client);
             http_client_deinit(&ox_global->http_client);
         }
         i_free_and_null(ox_global);