mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-09 16:21:45 +00:00
Fix build error
This commit is contained in:
1 parent
dd6bffdd0d
commit
2bab274056
2 files changed
+11
-15
No files matched your search
@@ -127,7 +127,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with: { fetch-depth: 2 }
|
with: { fetch-depth: 2 }
|
||||||
- run: if ./test/match_changed_files.sh "^src|examples/stm32/nucleo-f7" ; then echo GO=1 >> $GITHUB_ENV ; fi
|
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-f7" ; then echo GO=1 >> $GITHUB_ENV ; fi
|
||||||
- if: ${{ env.GO == 1 }}
|
- if: ${{ env.GO == 1 }}
|
||||||
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
|
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
|
||||||
- if: ${{ env.GO == 1 }}
|
- if: ${{ env.GO == 1 }}
|
||||||
@@ -142,7 +142,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with: { fetch-depth: 2 }
|
with: { fetch-depth: 2 }
|
||||||
- run: if ./test/match_changed_files.sh "^src|examples/stm32/nucleo-f4" ; then echo GO=1 >> $GITHUB_ENV ; fi
|
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-f4" ; then echo GO=1 >> $GITHUB_ENV ; fi
|
||||||
- if: ${{ env.GO == 1 }}
|
- if: ${{ env.GO == 1 }}
|
||||||
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
|
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
|
||||||
- if: ${{ env.GO == 1 }}
|
- if: ${{ env.GO == 1 }}
|
||||||
@@ -155,7 +155,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with: { fetch-depth: 3 }
|
with: { fetch-depth: 3 }
|
||||||
- run: if ./test/match_changed_files.sh "^src|examples/stm32/nucleo-h7" ; then echo GO=1 >> $GITHUB_ENV ; fi
|
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h7" ; then echo GO=1 >> $GITHUB_ENV ; fi
|
||||||
- if: ${{ env.GO == 1 }}
|
- if: ${{ env.GO == 1 }}
|
||||||
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
|
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
|
||||||
- if: ${{ env.GO == 1 }}
|
- if: ${{ env.GO == 1 }}
|
||||||
@@ -166,7 +166,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with: { fetch-depth: 2 }
|
with: { fetch-depth: 2 }
|
||||||
- run: if ./test/match_changed_files.sh "^src|examples/ti/ek-tm4c" ; then echo GO=1 >> $GITHUB_ENV ; fi
|
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/ti/ek-tm4c" ; then echo GO=1 >> $GITHUB_ENV ; fi
|
||||||
- if: ${{ env.GO == 1 }}
|
- if: ${{ env.GO == 1 }}
|
||||||
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
|
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
|
||||||
- run: echo GO=0 > $GITHUB_ENV ; if ./test/match_changed_files.sh "^src|examples/ti/ek-tm4c1294xl-baremetal" ; then echo GO=1 > $GITHUB_ENV ; fi
|
- run: echo GO=0 > $GITHUB_ENV ; if ./test/match_changed_files.sh "^src|examples/ti/ek-tm4c1294xl-baremetal" ; then echo GO=1 > $GITHUB_ENV ; fi
|
||||||
@@ -181,7 +181,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with: { fetch-depth: 2 }
|
with: { fetch-depth: 2 }
|
||||||
- run: if ./test/match_changed_files.sh "^src|examples/rp2040/pico-w5500" ; then echo GO=1 >> $GITHUB_ENV ; fi
|
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/rp2040/pico-w5500" ; then echo GO=1 >> $GITHUB_ENV ; fi
|
||||||
- if: ${{ env.GO == 1 }}
|
- if: ${{ env.GO == 1 }}
|
||||||
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
|
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
|
||||||
- if: ${{ env.GO == 1 }}
|
- if: ${{ env.GO == 1 }}
|
||||||
|
|||||||
@@ -149,8 +149,8 @@ static void handle_stats_get(struct mg_connection *c) {
|
|||||||
|
|
||||||
static size_t print_events(void (*out)(char, void *), void *ptr, va_list *ap) {
|
static size_t print_events(void (*out)(char, void *), void *ptr, va_list *ap) {
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
int page_number = va_arg(*ap, int);
|
int pageno = va_arg(*ap, int);
|
||||||
int start = (page_number - 1) * EVENTS_PER_PAGE;
|
int start = (pageno - 1) * EVENTS_PER_PAGE;
|
||||||
int end = start + EVENTS_PER_PAGE;
|
int end = start + EVENTS_PER_PAGE;
|
||||||
|
|
||||||
for (int i = start; i < end && i < events_no; i++) {
|
for (int i = start; i < end && i < events_no; i++) {
|
||||||
@@ -166,17 +166,13 @@ static size_t print_events(void (*out)(char, void *), void *ptr, va_list *ap) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void handle_events_get(struct mg_connection *c, struct mg_str query) {
|
static void handle_events_get(struct mg_connection *c, struct mg_str query) {
|
||||||
int page_number;
|
int pageno;
|
||||||
bool is_last_page;
|
|
||||||
|
|
||||||
// query is represented by 'page=<page_id>'
|
// query is represented by 'page=<page_id>'
|
||||||
page_number = atoi(query.ptr + 5);
|
pageno = atoi(query.ptr + 5);
|
||||||
if (page_number > events_no / EVENTS_PER_PAGE + 1 || page_number < 1)
|
if (pageno > events_no / EVENTS_PER_PAGE + 1 || pageno < 1) pageno = 1;
|
||||||
page_number = 1;
|
|
||||||
|
|
||||||
mg_http_reply(c, 200, s_json_header, "{%m:[%M], %m:%d}", MG_ESC("arr"),
|
mg_http_reply(c, 200, s_json_header, "{%m:[%M], %m:%d}", MG_ESC("arr"),
|
||||||
print_events, page_number,
|
print_events, pageno, MG_ESC("totalCount"), events_no);
|
||||||
MG_ESC("totalCount"), events_no);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_settings_set(struct mg_connection *c, struct mg_str body) {
|
static void handle_settings_set(struct mg_connection *c, struct mg_str body) {
|
||||||
|
|||||||
Reference in new issue
Block a user