Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | ========================================================================= |
michael@0 | 2 | State machine transitions for the Crash Generation Server |
michael@0 | 3 | ========================================================================= |
michael@0 | 4 | |
michael@0 | 5 | ========================================================================= |
michael@0 | 6 | | |
michael@0 | 7 | STATE | ACTIONS |
michael@0 | 8 | | |
michael@0 | 9 | ========================================================================= |
michael@0 | 10 | ERROR | Clean up resources used to serve clients. |
michael@0 | 11 | | Always remain in ERROR state. |
michael@0 | 12 | ------------------------------------------------------------------------- |
michael@0 | 13 | INITIAL | Connect to the pipe asynchronously. |
michael@0 | 14 | | If connection is successfully queued up asynchronously, |
michael@0 | 15 | | go into CONNECTING state. |
michael@0 | 16 | | If connection is done synchronously, go into CONNECTED |
michael@0 | 17 | | state. |
michael@0 | 18 | | For any unexpected problems, go into ERROR state. |
michael@0 | 19 | ------------------------------------------------------------------------- |
michael@0 | 20 | CONNECTING | Get the result of async connection request. |
michael@0 | 21 | | If I/O is still incomplete, remain in the CONNECTING |
michael@0 | 22 | | state. |
michael@0 | 23 | | If connection is complete, go into CONNECTED state. |
michael@0 | 24 | | For any unexpected problems, go into DISCONNECTING state. |
michael@0 | 25 | ------------------------------------------------------------------------- |
michael@0 | 26 | CONNECTED | Read from the pipe asynchronously. |
michael@0 | 27 | | If read request is successfully queued up asynchronously, |
michael@0 | 28 | | go into READING state. |
michael@0 | 29 | | For any unexpected problems, go into DISCONNECTING state. |
michael@0 | 30 | ------------------------------------------------------------------------- |
michael@0 | 31 | READING | Get the result of async read request. |
michael@0 | 32 | | If read is done, go into READ_DONE state. |
michael@0 | 33 | | For any unexpected problems, go into DISCONNECTING state. |
michael@0 | 34 | ------------------------------------------------------------------------- |
michael@0 | 35 | READ_DONE | Register the client, prepare the reply and write the |
michael@0 | 36 | | reply to the pipe asynchronously. |
michael@0 | 37 | | If write request is successfully queued up asynchronously, |
michael@0 | 38 | | go into WRITING state. |
michael@0 | 39 | | For any unexpected problems, go into DISCONNECTING state. |
michael@0 | 40 | ------------------------------------------------------------------------- |
michael@0 | 41 | WRITING | Get the result of the async write request. |
michael@0 | 42 | | If write is done, go into WRITE_DONE state. |
michael@0 | 43 | | For any unexpected problems, go into DISCONNECTING state. |
michael@0 | 44 | ------------------------------------------------------------------------- |
michael@0 | 45 | WRITE_DONE | Read from the pipe asynchronously (for an ACK). |
michael@0 | 46 | | If read request is successfully queued up asynchonously, |
michael@0 | 47 | | go into READING_ACK state. |
michael@0 | 48 | | For any unexpected problems, go into DISCONNECTING state. |
michael@0 | 49 | ------------------------------------------------------------------------- |
michael@0 | 50 | READING_ACK | Get the result of the async read request. |
michael@0 | 51 | | If read is done, perform action for successful client |
michael@0 | 52 | | connection. |
michael@0 | 53 | | Go into DISCONNECTING state. |
michael@0 | 54 | ------------------------------------------------------------------------- |
michael@0 | 55 | DISCONNECTING | Disconnect from the pipe, reset the event and go into |
michael@0 | 56 | | INITIAL state and signal the event again. If anything |
michael@0 | 57 | | fails, go into ERROR state. |
michael@0 | 58 | ========================================================================= |