1 /* Pseudo about: protocol implementation */
9 #include "cache/cache.h"
10 #include "network/connection.h"
11 #include "protocol/about.h"
12 #include "protocol/protocol.h"
13 #include "protocol/uri.h"
14 #include "util/string.h"
20 unsigned char *string
;
23 static const struct about_page about_pages
[] = {
27 "<p>Bloat? What bloat?</p>"
37 "/* /'.\"//~~~~\\ */\n"
38 "/* `\\/`\\`--') , */\n"
46 "</pre></body></html>"
51 "<html><body text=\"white\" bgcolor=\"red\">"
52 "<p align=\"center\">And the <em>beste</em> shall meet "
53 "a <em>being</em> and the being shall wear signs "
54 "of EL and the signs shall have colour of enke. "
55 "And the being shall be of <em>Good Nature</em>. "
56 "From on high the beste hath looked down upon the being "
57 "and the being was <em>smal</em> compared to it. "
58 "Yet <em>faster</em> and <em>leaner</em> it hath been "
59 "and it would come through doors closed to the beste. "
60 "And there was truly great <em>respect</em> "
61 "twix the beste and the <em>smal being</em> "
62 "and they bothe have <em>served</em> to naciouns. "
63 "Yet only the <em>true believers</em> "
64 "would choose betwene them and the followers "
65 "of <em>mammon</em> stayed <em>blinded</em> to bothe.</p>"
66 "<p align=\"right\">from <em>The Book of Mozilla</em> "
67 "(Apocryphon of ELeasar), 12:24</p>"
73 "<html><body text=\"yellow\">"
74 "<p>I must not fear. Fear is the mind-killer. "
75 "Fear is the little-death that brings total obliteration. "
76 "I will face my fear. "
77 "I will permit it to pass over me and through me. "
78 "And when it has gone past I will turn the inner eye "
80 "Where the fear has gone there will be nothing. "
81 "Only I will remain.</p>"
91 about_protocol_handler(struct connection
*conn
)
93 struct cache_entry
*cached
= get_cache_entry(conn
->uri
);
95 /* Only do this the first time */
96 if (cached
&& !cached
->content_type
) {
99 const struct about_page
*page
= about_pages
;
101 for (; page
->name
; page
++) {
105 if (strcmp(conn
->uri
->data
, page
->name
))
110 add_fragment(cached
, 0, str
, len
);
117 /* Set content to known type */
118 mem_free_set(&cached
->content_type
, stracpy("text/html"));
121 conn
->cached
= cached
;
122 abort_connection(conn
, connection_state(S_OK
));