Merge pull request #131 from jrosser/fixes

Small fixes for compiling on Ubuntu 12.04
This commit is contained in:
Peter Thorson
2012-08-04 07:44:12 -07:00
7 changed files with 22 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
BOOST_LIBS=boost_system boost_date_time boost_regex
BOOST_LIBS=boost_system boost_date_time boost_regex boost_thread
include ../common.mk

View File

@@ -2,6 +2,8 @@ BOOST_LIBS=boost_system boost_thread boost_regex boost_random
include ../common.mk
LDFLAGS := $(LDFLAGS) -lpthread
chat_client: chat_client.o chat_client_handler.o
$(CXX) $(CFLAGS) $^ -o $@ $(LDFLAGS)

View File

@@ -2,6 +2,8 @@ BOOST_LIBS=boost_system boost_date_time boost_thread boost_regex boost_random
include ../common.mk
LDFLAGS := $(LDFLAGS) -lpthread
fuzzing_client: fuzzing_client.o
$(CXX) $(CFLAGS) $^ -o $@ $(LDFLAGS)

View File

@@ -1,4 +1,4 @@
BOOST_LIBS=boost_system boost_date_time boost_regex
BOOST_LIBS=boost_system boost_date_time boost_regex boost_thread
include ../common.mk

View File

@@ -138,8 +138,8 @@ private:
m_msg_stats.clear();
}
int m_connections_max;
int m_connections_cur;
unsigned int m_connections_max;
unsigned int m_connections_cur;
std::map<std::string,size_t> m_msg_stats;
boost::shared_ptr<boost::asio::deadline_timer> m_timer;
};
@@ -150,14 +150,16 @@ int main(int argc, char* argv[]) {
int num_connections = 100;
int batch_size = 25;
int delay_ms = 16;
if (argc != 5) {
std::cout << "Usage: `echo_client test_url num_connections batch_size delay_ms`" << std::endl;
} else {
uri = argv[1];
num_connections = atoi(argv[2]);
batch_size = atoi(argv[3]);
delay_ms = atoi(argv[4]);
if (argc > 1) {
if (argc != 5) {
std::cout << "Usage: `echo_client test_url num_connections batch_size delay_ms`" << std::endl;
} else {
uri = argv[1];
num_connections = atoi(argv[2]);
batch_size = atoi(argv[3]);
delay_ms = atoi(argv[4]);
}
}
// 12288 is max OS X limit without changing kernal settings
@@ -209,7 +211,7 @@ int main(int argc, char* argv[]) {
connections.insert(endpoint.connect(uri));
boost::thread t(boost::bind(&plain_endpoint_type::run, &endpoint));
boost::thread t(boost::bind(&plain_endpoint_type::run, &endpoint, false));
std::cout << "launching " << num_connections << " connections to " << uri << " in batches of " << batch_size << std::endl;

View File

@@ -237,7 +237,7 @@ public:
boost::lock_guard<boost::recursive_mutex> lock(m_lock);
if (!new_handler) {
elog()->at(log::elevel::FATAL)
elog().at(log::elevel::FATAL)
<< "Tried to switch to a NULL handler." << log::endl;
throw websocketpp::exception("TODO: handlers can't be null");
}

View File

@@ -30,7 +30,9 @@
#ifndef BOOST_RNG_HPP
#define BOOST_RNG_HPP
#define __STDC_LIMIT_MACROS 1
#include <stdint.h>
#include <boost/random.hpp>
#include <boost/random/random_device.hpp>