--- smsdaemon/util.cpp 2008/06/11 06:46:14 43 +++ smsdaemon/util.cpp 2008/06/11 10:21:47 49 @@ -7,7 +7,7 @@ #include #include #include - +#include #include #include "util.h" @@ -177,8 +177,10 @@ string document; ostringstream command; - command << "wget -O " << tempfile << " -o /dev/null \"" << url << "\""; - system( command.str().c_str() ); + command << "wget -O " << tempfile << " --tries=1 --timeout=15 -o /dev/null \"" << url << "\""; + int res = system( command.str().c_str() ); + if (res) + throw std::runtime_error("Command time out"); ifstream in( tempfile.c_str() );