diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-08-24 07:31:40 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-08-24 07:31:40 +0000 |
| commit | f1cfed2132cc1db11af4dea4f6b5b2bad9a4323b (patch) | |
| tree | 7a1c2b6da07eddb799239def0a0cbacc18f580ed | |
| parent | ab099c22c81a4f800d9d6d964f7426cfcb8c3419 (diff) | |
- Added unique connection identifier to IMAP debug messages
git-svn-id: https://svn.roundcube.net/trunk@5116 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/CHANGELOG | 1 | ||||
| -rw-r--r-- | roundcubemail/program/include/rcube_imap_generic.php | 14 |
2 files changed, 13 insertions, 2 deletions
diff --git a/roundcubemail/CHANGELOG b/roundcubemail/CHANGELOG index 4e49e1804..2dbcfa7ec 100644 --- a/roundcubemail/CHANGELOG +++ b/roundcubemail/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Added unique connection identifier to IMAP debug messages - Added 'priority' column on messages list (#1486782) - Fix image type check for contact photo uploads diff --git a/roundcubemail/program/include/rcube_imap_generic.php b/roundcubemail/program/include/rcube_imap_generic.php index dd10033bc..75acc5a3d 100644 --- a/roundcubemail/program/include/rcube_imap_generic.php +++ b/roundcubemail/program/include/rcube_imap_generic.php @@ -105,6 +105,7 @@ class rcube_imap_generic private $prefs; private $cmd_tag; private $cmd_num = 0; + private $resourceid; private $_debug = false; private $_debug_handler = false; @@ -734,8 +735,13 @@ class rcube_imap_generic $line = trim(fgets($this->fp, 8192)); - if ($this->_debug && $line) { - $this->debug('S: '. $line); + if ($this->_debug) { + // set connection identifier for debug output + preg_match('/#([0-9]+)/', (string)$this->fp, $m); + $this->resourceid = strtoupper(substr(md5($m[1].$this->user.microtime()), 0, 4)); + + if ($line) + $this->debug('S: '. $line); } // Connected to wrong port or connection error? @@ -3361,6 +3367,10 @@ class rcube_imap_generic */ private function debug($message) { + if ($this->resourceid) { + $message = sprintf('[%s] %s', $this->resourceid, $message); + } + if ($this->_debug_handler) { call_user_func_array($this->_debug_handler, array(&$this, $message)); } else { |
