diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 785b79f0..27b689fb 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -64,7 +64,7 @@ jobs: steps: - uses: actions/checkout@v4 with: { fetch-depth: 2 } - - run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test s390 SSL=${{ matrix.ssl }} + - run: sudo apt -y update ; sudo apt -y install binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test s390 SSL=${{ matrix.ssl }} armhf: runs-on: ubuntu-latest strategy: @@ -75,7 +75,7 @@ jobs: steps: - uses: actions/checkout@v4 with: { fetch-depth: 2 } - - run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test armhf SSL=${{ matrix.ssl }} + - run: sudo apt -y update ; sudo apt -y install binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test armhf SSL=${{ matrix.ssl }} unamalgamated-mg_prefix: runs-on: ubuntu-latest strategy: @@ -301,6 +301,8 @@ jobs: with: { fetch-depth: 2 } - run: echo # nothing specific to install or do - run: make -C examples/arduino arduino-xiao +# TODO(): - run: make -C examples/arduino arduino-esp32 +# TODO(): - run: make -C examples/arduino arduino-teensy41 # - run: make -C examples/arduino arduino-nano - run: make -C examples/arduino clean diff --git a/.github/workflows/quicktest.yml b/.github/workflows/quicktest.yml index 4b09b30f..e791275c 100644 --- a/.github/workflows/quicktest.yml +++ b/.github/workflows/quicktest.yml @@ -33,7 +33,7 @@ jobs: with: { fetch-depth: 2 } - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi - if: ${{ env.GO == 1 }} - run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test s390 + run: sudo apt -y update ; sudo apt -y install binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test s390 armhf: runs-on: ubuntu-latest steps: @@ -41,7 +41,7 @@ jobs: with: { fetch-depth: 2 } - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi - if: ${{ env.GO == 1 }} - run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test armhf + run: sudo apt -y update ; sudo apt -y install binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test armhf unamalgamated-mg_prefix: runs-on: ubuntu-latest steps: diff --git a/examples/arduino/Makefile b/examples/arduino/Makefile index 6e158828..bebf4498 100644 --- a/examples/arduino/Makefile +++ b/examples/arduino/Makefile @@ -14,6 +14,7 @@ arduino-xiao-board: ./arduino/arduino --install-boards Seeeduino:samd arduino-xiao: arduino arduino-xiao-board + cd sim800-mqtt && ../arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 sim800-mqtt.ino cd w5500-http && ../arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-http.ino cd w5500-mqtt && ../arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-mqtt.ino @@ -21,6 +22,18 @@ arduino-nano: arduino cd w5500-http && ../arduino/arduino --pref compiler.cpp.extra_flags=-DMG_ENABLE_LOG=0 --verbose --verify --board arduino:avr:nano w5500-http.ino cd w5500-mqtt && ../arduino/arduino --pref compiler.cpp.extra_flags=-DMG_ENABLE_LOG=0 --verbose --verify --board arduino:avr:nano w5500-mqtt.ino +arduino-esp32: arduino +# cd esp32-http && ../arduino/arduino --verbose --verify --board esp32-http.ino +# esp32-mqtt + +arduino-teensy41: arduino +# cd teensy41-http && ../arduino/arduino --verbose --verify --board teensy41-http.ino + + + + + + clean: rm -rf arduino diff --git a/examples/pico-sdk/pico-rmii/Makefile b/examples/pico-sdk/pico-rmii/Makefile index 08adf5f2..8ed60d61 100644 --- a/examples/pico-sdk/pico-rmii/Makefile +++ b/examples/pico-sdk/pico-rmii/Makefile @@ -13,7 +13,7 @@ build: pico-sdk cd build && cmake -G "Unix Makefiles" .. && make pico-sdk: - git clone --depth 1 -b 1.4.0 https://github.com/raspberrypi/pico-sdk $@ + git clone --depth 1 -b 2.1.0 https://github.com/raspberrypi/pico-sdk $@ cd $@ && git submodule update --init clean: diff --git a/examples/pico-sdk/pico-rndis-dashboard/Makefile b/examples/pico-sdk/pico-rndis-dashboard/Makefile index 5af7835e..7f7334e2 100644 --- a/examples/pico-sdk/pico-rndis-dashboard/Makefile +++ b/examples/pico-sdk/pico-rndis-dashboard/Makefile @@ -13,7 +13,7 @@ build build/firmware.uf2: pico-sdk main.c net.c cd build && cmake -G "Unix Makefiles" .. && make pico-sdk: - git clone --depth 1 -b 1.5.0 https://github.com/raspberrypi/pico-sdk $@ + git clone --depth 1 -b 2.1.0 https://github.com/raspberrypi/pico-sdk $@ cd $@ && git submodule update --init clean: diff --git a/examples/pico-sdk/pico-rndis-dashboard/main.c b/examples/pico-sdk/pico-rndis-dashboard/main.c index e31e0787..ab5fc83d 100644 --- a/examples/pico-sdk/pico-rndis-dashboard/main.c +++ b/examples/pico-sdk/pico-rndis-dashboard/main.c @@ -8,7 +8,7 @@ static struct mg_tcpip_if *s_ifp; -const uint8_t tud_network_mac_address[6] = {2, 2, 0x84, 0x6A, 0x96, 0}; +uint8_t tud_network_mac_address[6] = {2, 2, 0x84, 0x6A, 0x96, 0}; static void blink_cb(void *arg) { // Blink periodically gpio_put(PICO_DEFAULT_LED_PIN, !gpio_get_out_level(PICO_DEFAULT_LED_PIN)); diff --git a/examples/pico-sdk/pico-rndis-device/Makefile b/examples/pico-sdk/pico-rndis-device/Makefile index 5af7835e..7f7334e2 100644 --- a/examples/pico-sdk/pico-rndis-device/Makefile +++ b/examples/pico-sdk/pico-rndis-device/Makefile @@ -13,7 +13,7 @@ build build/firmware.uf2: pico-sdk main.c net.c cd build && cmake -G "Unix Makefiles" .. && make pico-sdk: - git clone --depth 1 -b 1.5.0 https://github.com/raspberrypi/pico-sdk $@ + git clone --depth 1 -b 2.1.0 https://github.com/raspberrypi/pico-sdk $@ cd $@ && git submodule update --init clean: diff --git a/examples/pico-sdk/pico-rndis-device/main.c b/examples/pico-sdk/pico-rndis-device/main.c index af168620..2d72cfd1 100644 --- a/examples/pico-sdk/pico-rndis-device/main.c +++ b/examples/pico-sdk/pico-rndis-device/main.c @@ -25,7 +25,7 @@ int hal_led_pin(void) { static struct mg_tcpip_if *s_ifp; -const uint8_t tud_network_mac_address[6] = {2, 2, 0x84, 0x6A, 0x96, 0}; +uint8_t tud_network_mac_address[6] = {2, 2, 0x84, 0x6A, 0x96, 0}; bool tud_network_recv_cb(const uint8_t *buf, uint16_t len) { mg_tcpip_qwrite((void *) buf, len, s_ifp); diff --git a/examples/pico-sdk/pico-rndis-device/mongoose_config.h b/examples/pico-sdk/pico-rndis-device/mongoose_config.h index c2729977..2c88e5c6 100644 --- a/examples/pico-sdk/pico-rndis-device/mongoose_config.h +++ b/examples/pico-sdk/pico-rndis-device/mongoose_config.h @@ -3,4 +3,3 @@ #define MG_ENABLE_TCPIP 1 #define MG_ENABLE_TCPIP_DRIVER_INIT 0 #define MG_ENABLE_PACKED_FS 1 - diff --git a/test/unit_test.c b/test/unit_test.c index 7aa994d5..e6d1bb15 100644 --- a/test/unit_test.c +++ b/test/unit_test.c @@ -1469,6 +1469,7 @@ static void test_http_no_content_length(void) { char buf[100]; struct mg_mgr mgr; const char *url = "http://127.0.0.1:12348"; + const char *url2 = "http://127.0.0.1:12349"; int i; const char *post_req = "POST / HTTP/1.1\r\nContent-Type:" @@ -1482,17 +1483,17 @@ static void test_http_no_content_length(void) { ASSERT(strcmp(buf1, "mc") == 0); ASSERT(strcmp(buf2, "mc") == 0); mg_mgr_free(&mgr); - + // 12348 is in TIME_WAIT, use another port mg_mgr_init(&mgr); - mg_http_listen(&mgr, url, f41, (void *) NULL); - ASSERT(fetch(&mgr, buf, url, "POST / HTTP/1.1\r\n\r\n") == 411); - ASSERT(fetch(&mgr, buf, url, "HTTP/1.1 200\r\n\r\n") == 411); - ASSERT(fetch(&mgr, buf, url, "HTTP/1.1 100\r\n\r\n") != 411); - ASSERT(fetch(&mgr, buf, url, "HTTP/1.1 304\r\n\r\n") != 411); - ASSERT(fetch(&mgr, buf, url, "HTTP/1.1 305\r\n\r\n") == 411); - ASSERT(fetch(&mgr, buf, url, post_req) != 411); + mg_http_listen(&mgr, url2, f41, (void *) NULL); + ASSERT(fetch(&mgr, buf, url2, "POST / HTTP/1.1\r\n\r\n") == 411); + ASSERT(fetch(&mgr, buf, url2, "HTTP/1.1 200\r\n\r\n") == 411); + ASSERT(fetch(&mgr, buf, url2, "HTTP/1.1 100\r\n\r\n") != 411); + ASSERT(fetch(&mgr, buf, url2, "HTTP/1.1 304\r\n\r\n") != 411); + ASSERT(fetch(&mgr, buf, url2, "HTTP/1.1 305\r\n\r\n") == 411); + ASSERT(fetch(&mgr, buf, url2, post_req) != 411); // Check it is processed only once (see #2811) - ASSERT(fpr(&mgr, buf, url, "POST / HTTP/1.1\r\n\r\n") == 411); + ASSERT(fpr(&mgr, buf, url2, "POST / HTTP/1.1\r\n\r\n") == 411); mg_mgr_free(&mgr); ASSERT(mgr.conns == NULL); } @@ -1772,7 +1773,7 @@ static void ehr(struct mg_connection *c, int ev, void *ev_data) { static void test_http_range(void) { struct mg_mgr mgr; - const char *url = "http://127.0.0.1:12349"; + const char *url = "http://127.0.0.1:12350"; struct mg_http_message hm; char buf[FETCH_BUF_SIZE];