[vlc-commits] https: automatically enable if missing features are not used
Rémi Denis-Courmont
git at videolan.org
Wed Dec 16 23:31:55 CET 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Dec 17 00:27:09 2015 +0200| [aa780d5820a4ef40b2c243bc3ab5781638c6e8a6] | committer: Rémi Denis-Courmont
https: automatically enable if missing features are not used
As of now, the new module works if:
- proxy is not used,
- cookies are disabled,
- HTTP "continuous" streaming mode is not enabled,
- authentication is not required.
In practice, it remains disabled by default because HTTP cookies are
enabled. --no-http-forward-cookies is needed.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa780d5820a4ef40b2c243bc3ab5781638c6e8a6
---
modules/access/http/access.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/modules/access/http/access.c b/modules/access/http/access.c
index 77fb3fc..c7d19a3 100644
--- a/modules/access/http/access.c
+++ b/modules/access/http/access.c
@@ -28,6 +28,7 @@
#include <vlc_common.h>
#include <vlc_access.h>
#include <vlc_plugin.h>
+#include <vlc_network.h> /* FIXME: only for vlc_getProxyUrl() */
#include "connmgr.h"
#include "file.h"
@@ -109,6 +110,17 @@ static int Control(access_t *access, int query, va_list args)
static int Open(vlc_object_t *obj)
{
access_t *access = (access_t *)obj;
+
+ if (var_InheritBool(obj, "http-continuous"))
+ return VLC_EGENERIC; /* FIXME not implemented yet */
+ if (var_InheritBool(obj, "http-forward-cookies"))
+ return VLC_EGENERIC; /* FIXME not implemented yet */
+
+ char *proxy = vlc_getProxyUrl(access->psz_url);
+ free(proxy);
+ if (proxy != NULL)
+ return VLC_EGENERIC; /* FIXME not implemented yet */
+
access_sys_t *sys = malloc(sizeof (*sys));
int ret = VLC_ENOMEM;
@@ -147,6 +159,8 @@ static int Open(vlc_object_t *obj)
msg_Err(access, "HTTP connection failure");
goto error;
}
+ if (status == 401) /* authentication */
+ goto error; /* FIXME not implemented yet */
if (status >= 300)
{
msg_Err(access, "HTTP %d error", status);
@@ -185,7 +199,11 @@ vlc_module_begin()
set_shortname(N_("HTTPS"))
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_ACCESS)
- set_capability("access", 0)
+ set_capability("access", 2)
add_shortcut("https")
set_callbacks(Open, Close)
+
+ // TODO: force HTTP/2 over TCP
+ //add_bool("http2", false, N_("HTTP 2.0"),
+ // N_("Negotiate HTTP version 2.0"), true)
vlc_module_end()
More information about the vlc-commits
mailing list