Bug 806296 - Patch 1(v1): Cannot create an encrypted socket, r=echou
authorGina Yeh <gyeh@mozilla.com>
Wed, 31 Oct 2012 17:33:50 +0800
changeset 111879 de25c9c57c5385b0c23f226aaa3c6a88bf5b2ff3
parent 111878 265f424378e886201b8cd2ab23d645fe3c4eda6a
child 111880 1baac3f2334c5516cfa56ce944eafa4cec3e6356
child 111906 3393586a210b24706bd48e8fcdbfe53dcddcd575
push id17306
push userechou@mozilla.com
push dateWed, 31 Oct 2012 09:34:30 +0000
treeherdermozilla-inbound@de25c9c57c53 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechou
bugs806296
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 806296 - Patch 1(v1): Cannot create an encrypted socket, r=echou
dom/bluetooth/BluetoothHfpManager.cpp
dom/bluetooth/BluetoothOppManager.cpp
dom/bluetooth/BluetoothScoManager.cpp
dom/bluetooth/BluetoothUnixSocketConnector.cpp
--- a/dom/bluetooth/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/BluetoothHfpManager.cpp
@@ -601,17 +601,17 @@ BluetoothHfpManager::Connect(const nsASt
   }
 
   nsRefPtr<BluetoothReplyRunnable> runnable = aRunnable;
 
   nsresult rv = bs->GetSocketViaService(aDevicePath,
                                         serviceUuidStr,
                                         BluetoothSocketType::RFCOMM,
                                         true,
-                                        false,
+                                        true,
                                         this,
                                         runnable);
 
   runnable.forget();
   return NS_FAILED(rv) ? false : true;
 }
 
 bool
@@ -630,17 +630,17 @@ BluetoothHfpManager::Listen()
   if (!bs) {
     NS_WARNING("BluetoothService not available!");
     return false;
   }
 
   nsresult rv = bs->ListenSocketViaService(BluetoothReservedChannels::HANDSFREE_AG,
                                            BluetoothSocketType::RFCOMM,
                                            true,
-                                           false,
+                                           true,
                                            this);
 
   mSocketStatus = GetConnectionStatus();
 
   return NS_FAILED(rv) ? false : true;
 }
 
 void
--- a/dom/bluetooth/BluetoothOppManager.cpp
+++ b/dom/bluetooth/BluetoothOppManager.cpp
@@ -197,17 +197,17 @@ BluetoothOppManager::Connect(const nsASt
     NS_ConvertUTF8toUTF16(mozilla::dom::bluetooth::BluetoothServiceUuidStr::ObjectPush);
 
   nsRefPtr<BluetoothReplyRunnable> runnable = aRunnable;
 
   nsresult rv = bs->GetSocketViaService(aDeviceObjectPath,
                                         serviceUuidStr,
                                         BluetoothSocketType::RFCOMM,
                                         true,
-                                        false,
+                                        true,
                                         this,
                                         runnable);
 
   runnable.forget();
   return NS_FAILED(rv) ? false : true;
 }
 
 void
@@ -237,17 +237,17 @@ BluetoothOppManager::Listen()
   if (!bs) {
     NS_WARNING("BluetoothService not available!");
     return false;
   }
 
   nsresult rv = bs->ListenSocketViaService(BluetoothReservedChannels::OPUSH,
                                            BluetoothSocketType::RFCOMM,
                                            true,
-                                           false,
+                                           true,
                                            this);
   return NS_FAILED(rv) ? false : true;
 }
 
 bool
 BluetoothOppManager::SendFile(BlobParent* aActor,
                               BluetoothReplyRunnable* aRunnable)
 {
--- a/dom/bluetooth/BluetoothScoManager.cpp
+++ b/dom/bluetooth/BluetoothScoManager.cpp
@@ -239,17 +239,17 @@ BluetoothScoManager::Listen()
   if (!bs) {
     NS_WARNING("BluetoothService not available!");
     return false;
   }
 
   nsresult rv = bs->ListenSocketViaService(-1,
                                            BluetoothSocketType::SCO,
                                            true,
-                                           false,
+                                           true,
                                            this);
 
   mSocketStatus = GetConnectionStatus();
 
   return NS_FAILED(rv) ? false : true;
 }
 
 void
--- a/dom/bluetooth/BluetoothUnixSocketConnector.cpp
+++ b/dom/bluetooth/BluetoothUnixSocketConnector.cpp
@@ -83,22 +83,20 @@ BluetoothUnixSocketConnector::SetUp(int 
 {
   int lm = 0;
   int sndbuf;
   /* kernel does not yet support LM for SCO */
   switch (mType) {
   case BluetoothSocketType::RFCOMM:
     lm |= mAuth ? RFCOMM_LM_AUTH : 0;
     lm |= mEncrypt ? RFCOMM_LM_ENCRYPT : 0;
-    lm |= (mAuth && mEncrypt) ? RFCOMM_LM_SECURE : 0;
     break;
   case BluetoothSocketType::L2CAP:
     lm |= mAuth ? L2CAP_LM_AUTH : 0;
     lm |= mEncrypt ? L2CAP_LM_ENCRYPT : 0;
-    lm |= (mAuth && mEncrypt) ? L2CAP_LM_SECURE : 0;
     break;
   }
 
   if (lm) {
     if (setsockopt(aFd, SOL_RFCOMM, RFCOMM_LM, &lm, sizeof(lm))) {
       NS_WARNING("setsockopt(RFCOMM_LM) failed, throwing");
       return false;
     }