Bug 1152531 - Releasing MMS connection if MMS fails to send due to ensureRouting error. r=bevis
authorEdgar Chen <echen@mozilla.com>
Fri, 10 Apr 2015 15:10:14 +0800
changeset 238584 fac9c1f3729b
parent 238583 1eaafc6a721e
child 238585 faa9d04ab03f
push id15046
push userechen@mozilla.com
push date2015-04-13 03:13 +0000
treeherderb2g-inbound@fac9c1f3729b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbevis
bugs1152531
milestone40.0a1
Bug 1152531 - Releasing MMS connection if MMS fails to send due to ensureRouting error. r=bevis
dom/mobilemessage/gonk/MmsService.js
--- a/dom/mobilemessage/gonk/MmsService.js
+++ b/dom/mobilemessage/gonk/MmsService.js
@@ -718,16 +718,17 @@ XPCOMUtils.defineLazyGetter(this, "gMmsT
                                    cancellable.done(aHttpStatus, aData));
         };
 
         mmsConnection.ensureRouting(url)
           .then(() => startTransaction(),
                 (aError) => {
                   debug("Failed to ensureRouting: " + aError);
 
+                  mmsConnection.release();
                   cancellable.done(_HTTP_STATUS_FAILED_TO_ROUTE, null);
                 });
       });
 
       return cancellable;
     },
 
     sendHttpRequest: function(mmsConnection, method, url, istream, proxyFilter,