Changeset 6298 in orxonox.OLD for branches/network
- Timestamp:
- Dec 26, 2005, 4:07:41 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_protocol.cc
r6273 r6298 66 66 PRINTF(5)("create header length = %i, bufferLength = %i\n", length, bufferLength); 67 67 //If there isn't enough space for the header return -1 68 if (length + this->headerLength> bufferLength)68 if (length + 2*INTSIZE > bufferLength) 69 69 return -1; 70 70 … … 72 72 // FIXME: without move Create space for the header 73 73 for( int i = length - 1; i >= 0; i--) 74 data[i + this->headerLength] = data[i];74 data[i + INTSIZE+INTSIZE] = data[i]; 75 75 76 76 //Now create the header … … 81 81 /* data length*/ 82 82 //data[1] = length; 83 res = Converter::intToByteArray( length, data+res, bufferLength-res );83 res += Converter::intToByteArray( length, data+res, bufferLength-res ); 84 84 85 85 86 return length + this->headerLength;86 return length + res; 87 87 } 88 88
Note: See TracChangeset
for help on using the changeset viewer.