mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-09 09:35:32 -04:00
Modifications to fix some networking/endian issues on PPC OSX.
* added sockaddr_clear() function to zero network addresses before use. * used this function in p3connmgr. * added htonll() and ntohll() functions to rsnet.h with compile-time ENDIAN checking * use htonll() and ntohll() in serialiser. * added net_test.cc to check network/endian/inet_addr issues. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@328 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
cea158b77d
commit
31136da7cc
10 changed files with 374 additions and 40 deletions
|
@ -123,8 +123,7 @@ bool getRawUInt64(void *data, uint32_t size, uint32_t *offset, uint64_t *out)
|
|||
uint64_t netorder_num;
|
||||
memcpy(&netorder_num, buf, sizeof(uint64_t));
|
||||
|
||||
//(*out) = ntohll(netorder_num);
|
||||
(*out) = netorder_num;
|
||||
(*out) = ntohll(netorder_num);
|
||||
(*offset) += 8;
|
||||
return true;
|
||||
}
|
||||
|
@ -140,8 +139,7 @@ bool setRawUInt64(void *data, uint32_t size, uint32_t *offset, uint64_t in)
|
|||
void *buf = (void *) &(((uint8_t *) data)[*offset]);
|
||||
|
||||
/* convert the data to the right format */
|
||||
//uint64_t netorder_num = htonll(in);
|
||||
uint64_t netorder_num = in;
|
||||
uint64_t netorder_num = htonll(in);
|
||||
|
||||
/* pack it in */
|
||||
memcpy(buf, &netorder_num, sizeof(uint64_t));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue