From 8d513db40571cb651344e3ce8dc0b04e0409d368 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Fri, 27 Mar 2015 11:15:22 +0000 Subject: [PATCH] Added operation mode (omode) "strict". This adds the operation mode "strict". It does not yet have any specific features and alias the "normal" mode. This change is mostly to make the setting of "strict" valid so it can be used already. --- src/cfgfile.c | 2 ++ src/cfgfile.h | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/cfgfile.c b/src/cfgfile.c index 8d3139bb..e4b1db16 100644 --- a/src/cfgfile.c +++ b/src/cfgfile.c @@ -156,6 +156,8 @@ operation_mode config_str_to_omode(const char *str) return OMODE_NORMAL; } else if (strcasecmp(str, "legacy-compat") == 0 || strcasecmp(str, "legacy") == 0) { return OMODE_LEGACY; + } else if (strcasecmp(str, "strict") == 0) { + return OMODE_STRICT; } else { ICECAST_LOG_ERROR("Unknown operation mode \"%s\", falling back to DEFAULT.", str); return OMODE_DEFAULT; diff --git a/src/cfgfile.h b/src/cfgfile.h index 3fa3336e..93d6e9ff 100644 --- a/src/cfgfile.h +++ b/src/cfgfile.h @@ -33,9 +33,24 @@ struct _mount_proxy; #define XMLSTR(str) ((xmlChar *)(str)) typedef enum _operation_mode { + /* Default operation mode. may depend on context */ OMODE_DEFAULT = 0, + /* The normal mode. */ OMODE_NORMAL, - OMODE_LEGACY + /* Mimic some of the behavior of older versions. + * This mode should only be used in transition to normal mode, + * e.g. to give some clients time to upgrade to new API. + */ + OMODE_LEGACY, + /* The struct mode includes some behavior for future versions + * that can for some reason not yet be used in the normal mode + * e.g. because it may break interfaces in some way. + * New applications should test against this mode and developer + * of software interacting with Icecast on an API level should + * have a look for strict mode behavior to avoid random breakage + * with newer versions of Icecast. + */ + OMODE_STRICT } operation_mode; typedef enum _http_header_type {