Browse Source

rtmp-services: Fix ingest update request user agent

The user agent for the obsproject.com ingest update request would have
the version string baked in to the plugin, so if the plugin library
wasn't updated with the rest of the project, it would return the
incorrect version.  This makes sure it returns the correct version by
requesting the version string from libobs itself.
jp9000 8 years ago
parent
commit
3786a203c7
1 changed files with 7 additions and 1 deletions
  1. 7 1
      plugins/rtmp-services/rtmp-services-main.c

+ 7 - 1
plugins/rtmp-services/rtmp-services-main.c

@@ -44,11 +44,16 @@ bool obs_module_load(void)
 {
 {
 	char *local_dir = obs_module_file("");
 	char *local_dir = obs_module_file("");
 	char *cache_dir = obs_module_config_path("");
 	char *cache_dir = obs_module_config_path("");
+	struct dstr module_name = {0};
+
+	dstr_copy(&module_name, "rtmp-services plugin (libobs ");
+	dstr_cat(&module_name, obs_get_version_string());
+	dstr_cat(&module_name, ")");
 
 
 	if (cache_dir) {
 	if (cache_dir) {
 		update_info = update_info_create(
 		update_info = update_info_create(
 				RTMP_SERVICES_LOG_STR,
 				RTMP_SERVICES_LOG_STR,
-				RTMP_SERVICES_VER_STR,
+				module_name.array,
 				RTMP_SERVICES_URL,
 				RTMP_SERVICES_URL,
 				local_dir,
 				local_dir,
 				cache_dir,
 				cache_dir,
@@ -57,6 +62,7 @@ bool obs_module_load(void)
 
 
 	bfree(local_dir);
 	bfree(local_dir);
 	bfree(cache_dir);
 	bfree(cache_dir);
+	dstr_free(&module_name);
 
 
 	obs_register_service(&rtmp_common_service);
 	obs_register_service(&rtmp_common_service);
 	obs_register_service(&rtmp_custom_service);
 	obs_register_service(&rtmp_custom_service);