Skip to content

Commit 2751062

Browse files
authored
Revert "升级到apache 2.0"
1 parent 2c721ce commit 2751062

24 files changed

Lines changed: 760 additions & 330 deletions

LICENSE

Lines changed: 339 additions & 201 deletions
Large diffs are not rendered by default.

inc/webnet.h

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
/*
2-
* Copyright (c) 2006-2022, RT-Thread Development Team
2+
* File : webnet.h
3+
* This file is part of RT-Thread RTOS
4+
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
35
*
4-
* SPDX-License-Identifier: Apache-2.0
6+
* This software is dual-licensed: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation. For the terms of this
9+
* license, see <http://www.gnu.org/licenses/>.
10+
*
11+
* You are free to use this software under the terms of the GNU General
12+
* Public License, but WITHOUT ANY WARRANTY; without even the implied
13+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
* See the GNU General Public License for more details.
15+
*
16+
* Alternatively for commercial application, you can contact us
17+
* by email <business@rt-thread.com> for commercial license.
18+
*
19+
* You should have received a copy of the GNU General Public License along
20+
* with this program; if not, write to the Free Software Foundation, Inc.,
21+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
522
*
623
* Change Logs:
724
* Date Author Notes
@@ -53,7 +70,7 @@ extern "C" {
5370
#ifndef WEBNET_USING_RANGE
5471
#define WEBNET_USING_RANGE
5572
#endif
56-
73+
5774
#ifndef WEBNET_USING_KEEPALIVE
5875
#define WEBNET_USING_KEEPALIVE
5976
#endif
@@ -64,7 +81,7 @@ extern "C" {
6481

6582
#define WEBNET_VERSION "2.0.3" /* webnet version string */
6683
#define WEBNET_VERSION_NUM 0x20003 /* webnet version number */
67-
#define WEBNET_THREAD_NAME "webnet" /* webnet thread name */
84+
#define WEBNET_THREAD_NAME "webnet" /* webnet thread name */
6885

6986
#define WEBNET_THREAD_STACKSIZE (4 * 1024) /* webnet thread stack size */
7087
#define WEBNET_PRIORITY 20 /* webnet thread priority */

inc/wn_module.h

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
/*
2-
* Copyright (c) 2006-2022, RT-Thread Development Team
2+
* File : wn_module.h
3+
* This file is part of RT-Thread RTOS
4+
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
35
*
4-
* SPDX-License-Identifier: Apache-2.0
6+
* This software is dual-licensed: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation. For the terms of this
9+
* license, see <http://www.gnu.org/licenses/>.
10+
*
11+
* You are free to use this software under the terms of the GNU General
12+
* Public License, but WITHOUT ANY WARRANTY; without even the implied
13+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
* See the GNU General Public License for more details.
15+
*
16+
* Alternatively for commercial application, you can contact us
17+
* by email <business@rt-thread.com> for commercial license.
18+
*
19+
* You should have received a copy of the GNU General Public License along
20+
* with this program; if not, write to the Free Software Foundation, Inc.,
21+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
522
*
623
* Change Logs:
724
* Date Author Notes
@@ -20,21 +37,21 @@ extern "C" {
2037
#endif
2138

2239
/* initialization event */
23-
#define WEBNET_EVENT_INIT (1 << 0)
40+
#define WEBNET_EVENT_INIT (1 << 0)
2441
/* map uri request to physical url */
25-
#define WEBNET_EVENT_URI_PHYSICAL (1 << 1)
42+
#define WEBNET_EVENT_URI_PHYSICAL (1 << 1)
2643
/* uri request */
27-
#define WEBNET_EVENT_URI_POST (1 << 2)
44+
#define WEBNET_EVENT_URI_POST (1 << 2)
2845
/* header of response */
29-
#define WEBNET_EVENT_RSP_HEADER (1 << 3)
46+
#define WEBNET_EVENT_RSP_HEADER (1 << 3)
3047
/* file content of response */
31-
#define WEBNET_EVENT_RSP_FILE (1 << 4)
48+
#define WEBNET_EVENT_RSP_FILE (1 << 4)
3249

3350

3451
/* continue other modules */
35-
#define WEBNET_MODULE_CONTINUE 0
52+
#define WEBNET_MODULE_CONTINUE 0
3653
/* this session is finished */
37-
#define WEBNET_MODULE_FINISHED 1
54+
#define WEBNET_MODULE_FINISHED 1
3855

3956
int webnet_module_handle_event(struct webnet_session* session, int event);
4057
int webnet_module_system_dofile(struct webnet_session* session);

inc/wn_request.h

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
/*
2-
* Copyright (c) 2006-2022, RT-Thread Development Team
2+
* File : wn_request.h
3+
* This file is part of RT-Thread RTOS
4+
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
35
*
4-
* SPDX-License-Identifier: Apache-2.0
6+
* This software is dual-licensed: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation. For the terms of this
9+
* license, see <http://www.gnu.org/licenses/>.
10+
*
11+
* You are free to use this software under the terms of the GNU General
12+
* Public License, but WITHOUT ANY WARRANTY; without even the implied
13+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
* See the GNU General Public License for more details.
515
*
616
* Alternatively for commercial application, you can contact us
717
* by email <business@rt-thread.com> for commercial license.
@@ -31,14 +41,14 @@ enum webnet_method
3141
WEBNET_POST,
3242
WEBNET_HEADER,
3343
WEBNET_HEAD,
34-
WEBNET_PUT,
35-
WEBNET_OPTIONS,
36-
WEBNET_PROPFIND,
37-
WEBNET_PROPPATCH,
38-
WEBNET_DELETE,
39-
WEBNET_CONNECT,
40-
WEBNET_MKCOL,
41-
WEBNET_MOVE,
44+
WEBNET_PUT,
45+
WEBNET_OPTIONS,
46+
WEBNET_PROPFIND,
47+
WEBNET_PROPPATCH,
48+
WEBNET_DELETE,
49+
WEBNET_CONNECT,
50+
WEBNET_MKCOL,
51+
WEBNET_MOVE,
4252
WEBNET_SUBSCRIBE,
4353
WEBNET_UNSUBSCRIBE,
4454
WEBNET_NOTIFY,
@@ -82,8 +92,8 @@ struct webnet_request
8292
size_t pos_end;
8393
#endif /* WEBNET_USING_RANGE */
8494
#ifdef WEBNET_USING_DAV
85-
char* depth;
86-
char* destination;
95+
char* depth;
96+
char* destination;
8797
#endif /* WEBNET_USING_DAV */
8898

8999
/* DMR */
@@ -96,7 +106,7 @@ struct webnet_request
96106

97107
/* query information */
98108
char* query;
99-
int query_offset;
109+
int query_offset;
100110
struct webnet_query_item* query_items;
101111
rt_uint16_t query_counter;
102112

inc/wn_session.h

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
/*
2-
* Copyright (c) 2006-2022, RT-Thread Development Team
2+
* File : wn_session.h
3+
* This file is part of RT-Thread RTOS
4+
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
35
*
4-
* SPDX-License-Identifier: Apache-2.0
6+
* This software is dual-licensed: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation. For the terms of this
9+
* license, see <http://www.gnu.org/licenses/>.
10+
*
11+
* You are free to use this software under the terms of the GNU General
12+
* Public License, but WITHOUT ANY WARRANTY; without even the implied
13+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
* See the GNU General Public License for more details.
15+
*
16+
* Alternatively for commercial application, you can contact us
17+
* by email <business@rt-thread.com> for commercial license.
518
*
619
* Change Logs:
720
* Date Author Notes
@@ -16,22 +29,22 @@
1629

1730
#ifdef RT_USING_SAL
1831
#include <sys/socket.h>
19-
#else
32+
#else
2033
#include <lwip/sockets.h>
2134
#endif
2235

2336
#ifdef __cplusplus
2437
extern "C" {
2538
#endif
2639

27-
#define WEBNET_SESSION_BUFSZ (4 * 1024)
40+
#define WEBNET_SESSION_BUFSZ (4 * 1024)
2841

2942
/* close session */
30-
#define WEBNET_EVENT_CLOSE (1 << 5)
43+
#define WEBNET_EVENT_CLOSE (1 << 5)
3144
/* read session */
32-
#define WEBNET_EVENT_READ (1 << 6)
45+
#define WEBNET_EVENT_READ (1 << 6)
3346
/* write session */
34-
#define WEBNET_EVENT_WRITE (1 << 7)
47+
#define WEBNET_EVENT_WRITE (1 << 7)
3548

3649

3750
struct webnet_session_ops
@@ -42,11 +55,11 @@ struct webnet_session_ops
4255

4356
enum webnet_session_phase
4457
{
45-
WEB_PHASE_METHOD = 0, /* parse method */
46-
WEB_PHASE_HEADER, /* handle web request header */
47-
WEB_PHASE_QUERY, /* handle web query */
48-
WEB_PHASE_RESPONSE, /* handle web response */
49-
WEB_PHASE_CLOSE, /* to close session */
58+
WEB_PHASE_METHOD = 0, /* parse method */
59+
WEB_PHASE_HEADER, /* handle web request header */
60+
WEB_PHASE_QUERY, /* handle web query */
61+
WEB_PHASE_RESPONSE, /* handle web response */
62+
WEB_PHASE_CLOSE, /* to close session */
5063
};
5164

5265
struct webnet_session
@@ -65,10 +78,10 @@ struct webnet_session
6578
rt_uint16_t buffer_offset;
6679
rt_uint8_t buffer[WEBNET_SESSION_BUFSZ];
6780

68-
/* session phase */
69-
rt_uint32_t session_phase;
81+
/* session phase */
82+
rt_uint32_t session_phase;
7083

71-
rt_uint32_t session_event_mask;
84+
rt_uint32_t session_event_mask;
7285
const struct webnet_session_ops* session_ops;
7386
rt_uint32_t user_data;
7487
};

inc/wn_utils.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
/*
2-
* Copyright (c) 2006-2022, RT-Thread Development Team
2+
* File : wn_utils.c
3+
* This file is part of RT-Thread RTOS
4+
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
35
*
4-
* SPDX-License-Identifier: Apache-2.0
6+
* This software is dual-licensed: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation. For the terms of this
9+
* license, see <http://www.gnu.org/licenses/>.
10+
*
11+
* You are free to use this software under the terms of the GNU General
12+
* Public License, but WITHOUT ANY WARRANTY; without even the implied
13+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
* See the GNU General Public License for more details.
15+
*
16+
* Alternatively for commercial application, you can contact us
17+
* by email <business@rt-thread.com> for commercial license.
518
*
619
* Change Logs:
720
* Date Author Notes

module/wn_module_alias.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
/*
2-
* Copyright (c) 2006-2022, RT-Thread Development Team
2+
* File : wn_module_alias.c
3+
* This file is part of RT-Thread RTOS
4+
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
35
*
4-
* SPDX-License-Identifier: Apache-2.0
6+
* This software is dual-licensed: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation. For the terms of this
9+
* license, see <http://www.gnu.org/licenses/>.
10+
*
11+
* You are free to use this software under the terms of the GNU General
12+
* Public License, but WITHOUT ANY WARRANTY; without even the implied
13+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
* See the GNU General Public License for more details.
15+
*
16+
* Alternatively for commercial application, you can contact us
17+
* by email <business@rt-thread.com> for commercial license.
518
*
619
* Change Logs:
720
* Date Author Notes

module/wn_module_asp.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
/*
2-
* Copyright (c) 2006-2022, RT-Thread Development Team
2+
* File : wn_module_asp.c
3+
* This file is part of RT-Thread RTOS
4+
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
35
*
4-
* SPDX-License-Identifier: Apache-2.0
6+
* This software is dual-licensed: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation. For the terms of this
9+
* license, see <http://www.gnu.org/licenses/>.
10+
*
11+
* You are free to use this software under the terms of the GNU General
12+
* Public License, but WITHOUT ANY WARRANTY; without even the implied
13+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
* See the GNU General Public License for more details.
15+
*
16+
* Alternatively for commercial application, you can contact us
17+
* by email <business@rt-thread.com> for commercial license.
518
*
619
* Change Logs:
720
* Date Author Notes
@@ -113,7 +126,7 @@ static void _default_asp_handler(struct webnet_session* session, const char* nam
113126
total = 1024*32;
114127
used = 1024*16;
115128
max_used = 1024*24;
116-
129+
117130
webnet_session_printf(session, "current %d/maximal used %d/total %d", used, max_used, total);
118131
}
119132
else if (strncmp(name, "TICK", 4) == 0)

module/wn_module_auth.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
/*
2-
* Copyright (c) 2006-2022, RT-Thread Development Team
2+
* File : wn_module_auth.c
3+
* This file is part of RT-Thread RTOS
4+
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
35
*
4-
* SPDX-License-Identifier: Apache-2.0
6+
* This software is dual-licensed: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation. For the terms of this
9+
* license, see <http://www.gnu.org/licenses/>.
10+
*
11+
* You are free to use this software under the terms of the GNU General
12+
* Public License, but WITHOUT ANY WARRANTY; without even the implied
13+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
* See the GNU General Public License for more details.
15+
*
16+
* Alternatively for commercial application, you can contact us
17+
* by email <business@rt-thread.com> for commercial license.
518
*
619
* Change Logs:
720
* Date Author Notes

module/wn_module_cgi.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
/*
2-
* Copyright (c) 2006-2022, RT-Thread Development Team
2+
* File : wn_module_cgi.c
3+
* This file is part of RT-Thread RTOS
4+
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
35
*
4-
* SPDX-License-Identifier: Apache-2.0
6+
* This software is dual-licensed: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation. For the terms of this
9+
* license, see <http://www.gnu.org/licenses/>.
10+
*
11+
* You are free to use this software under the terms of the GNU General
12+
* Public License, but WITHOUT ANY WARRANTY; without even the implied
13+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
* See the GNU General Public License for more details.
515
*
616
* Alternatively for commercial application, you can contact us
717
* by email <business@rt-thread.com> for commercial license.
@@ -23,7 +33,7 @@
2333

2434
#ifdef WEBNET_USING_CGI
2535

26-
#define CGI_ROOT_PATH_MAX 64
36+
#define CGI_ROOT_PATH_MAX 64
2737

2838
static char _cgi_root[CGI_ROOT_PATH_MAX] = {0};
2939
struct webnet_cgi_item

0 commit comments

Comments
 (0)