summaryrefslogtreecommitdiff
path: root/src/phFriNfc_LlcpTransport_Connection.c
diff options
context:
space:
mode:
authorSylvain Fonteneau <sylvain.fonteneau@trusted-logic.com>2010-12-01 09:22:11 +0100
committerNick Pelly <npelly@google.com>2010-12-07 09:23:33 -0800
commit8a4742c9dfa8010c06e5c746ab739ed71ba327bd (patch)
tree05cffd8d866d486078845fe02ef5a5b5d9624114 /src/phFriNfc_LlcpTransport_Connection.c
parent3d254b6b7034191c1134c4aa0ea66e3749a3af69 (diff)
downloadlibnfc-nxp-8a4742c9dfa8010c06e5c746ab739ed71ba327bd.tar.gz
Fix to prevent any action on a LLCP socket while disconnecting.
Mark a socket as disconnecting as soon as the disconnect request is received instead of waiting for the DISC packet to be sent. Change-Id: I95330b7039c6fa741adc69ab1323852a60b7d49e
Diffstat (limited to 'src/phFriNfc_LlcpTransport_Connection.c')
-rw-r--r--src/phFriNfc_LlcpTransport_Connection.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/phFriNfc_LlcpTransport_Connection.c b/src/phFriNfc_LlcpTransport_Connection.c
index 3f3c37a..c4d2b96 100644
--- a/src/phFriNfc_LlcpTransport_Connection.c
+++ b/src/phFriNfc_LlcpTransport_Connection.c
@@ -2369,6 +2369,9 @@ NFCSTATUS phLibNfc_LlcpTransport_ConnectionOriented_Disconnect(phFriNfc_LlcpTran
pLlcpSocket->pfSocketDisconnect_Cb = pDisconnect_RspCb;
pLlcpSocket->pDisonnectContext = pContext;
+ /* Set the socket in connecting state */
+ pLlcpSocket->eSocket_State = phFriNfc_LlcpTransportSocket_eSocketDisconnecting;
+
/* Test if a send IFRAME is pending with this socket */
if((pLlcpSocket->bSocketSendPending == TRUE) || (pLlcpSocket->bSocketRecvPending == TRUE))
{
@@ -2420,9 +2423,6 @@ NFCSTATUS phLibNfc_LlcpTransport_ConnectionOriented_Disconnect(phFriNfc_LlcpTran
/* Store the index of the socket */
pLlcpSocket->psTransport->socketIndex = pLlcpSocket->index;
- /* Set the socket in connecting state */
- pLlcpSocket->eSocket_State = phFriNfc_LlcpTransportSocket_eSocketDisconnecting;
-
status = phFriNfc_Llcp_Send(pLlcpSocket->psTransport->pLlcp,
&pLlcpSocket->sLlcpHeader,
NULL,