aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-26 11:27:25 -0800
committerJosh Blum <josh@joshknows.com>2011-01-26 11:27:25 -0800
commitdb1fd30da6def1269eae62b5ccd3c81c28ae000f (patch)
treebfb277c09bbf8f9675710316c927f552875eed36
parentbf25ec24adc6e4d1aa563962452630628dad3215 (diff)
downloaduhd-db1fd30da6def1269eae62b5ccd3c81c28ae000f.tar.gz
uhd-db1fd30da6def1269eae62b5ccd3c81c28ae000f.tar.bz2
uhd-db1fd30da6def1269eae62b5ccd3c81c28ae000f.zip
uhd: fixed maxosx bug, was resizing the transport buffer
but it cant be resized on macos and I messed up the code that blocked that behavior reimplemented block in usrp2_impl, seems more correct here
-rw-r--r--host/lib/transport/udp_zero_copy_asio.cpp4
-rw-r--r--host/lib/usrp/subdev_spec.cpp2
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp7
-rw-r--r--host/lib/utils/paths.cpp1
4 files changed, 7 insertions, 7 deletions
diff --git a/host/lib/transport/udp_zero_copy_asio.cpp b/host/lib/transport/udp_zero_copy_asio.cpp
index 5c049cfad..3826dcd79 100644
--- a/host/lib/transport/udp_zero_copy_asio.cpp
+++ b/host/lib/transport/udp_zero_copy_asio.cpp
@@ -353,14 +353,10 @@ template<typename Opt> static void resize_buff_helper(
"See the transport application notes on buffer resizing.\n%s"
) % name % min_sock_buff_size % help_message));
}
-
- //only enable on platforms that are happy with the large buffer resize
- #if defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)
//otherwise, ensure that the buffer is at least the minimum size
else if (udp_trans->get_buff_size<Opt>() < min_sock_buff_size){
resize_buff_helper<Opt>(udp_trans, min_sock_buff_size, name);
}
- #endif /*defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)*/
}
udp_zero_copy::sptr udp_zero_copy::make(
diff --git a/host/lib/usrp/subdev_spec.cpp b/host/lib/usrp/subdev_spec.cpp
index 51c88bda3..d5d950f1f 100644
--- a/host/lib/usrp/subdev_spec.cpp
+++ b/host/lib/usrp/subdev_spec.cpp
@@ -46,7 +46,7 @@ bool usrp::operator==(const subdev_spec_pair_t &lhs, const subdev_spec_pair_t &r
subdev_spec_t::subdev_spec_t(const std::string &markup){
BOOST_FOREACH(const std::string &pair, pair_tokenizer(markup)){
- if (pair == "") continue;
+ if (pair.empty()) continue;
std::vector<std::string> db_sd; boost::split(db_sd, pair, boost::is_any_of(":"));
switch(db_sd.size()){
case 1: this->push_back(subdev_spec_pair_t("", db_sd.front())); break;
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 059ddf65f..9ce0f7359 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -202,8 +202,11 @@ static device::sptr usrp2_make(const device_addr_t &device_addr){
//setup the dsp transport hints (default to a large recv buff)
device_addr_t dsp_xport_hints = device_addr;
if (not dsp_xport_hints.has_key("recv_buff_size")){
- //set to half-a-second of buffering at max rate
- dsp_xport_hints["recv_buff_size"] = "50e6";
+ //only enable on platforms that are happy with the large buffer resize
+ #if defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)
+ //set to half-a-second of buffering at max rate
+ dsp_xport_hints["recv_buff_size"] = "50e6";
+ #endif /*defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)*/
}
//create a ctrl and data transport for each address
diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp
index 93d15d290..8d604d849 100644
--- a/host/lib/utils/paths.cpp
+++ b/host/lib/utils/paths.cpp
@@ -64,6 +64,7 @@ static std::vector<fs::path> get_env_paths(const std::string &var_name){
//convert to filesystem path, filter blank paths
std::vector<fs::path> paths;
+ if (var_value.empty()) return paths; //FIXME boost tokenizer throws w/ blank strings on some platforms
BOOST_FOREACH(const std::string &path_string, path_tokenizer(var_value)){
if (path_string.empty()) continue;
paths.push_back(fs::system_complete(path_string));