- if ((in = open_mcast(url)) < 0) {
- fprintf(stderr,"Can't open url %s!\n",url);
+ if (!is_url(url)) {
+ char *service_url;
+ if ((service_url = get_url_from_sap(url))) {
+ printf("SAP says: '%s' -> %s\n", url, service_url);
+ url = service_url;
+ }
+ }
+
+ if (is_http(url)) {
+ if ((in = open_http(url)) < 0) {
+ fprintf(stderr,"Can't open url %s!\n",url);
+ exit(EXIT_FAILURE);
+ }
+ } else if (is_mcast(url)) {
+ if ((in = open_mcast(url)) < 0) {
+ fprintf(stderr,"Can't open url %s!\n",url);
+ exit(EXIT_FAILURE);
+ }
+ } else {
+ printf("URL '%s' not supported!\n", url);