Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6298 in orxonox.OLD for branches/network/src/lib


Ignore:
Timestamp:
Dec 26, 2005, 4:07:41 AM (19 years ago)
Author:
rennerc
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_protocol.cc

    r6273 r6298  
    6666  PRINTF(5)("create header length = %i, bufferLength = %i\n", length, bufferLength);
    6767  //If there isn't enough space for the header return -1
    68   if (length + this->headerLength > bufferLength)
     68  if (length + 2*INTSIZE > bufferLength)
    6969    return -1;
    7070
     
    7272  // FIXME: without move Create space for the header
    7373  for( int i = length - 1; i >= 0; i--)
    74     data[i + this->headerLength] = data[i];
     74    data[i + INTSIZE+INTSIZE] = data[i];
    7575
    7676  //Now create the header
     
    8181  /* data length*/
    8282  //data[1] = length;
    83   res = Converter::intToByteArray( length, data+res, bufferLength-res );
     83  res += Converter::intToByteArray( length, data+res, bufferLength-res );
    8484
    8585
    86   return length + this->headerLength;
     86  return length + res;
    8787}
    8888
Note: See TracChangeset for help on using the changeset viewer.