Move from protobuf-lite to protobuf to accommodate Ubuntu lucid

Add changelog entry
This commit is contained in:
Keith Winstein
2012-02-19 23:48:20 -05:00
parent 356ce40cea
commit 58b584a2b3
8 changed files with 13 additions and 39 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -Wextra -Weffc++ -fno-defau
noinst_PROGRAMS = encrypt decrypt ntester parse termemu
LIBS = $(protobuf_lite_LIBS)
LIBS = $(protobuf_LIBS)
encrypt_SOURCES = encrypt.cc
encrypt_CPPFLAGS = -I$(srcdir)/../crypto
+1 -1
View File
@@ -1,6 +1,6 @@
AM_CPPFLAGS = -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I$(srcdir)/../network -I$(srcdir)/../crypto -I$(builddir)/../protobufs -I$(srcdir)/../util
AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -Wextra -Weffc++ -fno-default-inline -pipe
LIBS = $(protobuf_lite_LIBS)
LIBS = $(protobuf_LIBS)
LDADD = ../crypto/libmoshcrypto.a ../network/libmoshnetwork.a ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../util/libmoshutil.a ../protobufs/libmoshprotos.a -lutil -lrt -lm -lutempter
bin_PROGRAMS = mosh-client mosh-server
+1 -31
View File
@@ -191,10 +191,7 @@ void Connection::send( string s )
ssize_t bytes_sent = sendto( sock, p.data(), p.size(), 0,
(sockaddr *)&remote_addr, sizeof( remote_addr ) );
if ( (bytes_sent < 0) && (errno == EMSGSIZE) ) {
update_MTU();
throw NetworkException( "Path MTU Discovery", EMSGSIZE );
} else if ( bytes_sent == static_cast<int>( p.size() ) ) {
if ( bytes_sent == static_cast<ssize_t>( p.size() ) ) {
return;
} else {
throw NetworkException( "sendto", errno );
@@ -349,30 +346,3 @@ public:
}
}
};
void Connection::update_MTU( void )
{
if ( !attached ) {
return;
}
/* We don't want to use our main socket because we don't want to have to connect it */
Socket path_MTU_socket( AF_INET, SOCK_DGRAM, 0 );
/* Connect socket so we can retrieve path MTU */
if ( connect( path_MTU_socket.fd, (sockaddr *)&remote_addr, sizeof( remote_addr ) ) < 0 ) {
throw NetworkException( "connect", errno );
}
int PMTU;
socklen_t optlen = sizeof( PMTU );
if ( getsockopt( path_MTU_socket.fd, IPPROTO_IP, IP_MTU, &PMTU, &optlen ) < 0 ) {
throw NetworkException( "getsockopt", errno );
}
if ( optlen != sizeof( PMTU ) ) {
throw NetworkException( "Error getting path MTU", errno );
}
MTU = min( PMTU, int(SEND_MTU) ); /* need cast to compile without optimization! XXX */
}
-2
View File
@@ -99,8 +99,6 @@ namespace Network {
Packet new_packet( string &s_payload );
void update_MTU( void );
public:
Connection( const char *desired_ip ); /* server */
Connection( const char *key_str, const char *ip, int port ); /* client */
+2 -2
View File
@@ -1,8 +1,8 @@
source = userinput.proto hostinput.proto transportinstruction.proto
PROTOC = protoc
AM_CPPFLAGS = $(protobuf_lite_CFLAGS)
AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -Wextra -fno-default-inline -pipe
AM_CPPFLAGS = $(protobuf_CFLAGS)
AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -fno-default-inline -pipe
SUFFIXES = .proto .pb.cc