v1.1.1 : Fixed functional tests & Multiple bugfixes

This commit is contained in:
Brendan LE GLAUNEC
2016-11-12 12:55:32 +01:00
parent f80af6bd58
commit 553524ae43
34 changed files with 663 additions and 356 deletions
+2 -2
View File
@@ -92,12 +92,12 @@ bool
configuration::load_url() {
std::string content;
LOG_DEBUG_("Trying to open ids file from " + this->rtsp_ids_file, "configuration");
LOG_DEBUG_("Trying to open url file from " + this->rtsp_url_file, "configuration");
if (this->rtsp_url_file.size()) {
content = read_file(this->rtsp_url_file.c_str()).second;
} else {
LOG_WARN_(
"No ids file detected in your configuration, Cameradar will use "
"No url file detected in your configuration, Cameradar will use "
"the default one "
"instead.",
"configuration");
+3 -3
View File
@@ -25,8 +25,8 @@ size_t
write_data(void* buffer, size_t size, size_t nmemb, void* userp) {
// I'm sorry for this
// Forget you ever saw it
(void)buffer;
(void)userp;
if (not buffer || not size || not nmemb) return 0;
return size * nmemb;
}
@@ -88,7 +88,7 @@ curl_describe(const std::string& path, bool logs) {
m.lock();
curl_global_cleanup();
m.unlock();
LOG_DEBUG_("Response code : " + std::to_string(rc), "describe");
LOG_DEBUG_("[" + path + "] Response code : " + std::to_string(rc), "describe");
if (logs) {
// Some cameras return 400 instead of 401, don't know why.
// Some cameras timeout and then curl considers the status as 0
+12 -5
View File
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include <rtsp_path.h>
#include <logger.h>
#include <rtsp_path.h>
namespace etix {
@@ -21,10 +21,17 @@ namespace cameradar {
const std::string
make_path(const stream_model& model) {
std::string ret(model.service_name + "://" + model.username + ":" + model.password + "@" +
model.address + ":" + std::to_string(model.port) + model.route);
LOG_DEBUG_(ret, "debug");
return ret;
if (model.password != "" || model.username != "") {
std::string ret(model.service_name + "://" + model.username + ":" + model.password + "@" +
model.address + ":" + std::to_string(model.port) + model.route);
LOG_DEBUG_(ret, "debug");
return ret;
} else {
std::string ret(model.service_name + "://" + model.address + ":" +
std::to_string(model.port) + model.route);
LOG_DEBUG_(ret, "debug");
return ret;
}
}
}
}