add infrastructure to cleanly swap inbetween the DB and the IO queue; add infrastruct...
authorWilfried Goesgens <dothebart@citadel.org>
Wed, 17 Aug 2011 17:18:07 +0000 (17:18 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Wed, 17 Aug 2011 17:18:07 +0000 (17:18 +0000)
commit9b11f8130194f05d4599cddfd796b80093d5cef2
tree9f58b159689a699444c57577522540aaf22c580e
parent682137147d66ec1ea06b9099c55e597c23b0e31f
add infrastructure to cleanly swap inbetween the DB and the IO queue; add infrastructure needed for async message reading.

  - QueueDBOperation(): use our own vars on the AsyncIO struct, so we don't overwrite handlers & events from the file I/O stuff.
  - DB_PerformNext(): don't use default: so we get warnings if new states are added and not handled here.
  - DB_PerformNext(): if we don't get a DB query or Terminate, the db operations are done, remove our handlers, this AsyncIO context is handed over into another Queue by the application logic.
  - NextDBOperation(): use our own vars on the AsyncIO struct, so we don't overwrite handlers & events from the file I/O stuff.
  - HandleInbound(): handle more read-states; needed for message reading.
  - HandleInbound(): move Rumpelstilskin lookup if to switch()
  - IO_send_callback(): fix/add IO debugging to /tmp/foo
  - IO_send_callback(): Adjust switch to some edge cases:
    - eSendReply: check whether we're done with sending, if, fall forward to writing.
    - eReadMore: was missing, continue reading (if)
    - eReadPayload: new, read smtp messages for example.
    - eDBQuery: the application logic want to perform database I/O with this context, clean up hooks and remove it from this queue.
  - set_start_callback(): properly hanle the new cases
  - IO_recv_callback(): fix/add IO debugging to /tmp/foo
  - ReAttachIO(): use me if you want to continue with file I/O after i.e. DB-I/O
citadel/event_client.c
citadel/event_client.h