mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
shave 16 bytes off sizeof(tr_peerIo)
This commit is contained in:
+24
-28
@@ -41,37 +41,33 @@
|
|||||||
***
|
***
|
||||||
**/
|
**/
|
||||||
|
|
||||||
struct tr_extensions
|
|
||||||
{
|
|
||||||
unsigned int extendedProtocolSupported : 1;
|
|
||||||
unsigned int fastPeersSupported : 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct tr_peerIo
|
struct tr_peerIo
|
||||||
{
|
{
|
||||||
struct tr_handle * handle;
|
unsigned int isEncrypted : 1;
|
||||||
|
unsigned int isIncoming : 1;
|
||||||
|
unsigned int peerIdIsSet : 1;
|
||||||
|
unsigned int extendedProtocolSupported : 1;
|
||||||
|
unsigned int fastPeersSupported : 1;
|
||||||
|
|
||||||
struct in_addr in_addr;
|
uint8_t encryptionMode;
|
||||||
int port;
|
uint8_t timeout;
|
||||||
int socket;
|
uint16_t port;
|
||||||
int encryptionMode;
|
int socket;
|
||||||
int timeout;
|
|
||||||
struct bufferevent * bufev;
|
|
||||||
uint8_t peerId[20];
|
|
||||||
time_t timeCreated;
|
|
||||||
|
|
||||||
tr_extensions extensions;
|
uint8_t peerId[20];
|
||||||
|
time_t timeCreated;
|
||||||
|
|
||||||
unsigned int isEncrypted : 1;
|
struct tr_handle * handle;
|
||||||
unsigned int isIncoming : 1;
|
|
||||||
unsigned int peerIdIsSet : 1;
|
|
||||||
|
|
||||||
tr_can_read_cb canRead;
|
struct in_addr in_addr;
|
||||||
tr_did_write_cb didWrite;
|
struct bufferevent * bufev;
|
||||||
tr_net_error_cb gotError;
|
|
||||||
void * userData;
|
|
||||||
|
|
||||||
tr_crypto * crypto;
|
tr_can_read_cb canRead;
|
||||||
|
tr_did_write_cb didWrite;
|
||||||
|
tr_net_error_cb gotError;
|
||||||
|
void * userData;
|
||||||
|
|
||||||
|
tr_crypto * crypto;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -388,7 +384,7 @@ tr_peerIoEnableLTEP( tr_peerIo * io, int flag )
|
|||||||
assert( io != NULL );
|
assert( io != NULL );
|
||||||
assert( flag==0 || flag==1 );
|
assert( flag==0 || flag==1 );
|
||||||
|
|
||||||
io->extensions.extendedProtocolSupported = flag;
|
io->extendedProtocolSupported = flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -397,7 +393,7 @@ tr_peerIoEnableFEXT( tr_peerIo * io, int flag )
|
|||||||
assert( io != NULL );
|
assert( io != NULL );
|
||||||
assert( flag==0 || flag==1 );
|
assert( flag==0 || flag==1 );
|
||||||
|
|
||||||
io->extensions.fastPeersSupported = flag;
|
io->fastPeersSupported = flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -405,7 +401,7 @@ tr_peerIoSupportsLTEP( const tr_peerIo * io )
|
|||||||
{
|
{
|
||||||
assert( io != NULL );
|
assert( io != NULL );
|
||||||
|
|
||||||
return io->extensions.extendedProtocolSupported;
|
return io->extendedProtocolSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -413,7 +409,7 @@ tr_peerIoSupportsFEXT( const tr_peerIo * io )
|
|||||||
{
|
{
|
||||||
assert( io != NULL );
|
assert( io != NULL );
|
||||||
|
|
||||||
return io->extensions.fastPeersSupported;
|
return io->fastPeersSupported;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
***
|
***
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ struct bufferevent;
|
|||||||
struct tr_handle;
|
struct tr_handle;
|
||||||
struct tr_crypto;
|
struct tr_crypto;
|
||||||
typedef struct tr_peerIo tr_peerIo;
|
typedef struct tr_peerIo tr_peerIo;
|
||||||
typedef struct tr_extensions tr_extensions;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
***
|
***
|
||||||
|
|||||||
Reference in New Issue
Block a user