Skip to content

Commit f7fc8ab

Browse files
authored
Use HTTP method table from ESP-IDF's nghttp (espressif#4900)
Fixes: espressif#4884 * Use HTTP method table from ESP-IDF's nghttp * Parse methods using IDF's HTTP method list * Make example's loops to allow the CPU to switch tasks
1 parent dd834b3 commit f7fc8ab

File tree

11 files changed

+32
-22
lines changed

11 files changed

+32
-22
lines changed

‎libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ void setup(void){
125125

126126
voidloop(void){
127127
server.handleClient();
128+
delay(2);//allow the cpu to switch to other tasks
128129
}
129130

130131
voiddrawGraph(){

‎libraries/WebServer/examples/FSBrowser/FSBrowser.ino‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,5 @@ void setup(void){
300300

301301
voidloop(void){
302302
server.handleClient();
303+
delay(2);//allow the cpu to switch to other tasks
303304
}

‎libraries/WebServer/examples/HelloServer/HelloServer.ino‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ void setup(void){
7070

7171
voidloop(void){
7272
server.handleClient();
73+
delay(2);//allow the cpu to switch to other tasks
7374
}

‎libraries/WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@ void setup(){
5656
voidloop(){
5757
ArduinoOTA.handle();
5858
server.handleClient();
59+
delay(2);//allow the cpu to switch to other tasks
5960
}

‎libraries/WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ void setup(){
3838
voidloop(){
3939
ArduinoOTA.handle();
4040
server.handleClient();
41+
delay(2);//allow the cpu to switch to other tasks
4142
}

‎libraries/WebServer/examples/PathArgServer/PathArgServer.ino‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ void setup(void){
5353

5454
voidloop(void){
5555
server.handleClient();
56+
delay(2);//allow the cpu to switch to other tasks
5657
}

‎libraries/WebServer/examples/SDWebServer/SDWebServer.ino‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,5 @@ void setup(void){
310310

311311
voidloop(void){
312312
server.handleClient();
313+
delay(2);//allow the cpu to switch to other tasks
313314
}

‎libraries/WebServer/examples/SimpleAuthentification/SimpleAuthentification.ino‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,5 @@ void setup(void){
129129

130130
voidloop(void){
131131
server.handleClient();
132+
delay(2);//allow the cpu to switch to other tasks
132133
}

‎libraries/WebServer/examples/WebUpdate/WebUpdate.ino‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ void setup(void){
6565

6666
voidloop(void){
6767
server.handleClient();
68-
delay(1);
68+
delay(2);//allow the cpu to switch to other tasks
6969
}
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
#ifndef_HTTP_Method_H_
22
#define_HTTP_Method_H_
33

4-
typedefenum{
5-
HTTP_GET=0b00000001,
6-
HTTP_POST=0b00000010,
7-
HTTP_DELETE=0b00000100,
8-
HTTP_PUT=0b00001000,
9-
HTTP_PATCH=0b00010000,
10-
HTTP_HEAD=0b00100000,
11-
HTTP_OPTIONS=0b01000000,
12-
HTTP_ANY=0b01111111,
13-
} HTTPMethod;
4+
#include"http_parser.h"
5+
6+
typedefenumhttp_methodHTTPMethod;
7+
#defineHTTP_ANY (HTTPMethod)(255)
148

159
#endif/* _HTTP_Method_H_ */

0 commit comments

Comments
(0)