Skip to content
Snippets Groups Projects
  1. Mar 11, 2014
    • W. Trevor King's avatar
      irkerd: Pull request-parsing out into Irker._parse_request · 8468af97
      W. Trevor King authored
      There is a lot of error checking here, which is good, but it distracts
      from the core logic of Irker.handle.  By pulling the parsing out into
      a private helper function, we isolate the code focused on parsing and
      error checking from the code focused on dispatching and connection
      management, making both easier to read.
      
      I've also changed the Target-validation logic.  The old Target.valid
      returned True if the Target URL was valid, and False otherwise.  The
      new Target.validate returns None, and raises an InvalidRequest
      exception with an error message describing exactly why the URL is
      invalid.  We print these messages when dropping server URLs in
      Irker._parse_request, while the old Irker.handle code silently dropped
      invalid targets.  We also continue processing other server URLs after
      an invalid Target, while the old Irker.handle code bailed out after
      the first invalid Target.  Besides making the invalid URLs more
      obvious in the logs and increasing resiliency to invalid URLs, these
      changes allow us to pull the URL-to-Target conversion out of
      Irker.handle entirely, so it can focus more strongly on dispatch and
      connection management.
      8468af97
    • W. Trevor King's avatar
      irkerd: Add InvalidRequest and use it to flatten Irker.handle() · aae700b1
      W. Trevor King authored
      The old implementation had several instances of logic like this:
      
        if exception_condition:
            self.logerr("invalid request")
        else:
            # continue_processing
      
      This increases nesting after each round of exception checking, and
      makes the logic of the whole function harder to follow.  This commit
      replaces that logic with:
      
        try:
            if exception_condition:
                raise InvalidRequest("invalid request")
            # continue peocessing
        except InvalidRequest, e:
            self.logerr(str(e))
      
      Because the guts of the handle() function are already inside a
      try/except block, we can add our except clause to the existing block,
      and now exception checks don't increase nesting at all.
      
      The exception to this global try/except block is the 'URL has
      unexpected type' error, where we do want a local try/except block
      inside the channel loop.  That way we get both errors about invalid
      URLs and continue to attempt valid URLs.  This matches the existing
      logic for this check, but conflicts with the current target.valid
      check (which doesn't log an error and does stop processing of further
      channels).
      aae700b1
    • W. Trevor King's avatar
      irkerd: Store less state in IRCServerConnection.connect() · 9a53ff42
      W. Trevor King authored
      We will never need the connection-time port, server_address, username,
      ircname, or password again, so don't store them.  We *do* need server
      and real_server_name for Event handling, so keep them around.
      9a53ff42
  2. Feb 04, 2014
  3. Dec 25, 2013
  4. Dec 04, 2013
  5. Dec 03, 2013
  6. Dec 02, 2013
  7. Dec 01, 2013
    • Antoine Beaupré's avatar
      fix crash after introduction of immediate mode · fc36200e
      Antoine Beaupré authored
      this fixes the following backtrace:
      
      Exception happened during processing of request from ('127.0.0.1', 41192)
      Traceback (most recent call last):
        File /usr/lib/python2.7/SocketServer.py, line 295, in _handle_request_noblock
          self.process_request(request, client_address)
        File /usr/lib/python2.7/SocketServer.py, line 321, in process_request
          self.finish_request(request, client_address)
        File /usr/lib/python2.7/SocketServer.py, line 334, in finish_request
          self.RequestHandlerClass(request, client_address, self)
        File /usr/lib/python2.7/SocketServer.py, line 649, in __init__
          self.handle()
        File ./irkerd, line 820, in handle
          irker.handle(line.strip())
        File ./irkerd, line 786, in handle
          self.servers[target.server()].dispatch(target.channel, message, target.key, quit_after=quit_after)
        File ./irkerd, line 641, in dispatch
          eligibles[0].enqueue(channel, message, key)
      TypeError: enqueue() takes exactly 5 arguments (4 given)
      
      when running: ./irk irker-test test
      fc36200e
    • Eric S. Raymond's avatar
      Version bump for 2.3 release. · b2f0aa40
      Eric S. Raymond authored
      b2f0aa40
  8. Nov 30, 2013
  9. Nov 29, 2013
  10. Nov 27, 2013
  11. Nov 26, 2013
  12. Nov 16, 2013
  13. Oct 23, 2013
  14. Oct 21, 2013
  15. Oct 20, 2013
Loading