Fix connection ID issue in Obex lib

ConnectionID should be consistent in one Obex session.
This commit is contained in:
Tao Liejun
2009-09-09 17:18:49 +08:00
committed by Nick Pelly
parent 82dbf67851
commit e80534ff59
2 changed files with 7 additions and 7 deletions

View File

@@ -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 {

View File

@@ -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);