Skip to content

Commit

Permalink
Disallow setting two vHosts as default
Browse files Browse the repository at this point in the history
  • Loading branch information
pp3345 committed Apr 30, 2014
1 parent 5fdf2e5 commit 4dd72ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions HTTP/PancakeHTTP.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,11 @@ static UByte PancakeHTTPHostsConfiguration(UByte step, config_setting_t *setting

static UByte PancakeHTTPDefaultConfiguration(UByte step, config_setting_t *setting, PancakeConfigurationScope **scope) {
if(step == PANCAKE_CONFIGURATION_INIT && setting->value.ival == 1) {
if(PancakeHTTPDefaultVirtualHost) {
PancakeLoggerFormat(PANCAKE_LOGGER_ERROR, 0, "Another virtual host has already been set as default");
return 0;
}

PancakeHTTPDefaultVirtualHost = (PancakeHTTPVirtualHost*) (*scope)->data;
}

Expand Down

0 comments on commit 4dd72ac

Please sign in to comment.