Bug 1792451 - Set socket timeout in Pop3Client to release folder lock. r=mkmelin
authorPing Chen <remotenonsense@gmail.com>
Wed, 28 Sep 2022 01:20:21 +0000
changeset 36818 144b74e92a2048554e782b49de3b04cdafaab189
parent 36817 b4c3c9d564e2a821597cadb9dcfc9aa9b4ca4163
child 36819 20037543ebbbea598f8a60560dc5f29846e13e2f
push id20334
push userthunderbird@calypsoblue.org
push dateWed, 28 Sep 2022 13:10:29 +0000
treeherdercomm-central@144b74e92a20 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1792451
Bug 1792451 - Set socket timeout in Pop3Client to release folder lock. r=mkmelin Differential Revision: https://phabricator.services.mozilla.com/D158237
mailnews/local/src/Pop3Client.jsm
--- a/mailnews/local/src/Pop3Client.jsm
+++ b/mailnews/local/src/Pop3Client.jsm
@@ -273,16 +273,20 @@ class Pop3Client {
       // See if there is an APOP timestamp.
       // eslint-disable-next-line no-control-regex
       let matches = res.statusText.match(/<[\x00-\x7F]+@[\x00-\x7F]+>/);
       if (matches?.[0]) {
         this._apopTimestamp = matches[0];
       }
       this.onOpen();
     };
+    this._socket.transport.setTimeout(
+      Ci.nsISocketTransport.TIMEOUT_READ_WRITE,
+      Services.prefs.getIntPref("mailnews.tcptimeout")
+    );
   };
 
   /**
    * Parse the server response.
    * @param {string} str - Response received from the server.
    * @returns {Pop3Response}
    */
   _parse(str) {