Rename 'attached' to 'has_remote_addr'

Even with future support for detaching and reattaching, this variable will keep
its original meaning.
This commit is contained in:
Keegan McAllister
2012-03-06 11:54:56 -08:00
parent d7f7e7c4ae
commit e35733a2c1
6 changed files with 16 additions and 16 deletions
+5 -5
View File
@@ -105,9 +105,9 @@ void Connection::setup( void )
Connection::Connection( const char *desired_ip ) /* server */
: sock( -1 ),
has_remote_addr( false ),
remote_addr(),
server( true ),
attached( false ),
MTU( SEND_MTU ),
key(),
session( key ),
@@ -150,9 +150,9 @@ Connection::Connection( const char *desired_ip ) /* server */
Connection::Connection( const char *key_str, const char *ip, int port ) /* client */
: sock( -1 ),
has_remote_addr( false ),
remote_addr(),
server( false ),
attached( false ),
MTU( SEND_MTU ),
key( key_str ),
session( key ),
@@ -177,12 +177,12 @@ Connection::Connection( const char *key_str, const char *ip, int port ) /* clien
throw NetworkException( buffer, saved_errno );
}
attached = true;
has_remote_addr = true;
}
void Connection::send( string s )
{
assert( attached );
assert( has_remote_addr );
Packet px = new_packet( s );
@@ -252,7 +252,7 @@ string Connection::recv( void )
}
/* auto-adjust to remote host */
attached = true;
has_remote_addr = true;
if ( (remote_addr.sin_addr.s_addr != packet_remote_addr.sin_addr.s_addr)
|| (remote_addr.sin_port != packet_remote_addr.sin_port) ) {
+2 -2
View File
@@ -75,10 +75,10 @@ namespace Network {
static const uint64_t MAX_RTO = 1000; /* ms */
int sock;
bool has_remote_addr;
struct sockaddr_in remote_addr;
bool server;
bool attached;
int MTU;
@@ -110,7 +110,7 @@ namespace Network {
int port( void ) const;
string get_key( void ) const { return key.printable_key(); }
bool get_attached( void ) const { return attached; }
bool get_has_remote_addr( void ) const { return has_remote_addr; }
uint64_t timeout( void ) const;
double get_SRTT( void ) const { return SRTT; }
+1 -1
View File
@@ -73,7 +73,7 @@ namespace Network {
bool shutdown_in_progress( void ) const { return sender.get_shutdown_in_progress(); }
bool shutdown_acknowledged( void ) const { return sender.get_shutdown_acknowledged(); }
bool shutdown_ack_timed_out( void ) const { return sender.shutdown_ack_timed_out(); }
bool attached( void ) const { return connection.get_attached(); }
bool has_remote_addr( void ) const { return connection.get_has_remote_addr(); }
/* Other side has requested shutdown and we have sent one ACK */
bool counterparty_shutdown_ack_sent( void ) const { return sender.get_counterparty_shutdown_acknowledged(); }
+2 -2
View File
@@ -111,7 +111,7 @@ int TransportSender<MyState>::wait_time( void )
uint64_t now = timestamp();
if ( !connection->get_attached() ) {
if ( !connection->get_has_remote_addr() ) {
return -1;
}
@@ -128,7 +128,7 @@ void TransportSender<MyState>::tick( void )
{
calculate_timers(); /* updates assumed receiver state and rationalizes */
if ( !connection->get_attached() ) {
if ( !connection->get_has_remote_addr() ) {
return;
}