Commit fb08d85e authored by Michael Weinrich's avatar Michael Weinrich
Browse files

Fixed message signals and header error checking.

parent c96f1d7e
......@@ -64,12 +64,17 @@ class UPnT(log.Loggable):
if not config.get('GUI', False):
louie.connect(self.showInfoMessage, 'UPnT.infoMessage', louie.Any, weak=False)
louie.connect(self.showErrorMessage, 'UPnT.errorMessage', louie.Any, weak=False)
louie.connect(self.eventMessage, 'UPnT.event.notify_incorrect', louie.Any, weak=False)
louie.connect(self.eventMessage, 'UPnT.event.subscription_incorrect', louie.Any, weak=False)
louie.connect(self.addDeferredToList, 'UPnT.running_deferred', louie.Any, weak=False)
louie.connect(self.removeDeferredFromList, 'UPnT.ending_deferred', louie.Any, weak=False)
self.info('signals connected, waiting for signals...')
#reactor.addSystemEventTrigger('before', 'shutdown', self.waitForShutdown)
def eventMessage(self, message, list):
self.showErrorMessage(message, ', '.join(list))
def datagramReceived(self, data, ip, port):
"""
Process the received SSDP datagram.
......
......@@ -86,7 +86,7 @@ class ServerEventMessageChecks(log.Loggable):
reactor.callLater(2, self.isHostAvailable)
else:
self._host = self._service.parentDevice.host.ip
louie.connect(self.checkEventMessage, 'UPnT.event.server_message_received', louie.Any, weak=False)
louie.connect(self.checkEventMessage, 'UPnP.Event.Server.message_received', louie.Any, weak=False)
global control_point, event_server
if not control_point:
if not self._service.parentDevice.host._coherence.ctrl:
......@@ -217,7 +217,7 @@ class ServerEventMessageChecks(log.Loggable):
'Notify: CONTENT-LENGTH header missing',
[header['host'], command['path']]
)
elif header['content-length'] != len(body):
elif int(header['content-length']) != len(body):
louie.send(
'UPnT.event.notify_incorrect',
None,
......@@ -300,7 +300,7 @@ class ServerEventMessageChecks(log.Loggable):
else:
service_ident = header['host'] + command['path']
self.calcNextEventSeq(service_ident, header['sid'])
if header['seq'] != self.notifySeq[service_ident][header['sid']]:
if int(header['seq']) != self.notifySeq[service_ident][header['sid']]:
louie.send(
'UPnT.event.notify_incorrect',
None,
......
......@@ -311,7 +311,7 @@ class Service(log.Loggable):
d.addErrback(self.validateDescriptionContentFailed, self._urlBase + self._SCPDURL)
if not self._config.get('GUI', False):
print 'Starting Control Testing'
self.debug('Starting Control Testing')
d.addCallback(self.startControlTesting, d)
d.addErrback(self.startControlTestingFailed, self._urlBase + self._SCPDURL, d)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment