Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 117 lines (102 sloc) 4.031 kb
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
3 /* Cherokee
4 *
5 * Authors:
6 * Alvaro Lopez Ortega <alvaro@alobbs.com>
7 *
920e20b @alobbs Happy new year!
alobbs authored
8 * Copyright (C) 2001-2011 Alvaro Lopez Ortega
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
2c39092 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@2660 5dc97367-9…
alobbs authored
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 * 02110-1301, USA.
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
23 */
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
24
25 #include "common-internal.h"
26 #include "version.h"
27
28
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
29 ret_t
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
30 cherokee_version_add (cherokee_buffer_t *buf, cherokee_server_token_t level)
31 {
32 ret_t ret;
33
34 switch (level) {
35 case cherokee_version_product:
36 ret = cherokee_buffer_add_str (buf, "Cherokee web server");
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
37 break;
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
38 case cherokee_version_minor:
39 ret = cherokee_buffer_add_str (buf, "Cherokee web server " PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION);
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
40 break;
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
41 case cherokee_version_minimal:
42 ret = cherokee_buffer_add_str (buf, "Cherokee web server " PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION "." PACKAGE_MICRO_VERSION);
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
43 break;
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
44 case cherokee_version_os:
45 ret = cherokee_buffer_add_str (buf, "Cherokee web server " PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION "." PACKAGE_MICRO_VERSION " (" OS_TYPE ")");
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
46 break;
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
47 case cherokee_version_full:
d10c93d @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@541 5dc97367-97…
alobbs authored
48 ret = cherokee_buffer_add_str (buf, "Cherokee web server " PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION "." PACKAGE_MICRO_VERSION PACKAGE_PATCH_VERSION " (" OS_TYPE ")");
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
49 break;
dc4c28f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@526 5dc97367-97…
alobbs authored
50 default:
d10c93d @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@541 5dc97367-97…
alobbs authored
51 SHOULDNT_HAPPEN;
dc4c28f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@526 5dc97367-97…
alobbs authored
52 ret = ret_error;
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
53 }
54
55 return ret;
56 }
57
58
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
59 ret_t
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
60 cherokee_version_add_w_port (cherokee_buffer_t *buf, cherokee_server_token_t level, cuint_t port)
61 {
62 ret_t ret;
63
64 switch (level) {
65 case cherokee_version_product:
1ed31c4 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1663 5dc97367-9…
alobbs authored
66 ret = cherokee_buffer_add_va (buf, "Cherokee web server, Port %d", port);
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
67 break;
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
68 case cherokee_version_minor:
1ed31c4 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1663 5dc97367-9…
alobbs authored
69 ret = cherokee_buffer_add_va (buf, "Cherokee web server " PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION ", Port %d", port);
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
70 break;
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
71 case cherokee_version_minimal:
1ed31c4 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1663 5dc97367-9…
alobbs authored
72 ret = cherokee_buffer_add_va (buf, "Cherokee web server " PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION "." PACKAGE_MICRO_VERSION ", Port %d", port);
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
73 break;
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
74 case cherokee_version_os:
1ed31c4 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1663 5dc97367-9…
alobbs authored
75 ret = cherokee_buffer_add_va (buf, "Cherokee web server " PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION "." PACKAGE_MICRO_VERSION " (" OS_TYPE "), Port %d", port);
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
76 break;
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
77 case cherokee_version_full:
1ed31c4 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1663 5dc97367-9…
alobbs authored
78 ret = cherokee_buffer_add_va (buf, "Cherokee web server " PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION "." PACKAGE_MICRO_VERSION PACKAGE_PATCH_VERSION " (" OS_TYPE "), Port %d", port);
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
79 break;
dc4c28f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@526 5dc97367-97…
alobbs authored
80 default:
d10c93d @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@541 5dc97367-97…
alobbs authored
81 SHOULDNT_HAPPEN;
dc4c28f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@526 5dc97367-97…
alobbs authored
82 ret = ret_error;
970534b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@493 5dc97367-97…
alobbs authored
83 }
84
85 return ret;
86 }
d10c93d @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@541 5dc97367-97…
alobbs authored
87
88
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
89 ret_t
d10c93d @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@541 5dc97367-97…
alobbs authored
90 cherokee_version_add_simple (cherokee_buffer_t *buf, cherokee_server_token_t level)
91 {
92 ret_t ret;
93
94 switch (level) {
95 case cherokee_version_product:
96 ret = cherokee_buffer_add_str (buf, "Cherokee");
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
97 break;
d10c93d @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@541 5dc97367-97…
alobbs authored
98 case cherokee_version_minor:
99 ret = cherokee_buffer_add_str (buf, "Cherokee/" PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION);
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
100 break;
d10c93d @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@541 5dc97367-97…
alobbs authored
101 case cherokee_version_minimal:
102 ret = cherokee_buffer_add_str (buf, "Cherokee/" PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION "." PACKAGE_MICRO_VERSION);
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
103 break;
d10c93d @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@541 5dc97367-97…
alobbs authored
104 case cherokee_version_os:
105 ret = cherokee_buffer_add_str (buf, "Cherokee/" PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION "." PACKAGE_MICRO_VERSION " (" OS_TYPE ")");
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
106 break;
d10c93d @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@541 5dc97367-97…
alobbs authored
107 case cherokee_version_full:
108 ret = cherokee_buffer_add_str (buf, "Cherokee/" PACKAGE_MAJOR_VERSION "." PACKAGE_MINOR_VERSION "." PACKAGE_MICRO_VERSION PACKAGE_PATCH_VERSION " (" OS_TYPE ")");
4a806f0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@542 5dc97367-97…
alobbs authored
109 break;
d10c93d @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@541 5dc97367-97…
alobbs authored
110 default:
111 SHOULDNT_HAPPEN;
112 ret = ret_error;
113 }
114
115 return ret_ok;
116 }
Something went wrong with that request. Please try again.