quick hack to test SSL in bundles
authorRobin Gareus <robin@gareus.org>
Sun, 17 Jul 2016 15:03:48 +0000 (17:03 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 17 Jul 2016 15:03:48 +0000 (17:03 +0200)
this needs to be reverted, and we need a proper curl wrapper,
shared by video-timeline AND freesound moocher

gtk2_ardour/luainstance.cc
gtk2_ardour/utils_videotl.cc

index 5893c15fd942d7e31be0dfccc366d310a2bb698b..4d3ea5f777a0e0e50fb433b05f53e8b0ac7ed7dc 100644 (file)
@@ -39,6 +39,7 @@
 #include "time_axis_view.h"
 #include "selection.h"
 #include "script_selector.h"
 #include "time_axis_view.h"
 #include "selection.h"
 #include "script_selector.h"
+#include "utils_videotl.h"
 
 #include "pbd/i18n.h"
 
 
 #include "pbd/i18n.h"
 
@@ -345,6 +346,17 @@ const char *luasignalstr[] = {
 #undef ENGINE
 }; // namespace
 
 #undef ENGINE
 }; // namespace
 
+
+std::string lua_http_get (const char *u) {
+       char *rv = a3_curl_http_get (u, NULL);
+       if (!rv) {
+               return "";
+       }
+       std::string s (rv);
+       free (rv);
+       return s;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
 #define xstr(s) stringify(s)
 ////////////////////////////////////////////////////////////////////////////////
 
 #define xstr(s) stringify(s)
@@ -537,6 +549,8 @@ LuaInstance::register_classes (lua_State* L)
        luabridge::getGlobalNamespace (L)
                .beginNamespace ("ArdourUI")
 
        luabridge::getGlobalNamespace (L)
                .beginNamespace ("ArdourUI")
 
+               .addFunction ("curl_http_get", &lua_http_get)
+
                .beginStdList <ArdourMarker*> ("ArdourMarkerList")
                .endClass ()
 
                .beginStdList <ArdourMarker*> ("ArdourMarkerList")
                .endClass ()
 
index 2d859b692ad404ced8a40fd82680469c2e60b532..0a521a19357bbd2d1ec94450ba9a458e252900d4 100644 (file)
@@ -337,8 +337,7 @@ extern "C" {
                struct A3MemoryStruct chunk;
                long int httpstatus;
                if (status) *status = 0;
                struct A3MemoryStruct chunk;
                long int httpstatus;
                if (status) *status = 0;
-               //Glib::usleep(500000); return NULL; // TEST & DEBUG
-               if (strncmp("http://", u, 7)) return NULL;
+               if (strncmp("http://", u, 7) && strncmp("https://", u, 8)) return NULL;
 
                chunk.data=NULL;
                chunk.size=0;
 
                chunk.data=NULL;
                chunk.size=0;