prop_sbuf[0] = '*';
prop_sbuf[1] = '\0';
} else {
- memset(&u, 0, sizeof(u));
+ urlinit(&u);
urlparse(s, &u);
if (u.scheme && (!strcmp(u.scheme, "http") || !strcmp(u.scheme, "https")) && u.host) {
if (u.port)
hc->hc_scheme, hc->hc_host, hc->hc_port, location);
}
- memset(&u, 0, sizeof(u));
+ urlinit(&u);
if (urlparse(location2 ? location2 : location, &u)) {
tvherror("httpc", "%04X: redirection - cannot parse url '%s'",
shortid(hc), location2 ? location2 : location);
tvhlog(LOG_NOTICE, "httpc", "Test: unable to open '%s': %s", path, strerror(errno));
return;
}
- memset(&u1, 0, sizeof(u1));
- memset(&u2, 0, sizeof(u2));
+ urlinit(&u1);
+ urlinit(&u2);
http_arg_init(&args);
efd = tvhpoll_create(1);
while (fgets(line, sizeof(line), fp) != NULL && tvheadend_running) {
if (img->url == NULL || img->url[0] == '\0')
return res;
- memset(&url, 0, sizeof(url));
+ urlinit(&url);
/* Open file */
if (hts_settings_buildpath(path, sizeof(path), "imagecache/data/%d",
/* Parse URL */
mpegts_mux_nice_name((mpegts_mux_t*)im, buf, sizeof(buf));
- memset(&url, 0, sizeof(url));
+ urlinit(&url);
if (raw && !strncmp(raw, "pipe://", 7)) {
chnum += (int64_t)*total * CHANNEL_SPLIT;
}
- memset(&u, 0, sizeof(u));
+ urlinit(&u);
if (urlparse(url, &u))
return;
if (u.host == NULL || u.host[0] == '\0')
return 0;
}
- memset(&u, 0, sizeof(u));
+ urlinit(&u);
if (!urlparse(in->in_url, &u)) {
last_url = strrchr(u.path, '/');
if (last_url)
http_client_t *hc;
url_t u;
- memset(&u, 0, sizeof(u));
+ urlinit(&u);
if (in->in_url == NULL)
goto done;
tvherror("iptv", "m3u contents parsing failed");
return 0;
}
- memset(&u, 0, sizeof(u));
+ urlinit(&u);
if (!urlparse(url, &u)) {
hc->hc_keepalive = 0;
r = http_client_simple_reconnect(hc, &u);
iptv_url_set0(url, sane_url, str, str);
return 1;
}
- memset(&u, 0, sizeof(u));
+ urlinit(&u);
if (!urlparse(str, &u)) {
len = (u.scheme ? strlen(u.scheme) + 3 : 0) +
(u.host ? strlen(u.host) + 1 : 0) +
if (satip_device_find_by_descurl(descurl))
return;
d = calloc(1, sizeof(satip_discovery_t));
+ urlinit(&d->url);
if (urlparse(descurl, &d->url)) {
satip_discovery_destroy(d, 0);
return;
#define __TVH_URL_H__
#include <stdint.h>
+#include <string.h>
/* URL structure */
typedef struct url
char *raw;
} url_t;
+static inline void urlinit ( url_t *url ) { memset(url, 0, sizeof(*url)); }
void urlreset ( url_t *url );
int urlparse ( const char *str, url_t *url );
void urlparse_done ( void );