/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to server.py

  • Committer: Björn Påhlsson
  • Date: 2008-08-03 16:08:20 UTC
  • mto: (237.7.1 mandos) (24.1.154 mandos)
  • mto: This revision was merged to the branch mainline in revision 41.
  • Revision ID: belorn@braxen-20080803160820-0tw2n3ufebh51e3i
Added support for protocol version handling

Show diffs side-by-side

added added

removed removed

Lines of Context:
433
433
    def handle(self):
434
434
        logger.debug(u"TCP connection from: %s",
435
435
                     unicode(self.client_address))
 
436
 
 
437
        line = self.socket.makefile().readline()
 
438
        try:
 
439
            if int(line.strip().split()[0]) > 1:
 
440
                raise RuntimeError
 
441
        except (ValueError, IndexError, RuntimeError), error:
 
442
            logger.error(u"Unknown protocol version: %s", error)
 
443
            return
 
444
        
436
445
        session = gnutls.connection.ClientSession\
437
446
                  (self.request, gnutls.connection.X509Credentials())
438
447
        # Note: gnutls.connection.X509Credentials is really a generic