--- smsdaemon/Spooler.cpp 2008/12/07 00:59:05 132 +++ smsdaemon/Spooler.cpp 2008/12/07 08:44:22 134 @@ -38,7 +38,7 @@ { bool error = false; lock(); - std::string file = getSpoolFilename(); + std::string file = findSpoolFilename(); std::ofstream out(file.c_str()); if (out) { out << recipient << "\n" << message; @@ -50,6 +50,7 @@ if (error) throw std::runtime_error("Could not create spoolfile"); + this->filename = file; } std::string Spooler::dequeue() @@ -86,13 +87,15 @@ unlock(); + this->filename = file; + if (file != "") return message; else throw filenotfoundexception(); } -std::string Spooler::getSpoolFilename() +std::string Spooler::findSpoolFilename() { std::string file; std::stringstream ss; @@ -144,3 +147,8 @@ { flock(fd, LOCK_UN); } + +string Spooler::getFilename() +{ + return filename; +}