CC-4638: Stream Settings -> Apache error when setting master source port to same port Airtime is running on

-fixed
This commit is contained in:
denise 2012-11-12 14:28:50 -05:00
parent 33b2520c14
commit a727f2bb1e
1 changed files with 7 additions and 4 deletions

View File

@ -150,13 +150,15 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
if ($master_harbor_input_port == $dj_harbor_input_port && $master_harbor_input_port != "") {
$element = $this->getElement("dj_harbor_input_port");
$element->addError("You cannot use same port as Master DJ port.");
$isValid = false;
}
if ($master_harbor_input_port != "") {
if (is_numeric($master_harbor_input_port)) {
if ($master_harbor_input_port != Application_Model_StreamSetting::getMasterLiveStreamPort()) {
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$res = socket_bind($sock, 0, $master_harbor_input_port);
if (!$res) {
try {
socket_bind($sock, 0, $master_harbor_input_port);
} catch (Exception $e) {
$element = $this->getElement("master_harbor_input_port");
$element->addError("Port '$master_harbor_input_port' is not available.");
$isValid = false;
@ -171,8 +173,9 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
if (is_numeric($dj_harbor_input_port)) {
if ($dj_harbor_input_port != Application_Model_StreamSetting::getDjLiveStreamPort()) {
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$res = socket_bind($sock, 0, $dj_harbor_input_port);
if (!$res) {
try {
socket_bind($sock, 0, $dj_harbor_input_port);
} catch (Exception $e) {
$element = $this->getElement("dj_harbor_input_port");
$element->addError("Port '$dj_harbor_input_port' is not available.");
$isValid = false;