diff options
author | Tao Liejun <L.J.Tao@motorola.com> | 2009-09-09 17:18:49 +0800 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2009-09-15 09:54:20 -0700 |
commit | e80534ff59b2e62a0ddf4359147b81f5ba10de86 (patch) | |
tree | 385e5e522fa81e79cd34203d15e41f8307a8ceb1 /obex | |
parent | 82dbf6785184a9a0808210294365e32ff21add9c (diff) | |
download | frameworks_base-e80534ff59b2e62a0ddf4359147b81f5ba10de86.zip frameworks_base-e80534ff59b2e62a0ddf4359147b81f5ba10de86.tar.gz frameworks_base-e80534ff59b2e62a0ddf4359147b81f5ba10de86.tar.bz2 |
Fix connection ID issue in Obex lib
ConnectionID should be consistent in one Obex session.
Diffstat (limited to 'obex')
-rw-r--r-- | obex/javax/obex/ServerOperation.java | 6 | ||||
-rw-r--r-- | obex/javax/obex/ServerSession.java | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/obex/javax/obex/ServerOperation.java b/obex/javax/obex/ServerOperation.java index 8710c64..504fe35 100644 --- a/obex/javax/obex/ServerOperation.java +++ b/obex/javax/obex/ServerOperation.java @@ -169,10 +169,10 @@ public final class ServerOperation implements Operation, BaseStream { mHasBody = true; } - if (requestHeader.mConnectionID != null) { + if (mListener.getConnectionId() != -1 && requestHeader.mConnectionID != null) { mListener.setConnectionId(ObexHelper.convertToLong(requestHeader.mConnectionID)); } else { - mListener.setConnectionId(0); + mListener.setConnectionId(1); } if (requestHeader.mAuthResp != null) { @@ -438,7 +438,7 @@ public final class ServerOperation implements Operation, BaseStream { if (body != null) { mHasBody = true; } - if (requestHeader.mConnectionID != null) { + if (mListener.getConnectionId() != -1 && requestHeader.mConnectionID != null) { mListener.setConnectionId(ObexHelper .convertToLong(requestHeader.mConnectionID)); } else { diff --git a/obex/javax/obex/ServerSession.java b/obex/javax/obex/ServerSession.java index 675272d..aca90bb 100644 --- a/obex/javax/obex/ServerSession.java +++ b/obex/javax/obex/ServerSession.java @@ -283,10 +283,10 @@ public final class ServerSession extends ObexSession implements Runnable { ObexHelper.updateHeaderSet(request, headers); - if (request.mConnectionID != null) { + if (mListener.getConnectionId() != -1 && request.mConnectionID != null) { mListener.setConnectionId(ObexHelper.convertToLong(request.mConnectionID)); } else { - mListener.setConnectionId(-1); + mListener.setConnectionId(1); } // the Auth chan is initiated by the server, client sent back the authResp . if (request.mAuthResp != null) { @@ -405,7 +405,7 @@ public final class ServerSession extends ObexSession implements Runnable { ObexHelper.updateHeaderSet(request, headers); } - if (request.mConnectionID != null) { + if (mListener.getConnectionId() != -1 && request.mConnectionID != null) { mListener.setConnectionId(ObexHelper.convertToLong(request.mConnectionID)); } else { mListener.setConnectionId(1); @@ -527,7 +527,7 @@ public final class ServerSession extends ObexSession implements Runnable { ObexHelper.updateHeaderSet(request, headers); } - if (request.mConnectionID != null) { + if (mListener.getConnectionId() != -1 && request.mConnectionID != null) { mListener.setConnectionId(ObexHelper.convertToLong(request.mConnectionID)); } else { mListener.setConnectionId(1); |