mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 20:49:27 +00:00
Bug 1173334: Open nfcd connections with socket type SOCK_SEQPACKET, allstars.chh
NFC requires sequential transfer of individual messages. Using the socket type SOCK_SEQPACKET guarantees these properties.
This commit is contained in:
parent
0ea3d9527b
commit
c9da785375
@ -453,7 +453,7 @@ NfcService::OnConnectSuccess(int aIndex)
|
||||
|
||||
switch (aIndex) {
|
||||
case LISTEN_SOCKET: {
|
||||
nsCString value("nfcd:-a ");
|
||||
nsCString value("nfcd:-S -a ");
|
||||
value.Append(mListenSocketName);
|
||||
if (NS_WARN_IF(property_set("ctl.start", value.get()) < 0)) {
|
||||
OnConnectError(STREAM_SOCKET);
|
||||
|
@ -23,7 +23,7 @@ NfcConnector::~NfcConnector()
|
||||
nsresult
|
||||
NfcConnector::CreateSocket(int& aFd) const
|
||||
{
|
||||
aFd = socket(AF_LOCAL, SOCK_STREAM, 0);
|
||||
aFd = socket(AF_LOCAL, SOCK_SEQPACKET, 0);
|
||||
if (aFd < 0) {
|
||||
NS_WARNING("Could not open NFC socket!");
|
||||
return NS_ERROR_FAILURE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user