annotate packages/net/httpd/current/src/init.cxx @ 2271:fd2c3f3def9d

* src/monitor.c (cyg_monitor_network): Calling the network monitor html handler can trigger an exception when the function getifaddrs() fails because we are out of memory. Check the return code and return failure if this happens.
author asl
date Fri, 11 Aug 2006 15:54:45 +0000
parents 606f06850b83
children 74dbf4c3f2e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
468
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
1 /* =================================================================
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
2 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
3 * init.cxx
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
4 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
5 * Constructor for HTTPD
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
6 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
7 * =================================================================
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
8 * ####ECOSGPLCOPYRIGHTBEGIN####
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
9 * -------------------------------------------
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
10 * This file is part of eCos, the Embedded Configurable Operating
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
11 * System.
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
12 * Copyright (C) 2002 Nick Garnett.
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
13 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
14 * eCos is free software; you can redistribute it and/or modify it
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
15 * under the terms of the GNU General Public License as published by
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
16 * the Free Software Foundation; either version 2 or (at your option)
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
17 * any later version.
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
18 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
19 * eCos is distributed in the hope that it will be useful, but
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
22 * General Public License for more details.
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
23 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
24 * You should have received a copy of the GNU General Public License
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
25 * along with eCos; if not, write to the Free Software Foundation,
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
26 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
27 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
28 * As a special exception, if other files instantiate templates or
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
29 * use macros or inline functions from this file, or you compile this
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
30 * file and link it with other works to produce a work based on this
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
31 * file, this file does not by itself cause the resulting work to be
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
32 * covered by the GNU General Public License. However the source code
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
33 * for this file must still be made available in accordance with
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
34 * section (3) of the GNU General Public License.
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
35 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
36 * This exception does not invalidate any other reasons why a work
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
37 * based on this file might be covered by the GNU General Public
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
38 * License.
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
39 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
40 * -------------------------------------------
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
41 * ####ECOSGPLCOPYRIGHTEND####
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
42 * =================================================================
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
43 * #####DESCRIPTIONBEGIN####
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
44 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
45 * Author(s): nickg@calivar.com
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
46 * Contributors: nickg@calivar.com
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
47 * Date: 2002-10-14
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
48 * Purpose:
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
49 * Description:
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
50 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
51 * ####DESCRIPTIONEND####
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
52 *
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
53 * =================================================================
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
54 */
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
55
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
56 #include <pkgconf/system.h>
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
57 #include <pkgconf/isoinfra.h>
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
58 #include <pkgconf/httpd.h>
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
59
1534
606f06850b83 * include/httpd.h:
nickg
parents: 468
diff changeset
60 #ifdef CYGNUM_HTTPD_SERVER_AUTO_START
606f06850b83 * include/httpd.h:
nickg
parents: 468
diff changeset
61
468
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
62 #include <cyg/infra/cyg_trac.h> // tracing macros
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
63 #include <cyg/infra/cyg_ass.h> // assertion macros
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
64
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
65 /* ================================================================= */
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
66
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
67 __externC void cyg_httpd_startup(void);
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
68
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
69 /* ================================================================= */
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
70 /* Initialization object
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
71 */
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
72
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
73 class Cyg_Httpd_Init_Class
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
74 {
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
75 public:
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
76 Cyg_Httpd_Init_Class();
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
77 };
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
78
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
79 /* ----------------------------------------------------------------- */
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
80 /* Static initialization object instance. The constructor is
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
81 * prioritized to run at the same time as any filesystem constructors.
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
82 */
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
83 static Cyg_Httpd_Init_Class httpd_initializer CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_IO_FS);
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
84
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
85 /* ----------------------------------------------------------------- */
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
86 /* Constructor, just calls the startup routine.
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
87 */
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
88
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
89 Cyg_Httpd_Init_Class::Cyg_Httpd_Init_Class()
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
90 {
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
91 cyg_httpd_startup();
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
92 }
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
93
1534
606f06850b83 * include/httpd.h:
nickg
parents: 468
diff changeset
94 #endif // CYGNUM_HTTPD_SERVER_AUTO_START
606f06850b83 * include/httpd.h:
nickg
parents: 468
diff changeset
95
468
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
96 /* ----------------------------------------------------------------- */
ca4f29d41b18 Created new HTTPD package.
nickg
parents:
diff changeset
97 /* end of httpd.c */