From 9e832e94876fcdd5bf653da5579cdc841b5fd3e6 Mon Sep 17 00:00:00 2001 From: Tadashi MATSUO Date: Tue, 29 Jun 2010 02:04:19 +0900 Subject: [PATCH] Wait for the verifying process to exit in order to avoid dead-lock. * twittering-mode.el (twittering-verify-credentials): wait for the process to exit in order to avoid dead-lock. --- ChangeLog | 3 +++ twittering-mode.el | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 465490e2..4fb7aa84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ in order to avoid dead-lock. (twittering-get-list-index-sync): likewise. + * twittering-mode.el (twittering-verify-credentials): wait for the + process to exit in order to avoid dead-lock. + 2010-06-13 Tadashi MATSUO * twittering-mode.el (twittering-write-and-encrypt): fix arguments diff --git a/twittering-mode.el b/twittering-mode.el index 70a72114..7d41fa36 100644 --- a/twittering-mode.el +++ b/twittering-mode.el @@ -3114,10 +3114,19 @@ authorized -- The account has been authorized.") 'verify-credentials `((sentinel . twittering-http-get-verify-credentials-sentinel))))) - (unless proc + (cond + ((null proc) (setq twittering-account-authorization nil) (message "Authorization failed. Type M-x twit to retry.") - (setq twittering-oauth-access-token-alist nil)))) + (setq twittering-oauth-access-token-alist nil)) + (t + (while (and (eq twittering-account-authorization 'queried) + (memq (process-status proc) '(run connect open))) + (sit-for 0.1)) + (when (eq twittering-account-authorization 'queried) + (message "Authorization failed. Type M-x twit to retry.") + (setq twittering-oauth-access-token-alist nil) + (setq twittering-account-authorization nil)))))) (t (message "Failed to load an authorized token from \"%s\"." twittering-private-info-file)