Merge "Bluetooth OBEX timeout problem."

This commit is contained in:
Jean-Baptiste Queru
2010-11-01 10:46:36 -07:00
committed by Android Code Review

View File

@ -397,11 +397,13 @@ public final class ServerOperation implements Operation, BaseStream {
&& (headerID != ObexHelper.OBEX_OPCODE_GET_FINAL)) {
if (length > 3) {
byte[] temp = new byte[length];
byte[] temp = new byte[length - 3];
// First three bytes already read, compensating for this
bytesReceived = mInput.read(temp);
while (bytesReceived != length) {
bytesReceived += mInput.read(temp, bytesReceived, length - bytesReceived);
while (bytesReceived != temp.length) {
bytesReceived += mInput.read(temp, bytesReceived,
temp.length - bytesReceived);
}
}