Handle HTTP related CPE fault requests gracefully.

This commit is contained in:
Zaid Abdulla committed 2013-08-08 11:38:44 +03:00
1 parent 4c4b1d630b
commit 84d75c4696
3 files changed
+10 -2

No files matched your search

+5
View File
@@ -309,6 +309,11 @@ listener = (httpRequest, httpResponse) ->
) )
else if cwmpRequest.fault? else if cwmpRequest.fault?
taskId = cwmpRequest.id taskId = cwmpRequest.id
if not taskId
# Fault not related to a task. return empty response.
res = tr069.response(null, {}, {})
writeResponse(currentRequest, res)
return
db.getTask(taskId, (task) -> db.getTask(taskId, (task) ->
if not task if not task
+1 -1
View File
@@ -14,7 +14,7 @@ exports.PRESETS_CACHE_DURATION = 86400
exports.PRESETS_TIME_PADDING = 1 exports.PRESETS_TIME_PADDING = 1
exports.MONGODB_SOCKET = '/tmp/mongodb-27017.sock' exports.MONGODB_SOCKET = '/tmp/mongodb-27017.sock'
exports.MEMCACHED_SOCKET = '/tmp/memcached.sock' exports.MEMCACHED_SOCKET = '/tmp/memcached.sock'
exports.WORKER_RESPAWN_TIME = 3000 exports.WORKER_RESPAWN_TIME = 60000
exports.LOG_INFORMS = false exports.LOG_INFORMS = false
exports.DEBUG_DEVICES = {} # {'202BC1-BM632w-8KA8WA1151100043' : true} exports.DEBUG_DEVICES = {} # {'202BC1-BM632w-8KA8WA1151100043' : true}
exports.DEVICE_ONLINE_THRESHOLD = 4000 exports.DEVICE_ONLINE_THRESHOLD = 4000
+4 -1
View File
@@ -211,7 +211,10 @@ exports.request = (httpRequest) ->
# some devices send invalid utf8 characters # some devices send invalid utf8 characters
xml = libxmljs.parseXml httpRequest.getBody('binary') xml = libxmljs.parseXml httpRequest.getBody('binary')
cwmpRequest.id = xml.get('//soap-env:Envelope/soap-env:Header/cwmp:ID', NAMESPACES).text() try
cwmpRequest.id = xml.get('//soap-env:Envelope/soap-env:Header/cwmp:ID', NAMESPACES).text()
catch err
cwmpRequest.id = null
methodElement = xml.get('/soap-env:Envelope/soap-env:Body/cwmp:*', NAMESPACES) methodElement = xml.get('/soap-env:Envelope/soap-env:Body/cwmp:*', NAMESPACES)
if methodElement? if methodElement?