~ubuntu-branches/ubuntu/karmic/gears/karmic

« back to all changes in this revision

Viewing changes to gears/localserver/android/http_request_diagram.dot

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Lesicnik
  • Date: 2009-04-30 19:15:25 UTC
  • Revision ID: james.westby@ubuntu.com-20090430191525-0790sb5wzg8ou0xb
Tags: upstream-0.5.21.0~svn3334+dfsg
ImportĀ upstreamĀ versionĀ 0.5.21.0~svn3334+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
digraph G {
 
2
 
 
3
 /*
 
4
  This diagram shows the state machine of
 
5
  the HttpRequest implementation on Android.
 
6
  States are in oval
 
7
  Functionss are boxed
 
8
  "chunks" of code (not necessary functions) are dashed
 
9
  Direct transitions (in the same thread) are in black,
 
10
  while interthreads transitions are in blue.
 
11
  Red transitions are just here to highlight the switch
 
12
  to the Abort state.
 
13
  Bolded ovals (START/EXIT/ABORT) are not really states,
 
14
  just start/end points.
 
15
 */
 
16
 
 
17
  rankdir = LR;
 
18
  concentrate=false;
 
19
 
 
20
  {
 
21
    rank = min;
 
22
    START [style="bold"];
 
23
    ABORT [style="bold"];
 
24
    EXIT [style="bold"];
 
25
  }
 
26
 
 
27
  ServeLocally [shape="box", style="solid"];
 
28
 
 
29
  { 
 
30
    rank = same;
 
31
    Child_CONNECT_TO_REMOTE; 
 
32
    Child_PARSE_HEADERS;
 
33
    Child_CONNECTED;
 
34
    Child_POST;
 
35
    Child_RECEIVE;
 
36
    Redirection [shape="box", style="dashed"];
 
37
    ParseHeaders [shape="box", style="solid"];
 
38
    ConnectToRemote [shape="box", style="solid"];
 
39
    SendPostData [shape="box", style="solid"];
 
40
    Receive [shape="box", style="solid"];
 
41
  }
 
42
 
 
43
  {
 
44
    rank = same;
 
45
    Child_ABORT;
 
46
    Interrupt;
 
47
  }
 
48
 
 
49
  {
 
50
    rank = max;
 
51
    Main_RECEIVED;
 
52
    Main_COMPLETE;
 
53
    Main_IDLE;
 
54
    InsertIntoCache [shape="box", style="solid"];
 
55
    SaveCacheResult [shape="box", style="solid"];
 
56
    StopChild [shape="box", style="solid"];
 
57
  }
 
58
  
 
59
/*
 
60
  {
 
61
    SetReadyState [shape="box"];
 
62
    START -> SetReadyState [label="OPEN(1)"];
 
63
    Child_CONNECTED -> SetReadyState [color="blue", label="SENT(2)"];
 
64
    ParseHeaders -> SetReadyState [color="blue", label="INTERACTIVE(3)"];
 
65
    Main_COMPLETE -> SetReadyState [label="COMPLETE(4)"];
 
66
  }
 
67
*/
 
68
 
 
69
  ABORT -> Child_ABORT [label="was_aborted_", color="blue"];
 
70
 
 
71
  Main_IDLE -> EXIT;
 
72
  START -> Main_REQUEST;
 
73
  Main_REQUEST -> ServeLocally;
 
74
  ServeLocally -> Child_CONNECT_TO_REMOTE [color="blue", label="CACHE MISS"];
 
75
  ServeLocally -> Child_PARSE_HEADERS [color="blue"];
 
76
  Child_CONNECT_TO_REMOTE -> ConnectToRemote;
 
77
  ConnectToRemote -> Child_CONNECTED;
 
78
  ConnectToRemote -> Child_ABORT [style="solid", label="FAILED", color=red];
 
79
  Child_CONNECTED -> Child_POST [label="POST"];
 
80
  Child_CONNECTED -> Child_PARSE_HEADERS;
 
81
  Child_POST -> SendPostData;
 
82
  SendPostData -> Child_PARSE_HEADERS [label="POST"];
 
83
  SendPostData -> Child_ABORT [style="solid", label="POST FAILED", color=red];
 
84
  Child_PARSE_HEADERS -> ParseHeaders;
 
85
  Child_PARSE_HEADERS -> Child_ABORT [style="solid", label="FAILED PARSE HEADERS", color=red];
 
86
  Redirection -> Child_RECEIVE [label="NO REDIRECT"];
 
87
  ParseHeaders -> Redirection;
 
88
  Redirection -> Main_REQUEST [color="blue", label="REDIRECT"];
 
89
  Redirection -> Child_ABORT [style="solid", label="CANNOT OPEN AFTER REDIRECT", color=red];
 
90
  Child_RECEIVE -> Receive;
 
91
  Receive -> Main_RECEIVED [color="blue"];
 
92
  Receive -> Child_ABORT [style="solid", "ERROR", color=red]; 
 
93
  Child_ABORT -> Interrupt;
 
94
  Interrupt -> Main_COMPLETE [color="blue"];
 
95
  Main_RECEIVED -> InsertIntoCache -> SaveCacheResult;
 
96
  SaveCacheResult -> Main_COMPLETE;
 
97
  Main_RECEIVED -> Main_COMPLETE;
 
98
  Main_COMPLETE -> StopChild -> Main_IDLE;
 
99
}