Browse Source

Merge commit 'cd9d6399fd00f5aeacaa90cdc0b74c3570024119'

* commit 'cd9d6399fd00f5aeacaa90cdc0b74c3570024119':
  tls: Support passing old-style tcp options

See: 4f4eb380f0
Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.5
Michael Niedermayer 11 years ago
parent
commit
d246397161
1 changed files with 12 additions and 4 deletions
  1. +12
    -4
      libavformat/tls.c

+ 12
- 4
libavformat/tls.c View File

@@ -168,22 +168,30 @@ static int tls_open(URLContext *h, const char *uri, int flags)
TLSContext *c = h->priv_data; TLSContext *c = h->priv_data;
int ret; int ret;
int port; int port;
const char *p;
char buf[200], host[200], opts[50] = ""; char buf[200], host[200], opts[50] = "";
int numerichost = 0; int numerichost = 0;
struct addrinfo hints = { 0 }, *ai = NULL; struct addrinfo hints = { 0 }, *ai = NULL;
const char *proxy_path; const char *proxy_path;
int use_proxy; int use_proxy;
const char *p = strchr(uri, '?');


ff_tls_init(); ff_tls_init();


if(p && av_find_info_tag(buf, sizeof(buf), "listen", p))
c->listen = 1;
if (c->listen) if (c->listen)
snprintf(opts, sizeof(opts), "?listen=1"); snprintf(opts, sizeof(opts), "?listen=1");


av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port, NULL, 0, uri); av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port, NULL, 0, uri);
ff_url_join(buf, sizeof(buf), "tcp", NULL, host, port, "%s", opts);

p = strchr(uri, '?');

if (!p) {
p = opts;
} else {
if (av_find_info_tag(opts, sizeof(opts), "listen", p))
c->listen = 1;
}

ff_url_join(buf, sizeof(buf), "tcp", NULL, host, port, "%s", p);


hints.ai_flags = AI_NUMERICHOST; hints.ai_flags = AI_NUMERICHOST;
if (!getaddrinfo(host, NULL, &hints, &ai)) { if (!getaddrinfo(host, NULL, &hints, &ai)) {


Loading…
Cancel
Save