RIP eventrace

Client makes a whois query


Use Case:

  1. Client connects to the server (sv) whois port.
  2. Server starts a thread (th) to serve the client using a "whois protocol" (pw).
  3. Thread waits for a whois query.
  4. Client issues a whois query.
  5. Thread sends a banner to the client.
  6. Client receives the banner.
  7. Thread converts the whois query into a "query command" (qc).
  8. The qc is made up of a list of keytypes. These are obtained by performing a series of tests on the keys received in the whois query, by "which_keytypes" (wq).
  9. A set of "query instructions" (qi) are created from the qc.
  10. The set of instructions in qi are executed.
  11. A connections is made to the database.
  12. For instructions that require the "radix tree" (rx), a query is made directly to that.
  13. The other queries go to the database.
  14. Results are returned one row at a time.
  15. A string is extracted from the row, one column at a time.
  16. The results are sent back to the client.
  17. The client receives the results.
  18. The results are freed from memory.
  19. The connection to the database is closed.
  20. The connection to the client is closed.
  21. The client is disconnected.


Event Trace:

        +--------+                   +------+        +------+        +------+        +------+        +------+        +------+        +------+        +------+
        | client |             tcp   |  sk  |        |  th  |        |  pw  |        |  qc  |        |  wk  |        |  qi  |        |  sq  |        |  rx  |
        +---+----+              :    +---+--+        +---+--+        +---+--+        +---+--+        +---+--+        +---+--+        +---+--+        +---+--+
    
  1. | connect : | | | | | | | |
  2. $-------------------:-------}| | PW_interact() | | | | | | $ : | $--------------}| | | | | | $ : | | $ | | | | |
  3. $ : | | SK_gets() $ | | | | | $ : |{------------------------------$ | | | | | $ : $ | | | | | | | / : / | | | | | | | $ : $ | | | | | | |
  4. $ whois query : $ | | | | | | | $---------------------------}$ | | | | | | |
  5. | : | | SK_puts() $ | | | | |
  6. | whois banner : |{------------------------------$ | | | | | |{---------------------------$ : | | | | | |
  7. | : | | $ QC_new() | | | | |
  8. | : | : $--------------}| WK_new() | | | | | : | | | $--------------}| | | | | : | | | | $ | | |
  9. | : | | $ QI_new() | | | | | | : | | $----------------------------------------------}| | | | : | | | | | $ | |
  10. | : | | $ QI_execute() | | | | | | : | | $----------------------------------------------}| | |
  11. | : | | | | | $ SQ_get_connection() | | : | | | | | $--------------}| | | : | | | | | | $ |
  12. | : | | | | | $ RX_asc_search() | | : | | | | | $------------------------------}| | : | | | | | | | $
  13. | : | | | | | $ SQ_execute_query() | | : | | | | | $--------------}| | | : | | | | | | $ |
  14. | : | | | | | $ SQ_row_next() | | | : | | | | | $--------------}| | | : | | | | | | $ |
  15. | : | | | | | $ SQ_get_column_string() | | : | | | | | $--------------}| | | : | | | | | | $ |
  16. | : | | | | | SK_puts() $ | |
  17. | whois objects : |{------------------------------------------------------------------------------$ | | |{---------------------------$ | | | | | | |
  18. | : | | | | | $ SQ_free_result() | | : | | | | | $--------------}| | | : | | | | | | $ |
  19. | : | | | | | $ SQ_close_connection() | | : | | | | | $--------------}| | | : | | | | | | $ | | : | | | | | $ | |
  20. | : | | SK_close() $ | | | | |
  21. | disconnect : |{------------------------------$ | | | | | |{---------------------------$ | | | | | | | | : | | | | | | | |