~ubuntu-dev/ubuntu/lucid/coherence/lucid-201002101853

« back to all changes in this revision

Viewing changes to coherence/upnp/core/event.py

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Quette
  • Date: 2008-03-05 13:43:01 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080305134301-pg572ehbze3h7cii
Tags: 0.5.2-1
* New upstream release
* debian/control: depend on python-pkg-resources instead of
  python-setuptools for the runtime dependency (Closes: #468724)

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
            self.debug("data:", data)
51
51
            headers = request.getAllHeaders()
52
52
            sid = headers['sid']
53
 
            tree = utils.parse_xml(data).getroot()
 
53
            try:
 
54
                tree = utils.parse_xml(data).getroot()
 
55
            except SyntaxError:
 
56
                self.warning("malformed notify from %r", request.client)
 
57
                return ""
 
58
 
54
59
            ns = "urn:schemas-upnp-org:event-1-0"
55
60
            event = Event(sid)
56
61
            for prop in tree.findall('{%s}property' % ns):
322
327
    def dataReceived(self, data):
323
328
        cmd, headers = utils.parse_http_response(data)
324
329
        self.debug( "notification response received %r %r", cmd, headers)
325
 
        if int(cmd[1]) != 200:
326
 
            self.warning("response with error code %r received upon our notification", cmd[1])
 
330
        try:
 
331
            if int(cmd[1]) != 200:
 
332
                self.warning("response with error code %r received upon our notification", cmd[1])
 
333
        except:
 
334
            self.debug("response without error code received upon our notification")
327
335
        self.transport.loseConnection()
328
336
 
329
337
    def connectionLost( self, reason):