Willy Tarreau | 244b47b | 2007-03-03 11:46:27 +0100 | [diff] [blame] | 1 | Naming rules for manipulated objects and structures. |
| 2 | |
| 3 | Previously, there were ambiguities between sessions, transactions and requests, |
| 4 | as well as in the way responses are noted ("resp", "rep", "rsp"). |
| 5 | |
| 6 | Here is a proposal for a better naming scheme. |
| 7 | |
| 8 | The "session" is above the transport level, which means at ISO layer 5. |
| 9 | We can talk about "http sessions" when we consider the entity which lives |
| 10 | between the accept() and the close(), or the connect() and the close(). |
| 11 | |
| 12 | => This demonstrates that it is not possible to have the same http session from |
| 13 | the client to the server. |
| 14 | |
| 15 | A session can carry one or multiple "transactions", which are each composed of |
| 16 | one "request" and zero or one "response". Both "request" and "response" are |
| 17 | described in RFC2616 as "HTTP messages". RFC2616 also seldom references the |
| 18 | word "transaction" without explicitly defining it. |
| 19 | |
| 20 | An "HTTP message" is composed of a "start line" which can be either a |
| 21 | "request line" or a "status line", followed by a number of "message headers" |
| 22 | which can be either "request headers" or "response headers", and an "entity", |
| 23 | itself composed of "entity headers" and an "entity body".Most probably, |
| 24 | "message headers" and "entity headers" will always be processed together as |
| 25 | "headers", while the "entity body" will design the payload. |
| 26 | |
| 27 | We must try to always use the same abbreviations when naming objects. Here are |
| 28 | a few common ones : |
| 29 | |
| 30 | - txn : transaction |
| 31 | - req : request |
| 32 | - rtr : response to request |
| 33 | - msg : message |
| 34 | - hdr : header |
| 35 | - ent : entity |
| 36 | - bdy : body |
| 37 | - sts : status |
| 38 | - stt : state |
| 39 | - idx : index |
| 40 | - cli : client |
| 41 | - srv : server |
| 42 | - svc : service |
| 43 | - ses : session |
| 44 | - tsk : task |
| 45 | |
| 46 | Short names for unions or cascaded structs : |
| 47 | - sl : start line |
| 48 | - sl.rq : request line |
| 49 | - sl.st : status line |
| 50 | - cl : client |
| 51 | - px : proxy |
| 52 | - sv : server |
| 53 | - st : state / status |
| 54 | |