         query.doc = lastReceivedDoc
 
       docState[query.doc] or= queue: syncQueue (query, callback) ->
-                                                   # When the session is closed, we'll nuke docState. When that happens, no more messages
-                                                   # should be handled.
+        # When the session is closed, we'll nuke docState. When that happens, no more messages
+        # should be handled.
         return callback() unless docState
 
         # Close messages are {open:false}


    # Authentication process has failed, send error and stop session
    failAuthentication = (error) ->
      session.send {
        auth: null, 
        error: error
      }
      session.stop()

    # Wait for client to send an auth message, but don't wait forever

    # We don't process any messages from the agent until they've authorized. Instead,
    # they are stored in this buffer.
    buffer = []
    session.on 'message', bufferMsg = (msg) ->
      if typeof msg.auth != 'undefined'
        clearTimeout timeout
        data.authentication = msg.auth
