From 7cfafdcd74505e3e303be14fc0f2d92d6a520d58 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Thu, 9 Mar 2017 20:50:39 -0800 Subject: [PATCH] Rename config FS_IP to FS_HOSTNAME --- lib/config.coffee | 5 ++++- lib/cwmp.coffee | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/config.coffee b/lib/config.coffee index d91c9bd..d6250bf 100644 --- a/lib/config.coffee +++ b/lib/config.coffee @@ -43,7 +43,7 @@ options = { FS_PORT : {type : 'int', default : 7567}, FS_INTERFACE : {type : 'string', default : '0.0.0.0'}, FS_SSL : {type : 'bool', default : false}, - FS_IP : {type : 'string', default : '192.168.0.1'}, + FS_HOSTNAME : {type : 'string', default : 'acs.example.com'}, FS_LOG_FILE : {type: 'path', default : ''}, FS_ACCESS_LOG_FILE : {type : 'path', default : ''}, @@ -98,6 +98,9 @@ setConfig = (name, value, commandLineArgument) -> if name in ['XML_PARSE_RECOVER', 'xml-parse-recover'] setConfig('XML_RECOVER', value) + if name in ['FS_IP', 'fs-ip'] + setConfig('FS_HOSTNAME', value) + cast = (val, type) -> switch type when 'int' diff --git a/lib/cwmp.coffee b/lib/cwmp.coffee index 9391eb3..5f54f2e 100644 --- a/lib/cwmp.coffee +++ b/lib/cwmp.coffee @@ -503,10 +503,10 @@ sendAcsRequest = (sessionContext, id, acsRequest) -> if acsRequest.name is 'Download' if not acsRequest.url? FS_PORT = config.get('FS_PORT') - FS_IP = config.get('FS_IP') + FS_HOSTNAME = config.get('FS_HOSTNAME') FS_SSL = config.get('FS_SSL') acsRequest.url = if FS_SSL then 'https://' else 'http://' - acsRequest.url += FS_IP + acsRequest.url += FS_HOSTNAME acsRequest.url += ":#{FS_PORT}" if FS_PORT != 80 acsRequest.url += "/#{encodeURIComponent(acsRequest.fileName)}"