Compare commits

...
1713 Commits
Author SHA1 Message Date
Sergio R. Caprile 739d78a45a update version 2025-08-21 13:13:25 -03:00
Sergio R. Caprile 8a62633b2f keep, linked by other examples 2025-08-14 11:38:48 -03:00
Sergio R. Caprile aae1a687a9 Merge pull request #3235 from cesanta/client
Refactor HTTP client
2025-08-14 11:00:23 -03:00
Sergio R. Caprile 61285ec418 cleanup 2025-08-14 10:59:07 -03:00
Sergio R. Caprile a00b3f1c6c Merge pull request #3241 from cesanta/mingw
Fixed mingw build error
2025-08-13 10:48:53 -03:00
robert 2c813f3e72 Fixed mingw build error 2025-08-13 05:17:34 -04:00
Sergio R. Caprile ea68d7a705 Merge pull request #3240 from cesanta/ppp
fix ppp driver
2025-08-12 17:51:40 -03:00
Sergio R. Caprile 654f401038 fix ppp driver 2025-08-12 17:21:36 -03:00
Sergio R. Caprile ad89122a06 Merge pull request #3237 from cesanta/tests
Fix built-in TLS CA bundle, cleanup
2025-08-12 16:34:51 -03:00
Sergio R. Caprile 73ed158e76 Fix built-in TLS CA bundle, cleanup 2025-08-12 16:10:12 -03:00
Sergio R. Caprile 548c3dc77f fix #9f76ea8 breaking bigendian 2025-08-12 15:57:26 -03:00
Sergio R. Caprile c1fa067a1f Merge pull request #3236 from cesanta/tls
Verify host against CN, too
2025-08-12 12:09:23 -03:00
Sergey Lyubka 9fd87060f9 Verify host against CN, too 2025-08-12 15:49:08 +01:00
Sergey Lyubka de0a3b035a Refactor HTTP client 2025-08-12 09:21:38 +01:00
Sergey Lyubka 9f76ea8030 CHACHA20 -> MG_ENABLE_CHACHA20 2025-08-12 08:42:20 +01:00
Sergio R. Caprile 76b7356873 Zephyr wants _DEBUG to provide mbedtls_strerror() 2025-08-11 13:23:51 -03:00
novlean c24d5aabd8 Merge pull request #3231 from cesanta/novlean-patch-2
Update README.md
2025-08-06 14:38:25 +01:00
novlean 0df6645b90 Update README.md 2025-08-06 14:38:11 +01:00
Sergey Lyubka b19cf8654f Merge pull request #3203 from cesanta/dns
Built-in TCP/IP (re-)starts DNS connection on DHCP link up
2025-08-01 12:13:39 +01:00
Sergey Lyubka 19933a4673 Merge pull request #3222 from cesanta/mbedrbose
Add verbose MbedTLS errors
2025-08-01 12:10:20 +01:00
Sergio R. Caprile 76963f7d01 Merge pull request #3229 from cesanta/tests
fix possible overflow, improve tests
2025-07-31 13:50:42 -03:00
Sergio R. Caprile e670ea3d61 fix possible overflow, improve tests 2025-07-31 13:43:18 -03:00
Sergio R. Caprile fa33b57e4f Merge pull request #3228 from cesanta/tests
mask built-in TCP/IP with WolfSSL test
2025-07-30 17:10:16 -03:00
Sergio R. Caprile 77e369bc79 mask built-in TCP/IP with WolfSSL test 2025-07-30 17:09:42 -03:00
Sergio R. Caprile 94ad9767d3 Merge pull request #3225 from cesanta/tests
ChaCha20 not working in S390 (bigendian)
2025-07-30 16:15:40 -03:00
Sergio R. Caprile aa76f5673b ChaCha20 not working in S390 (bigendian) 2025-07-30 16:13:34 -03:00
Sergio R. Caprile 81a699c801 Merge pull request #3224 from cesanta/tests
Fix tests
2025-07-29 17:26:07 -03:00
Sergio R. Caprile bd15c456b2 Fix tests
Fix Ubuntu starting Mosquitto right after install
Skip TLS on localhost on MacOS with MbedTLS
fix MQTT_LOCALHOST for built-in TCP/IP tests
2025-07-29 17:17:03 -03:00
Sergio R. Caprile 10d9e1e9ae Merge pull request #3223 from cesanta/zephyr
Improve 4.2 test time
2025-07-29 11:22:56 -03:00
Sergio R. Caprile 6a3813f633 Improve 4.2 test time
fix for intermediate releases
2025-07-29 11:19:16 -03:00
Sergio R. Caprile 51fe22a95f Add verbose MbedTLS errors 2025-07-28 16:18:53 -03:00
Sergio R. Caprile 105762416f Merge pull request #3221 from cesanta/tests
add tests for Zephyr 4.2.0
2025-07-28 15:07:50 -03:00
Sergio R. Caprile db7087f455 add tests for Zephyr 4.2.0 2025-07-28 14:43:09 -03:00
Sergio R. Caprile c5693503cb Merge pull request #3220 from cesanta/zephyr
update to Zephyr 4.2.0
2025-07-28 11:26:03 -03:00
Sergio R. Caprile b74590a4a5 update to Zephyr 4.2.0 2025-07-28 11:25:02 -03:00
Sergio R. Caprile d5eeed48eb Merge pull request #3219 from cesanta/tests
workaround GH storage
2025-07-28 10:44:53 -03:00
Sergio R. Caprile fc5c0d0964 workaround GH storage 2025-07-28 10:28:18 -03:00
robert aa2647c0bc clang format 2025-07-28 04:11:22 -04:00
robertc2000 cef0acdb40 Merge pull request #3218 from cesanta/same54-driver-update
Update same54 driver
2025-07-28 11:07:47 +03:00
robert 2140656acc Update same54 driver 2025-07-28 03:55:00 -04:00
Sergio R. Caprile fd0c969f16 Merge pull request #3217 from cesanta/tests
move Zephyr tests to their own script
2025-07-25 17:08:19 -03:00
Sergio R. Caprile dfeb929e0e move Zephyr tests to their own script 2025-07-25 17:07:06 -03:00
Sergio R. Caprile d3e67733a6 Merge pull request #3216 from cesanta/tests
Tests
2025-07-25 11:44:36 -03:00
Sergio R. Caprile eff74fdc9d Zephyr: only clean if there's a build 2025-07-25 11:38:30 -03:00
Sergio R. Caprile 5e4c40ad09 remove tailwindcss dependency 2025-07-25 11:33:49 -03:00
Sergio R. Caprile 087e6d3142 Merge pull request #3215 from cesanta/tests
fix mingw[++] tests, add local MQTTS
2025-07-24 18:43:57 -03:00
Sergio R. Caprile 587b074822 fix mingw[++] tests, add local MQTTS 2025-07-24 18:42:14 -03:00
Sergio R. Caprile 6aa8c01ac7 fix TLS text 2025-07-24 17:11:19 -03:00
Sergio R. Caprile 3bbcd5df3e Merge pull request #3214 from cesanta/tests
introduce local MQTT server, fix container calling, fill prerequisites
2025-07-24 16:10:08 -03:00
Sergio R. Caprile af512c57ef introduce local MQTT server, fix container calling, fill prerequisites 2025-07-24 15:54:58 -03:00
Sergio R. Caprile 58297a7871 remove obsolete example 2025-07-24 11:25:11 -03:00
Sergio R. Caprile 18a530048c Increase MQTT connect expected time 2025-07-24 10:15:09 -03:00
Sergio R. Caprile f9ed75d6b3 attempt to get reasons 2025-07-23 10:53:00 -03:00
Sergio R. Caprile 3c1f41e575 disable scheduled run 2025-07-23 10:33:51 -03:00
Sergio R. Caprile c772936dd1 enable manual run 2025-07-23 10:31:07 -03:00
Sergio R. Caprile 253696be45 Merge pull request #3213 from cesanta/tests
disable hw tests on quick test
2025-07-23 10:27:12 -03:00
Sergio R. Caprile 79b7accc55 disable hw tests on quick test 2025-07-23 10:26:34 -03:00
Sergio R. Caprile 7a1e846c73 Merge pull request #3211 from cesanta/ooofin
Fix ignoring SEQ on FIN
2025-07-23 08:34:05 -03:00
Sergio R. Caprile ce59ff89c3 Merge pull request #3212 from cesanta/tests
fix sh not being bash
2025-07-22 18:03:00 -03:00
Sergio R. Caprile d31d064d5e fix sh not being bash 2025-07-22 17:01:01 -03:00
Sergio R. Caprile 467fbf4bb4 Fix ignoring SEQ on FIN 2025-07-22 14:16:35 -03:00
Sergey Lyubka 6769223ce1 Nitpick: rename fn -> mqtt_ev_handler 2025-07-22 10:11:20 +01:00
Sergey Lyubka 294e483885 Nitpick: rename s_conn -> s_mqtt_conn 2025-07-22 10:10:14 +01:00
Sergey Lyubka 43513e2d56 Update MQTT client: enable keep alive, use rx/tx topics 2025-07-22 09:44:43 +01:00
Sergey Lyubka d1b7687e98 Fix comments 2025-07-21 23:01:43 +01:00
Sergey Lyubka 9ac09da1d2 Remove mg_http_run_simple_server - move to docs 2025-07-21 14:03:12 +01:00
Sergey Lyubka 24a330c750 Nits 2025-07-20 12:49:58 +01:00
Sergey Lyubka 13a9c773f2 mg_hello -> mg_http_run_simple_server() 2025-07-20 09:36:34 +01:00
Sergey Lyubka 3cd166d065 MG_ARCH_CUBE nitpicks 2025-07-19 08:33:48 +01:00
Sergio R. Caprile 490066fd17 Merge pull request #3209 from cesanta/tests
Fix misc warnings and nits
2025-07-18 17:40:53 -03:00
Sergio R. Caprile 94fce72ade Fix misc warnings and nits 2025-07-18 17:08:32 -03:00
Sergio R. Caprile eacc64bdd1 fix missing def 2025-07-18 16:44:38 -03:00
Sergio R. Caprile 7b037f4957 Merge pull request #3208 from cesanta/cube
Introduce MG_ARCH_CUBE, autodetect everything
2025-07-18 11:22:17 -03:00
Sergio R. Caprile fa841916c1 assorted nit picks 2025-07-18 11:19:58 -03:00
Sergey Lyubka 75c11436ff Introduce MG_ARCH_CUBE, autodetect everything 2025-07-17 17:29:48 +01:00
Sergio R. Caprile e07a8283ec Merge pull request #3207 from cesanta/hal
Autodetect STM32 in mg_millis()
2025-07-16 10:27:37 -03:00
Sergey Lyubka 2a174b0d3b Autodetect STM32 in mg_millis() 2025-07-16 07:38:29 +01:00
Sergey Lyubka 013993abae example configs 2025-07-16 07:37:25 +01:00
Sergey Lyubka dccc153c68 example configs 2025-07-16 07:37:07 +01:00
Sergio R. Caprile db0867f435 Merge pull request #3206 from cesanta/restrict
Avoid trashing VC++'s own proprietary restrict-like keyword
2025-07-15 16:55:52 -03:00
Sergio R. Caprile 7234121835 Avoid trashing VC++'s own propropietary restrict-like keyword 2025-07-15 16:47:06 -03:00
Sergio R. Caprile 3aafc073d8 unbreak after #8a9b1d9 2025-07-15 13:42:48 -03:00
Sergio R. Caprile b527ed313c Merge pull request #3204 from cesanta/tests
Moving tests from GH yaml to bash scripts and Makefiles
2025-07-15 11:27:24 -03:00
Sergio R. Caprile cd86559685 Move tests to bash scripts and Makefiles 2025-07-15 11:24:09 -03:00
Sergio R. Caprile f67e843be6 fix tests 2025-07-15 11:24:09 -03:00
Sergio R. Caprile 4f9ebd8092 Merge pull request #3202 from cesanta/gcc
Rename MG_ARCH_NEWLIB -> MG_ARCH_ARMGCC
2025-07-15 09:08:13 -03:00
Sergey Lyubka 6c044d6aeb Rename MG_ARCH_NEWLIB -> MG_ARCH_ARM_GCC 2025-07-15 11:22:17 +01:00
Sergio R. Caprile c6ee909aa4 uint16_t always >= 0 2025-07-14 15:12:50 -03:00
Sergio R. Caprile 393063428e Built-in TCP/IP (re-)starts DNS connection on link up 2025-07-14 15:06:31 -03:00
Sergio R. Caprile 1494f5e831 Merge pull request #3201 from cesanta/sntp
fix SNTP through proper protocol handler setup
2025-07-14 10:09:47 -03:00
Sergey Lyubka 8bfd0c2ca3 add config template 2025-07-13 07:34:48 +01:00
Sergey Lyubka e9de2f3eb1 Remove gurubase link - useless 2025-07-12 06:50:27 +01:00
Sergio R. Caprile 8bf9d09d96 fix SNTP through proper protocol handler setup 2025-07-11 16:56:12 -03:00
Sergio R. Caprile 67255ce8f5 fix broken links 2025-07-10 09:48:53 -03:00
Sergey Lyubka 5db89aa264 Update help message 2025-07-09 12:58:15 +01:00
Sergey Lyubka 8a9b1d9873 Simplify dashboard 2025-07-09 00:21:31 +01:00
Sergio R. Caprile c08c1afb1e Merge pull request #3198 from cesanta/c89
make it C89-friendly
2025-07-08 14:10:58 -03:00
Sergio R. Caprile 2c7f58aed2 test checksum primitives, enforce rx frag test 2025-07-08 13:57:03 -03:00
Sergio R. Caprile b3ee71acbe make TCP/IP C89-friendly 2025-07-08 11:15:32 -03:00
Sergio R. Caprile 52ab6bc499 make it C89-friendly 2025-07-07 15:15:31 -03:00
Sergio R. Caprile bf059ad42f Merge pull request #3197 from cesanta/select
select() minimum wait is now 1ms
2025-07-07 14:43:52 -03:00
Sergio R. Caprile 85df6a6131 select() minimum wait is now 1ms 2025-07-07 14:40:18 -03:00
Sergio R. Caprile d840b4a4ee Merge pull request #3196 from cesanta/tests
fix tests
2025-07-07 11:33:25 -03:00
Sergio R. Caprile a8c2ce544e fix tests 2025-07-07 11:32:31 -03:00
Sergio R. Caprile b95022a3b3 Merge pull request #3195 from cesanta/sanasan
remove false positive
2025-07-03 11:49:01 -03:00
Sergio R. Caprile 8c45a9d2c9 remove false positive 2025-07-03 10:53:59 -03:00
Sergio R. Caprile 0fe64fbff9 Merge pull request #3194 from cesanta/udpret
mg_send and mg_io_send now honor UDP failures
2025-07-02 17:00:50 -03:00
Sergio R. Caprile 64e806628b Merge pull request #3188 from cesanta/wintls
Fix incorrect reference to a Windows compiler
Fix memory leaks in RSA signature verificator
2025-07-02 16:49:32 -03:00
Sergio R. Caprile ccd2b2699f fix memory leaks in RSA verification function 2025-07-02 16:40:36 -03:00
Sergio R. Caprile 0b5c0c9889 mg_send now honors UDP failures 2025-07-02 10:04:24 -03:00
robertc2000 6293e7dbec Merge pull request #3193 from cesanta/driver-macro
Removed MG_DRIVER_* macros
2025-07-02 13:08:39 +03:00
robert 87325ece82 Removed MG_DRIVER_* macros 2025-07-02 05:03:32 -04:00
Sergio R. Caprile 6cbd9b3067 Merge pull request #3192 from cesanta/freeunix
fix unix detection in wrong place
2025-07-01 16:32:20 -03:00
Sergio R. Caprile aa27fde9d0 fix unix detection in wrong place 2025-07-01 16:28:13 -03:00
Sergio R. Caprile e854585802 Improve Zephyr support 2025-06-30 10:35:53 -03:00
Sergio R. Caprile 2c5aba24cc Merge pull request #3189 from cesanta/zephyrotahack
Improve Zephyr support
2025-06-27 14:13:17 -03:00
Sergio R. Caprile 806ee0f2cb Improve Zephyr support 2025-06-27 14:11:04 -03:00
Sergey Lyubka e72b95fb1c Fix tutorials/http/http-server build with windows gcc 2025-06-27 14:33:44 +01:00
Sergey Lyubka 471e7ff61a Left-align tables 2025-06-26 10:42:47 +01:00
Sergey Lyubka 3d2de154d1 Add support matrix 2025-06-26 10:40:15 +01:00
Sergio R. Caprile fc551ec2e9 Merge pull request #3182 from cesanta/calloc
Introduce mg_calloc and MG_ENABLE_CUSTOM_CALLOC
2025-06-24 16:32:28 -03:00
Sergio R. Caprile f5e2c68c8b update examples 2025-06-24 16:26:31 -03:00
Sergey Lyubka 074ef5197b Introduce mg_calloc 2025-06-24 10:52:44 +01:00
Sergey Lyubka 5f1f4a0df8 malloc -> calloc 2025-06-24 09:12:38 +01:00
Sergey Lyubka 86334e9040 Keep only one listener 2025-06-24 08:57:49 +01:00
Sergey Lyubka f71cc3ebc3 Merge pull request #3173 from cesanta/chachaleak
Avoid chacha20 header leaking its redefinitions
2025-06-18 10:47:19 +01:00
Sergio R. Caprile 00910462e7 Merge pull request #3174 from cesanta/wka
Allow KA from erroneous implementations
2025-06-17 15:17:29 -03:00
Sergio R. Caprile 2fc56dd1d0 Allow KA from erroneous implementations 2025-06-17 15:14:30 -03:00
Sergio R. Caprile a5ebe71394 Avoid chacha20 header leaking its redefinitions 2025-06-17 12:12:48 -03:00
Sergio R. Caprile 0eb8bf6b51 Merge pull request #3167 from cesanta/threadx
Add MG_ARCH_TREADX
2025-06-16 10:51:16 -03:00
Sergey Lyubka 3a0fe5288c Add MG_ARCH_TREADX 2025-06-16 11:09:41 +01:00
Sergey Lyubka bfca233160 Merge pull request #3170 from cesanta/keepack
Add Keep-Alive ACK
2025-06-12 08:37:00 +01:00
Sergio R. Caprile acf217601b Add Keep-Alive ACK 2025-06-11 14:25:05 -03:00
Sergio R. Caprile b0d0fbfd9f clarify bridging for Wi-Fi 2025-06-11 09:31:24 -03:00
Sergio R. Caprile 9411f1c7b6 Merge pull request #3165 from cesanta/wifi612
Add Wi-Fi example for RW-612
2025-06-06 18:39:35 -03:00
Sergio R. Caprile d7d7ebf99a Add Wi-Fi example for RW-612 2025-06-06 18:26:27 -03:00
novlean 8072ae2057 Update README.md 2025-06-06 16:34:19 +01:00
Sergio R. Caprile e529e644ab Merge pull request #3164 from cesanta/asan
avoid ASAN reporting read overflows
2025-06-06 09:03:02 -03:00
Sergio R. Caprile d6fdfe5b1b avoid ASAN reporting read overflows 2025-06-05 17:26:56 -03:00
Sergio R. Caprile 50e15e574f Merge pull request #3163 from cesanta/test
expand test coverage
2025-06-05 14:24:47 -03:00
Sergio R. Caprile 58f1533779 expand test coverage 2025-06-05 14:24:03 -03:00
Sergio R. Caprile f4a49829ea unbreak FreeRTOS (#3158) 2025-06-05 14:03:26 -03:00
Sergio R. Caprile 3efe6641eb Merge pull request #3161 from cesanta/fix
Unbreak MbedTLS (#3148), rollback debugging leftovers
2025-06-04 09:08:32 -03:00
Sergio R. Caprile 0459d9e106 Unbreak MbedTLS (#3148), rollback debugging leftovers 2025-06-04 09:05:27 -03:00
Sergio R. Caprile 305d69ee36 Merge pull request #3159 from cesanta/isacheese
fix error introduced in #3149
2025-06-03 15:41:13 -03:00
Sergio R. Caprile 98e744a9ad fix error introduced in #3149 2025-06-03 15:29:28 -03:00
Sergey Lyubka 1d97f2e2b5 Enable POSIX_FS on ESP32 2025-06-03 08:23:05 +01:00
Sergio R. Caprile c92bc4b4ac Merge pull request #3158 from cesanta/posiz
Redefine mkdir only if MG_ENABLE_POSIX_FS==0
2025-06-02 11:06:09 -03:00
Sergey Lyubka 6a3e1e41c4 Redefine mkdir only if MG_ENABLE_POSIX_FS==0 2025-06-02 11:04:16 -03:00
Sergio R. Caprile 650caface3 fix duplicates 2025-05-30 10:03:01 -03:00
novlean 8b6e02e985 Merge pull request #3154 from cesanta/novlean-patch-2
Update README.md - stm32 websocket article
2025-05-29 17:01:52 +01:00
novlean 3ee6fe45f9 Update README.md 2025-05-29 17:01:05 +01:00
Sergio R. Caprile e811afd397 Merge pull request #3152 from cesanta/fuzzer
fix memory leak in fuzz test itself
2025-05-28 14:36:07 -03:00
Sergio R. Caprile b197a674e1 fix memory leak in fuzz test itself 2025-05-28 13:56:04 -03:00
Sergio R. Caprile 08f6b99b13 remove conditionals from CIfuzz 2025-05-28 11:57:27 -03:00
Sergio R. Caprile b18d0301f3 Update README.md 2025-05-28 11:46:49 -03:00
Sergio R. Caprile 5596621420 Update README.md 2025-05-28 11:05:37 -03:00
Sergio R. Caprile bd8a66eee7 Update README.md
GH changes in icon stuff
2025-05-28 11:02:07 -03:00
Sergio R. Caprile b62ebb3c10 Update README.md
GH changes in build icon
2025-05-28 10:59:57 -03:00
Sergio R. Caprile 45d796fe5b Merge pull request #3151 from cesanta/wonder
Add Portenta H7 STM32CubeIDE example
2025-05-27 17:27:43 -03:00
Sergio R. Caprile d8a3b90cad Add Portenta H7 STM32CubeIDE example 2025-05-27 17:26:26 -03:00
Sergio R. Caprile 5be9e55425 Merge pull request #3142 from cesanta/wonder
Add support for SDIO
2025-05-26 10:07:41 -03:00
Sergio R. Caprile 6b6acd3967 Merge pull request #3149 from cesanta/is_tls
set is_tls at mg_listen and mg_connect level
2025-05-26 10:06:38 -03:00
Sergio R. Caprile 1b06403a19 Add support for SDIO
Add support for SDIO in CYW driver
Add Portenta H7 example
2025-05-26 10:04:44 -03:00
Sergio R. Caprile b740c80855 set is_tls at mg_listen and mg_connect level 2025-05-26 09:42:48 -03:00
Sergey Lyubka 29594283c1 Merge pull request #3148 from cesanta/iowaitormsscapped
flush TLS buffer
2025-05-26 11:38:41 +01:00
Sergio R. Caprile 51f54f9b7e Merge pull request #3147 from cesanta/ra8-eth
RA8 eth and phy support
2025-05-23 14:23:52 -03:00
Sergio R. Caprile 1f48b1ca65 flush TLS buffer 2025-05-23 14:04:59 -03:00
robert fd2d7cccf3 RA8 eth and phy support 2025-05-23 10:15:49 -04:00
Sergio R. Caprile 5726e680ec Merge pull request #3143 from cesanta/fairplay
Make built-in TLS play fair to TCP
2025-05-23 10:22:56 -03:00
Sergio R. Caprile fadf28adb4 Make built-in TLS play fair to TCP
Handshake functions in Mongoose TLS assumed data was being fully sent
after calling mg_io_send(). This was in fact the case with the usual 1460-bytes MSS, but not with the default 536-bytes MSS.
This PR removes all those calls from individual handshake functions, actual send is done at the main handshake function, keeping track of the amount of data sent, and so handling small MTUs/MSSs and possible MG_IO_WAITs when running over a socket layer.
2025-05-22 14:45:46 -03:00
novlean a321c2d096 Merge pull request #3146 from cesanta/novlean-patch-2
Update README.md
2025-05-22 17:59:06 +01:00
novlean bbb07bf6f7 Update README.md 2025-05-22 17:58:42 +01:00
Sergio R. Caprile a801160bc0 collaterals #3140
We prepend current path to the URI, so a tilde could not be the first
char in a path. However, the same would happen for double dots, and
since we're already checking for that, it doesn't hurt to be on the safe
side for future's sake.
2025-05-21 10:43:14 -03:00
Sergio R. Caprile 662cc27f4f Merge pull request #3140 from dag10/master
Fix URIs or header values containing tildes being unparsable.
2025-05-21 09:58:30 -03:00
Sergio R. Caprile ccfe7e0724 update version 2025-05-21 09:46:14 -03:00
Sergio R. Caprile 8061a41b38 workaround 2025-05-19 09:22:59 -03:00
Drew Gottlieb d01aa01a51 Fix URIs or header values containing tildes being unparsable. 2025-05-15 17:13:15 -07:00
Sergio R. Caprile 39392b3690 Merge pull request #3139 from cesanta/freewill
free ifp on mgr_free
2025-05-15 18:04:42 -03:00
Sergio R. Caprile 54d4611eb6 call mg_tcpip_free from mg_mgr_free() 2025-05-15 17:37:40 -03:00
Sergio R. Caprile 34cdce750d Merge pull request #3138 from cesanta/pedantic
make clang happy
2025-05-15 17:11:22 -03:00
Sergio R. Caprile f3fafb6759 make clang happy 2025-05-15 17:09:29 -03:00
Sergio R. Caprile 0372c97ff5 add fuzz 2025-05-15 16:48:16 -03:00
Sergio R. Caprile b46136a0af Merge pull request #3137 from cesanta/testtls
add fuzz tests
2025-05-15 16:33:17 -03:00
Sergio R. Caprile ac3d41fb79 add fuzz tests 2025-05-15 16:32:42 -03:00
Sergio R. Caprile 14be42c868 INFO -> VERBOSE 2025-05-15 15:50:36 -03:00
robertc2000 f0ec14543a Merge pull request #3136 from cesanta/ra6-driver-init
RA6 driver init macro
2025-05-15 10:20:31 +03:00
robert f46c5b7214 RA6 driver init macro 2025-05-15 03:13:49 -04:00
Sergey Lyubka ccd6bcd95f Merge pull request #3132 from cesanta/tls
stronger bounds checking
2025-05-13 22:26:35 +01:00
Sergey Lyubka a3b63f3b0d Merge pull request #3130 from cesanta/longpost
fix broken TCP closure
2025-05-13 22:26:15 +01:00
Sergey Lyubka f2905a5e10 Merge pull request #3135 from cesanta/mss
Handle (specific) TCP options
2025-05-13 22:25:52 +01:00
Sergio R. Caprile 1ef6c6aeb5 Handle TCP options 2025-05-13 16:27:50 -03:00
robertc2000 bd53529b45 Merge pull request #3134 from cesanta/ota-rw612
OTA for FRDM-RW612
2025-05-13 10:33:41 +03:00
Sergio R. Caprile cc8ecc5a42 stronger bounds checking 2025-05-12 18:13:41 -03:00
robert 5a816a1d41 OTA for FRDM-RW612 2025-05-12 07:59:15 -04:00
robertc2000 9922286c67 Merge pull request #3131 from cesanta/ws-offset
Websocket offset validation enhancement
2025-05-09 13:05:20 +03:00
robert cdc439bc38 Websocket offset validation enhancement 2025-05-09 06:04:34 -04:00
Sergio R. Caprile ae8422e304 fix broken TCP closure 2025-05-08 13:40:02 -03:00
robert 539d080346 check null pointer 2025-05-07 08:40:07 -04:00
Sergey Lyubka 041ec6e1f8 Close if drained 2025-05-03 10:28:40 +01:00
Sergio R. Caprile f618fe125c Fix lwIP builds
fixes #3119

lwIP does not export ip_mreq by default, it requires enabling support for IGMP by setting LWIP_IGMP, with the associated extra stuff. Mongoose will print an error if mg_multicast_add() is called with no multicast support in lwIP.
2025-04-29 19:24:17 -03:00
Sergio R. Caprile 8ab514fabc make hexdump send CRLF 2025-04-28 12:33:31 -03:00
novlean 08ad2c3145 Merge pull request #3113 from cesanta/novlean-patch-2
Update README.md
2025-04-24 17:40:00 +01:00
novlean c64fd404d4 Update README.md
article
2025-04-24 17:39:51 +01:00
Sergio R. Caprile 143b0ac126 fix 2025-04-24 11:04:43 -03:00
Sergio R. Caprile c2e2432010 Merge pull request #3093 from cesanta/mdns-multicast
Added MDNS and driver support for multicast
2025-04-22 14:01:34 -03:00
Sergio R. Caprile 1d2a768184 refactor the rest of the drivers 2025-04-22 13:59:03 -03:00
novlean fb099641bc Merge pull request #3111 from cesanta/novlean-patch-2
Update README.md
2025-04-22 17:48:28 +01:00
novlean 6da9afbf29 Update README.md 2025-04-22 17:48:12 +01:00
Sergio R. Caprile dceb4beb09 Refactor MIP strategy and first driver (CMSIS) 2025-04-22 12:55:21 -03:00
robert 6f697db49d Added MDNS and driver support for multicast 2025-04-22 12:55:15 -03:00
Sergio R. Caprile b44193780e Merge pull request #3110 from cesanta/tlsfindata
Fix not reading last TLS small record with fast closure
2025-04-22 10:03:40 -03:00
Sergio R. Caprile 8e0212c3db Fix not reading last TLS small record with fast closure
Fixes #3104
MbedTLS API fairplay
2025-04-22 09:56:49 -03:00
Sergio R. Caprile 3861e2e1e7 Merge pull request #3097 from cesanta/builtdoze
fix missing weird types
2025-04-14 13:13:06 -03:00
Sergio R. Caprile 21eefa4b55 Merge pull request #3102 from cesanta/mipfin
Fix handling of FIN segments carrying data
2025-04-14 11:27:09 -03:00
Sergey Lyubka fb6c6aafeb Merge pull request #3100 from cesanta/timers
Fix #2768 - remove completed timers
2025-04-14 15:15:36 +01:00
Sergio R. Caprile df07426e78 Fix handling of FIN segments carrying data 2025-04-14 11:11:48 -03:00
Sergio R. Caprile 5cf1523a13 Merge pull request #3101 from cesanta/tlszero
workaround causing TLS libs to return zero
2025-04-14 10:40:36 -03:00
Sergio R. Caprile f2fe47e9f7 workaround causing TLS libs to return zero 2025-04-11 14:42:15 -03:00
Sergio R. Caprile 2557ab2e60 Merge pull request #3086 from cesanta/cywst
Add support for RM2 with STM32F (429, 746)
2025-04-11 09:28:25 -03:00
Sergio R. Caprile fbc1708000 Add support for RM2 with STM32F (429, 746) 2025-04-11 09:20:40 -03:00
Sergey Lyubka 0539cf1023 Fix #2768 - remove completed timers 2025-04-11 11:24:10 +01:00
Sergio R. Caprile 07b410447b fix missing weird types 2025-04-10 10:02:20 -03:00
Sergey Lyubka fb69016196 Merge pull request #3096 from cesanta/polldoze
allow other stack than WinSock in Windows
2025-04-10 07:21:29 +01:00
Sergio R. Caprile 169cbc044f Merge pull request #3095 from cesanta/noVLA
no VLA
2025-04-09 13:28:21 -03:00
Sergio R. Caprile 08091d02e5 allow other stack than WinSock in Windows 2025-04-09 12:05:01 -03:00
Sergio R. Caprile 6f2dcf92a7 no VLA 2025-04-09 10:55:54 -03:00
Sergio R. Caprile 578e52618d Merge pull request #3092 from cesanta/picofix
unbreak pico[2]W auto init
2025-04-07 16:00:33 -03:00
Sergio R. Caprile ec0fe66a17 unbreak pico[2]W auto init 2025-04-07 15:56:11 -03:00
novlean 8fee24291a Merge pull request #3091 from cesanta/novlean-patch-2
Update README.md
2025-04-07 17:53:34 +01:00
novlean 05bba2958d Update README.md
Articles
2025-04-07 17:53:22 +01:00
robert e656b1c792 Removed alloca call for ARM-CGT compatibility 2025-04-07 09:08:22 -04:00
Sergey Lyubka e0ccbadd25 Merge pull request #3083 from cesanta/cyw
Introducing CYW driver and Wi-Fi AP support
2025-03-30 11:27:56 +01:00
Sergey Lyubka 40a2a8822f Squash warning 2025-03-29 18:59:01 +00:00
Sergio R. Caprile e2ee356a87 Merge pull request #3084 from cesanta/2ap
Add support for AP in Pico 2 W (valid for Pico W)
2025-03-28 09:51:15 -03:00
Sergio R. Caprile 189bef61d3 Add support for AP in Pico 2 W (valid for Pico W) 2025-03-24 17:49:40 -03:00
Sergio R. Caprile 7d94f9f61b Add Pico + RM2 Wi-Fi example 2025-03-24 17:41:12 -03:00
Sergio R. Caprile e37a0b9056 Add CYW driver 2025-03-24 17:03:05 -03:00
Sergio R. Caprile 0b57b23951 Add support for Wi-Fi chip drivers 2025-03-24 17:02:50 -03:00
Sergey Lyubka c84826e84e Merge pull request #3081 from cesanta/dhcp
Allow user to set custom DHCP name
2025-03-24 08:01:43 +00:00
Sergey Lyubka 064fc6ff7b Allow user to set custom DHCP name 2025-03-22 16:30:02 +00:00
Sergio R. Caprile 042ea53478 Merge pull request #3076 from cesanta/mondirw
keep up with Wizard dir structure
2025-03-12 17:14:30 -03:00
Sergio R. Caprile 900b0acf7a keep up with Wizard dir structure 2025-03-12 17:08:36 -03:00
Sergio R. Caprile dc5f2e295a Merge pull request #3074 from cesanta/wait
fix IO_WAIT on send for builtin TLS and MbedTLS
2025-03-11 16:21:32 -03:00
Sergio R. Caprile c1849c2b19 fix IO_WAIT on send for builtin TLS and MbedTLS 2025-03-11 16:14:12 -03:00
Sergio R. Caprile 4eadf3699f unbreak C89 2025-03-11 16:00:42 -03:00
Sergio R. Caprile b30cf6587c Merge pull request #3072 from cesanta/rw612-wifi-xpresso
RW612 MCUXpresso WiFi example with FreeRTOS and LWIP
2025-03-08 14:56:29 -03:00
Sergio R. Caprile fbc231f33e Merge pull request #3070 from cesanta/hton
remove memcpy from htons/l and test load/save bigendian macros
2025-03-08 14:46:46 -03:00
Sergio R. Caprile bc8c839342 Merge pull request #3033 from cesanta/wifi
Change driver API: up(ifp) -> poll(ifp, 1second)
2025-03-08 11:40:39 -03:00
Sergio R. Caprile 90a23fe230 Add support for Wi-Fi chip drivers 2025-03-07 16:41:33 -03:00
Sergio R. Caprile 065027843e Change driver API: up(ifp) -> poll(ifp, 1second)
Add misc extras required by Wi-Fi drivers (in progress)
2025-03-07 14:14:16 -03:00
Sergio R. Caprile 8906b1ac0f Merge pull request #3025 from cesanta/ub
fix UB and possible exception trigger
2025-03-07 13:49:37 -03:00
robert 05f9e61a41 RW612 MCUXpresso WiFi example with FreeRTOS and LWIP 2025-03-07 11:12:30 -05:00
Sergio R. Caprile 782896b5d3 remove memcpy from htons/l 2025-03-05 17:20:35 -03:00
Sergio R. Caprile 4258f62560 Merge pull request #3069 from cesanta/beduino
add test for ESP32
2025-03-05 14:23:05 -03:00
Sergio R. Caprile 537ba64a54 add test for ESP32 2025-03-05 12:34:22 -03:00
Sergey Lyubka 25d20b7354 Add mg_tcpip_driver_w5100 to the header 2025-03-05 06:54:20 +00:00
Sergio R. Caprile 04d8362905 Merge pull request #3068 from cesanta/arduino
fix Arduino tests
2025-03-04 16:31:57 -03:00
Sergio R. Caprile 21266e9a45 fix Arduino tests 2025-03-04 16:20:18 -03:00
Sergio R. Caprile 7304e2171d Merge pull request #3065 from cesanta/reduino
Rename conflictive macros, add and refactor crypto tests
2025-03-04 12:11:45 -03:00
Sergio R. Caprile 61fc480850 Rename conflictive macros, refactor crypto tests 2025-03-04 11:55:57 -03:00
robertc2000 562e82f5ac Merge pull request #3059 from cesanta/ota-rt1050
OTA on RT1050
2025-03-03 10:09:27 +02:00
robert d7ff85bb48 OTA on RT1050 2025-03-03 03:03:28 -05:00
Sergio R. Caprile 55bc6105e1 Merge pull request #3058 from cesanta/move
move examples -> tutorials
2025-02-28 14:00:06 -03:00
Sergio R. Caprile 306c0b6096 move examples -> tutorials 2025-02-28 13:55:57 -03:00
Sergio R. Caprile 024078ae33 Merge pull request #3057 from cesanta/move
move vendors -> tutorials
2025-02-28 10:10:07 -03:00
Sergio R. Caprile b5a9ba8390 move vendors -> tutorials 2025-02-28 10:01:51 -03:00
Sergey Lyubka 93f36927ca Add .mjs mime type 2025-02-27 16:50:04 +00:00
Sergio R. Caprile 1db90cafd1 Merge pull request #3056 from cesanta/move
move Zephyr -> tutorials
2025-02-27 12:02:48 -03:00
Sergio R. Caprile bf23a0def7 move Zephyr -> tutorials 2025-02-27 10:57:08 -03:00
Sergio R. Caprile ea1cbeea9d Merge pull request #3054 from cesanta/move
move UART bridge -> tutorials
2025-02-26 15:11:27 -03:00
Sergio R. Caprile aeda7e5520 move UART bridge -> tutorials 2025-02-26 15:08:06 -03:00
Sergio R. Caprile a7899af8b8 Merge pull request #3053 from cesanta/move
move ESP32 device dashboard -> tutorials
2025-02-26 14:17:06 -03:00
Sergio R. Caprile b0385f47af move ESP32 device dashboard -> tutorials 2025-02-26 14:14:08 -03:00
Sergio R. Caprile 86c384657c Merge pull request #3052 from cesanta/move
integrate reference-projects into existing tutorials
2025-02-26 12:05:14 -03:00
Sergio R. Caprile 6e569110d2 integrate reference-projects intto existing tutorials 2025-02-26 12:00:46 -03:00
Sergio R. Caprile 3b1024b13c Merge pull request #3051 from cesanta/move
move MicroPython and dashboards -> tutorials
2025-02-26 11:43:14 -03:00
Sergio R. Caprile b3f5d11275 move MicroPython and dashboards -> tutorials 2025-02-26 11:31:01 -03:00
Sergio R. Caprile 1078ba0a92 Merge pull request #3050 from cesanta/move
move file-transfer -> tutorials
2025-02-25 16:54:25 -03:00
Sergio R. Caprile 005c8170d4 move file-transfer -> tutorials 2025-02-25 16:52:16 -03:00
Sergio R. Caprile b8d1d7a10b Merge pull request #3049 from cesanta/move
move ESP8266 -> tutorials
2025-02-25 16:11:30 -03:00
Sergio R. Caprile 76769fb4d5 move ESP8266 -> tutorials 2025-02-25 16:10:28 -03:00
Sergio R. Caprile 6ff6f0a4c6 Merge pull request #3048 from cesanta/move
move Arduino examples -> tutorials
2025-02-25 15:52:12 -03:00
Sergio R. Caprile 72a45d2f6a move Arduino examples -> tutorials 2025-02-25 15:48:09 -03:00
Sergio R. Caprile 2fe7c8a410 Merge pull request #3044 from cesanta/eth-drivers-rx
ETH driver: use the same scheme for RX
2025-02-19 14:12:49 -03:00
robert 5269eb9c39 ETH driver: use the same scheme for RX 2025-02-19 10:01:54 -05:00
Sergio R. Caprile 0a86bc0af2 update version 2025-02-19 10:21:27 -03:00
Sergio R. Caprile bc9f6ba0b0 Merge pull request #3043 from cesanta/loserst
add TLS support
2025-02-18 16:22:48 -03:00
Sergio R. Caprile 9e16a0ae42 add TLS support 2025-02-18 16:20:39 -03:00
Sergio R. Caprile 9ccbb49aef Merge pull request #3042 from cesanta/loserst
Fix Windows returning IO_RESET
2025-02-18 16:08:24 -03:00
Sergio R. Caprile d59f84fbbc Fix Windows returning IO_RESET 2025-02-18 16:04:13 -03:00
Sergio R. Caprile 4bbb5008b1 Merge pull request #3039 from cesanta/rw612-eth-driver
RW612 ETH driver
2025-02-18 09:28:16 -03:00
Sergio R. Caprile 49ce25511e Merge pull request #3041 from cesanta/atomillis
no LDRD in v6-M
2025-02-17 13:59:14 -03:00
Sergio R. Caprile 985276665d no LDRD in v6-M 2025-02-17 10:18:51 -03:00
robert 91f553c45f RW612 ETH driver 2025-02-17 03:47:41 -05:00
Sergey Lyubka 38ede8ec58 2024 -> 2025 2025-02-12 13:28:24 +00:00
Sergey Lyubka 997f6543ce Merge pull request #3037 from cesanta/tls2
TLS verification
2025-02-10 15:42:18 +00:00
Sergey Lyubka b50081a83b TLS verification 2025-02-10 15:36:29 +00:00
Sergio R. Caprile 34f512d244 Merge pull request #3034 from cesanta/picosdk
Fix Pico-SDK aggressive optimization breaking OTA
2025-02-06 10:31:09 -03:00
Sergio R. Caprile eb5752f41b Fix Pico-SDK aggressive optimization breaking OTA 2025-02-06 10:27:13 -03:00
Sergio R. Caprile ef8e7419fa ... 2025-02-02 19:41:54 -03:00
Sergio R. Caprile cfcdd15b89 ... 2025-02-02 19:28:54 -03:00
Sergio R. Caprile b26debaebc ... 2025-02-02 19:25:35 -03:00
Sergio R. Caprile 6deb061b12 ... 2025-02-02 19:20:30 -03:00
novlean 4c6745670c Merge pull request #3029 from cesanta/novlean-patch-1
Update LICENSE
2025-01-30 12:10:39 +00:00
novlean 01c662b7de Update LICENSE
2025
2025-01-30 12:10:26 +00:00
Sergio R. Caprile 179fe652c2 Merge pull request #3028 from cesanta/ota2350
Use BootROM reset for RP2350
2025-01-29 15:20:37 -03:00
Sergio R. Caprile 394bc3260d Use BootROM reset for RP2350 2025-01-29 15:17:04 -03:00
Sergio R. Caprile ce1a70e2dc fix error msg 2025-01-29 10:15:45 -03:00
Sergio R. Caprile 99022896f6 Merge pull request #3026 from cesanta/tst
misc fixes
2025-01-28 15:29:43 -03:00
Sergio R. Caprile 446b400667 misc fixes 2025-01-28 15:27:13 -03:00
Sergio R. Caprile a0d9b6a7e0 fix UB and possible HF trigger 2025-01-28 10:24:59 -03:00
Sergio R. Caprile 7d53c21efe fix for no TLS 2025-01-27 18:52:20 -03:00
Sergio R. Caprile b78efbac36 Merge pull request #3024 from cesanta/test
fix failing tests
2025-01-27 16:52:06 -03:00
Sergio R. Caprile 9be9dcec46 misc 2025-01-27 16:50:46 -03:00
Sergio R. Caprile 3766ab802b update SDK (no pico_rand) 2025-01-27 16:49:32 -03:00
Sergio R. Caprile b9141925a3 fix #2997 2025-01-27 16:15:03 -03:00
Sergio R. Caprile ed79fe86aa fix SDK 1.5 not building in recent gcc (update to SDK 2.1) 2025-01-27 14:26:11 -03:00
Sergey Lyubka 2f0b0955a9 Merge pull request #3023 from cesanta/smtp
fix built-in TLS not calling MG_EV_TLS_HS; uniformize mg_tls_init()
2025-01-27 14:44:51 +00:00
Sergio R. Caprile 2f8e15a900 fix qemu package name 2025-01-27 11:13:38 -03:00
Sergio R. Caprile b8b3a5c305 fix built-in TLS not calling MG_EV_TLS_HS; uniformize mg_tls_init() 2025-01-27 10:54:56 -03:00
Sergio R. Caprile e7ea421c54 fix outdated mongoose.h 2025-01-27 10:54:29 -03:00
Sergio R. Caprile 8de9699390 fix TLS multiple-record-per-frame handling in bare metal 2025-01-24 12:05:17 -03:00
Sergio R. Caprile bf592a22ae Fix TLS tests failing with small(lots of) records 2025-01-23 19:15:40 -03:00
Sergio R. Caprile 8d4a619a15 minimize elusive ARP lookup failure 2025-01-23 14:33:28 -03:00
Sergio R. Caprile 1a3588624d update mongoose.h 2025-01-21 16:50:14 -03:00
Sergio R. Caprile 74b3fd2efc Merge pull request #3009 from cesanta/fin
Close connection fast if both sides sent FIN
2025-01-17 20:07:35 -03:00
Sergio R. Caprile 091356ed59 give TLS a chance 2025-01-17 19:51:12 -03:00
Sergey Lyubka fc0e1ee311 Close connection fast if both sides sent FIN 2025-01-17 15:15:24 -03:00
Sergio R. Caprile 8dbfcbff58 Merge pull request #3014 from cesanta/test
improve TLS testing
2025-01-17 15:14:04 -03:00
Sergio R. Caprile 317591bc8a improve TLS testing 2025-01-17 14:07:49 -03:00
Sergio R. Caprile f71b3b91c0 Rollback 2025-01-16 21:04:12 -03:00
Sergio R. Caprile 9e255bcbce fix undefined behaviour 2025-01-16 20:42:43 -03:00
Sergio R. Caprile 8af319b953 Merge pull request #3011 from cesanta/to512
Change default MG_IO_SIZE 256 -> 512
2025-01-15 16:13:15 -03:00
Sergey Lyubka f90fd9cec4 Change default MG_IO_SIZE 256 -> 512 2025-01-15 19:10:10 +00:00
robert d386b1c12d XMC4 driver: added IDE compatibility 2025-01-13 03:34:25 -05:00
Sergey Lyubka 81551ec50d Quiet clone 2025-01-06 17:47:50 +00:00
Sergio R. Caprile 8fafcf6eaa Merge pull request #3001 from cesanta/towizard
move to Wizard
2025-01-03 11:54:36 -03:00
Sergio R. Caprile f0df6c61c9 move to Wizard 2025-01-03 11:53:11 -03:00
Sergey Lyubka 6cf36b5771 Add esp32-mqtt 2024-12-30 22:58:33 +00:00
Sergio R. Caprile 54799187e9 Merge pull request #2996 from cesanta/test
improve tests and debuggability
2024-12-30 13:41:02 -03:00
Sergio R. Caprile 6d0320be06 improve tests and debuggability 2024-12-30 12:25:27 -03:00
Sergey Lyubka 317a1527ad Add HTTPS 2024-12-29 14:03:39 +00:00
Sergey Lyubka 490eb0f57f Squash warning 2024-12-29 11:29:09 +00:00
Sergio R. Caprile f95283e341 Merge pull request #2995 from cesanta/update
misc fixes and updates
2024-12-27 11:21:50 -03:00
Sergio R. Caprile 837da0e458 misc fixes and updates 2024-12-27 11:16:10 -03:00
Sergio R. Caprile 8ce82a100e Merge pull request #2972 from cesanta/imxrt
move to Wizard
2024-12-27 09:17:43 -03:00
Sergio R. Caprile 9ece98c101 Merge pull request #2994 from cesanta/pico2w
Add Pico 2 W examples
2024-12-23 15:19:30 -03:00
Sergio R. Caprile 6a83147b33 Add Pico 2 W examples 2024-12-23 15:11:29 -03:00
Sergio R. Caprile 90e4228e1d keep TLS options as per the TLS tutorial. Default to built-in TLS while allowing to use other stacks, as tutorials show 2024-12-23 11:40:36 -03:00
Sergey Lyubka 553aeeef77 Add TLS support 2024-12-20 06:47:31 +00:00
Sergey Lyubka 6147e865f8 Update README 2024-12-19 12:38:20 +00:00
Sergey Lyubka 7b296fabb0 Merge pull request #2991 from cesanta/unpacked_crash
Fix mg_unpacked() crash
2024-12-18 11:07:27 +00:00
Sergey Lyubka 00c8f8acd0 Fix mg_unpacked() crash 2024-12-18 09:57:18 +00:00
Sergey Lyubka 1e1efa2c5e Merge pull request #2988 from cesanta/tlspoll
fix mg_tls_pending
2024-12-17 14:24:13 +00:00
robertc2000 b0b0dd9f0b Merge pull request #2990 from cesanta/w5100
Add W5100 driver
2024-12-17 15:34:54 +02:00
robert 30bb1c52d0 Add W5100 driver 2024-12-17 06:35:21 -05:00
Sergio R. Caprile 7fc96a61ad fix mg_tls_pending 2024-12-16 16:03:36 -03:00
Sergio R. Caprile 4a164c39b4 Merge pull request #2987 from cesanta/ifp
mgr::priv -> mgr::ifp, use explicit type
2024-12-16 11:36:36 -03:00
Sergey Lyubka b0e4069bb7 mgr::priv -> mgr::ifp, use explicit type 2024-12-16 14:22:13 +00:00
Sergey Lyubka 19cbb27b4c Fix TLS handling in net_builtin 2024-12-15 13:32:19 +00:00
Sergey Lyubka d44c864387 Add arduino/esp32-http example 2024-12-10 15:27:09 +00:00
Sergio R. Caprile 36e21e53e0 Merge pull request #2982 from cesanta/picowsdk
Add auto init for Pico-W driver
2024-12-05 14:59:21 -03:00
Sergio R. Caprile b7598cc354 Add auto init for Pico-W driver 2024-12-05 14:57:21 -03:00
Sergio R. Caprile 0a4f322d49 Merge pull request #2981 from cesanta/picowsdk
Add Pico-W driver in src/drivers
2024-12-05 12:21:41 -03:00
Sergio R. Caprile bf013fcdae Add Pico-W driver in src/drivedrivers 2024-12-05 12:11:14 -03:00
Sergey Lyubka fd52fccc15 Merge pull request #2976 from cesanta/http-invalid-versions
Validate HTTP version
2024-12-04 14:04:39 +00:00
robert c493d3a4ce Validate HTTP version 2024-12-04 06:34:24 -05:00
Sergio R. Caprile aeceb2b9e7 Merge pull request #2979 from cesanta/sdk2
update to Pico-SDK 2.0.0
2024-12-03 17:10:01 -03:00
Sergio R. Caprile cb5f833dd2 update to Pico-SDK 2.0.0 2024-12-02 14:19:49 -03:00
Sergio R. Caprile 0740ccd9f7 Merge pull request #2978 from cesanta/sdk2
update to Pico-SDK 2.0.0
2024-12-02 11:19:14 -03:00
Sergio R. Caprile 716c84c896 update to Pico-SDK 2.0.0 2024-12-02 11:15:33 -03:00
Sergey Lyubka c5fda07d1e Update Arduino sketches 2024-12-01 22:04:57 +00:00
Sergey Lyubka 7fffe0abaa Add simple RAM profiler 2024-11-28 13:11:04 +00:00
Sergey Lyubka 8a42325c23 Back to plain MQTT URL 2024-11-28 08:50:32 +00:00
Sergey Lyubka 78900304bf More PPP nitpicks 2024-11-28 08:46:32 +00:00
Sergey Lyubka fb6dfbcd3c PPP nitpicks 2024-11-28 08:31:43 +00:00
Sergey Lyubka 3dd4c7da2a Add PPP driver 2024-11-27 22:00:30 +00:00
Sergey Lyubka 03c955410c Update HTTP server Arduino example 2024-11-26 20:53:21 +00:00
Sergio R. Caprile 74f77c9ded Merge pull request #2975 from cesanta/ipsum
Fix IP csum calculation on 8-bit platforms
2024-11-26 17:36:43 -03:00
Sergey Lyubka 3caca03e8a Simplify MQTT example 2024-11-26 20:30:57 +00:00
Sergey Lyubka 49469840ab Fix IP csum calculation on 8-bit platforms 2024-11-26 20:23:12 +00:00
Sergio R. Caprile 85613ab02d Merge pull request #2974 from cesanta/noclash
avoid name clashing in OTA
2024-11-26 14:18:58 -03:00
Sergio R. Caprile 6e4ce85c87 avoid name clashing in OTA 2024-11-26 14:15:56 -03:00
Sergio R. Caprile 2a093dc183 remove is_io_err (unused) 2024-11-26 14:09:34 -03:00
Sergey Lyubka 01eeadbaf4 Merge pull request #2970 from kursataktas/mongoose-guru
Introducing Mongoose Guru on Gurubase.io
2024-11-23 08:22:57 +00:00
Sergio R. Caprile 851b3a7cfb move to Wizard 2024-11-22 17:38:26 -03:00
Sergio R. Caprile b6dc830bcb Merge pull request #2964 from cesanta/http-cookie
Use separate cookies for HTTP and HTTPS connections
2024-11-22 16:39:08 -03:00
Sergio R. Caprile 8ef02aae41 Merge pull request #2971 from cesanta/411
Fix issuing 411 responses as a client
2024-11-22 16:37:19 -03:00
Sergio R. Caprile 423dbd58a1 Merge pull request #2929 from cesanta/xmc7200
move to Wizard
2024-11-22 16:36:12 -03:00
Sergio R. Caprile 5582db615a Merge pull request #2923 from cesanta/1170
move to Wizard
2024-11-22 14:05:59 -03:00
Sergio R. Caprile 1479ebfb5d move to Wizard 2024-11-22 14:01:32 -03:00
Sergio R. Caprile 4389ef1e77 Merge pull request #2927 from cesanta/mcxn
move to Wizard
2024-11-22 12:21:36 -03:00
Sergio R. Caprile 5c305e7fa8 Fix issuing 411 responses as a client
15.5.12. 411 Length Required

The 411 (Length Required) status code indicates that the server refuses to accept the request without a defined Content-Length (Section 8.6). The client MAY repeat the request if it adds a valid Content-Length header field containing the length of the request content.

fixes #2969
2024-11-21 18:55:16 -03:00
Kursat Aktas 0427908eae Introducing Mongoose Guru on Gurubase.io
Signed-off-by: Kursat Aktas <kursat.ce@gmail.com>
2024-11-21 19:23:44 +03:00
Sergio R. Caprile 2df53c3d27 update version 2024-11-20 10:02:24 -03:00
Sergio R. Caprile 53ec9adb1b Merge pull request #2954 from cesanta/dbl
Fix dbl printing
2024-11-19 16:20:30 -03:00
Sergio R. Caprile 8b95a22e75 Merge pull request #2966 from cesanta/ota-h7-dual-core
H7 dual core OTA fix
2024-11-14 14:23:17 -03:00
robert 665298a04b H7 dual core OTA compatibility 2024-11-14 10:22:36 -05:00
Sergio R. Caprile 7e668df1fe default to built-in TLS without preventing other choices 2024-11-13 17:29:44 -03:00
Sergey Lyubka 85414cfec2 Add extra step 2024-11-12 08:55:53 +00:00
robert b973187960 Use separate cookies for HTTP and HTTPS connections 2024-11-12 03:46:11 -05:00
Sergio R. Caprile 991080e613 Merge pull request #2963 from cesanta/uaws
unbreak AWS example and associated tests
2024-11-11 17:30:22 -03:00
Sergio R. Caprile 72bf199577 unbreak AWS example and associated tests 2024-11-11 17:27:59 -03:00
Sergio R. Caprile 7bda43a6ec Merge pull request #2962 from cesanta/picosdk
Pico-SDK support fixes and cleanups
2024-11-11 15:08:06 -03:00
Sergio R. Caprile 2b8b0ebe95 Pico-SDK support fixes and cleanups 2024-11-11 14:52:28 -03:00
Sergey Lyubka 0aa61ce58f Update build, use EC certs 2024-11-10 08:45:34 +00:00
Sergey Lyubka 51a5dc78d7 zip only web_root files 2024-11-09 08:09:50 +00:00
Sergio R. Caprile 232bd9a22b Merge pull request #2959 from cesanta/picosdk
Move ARCH_RP2040 --> ARCH_PICOSDK
2024-11-08 14:38:56 -03:00
Sergio R. Caprile 58327a1753 Move ARCH_RP2040 --> ARCH_PICOSDK 2024-11-08 14:34:33 -03:00
Sergio R. Caprile 7844d84798 Merge pull request #2956 from cesanta/ota-rt1170
OTA RT1170
2024-11-07 13:45:28 -03:00
Sergio R. Caprile 7a30a42797 Merge pull request #2957 from cesanta/picornd
Use Pico-SDK RNG
2024-11-07 11:59:47 -03:00
Sergio R. Caprile 094202ff16 Use Pico-SDK RNG 2024-11-07 11:57:08 -03:00
robert 9c4523f4fa OTA RT1170 2024-11-07 08:39:28 -05:00
Sergio R. Caprile 69859c61e0 Merge pull request #2955 from cesanta/ota-rt10xx
IMXRT OTA: support included for 1024, 1040, 1064
2024-11-07 09:32:05 -03:00
robert 9878518e29 IMXRT OTA: support included for 1024, 1040, 1064 2024-11-07 03:11:57 -05:00
robert cde270728f Fixed tms570 driver definition not being added to net_builtin 2024-11-07 03:09:18 -05:00
Sergio R. Caprile 5559d0fa68 Merge pull request #2953 from cesanta/otapico
Add OTA for Pico-SDK (RP2040)
2024-11-06 16:36:14 -03:00
Sergio R. Caprile 8feff78526 add tests 2024-11-06 11:40:57 -03:00
Sergey Lyubka 226a3de55d Fix dbl printing 2024-11-06 06:14:38 +00:00
Sergio R. Caprile 67d0f5f4ae Add OTA for Pico-SDK (RP2040) 2024-11-05 17:17:22 -03:00
Sergio R. Caprile 192f5e563c Merge pull request #2952 from cesanta/rt1020-ota-fix
RT1020 OTA: removed unnecessary compiler optimisation
2024-11-05 09:27:20 -03:00
robert b6296e7a67 RT1020 OTA: removed unnecessary compiler optimisation 2024-11-05 03:48:26 -05:00
Sergio R. Caprile 67e17d3bc3 Merge pull request #2951 from cesanta/inline
MG_IRAM -> noinline
2024-11-01 16:26:05 -03:00
Sergio R. Caprile 64a6fef823 MG_IRAM -> noinline 2024-11-01 16:21:18 -03:00
robertc2000 e0c64cc4ff Merge pull request #2949 from cesanta/ota-f7
STM32F OTA support
2024-10-30 16:57:21 +02:00
robert 3e55478b3b STM32F OTA support 2024-10-30 10:55:05 -04:00
Sergey Lyubka 9aef821862 Merge pull request #2933 from cesanta/win_rng
Windows: added alternative to bcrypt lib
2024-10-29 15:44:05 +00:00
robert f394df840e Killed bcrypt, replaced with rand_s 2024-10-29 10:41:10 -04:00
Sergey Lyubka 7d33699173 Merge pull request #2935 from cesanta/tms570
TMS570 support
2024-10-26 11:14:26 +01:00
Sergey Lyubka d3ffe8c647 Merge pull request #2947 from cesanta/ota
Simplify OTA API
2024-10-25 10:40:32 +01:00
Sergio R. Caprile 9b99f62311 Refactor OTA API 2024-10-24 19:08:06 -03:00
Sergey Lyubka 3319ce78d3 Simplify OTA API 2024-10-22 01:25:19 +01:00
Sergey Lyubka 8eabf43525 Failing tests 2024-10-16 12:58:25 +01:00
Sergio R. Caprile adb12bb7be nits 2024-10-11 14:12:46 -03:00
Sergio R. Caprile 3c10b36651 Merge pull request #2938 from cesanta/isresp
Honor c->is_resp with Connection:close
2024-10-10 19:47:59 -03:00
Sergio R. Caprile d37c300d87 Honor c->is_resp with Connection:close 2024-10-10 19:44:09 -03:00
Sergio R. Caprile 9fc92e901e Merge pull request #2936 from cesanta/test
Add/fix Zephyr tests (again)
2024-10-10 15:53:17 -03:00
Sergio R. Caprile 5b52529295 Add/fix Zephyr tests (again) 2024-10-10 15:49:53 -03:00
Sergio R. Caprile f77a7ad623 Merge pull request #2926 from cesanta/arp
Fix gw ARP. Make ARP probe public. Add ARP event
2024-10-10 11:44:50 -03:00
Sergio R. Caprile 504ef9422e fix gw ARP on startup 2024-10-10 11:42:38 -03:00
robert cbbcec0895 TMS570 support 2024-10-10 03:23:51 -04:00
Sergio R. Caprile 32d90c38db tweaks 2024-10-09 11:33:14 -03:00
Sergey Lyubka e1f7f3d7bb Make ARP probe public. Add ARP event 2024-10-09 11:33:14 -03:00
Sergio R. Caprile 244536ea72 Merge pull request #2934 from cesanta/test
Add test Makefiles for more IDEs
2024-10-08 18:58:32 -03:00
Sergio R. Caprile fa24a3e09e Add test Makefiles for more IDEs
Expand Wizard test script
2024-10-08 18:55:32 -03:00
robert 5ec26a5015 Windows: added alternative to bcrypt lib 2024-10-08 09:21:13 -04:00
Sergey Lyubka 8a8ff2aef0 Merge pull request #2908 from cesanta/convenience
avoid trashing other projs thinking redefining types is convenient
2024-10-05 08:49:17 +01:00
Sergio R. Caprile 069254be6a Merge pull request #2932 from cesanta/test
Add test Makefiles for IDEs and Wizard test script
2024-10-04 17:37:19 -03:00
Sergio R. Caprile f3cd74cb46 Add test Makefiles for IDEs
Add Wizard test script
2024-10-04 17:35:02 -03:00
Sergio R. Caprile 4be8aa0f91 Merge pull request #2919 from cesanta/frag
Fix IP fragmentation checks for big-endian CPUs
2024-10-04 14:02:14 -03:00
Sergey Lyubka 93dd7a85f6 Fix IP fragmentation checks for big-endian CPUs 2024-10-04 16:18:33 +01:00
Sergio R. Caprile 062596e3fb move to Wizard 2024-10-04 11:55:24 -03:00
Sergio R. Caprile 5af2de635e Merge pull request #2931 from cesanta/revert-2930-tw
Revert "test prod Wizard"
2024-10-04 11:50:55 -03:00
Sergio R. Caprile a16df91fbb Revert "test prod Wizard" 2024-10-04 11:50:41 -03:00
Sergio R. Caprile 44178b9103 Merge pull request #2930 from cesanta/tw
test prod Wizard
2024-10-03 17:10:31 -03:00
Sergio R. Caprile b767f930ad test prod Wizard 2024-10-03 17:09:16 -03:00
Sergio R. Caprile ba61a6545a move to Wizard 2024-10-03 16:50:00 -03:00
Sergio R. Caprile 23ada5c7a5 try to get abort texts from GH 2024-10-03 13:46:50 -03:00
Sergio R. Caprile 97c37efffe fix removed linked files 2024-10-03 13:26:18 -03:00
Sergio R. Caprile 5db95be4fc fix test file 2024-10-03 12:05:44 -03:00
Sergio R. Caprile 5897422c70 Merge pull request #2928 from cesanta/newskeleton
move to Wizard
2024-10-03 12:00:47 -03:00
Sergio R. Caprile a7db0d3cc5 move to Wizard 2024-10-03 11:55:38 -03:00
Sergey Lyubka c49036a713 Merge pull request #2921 from cesanta/dp83848
DP83848 has no clock setup
2024-10-03 11:44:26 +01:00
Sergio R. Caprile 03246997fa Merge pull request #2922 from cesanta/newskeleton
move to Wizard
2024-10-02 14:51:57 -03:00
Sergio R. Caprile f4eac6e4fc move to Wizard 2024-10-02 13:42:14 -03:00
Sergio R. Caprile 48f695f3e6 DP83848 has no clock setup 2024-10-02 10:22:09 -03:00
Sergio R. Caprile 3525f044f5 Merge pull request #2890 from cesanta/tls
Fix multiple TLS records in buffer
2024-10-01 18:30:04 -03:00
Sergio R. Caprile b58f8b9d7c Fix multiple TLS records in buffer 2024-10-01 18:26:51 -03:00
Sergio R. Caprile c00962e881 Merge pull request #2914 from cesanta/tests
fixes and improvements for tests
2024-09-27 18:50:51 -03:00
Sergio R. Caprile 9bcf1d662b fix tests 2024-09-27 18:33:26 -03:00
Sergio R. Caprile 586e0721d8 Merge pull request #2911 from cesanta/testcube
add Wizard examples
2024-09-26 20:30:41 -03:00
Sergio R. Caprile 882dd1f3a7 add Wizard examples 2024-09-26 20:20:00 -03:00
Sergio R. Caprile 399291d783 Merge pull request #2910 from cesanta/newskeleton
move to Wizard
2024-09-26 17:14:24 -03:00
Sergio R. Caprile 46ac2e5252 move to Wizard 2024-09-26 17:11:57 -03:00
Sergio R. Caprile a81818b2db avoid trashing other projs thinking redefining types is convenient 2024-09-24 20:14:39 -03:00
Sergio R. Caprile 9b0d112176 Merge pull request #2907 from cesanta/armcgt
Add ARMCGT arch
2024-09-24 19:01:28 -03:00
Sergio R. Caprile ac17df0c65 Add ARMCGT arch 2024-09-24 18:58:54 -03:00
Sergio R. Caprile c4be4e7928 Merge pull request #2906 from cesanta/revert-2901-fpp
Revert "fix printf precision handling"
2024-09-24 18:02:49 -03:00
Sergio R. Caprile 877cbbd11d Revert "fix printf precision handling" 2024-09-24 18:01:07 -03:00
Sergio R. Caprile b2bb03310e Merge pull request #2905 from cesanta/arpudp
Fix ARP handling with UDP
2024-09-24 14:22:52 -03:00
Sergio R. Caprile 5c8885ee5f Fix ARP handling with UDP 2024-09-24 12:37:13 -03:00
Sergio R. Caprile 40ec6b263d Merge pull request #2901 from cesanta/fpp
fix printf precision handling
2024-09-20 20:51:20 -03:00
Sergio R. Caprile 3742da8770 fix printf precision handling 2024-09-20 20:40:54 -03:00
Sergio R. Caprile 19b06418c5 Merge pull request #2899 from cesanta/examples
move to Wizard
2024-09-19 16:30:14 -03:00
Sergio R. Caprile b7b8b9219d move to Wizard 2024-09-19 16:25:36 -03:00
Sergio R. Caprile 949966964f Merge pull request #2896 from cesanta/examplesh563
move to Wizard
2024-09-18 19:47:50 -03:00
Sergio R. Caprile c0a0f9c1df Merge pull request #2895 from cesanta/examples
move to Wizard
2024-09-18 19:43:19 -03:00
Sergio R. Caprile 7cff2fa8f1 Merge pull request #2897 from cesanta/detach
Detach HTTP handler if MG_EV_HTTP_HDRS changes c->recv
2024-09-18 09:44:15 -03:00
Sergey Lyubka c1b703a039 Detach HTTP handler if MG_EV_HTTP_HDRS changes c->recv 2024-09-18 13:30:27 +01:00
Sergio R. Caprile e0eff1d2bb update CodeQL 2024-09-17 13:14:52 -03:00
Sergio R. Caprile 037ef76ad8 move to Wizard 2024-09-16 17:03:44 -03:00
Sergio R. Caprile ae8025cd5c move to Wizard 2024-09-16 16:52:37 -03:00
Sergio R. Caprile 1804cc3a09 fix CIFuxx 2024-09-16 14:34:40 -03:00
Sergio R. Caprile 2d8e6b45ec fix CIFuxx 2024-09-16 14:31:26 -03:00
Sergio R. Caprile 3fa52d0d7d fix outdated example 2024-09-16 11:06:08 -03:00
Sergey Lyubka 6a7129d7af Merge pull request #2884 from cesanta/examples
pilot move to new skeleton in examples
2024-09-12 08:07:16 +01:00
Sergey Lyubka f0e113a532 Merge pull request #2893 from cesanta/picow
Add Pico-W example
2024-09-12 07:53:10 +01:00
Sergio R. Caprile 8b3e415201 Add Pico-W example 2024-09-11 10:56:52 -03:00
Sergio R. Caprile eb6a8afe8d Merge pull request #2891 from cesanta/cflags
default to built-in TLS without preventing other choices
2024-09-09 14:07:37 -03:00
Sergio R. Caprile a705a89e4a default to built-in TLS without preventing other choices 2024-09-09 14:05:39 -03:00
Sergio R. Caprile ea509c0a36 move to Wizard 2024-09-05 11:48:20 -03:00
Sergio R. Caprile 269600d875 pilot move 2024-09-04 17:13:19 -03:00
Sergio R. Caprile 95e3a8f3cc Merge pull request #2882 from cesanta/phy
Add MG_TCPIP_PHY_CONF
2024-09-03 11:26:43 -03:00
Sergey Lyubka ffeff3ab69 Add MG_TCPIP_PHY_CONF 2024-09-03 15:07:27 +01:00
Sergio R. Caprile bdc009eb65 Merge pull request #2880 from cesanta/rng
Make mg_random() fallible. Abort TLS on weak RNG
2024-09-02 11:12:27 -03:00
Sergey Lyubka 683f65f8ac Make mg_random() fallible. Abort TLS on weak RNG 2024-09-02 11:06:10 -03:00
Sergey Lyubka a737698372 Merge pull request #2881 from cesanta/mime
Fix #2871 - accept `*` in mg_http_serve_opts::mime_types
2024-09-02 08:57:13 +01:00
Sergey Lyubka eeecbbcff9 Fix #2871 - accept * in mg_http_serve_opts::mime_types 2024-09-02 06:12:02 +01:00
Sergio R. Caprile 44b3d60692 Merge pull request #2877 from cesanta/iosize
MG_IO_SIZE=256 on embedded platforms
2024-08-30 15:54:48 -03:00
Sergey Lyubka 641c7d1967 MG_IO_SIZE=256 on embedded platforms 2024-08-30 15:52:14 -03:00
Sergey Lyubka 7923d1e930 Merge pull request #2875 from cesanta/iface
add macro to access mif
2024-08-29 21:44:42 +01:00
Sergio R. Caprile 42e072a868 add macro to access mif 2024-08-29 17:11:25 -03:00
Sergio R. Caprile 97296934ab update version 2024-08-21 09:33:12 -03:00
Sergey Lyubka 83dbe5fa3e Windows friendly 2024-08-17 08:20:41 +01:00
Sergio R. Caprile b566b8b45a Merge pull request #2862 from cesanta/fs
Disable POSIX FS by default
2024-08-14 11:43:05 -03:00
Sergey Lyubka ecdfda56c2 Disable POSIX FS by default 2024-08-14 05:26:08 +01:00
Sergio R. Caprile 166c4a244a Merge pull request #2861 from cesanta/modusoperandi
Fix Microchip breaking standards (at least until they do it again)
2024-08-12 12:27:41 -03:00
Sergio R. Caprile be7bfbac39 Fix Microchip breaking standards, as always 2024-08-12 12:20:21 -03:00
Sergio R. Caprile 3c8953672d Merge pull request #2860 from cesanta/l2r
fix ARP resolution when remote host is the gw
2024-08-12 12:03:05 -03:00
Sergio R. Caprile 045b196eeb fix ARP resolution when remote host is the gw 2024-08-12 11:55:57 -03:00
Sergio R. Caprile d763fce8ed Merge pull request #2851 from cesanta/tm4c
Update TM4C driver init + nits
2024-07-31 17:00:34 -03:00
Sergio R. Caprile 15c8ba5d3f Update TM4C driver init + nits 2024-07-31 16:53:29 -03:00
Sergio R. Caprile 1b75017c3c Merge pull request #2849 from cesanta/nit
improve close on TLS
2024-07-30 20:17:07 -03:00
Sergio R. Caprile 3ffe5e958f improve close on TLS 2024-07-30 19:30:14 -03:00
Sergio R. Caprile 4f6a78cde8 Merge pull request #2848 from cesanta/patchnxpphy
Patch KSZ PHY for NXP
2024-07-30 14:43:23 -03:00
Sergio R. Caprile 3081d0766b Patch KSZ PHY for NXP 2024-07-30 14:34:13 -03:00
Sergio R. Caprile c1e34cb9b5 Merge pull request #2847 from cesanta/frtcp
make friends with FreeRTOS+TCP compatibility
2024-07-30 11:33:57 -03:00
Sergio R. Caprile dedf67fb52 make friends with FreeRTOS+TCP compatibility 2024-07-30 10:58:10 -03:00
Sergey Lyubka a74fb940aa C89 compatibility for http-restful-server 2024-07-27 07:01:48 +01:00
Sergey Lyubka 09275ae4ca C89 compatibility for http-restful-server 2024-07-27 07:00:51 +01:00
Sergey Lyubka 657717d0fb Merge pull request #2846 from cesanta/tls
Move http-restful-server to builtin TLS, plus minor nits
2024-07-26 19:38:23 +01:00
Sergey Lyubka 4493d35d26 Move http-restful-server to builtin TLS, plus minor nits 2024-07-26 19:31:15 +01:00
Sergey Lyubka 0d26ce9bcc Merge pull request #2843 from cesanta/tlsoffset
Refactor tls receive pointer scheme (fix read after free)
2024-07-26 19:26:13 +01:00
Sergio R. Caprile fe77075996 Refactor tls receive pointer scheme 2024-07-26 12:15:05 -03:00
Sergio R. Caprile 4d6b126b9d unbreak after incorrect cleanup 2024-07-26 12:14:33 -03:00
Sergio R. Caprile 7b1900d547 Merge pull request #2845 from cesanta/tls
Misc TLS cleanups
2024-07-25 19:42:56 -03:00
Sergio R. Caprile 5a8c56e784 Misc TLS cleanups 2024-07-25 19:01:35 -03:00
Sergio R. Caprile 8c4cfc8101 rework fetch 2024-07-24 18:30:08 -03:00
Sergey Lyubka 5f1f5ffffd Add md5 endpoint for testing POST 2024-07-23 20:10:18 +01:00
Sergio R. Caprile 603c4b7672 Merge pull request #2842 from cesanta/pcap
Make net_builtin send client TLS HS
2024-07-23 15:04:41 -03:00
Sergey Lyubka 4b49c63344 Make net_builtin send client TLS HS 2024-07-23 18:47:48 +01:00
Sergio R. Caprile 9bdc910327 do proper connect 2024-07-23 14:35:32 -03:00
Sergio R. Caprile 730f50f770 Merge pull request #2839 from cesanta/miptst
improve MIP tests
2024-07-22 21:03:33 -03:00
Sergio R. Caprile 91606a9e3f improve MIP tests 2024-07-22 20:22:29 -03:00
Sergio R. Caprile 22b52f831b Merge pull request #2829 from cesanta/vli
allow building uECC with VLI
2024-07-10 12:17:10 -03:00
Sergio R. Caprile 071b3f558f allow building uECC with VLI 2024-07-10 12:01:28 -03:00
Sergio R. Caprile 59cd4004ac Merge pull request #2827 from cesanta/ws
handle possible memory trashing on mg_send() and mg_iobuf_add() failures
2024-07-09 15:01:36 -03:00
Sergio R. Caprile 7f7c1ff6c2 handle possible memory trashes on mg_send() and mg_iobuf_add() failures 2024-07-09 14:56:22 -03:00
Sergio R. Caprile ad3acf355e Merge pull request #2826 from cesanta/openwolf
SSLv23_ methods deprecated
2024-07-09 14:10:44 -03:00
Sergio R. Caprile 4dcc4e3308 SSL_CTX_new can fail
SSLv23_ methods deprecated
2024-07-09 14:08:55 -03:00
Sergio R. Caprile a9902b55d8 Merge pull request #2823 from cesanta/c89
Fix warnings and allow building chacha with C89 compilers
2024-07-08 19:05:30 -03:00
Sergio R. Caprile d46798c2a7 silence cast and c++ warnings) 2024-07-08 17:02:54 -03:00
Sergio R. Caprile 90623492b7 be more C89-friendly 2024-07-08 16:23:41 -03:00
Sergey Lyubka ddf3ba8a15 Squash vc98 chacha warnings 2024-07-07 10:29:52 +01:00
Sergio R. Caprile 0c4d33d558 fix Keil AWS FreeRTOS-plus-TCP 2024-07-04 17:31:11 -03:00
Sergey Lyubka 1c3b6ad59b Merge pull request #2817 from cesanta/chachachan
fix stack trashing
2024-07-04 05:57:06 +01:00
Sergio R. Caprile 473a12d700 Merge pull request #2807 from cesanta/tls
Fix raw TLS overflow for large uploads
2024-07-03 17:24:47 -03:00
Sergio R. Caprile 774cfc4bdc fix magic number 2024-07-03 17:16:32 -03:00
Sergey Lyubka 509fbcc4f8 Fix raw TLS overflow for large uploads 2024-07-03 16:40:04 -03:00
Sergio R. Caprile 00862344f7 fix stack trashing 2024-07-03 14:44:51 -03:00
Sergio R. Caprile 5ad2b0531a Merge pull request #2813 from cesanta/foureleven
fix 411 not draining header data
2024-07-01 14:50:13 -03:00
Sergio R. Caprile be8dbb0dc7 fix 411 not draining header data 2024-07-01 14:38:27 -03:00
Sergio R. Caprile bdfa0b302b Merge pull request #2809 from cesanta/tls2
Enable builtin TLS by default
2024-06-27 08:53:10 -03:00
Sergey Lyubka 7541304a9a Enable builtin TLS by default 2024-06-27 12:04:32 +01:00
Sergio R. Caprile 395a51eeca silence CodeQL 2024-06-26 11:59:52 -03:00
Sergey Lyubka 17e2d49c43 Merge pull request #2806 from cesanta/pipelined
resume pipelined reqs after serving a file
2024-06-26 14:13:15 +01:00
Sergey Lyubka ac71c320cd Merge pull request #2800 from cesanta/zephyr
avoid redefinitions
2024-06-26 14:12:06 +01:00
Sergio R. Caprile 0356bf6092 resume pipelined reqs after serving a file 2024-06-25 18:30:14 -03:00
Sergio R. Caprile 8bc1edd027 add unit tests 2024-06-25 17:03:48 -03:00
Sergio R. Caprile 403f0dc8a5 add unit tests 2024-06-25 16:47:41 -03:00
Sergio R. Caprile dffa198ebd Add tests for recent embedded targets 2024-06-25 15:08:35 -03:00
Sergio R. Caprile 7028417d88 Merge pull request #2794 from cesanta/close
handle `Connection: close`
2024-06-25 15:07:07 -03:00
Sergio R. Caprile 2d4ebba3ed Merge pull request #2805 from cesanta/plustcp
Update to latest FreeRTOS+TCP
2024-06-24 18:11:40 -03:00
Sergio R. Caprile aa3fda9c33 Update to latest FreeRTOS+TCP 2024-06-24 16:54:07 -03:00
Sergio R. Caprile 0f9f0b545e Merge pull request #2802 from cesanta/w5500
allow auto driver init
2024-06-21 18:53:41 -03:00
Sergio R. Caprile 9fcc398540 allow auto driver init 2024-06-21 17:12:07 -03:00
Sergio R. Caprile 61f4ab61cb avoid redefinitions 2024-06-19 11:39:10 -03:00
Sergio R. Caprile 1f481cbe54 Merge pull request #2799 from cesanta/zephyr
update to latest (again)
2024-06-19 09:48:07 -03:00
Sergio R. Caprile f4ee10a96a update to latest (again) 2024-06-18 20:56:31 -03:00
Sergio R. Caprile 9974be3fdc handle 'Connection: close' 2024-06-18 10:38:41 -03:00
Sergio R. Caprile 793171e9e0 Merge pull request #2793 from cesanta/tabs
Fix #2790 - allow tabs as the HTTP header whitespace
2024-06-17 11:41:18 -03:00
Sergio R. Caprile cee7087d54 do check 2024-06-17 11:38:32 -03:00
Sergey Lyubka f9bcffcbd5 Fix #2790 - allow tabs as the HTTP header whitespace 2024-06-17 12:01:32 +01:00
Sergey Lyubka 8fd7e87333 Merge pull request #2787 from cesanta/nicer
play nicer to intermediate OOMs in OpenSSL
2024-06-17 12:42:38 +02:00
Sergey Lyubka c436194d43 Fix #2789 - rename local var to avoid clash with system include 2024-06-17 11:41:37 +01:00
Sergio R. Caprile fcd160cc8c play nicer to intermediate OOMs in OpenSSL 2024-06-14 19:13:01 -03:00
Sergio R. Caprile 5adbadc901 make tests pass 2024-06-14 19:11:37 -03:00
Sergio R. Caprile 5084279d81 Merge pull request #2784 from cesanta/mcxn
add MCUXpresso examples for MCXN947
2024-06-13 13:45:48 -03:00
Sergio R. Caprile bd21d0d0cf add MCUXpresso examples for MCXN947 2024-06-13 13:43:53 -03:00
Sergio R. Caprile a3fd81540a Merge pull request #2783 from cesanta/mcxn
Update MCXN947 FreeRTOS to CM33 port
2024-06-12 17:04:45 -03:00
Sergio R. Caprile ba3f6a5e76 Update MCXN947 FreeRTOS to CM33 port 2024-06-12 17:00:10 -03:00
Sergio R. Caprile 25c56e86c9 Merge pull request #2780 from cesanta/sntp2
update example
2024-06-10 16:18:25 -03:00
Sergio R. Caprile 0897b0969d update example 2024-06-10 16:12:38 -03:00
Sergio R. Caprile 6cb1c3c0e9 Merge pull request #2778 from cesanta/tls7
Add mtls and chacha20
2024-06-10 11:36:40 -03:00
Sergey Lyubka df257a8e8a Add mtls and chacha20 2024-06-09 17:43:49 +01:00
Sergey Lyubka 71abdc1bda Merge pull request #2777 from cesanta/sntp
Add mg_now() to sntp.c
2024-06-09 08:50:36 +01:00
Sergey Lyubka 22de1dc0f2 Add mg_now() to sntp.c 2024-06-09 07:52:25 +01:00
Sergey Lyubka 6357b30712 More expressive variable names in SNTP 2024-06-08 09:00:08 +01:00
Sergio R. Caprile b0e18d5e8a Merge pull request #2775 from cesanta/dhcpdns
DNS and SNTP via DHCP
2024-06-05 14:41:57 -03:00
Sergio R. Caprile be58d73a0a DNS and SNTP via DHCP 2024-06-05 14:10:31 -03:00
Sergio R. Caprile c1f630f5ed Merge pull request #2772 from cesanta/strdup
bring mg_strdup() back
2024-05-31 18:05:59 -03:00
Sergio R. Caprile ab75bfa6e7 bring mg_strdup() back 2024-05-31 17:45:53 -03:00
Sergio R. Caprile a4e0225c69 Merge pull request #2771 from cesanta/mcxfr
Add FreeRTOS example
2024-05-30 20:08:38 -03:00
Sergio R. Caprile 6d3d6c3601 Add FreeRTOS example 2024-05-30 20:05:57 -03:00
Sergio R. Caprile 2872de75a0 Merge pull request #2770 from cesanta/1170fr
Add FreeRTOS example
2024-05-30 12:34:01 -03:00
Sergio R. Caprile 70936e3738 Add FreeRTOS example 2024-05-30 12:23:19 -03:00
Sergio R. Caprile c272883ec1 Merge pull request #2769 from cesanta/xmc7
XMC7: Ethernet descriptors 8-byte alignment
2024-05-29 13:31:23 -03:00
robert d9619a8fa4 XMC7: Ethernet descriptors 8-byte alignment 2024-05-29 10:48:53 -04:00
Sergey Lyubka 9ec2022447 Merge pull request #2767 from cesanta/frdm-n94
FRDM-MCXN947
2024-05-28 21:39:51 +01:00
Sergio R. Caprile 10f56c55e6 Add FRDM-MCXN947 2024-05-28 16:55:52 -03:00
robert 69682d6d97 Added N94 baremetal skeleton 2024-05-28 16:55:52 -03:00
Sergio R. Caprile b61575eb2b Merge pull request #2759 from cesanta/synpsys
Move stm32h driver to synopsys
2024-05-28 16:55:24 -03:00
Sergio R. Caprile 6942de4f57 Move stm32h driver to synopsys 2024-05-28 14:51:19 -03:00
Sergio R. Caprile 8085e21a05 Merge pull request #2766 from cesanta/xmc7
add 100/10M
2024-05-27 15:14:44 -03:00
Sergio R. Caprile 0061fe02e6 add 100/10M 2024-05-27 14:40:07 -03:00
Sergio R. Caprile 6bb40e6ec9 update version 2024-05-20 11:21:09 -03:00
Sergio R. Caprile 94efcc83a1 update version 2024-05-20 10:54:40 -03:00
Sergey Lyubka 03402cf359 Add pack.js 2024-05-19 15:45:03 +01:00
Sergey Lyubka a473cf99b5 More complete MQTT example 2024-05-18 12:09:59 +01:00
Sergio R. Caprile c26bd2ffe8 Merge pull request #2757 from cesanta/wolf
fix WolfSSL
2024-05-17 18:11:30 -03:00
Sergio R. Caprile 9dc3d09981 fix WolfSSL 2024-05-17 17:54:52 -03:00
Sergio R. Caprile 76b4c9a6ff Merge pull request #2756 from cesanta/silwf
momentarily silence WolfSSL tests
2024-05-16 15:18:55 -03:00
Sergio R. Caprile 41add69294 momentarily silence WolfSSL tests 2024-05-16 15:17:19 -03:00
Sergio R. Caprile c911c9ad19 Merge pull request #2752 from cesanta/strip
add mg_str_to_num
2024-05-16 10:58:54 -03:00
Sergio R. Caprile dd883c0563 Merge pull request #2755 from cesanta/mbed
unbreak MbedTLS in Linux
2024-05-16 10:09:59 -03:00
Sergio R. Caprile 16a0c89d5f unbreak MbedTLS in Linux 2024-05-16 09:55:01 -03:00
Sergey Lyubka ac0e6f3377 Squash warnings on gcc 9.4 2024-05-16 11:13:21 +01:00
Sergey Lyubka 68f7be7a1a Merge pull request #2745 from cesanta/tls
Fix mbedTLS binding for 3.x
2024-05-16 10:45:46 +01:00
Sergey Lyubka b796e33ede Fix mbedTLS binding for 3.x 2024-05-16 10:45:11 +01:00
Sergey Lyubka 1051ba77c0 Merge pull request #2753 from julek-wolfssl/wolfssl
Add wolfSSL support
2024-05-16 10:18:38 +01:00
Juliusz Sosinowicz cb5b6b972a Turn off hanging test
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2024-05-16 10:37:31 +02:00
Juliusz Sosinowicz 925f21aca4 Update nightly
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2024-05-16 10:37:31 +02:00
Juliusz Sosinowicz dc09851ac8 Add wolfSSL support
- Added Makefile wolfSSL build option with `SSL=WOLFSSL`
- Fixed missing BIO symbol errors
- Rename `fe` to `mg_fe` as it collides with `fe` defined in `wolfssl/wolfcrypt/fe_operations.h`
- byte variable name shadows the wolfSSL byte type

Tested with `make test`

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2024-05-16 10:37:31 +02:00
Sergey Lyubka 323ba9d90c Merge pull request #2754 from cesanta/s390
Fix endianness issues in X25519 code
2024-05-15 22:01:53 +01:00
Sergey Lyubka c6ff8ab6dc Fix endianness issues in X25519 code 2024-05-15 21:56:47 +01:00
Sergio R. Caprile b5443f10c5 add mg_str_to_num 2024-05-15 16:46:31 -03:00
Sergio R. Caprile 3ae1a0f82a Merge pull request #2750 from cesanta/gbephy
fix LAN87x
2024-05-13 16:29:17 -03:00
Sergio R. Caprile 81f0f8a7c2 fix LAN87x 2024-05-13 16:12:51 -03:00
Sergey Lyubka 50963df42f Update mongoose.c 2024-05-11 13:29:40 +01:00
Sergio R. Caprile b316989378 Merge pull request #2749 from cesanta/strip
silence fuzzer
2024-05-10 12:14:59 -03:00
Sergio R. Caprile 23c68e2677 silence fuzzer 2024-05-10 11:12:12 -03:00
Sergio R. Caprile b46bee0540 Merge pull request #2737 from cesanta/strip
cleanup 'str' API
2024-05-09 14:43:39 -03:00
Sergio R. Caprile 4c6c27d8f6 fix 573f13c 2024-05-09 14:38:57 -03:00
Sergio R. Caprile 3c531897b6 cleanup 'str' API 2024-05-09 14:10:27 -03:00
Sergio R. Caprile 6c7672f4af Merge pull request #2747 from cesanta/t2
Reduce stack usage in mg_tls_hexdump()
2024-05-09 11:54:55 -03:00
Sergey Lyubka 2def6e867d Reduce stack usage in mg_tls_hexdump() 2024-05-09 15:48:55 +01:00
Sergey Lyubka 573f13c1ed Add mg_now() 2024-05-08 14:23:17 +01:00
Sergey Lyubka b7f9e5c947 Fix path 2024-05-08 14:07:20 +01:00
Sergey Lyubka da85affe5c Refactor OTA API 2024-05-08 05:38:13 +01:00
Sergio R. Caprile 3168a2aca0 Merge pull request #2743 from cesanta/warn
Squash warning
2024-05-07 17:08:07 -03:00
Sergio R. Caprile 1f5feaa103 Merge pull request #2744 from cesanta/certs
regenerate certs
2024-05-07 15:13:07 -03:00
Sergio R. Caprile 4be3dfd52b Fix nomadic brew 2024-05-07 14:56:48 -03:00
Sergio R. Caprile 1e26983263 Merge pull request #2742 from cesanta/esp32ota
Add MG_OTA_ESP32
2024-05-07 14:31:14 -03:00
Sergey Lyubka a620419b59 Add MG_OTA_ESP32 2024-05-07 18:15:32 +01:00
Sergey Lyubka ffdc9b0d3a Squash warning 2024-05-07 15:41:09 +01:00
Sergey Lyubka 379e047289 regenerate certs 2024-05-07 15:40:13 +01:00
Sergio R. Caprile 8e420406b9 Merge pull request #2740 from cesanta/newskeleton
move to new skeleton
2024-05-01 15:19:08 -03:00
Sergio R. Caprile fc0364b321 move to new skeleton 2024-05-01 15:17:39 -03:00
Sergio R. Caprile ea4986dec5 Merge pull request #2739 from cesanta/newskeleton
move to new skeleton
2024-05-01 14:44:15 -03:00
Sergio R. Caprile 2be30a3193 move to new skeleton 2024-05-01 14:42:21 -03:00
Sergio R. Caprile 81f90c7b51 Merge pull request #2738 from cesanta/newskeleton
move to new skeleton
2024-05-01 14:19:16 -03:00
Sergio R. Caprile 205a564482 move to new skeleton 2024-05-01 14:16:43 -03:00
Sergio R. Caprile 497df68de1 Merge pull request #2735 from cesanta/newskeleton
move to new skeleton
2024-04-29 13:47:14 -03:00
Sergio R. Caprile eaf8e24d4c move to new skeleton 2024-04-29 13:45:20 -03:00
Sergio R. Caprile 1721fb0484 Merge pull request #2734 from cesanta/newskeleton
move to new skeleton
2024-04-29 11:26:00 -03:00
Sergio R. Caprile fe0b144b84 move to new skeleton 2024-04-29 11:23:00 -03:00
Sergio R. Caprile d391bca2d3 Merge pull request #2733 from cesanta/newskeleton
move to new skeleton
2024-04-29 11:02:31 -03:00
Sergio R. Caprile a0b6e70ff8 move to new skeleton 2024-04-29 10:58:43 -03:00
robert 4f15392440 Patched XMC7 eth 2024-04-29 07:18:52 -04:00
Sergey Lyubka 959fcfdf1d Fix paths 2024-04-28 13:26:53 +01:00
Sergio R. Caprile 57f90d200d Merge pull request #2731 from cesanta/newskeleton
move to new skeleton
2024-04-26 17:01:58 -03:00
Sergio R. Caprile 663c645cf1 move to new skeleton 2024-04-26 16:58:58 -03:00
Sergio R. Caprile 972b255a48 Merge pull request #2729 from cesanta/newskeleton
move to new skeleton
2024-04-26 13:47:39 -03:00
Sergio R. Caprile 8c5dfa4227 move to new skeleton 2024-04-26 13:46:18 -03:00
Sergio R. Caprile 290d48e1aa Merge pull request #2727 from cesanta/newskeleton
move to new skeleton
2024-04-25 17:09:13 -03:00
Sergio R. Caprile 4eb3a1c978 move to new skeleton 2024-04-25 16:54:28 -03:00
Sergio R. Caprile b4a36a8303 Merge pull request #2726 from cesanta/newskeleton
move to new skeleton
2024-04-25 15:21:35 -03:00
Sergio R. Caprile d08ee4e63a move to new skeleton 2024-04-25 15:18:59 -03:00
Sergio R. Caprile 42f5802e47 Merge pull request #2725 from cesanta/newskeleton
move to new skeleton
2024-04-25 14:46:57 -03:00
Sergio R. Caprile 120ffb0b1f move to new skeleton 2024-04-25 14:45:28 -03:00
Sergey Lyubka d3a3ba0a32 Linkify mongoose.{c,h} 2024-04-25 11:32:57 +01:00
Sergio R. Caprile 79eebc14bb Merge pull request #2723 from cesanta/newskeleton
move to new skeleton
2024-04-24 17:12:17 -03:00
Sergey Lyubka 6fc41e2a3c Merge pull request #2720 from cesanta/tlsblues
TLS corner cases
2024-04-24 20:44:57 +01:00
Sergio R. Caprile 4843323f87 move to new skeleton 2024-04-24 16:09:24 -03:00
Sergio R. Caprile 04c6f3e6ef Merge pull request #2722 from cesanta/newskeleton
start moving to new skeleton
2024-04-24 12:03:10 -03:00
Sergio R. Caprile 5345c7260e start moving to new skeleton 2024-04-24 11:57:53 -03:00
Sergio R. Caprile 71a48ccde0 Merge pull request #2721 from cesanta/leftovers
track recent changes
2024-04-23 16:31:30 -03:00
Sergio R. Caprile 41e24d7733 track recent changes 2024-04-23 15:12:40 -03:00
Sergio R. Caprile f888b30863 TLS corner cases 2024-04-23 11:24:47 -03:00
Sergey Lyubka 10029d6a8d Merge pull request #2718 from cesanta/pathissane
change mg_path_is_sane()
2024-04-22 20:58:02 +01:00
Sergio R. Caprile 6697a2cfaa change mg_path_is_sane() 2024-04-22 11:27:22 -03:00
Sergey Lyubka 59020e0d5d Merge pull request #2717 from cesanta/xmc7
XMC7 full working example
2024-04-22 09:42:42 +01:00
robert 70abd1f98d XMC7 full working example 2024-04-22 03:15:10 -04:00
Sergey Lyubka 312ca8e978 Tiny nit - fix dependencies 2024-04-20 18:24:41 +01:00
Sergey Lyubka e1ccdc0570 Merge pull request #2657 from cesanta/xmc-eth
Added ethernet driver for Infineon XMC4 boards
2024-04-20 14:58:12 +01:00
Sergey Lyubka c7f9fe4a03 Merge pull request #2714 from cesanta/Makefly
move Makefile to test/
2024-04-20 08:12:23 +01:00
Sergio R. Caprile 89aaf1c30c move Makefile to test/ 2024-04-19 18:53:25 -03:00
Sergio R. Caprile 601af780c9 Merge pull request #2713 from cesanta/nodetemb
move Mongoose options to mongoose_config
2024-04-19 10:50:05 -03:00
Sergio R. Caprile 93477c8db4 move Mongoose options to mongoose_config 2024-04-19 10:47:16 -03:00
Sergey Lyubka ec5531dbf4 Merge pull request #2711 from cesanta/nodetemb
remove arch autodetection for embedded
2024-04-19 06:04:27 +01:00
Sergio R. Caprile 157f87f01a remove arch autodetection for embedded 2024-04-18 17:28:40 -03:00
Sergio R. Caprile 0f4ca8d010 Merge pull request #2710 from cesanta/2650plus
fix fuzzer
2024-04-18 10:15:00 -03:00
Sergio R. Caprile 0a168b6791 fix fuzzer 2024-04-18 10:05:41 -03:00
Sergey Lyubka a025577b30 Merge pull request #2709 from cesanta/bye_http_match_uri
remove http_match_uri()
2024-04-17 21:52:54 +01:00
Sergio R. Caprile ef61d6ea48 remove http_match_uri() 2024-04-17 16:13:10 -03:00
Sergey Lyubka e6bf658271 Fix #2685 - squash warnings in tls_builtin 2024-04-17 07:32:51 +01:00
Sergio R. Caprile 9cccb9839b Merge pull request #2691 from cesanta/mqtt12
add simple API support for app MQTT pub retries
2024-04-16 19:18:11 -03:00
Sergio R. Caprile 2bd188f3d6 add simple API support for app MQTT pub retries 2024-04-16 19:17:37 -03:00
Sergio R. Caprile 9fa840c1c7 Merge pull request #2650 from cesanta/str
Fix #2612 - struct mg_str::ptr -> buf
2024-04-16 19:12:03 -03:00
Sergey Lyubka e0e599ffa1 Fix #2612 - struct mg_str::ptr -> buf 2024-04-16 22:42:45 +01:00
Sergey Lyubka e93d18d200 Merge pull request #2707 from cesanta/mgcfg
Rename mongoose_custom as mongoose_config
2024-04-16 22:07:13 +01:00
Sergio R. Caprile 34150f3f71 Rename mongoose_custom as mongoose_config 2024-04-16 17:28:31 -03:00
Sergio R. Caprile db6730c8a3 Merge pull request #2706 from cesanta/tlspoll
poll TLS to process outstanding data in receive buffer
2024-04-15 14:24:22 -03:00
Sergio R. Caprile 08cac802a4 poll TLS to process outstanding data in receive buffer 2024-04-15 12:13:31 -03:00
Sergio R. Caprile af6a52e060 Merge pull request #2704 from cesanta/gbephy
Add support for DP83867
2024-04-15 11:58:47 -03:00
Sergio R. Caprile 1c63645254 Add support for DP83867 2024-04-12 17:11:10 -03:00
Sergey Lyubka be5d8b1d4f Merge pull request #2702 from cesanta/zlw
Allow zero-length 'last-will' messages
2024-04-12 08:12:28 +01:00
Sergio R. Caprile 2ac3552e6e Allow zero-length 'last-will' messages 2024-04-11 11:20:46 -03:00
Sergio R. Caprile 3c3c775213 Merge pull request #2699 from cesanta/rewact
increase builtin TLS test coverage
2024-04-10 17:17:10 -03:00
Sergio R. Caprile a24b7043ed increase builtin TLS test coverage 2024-04-10 17:07:12 -03:00
Sergio R. Caprile 7b621d7b5b Merge pull request #2697 from cesanta/ft
update to MG_EV_HTTP_HDRS
2024-04-10 14:38:15 -03:00
Sergio R. Caprile 8a335a8cea update to MG_EV_HTTP_HDRS 2024-04-10 12:20:33 -03:00
Sergio R. Caprile 355c292dbf Merge pull request #2696 from cesanta/rewact
fix missing install
2024-04-09 11:00:13 -03:00
Sergio R. Caprile 2511d747ae fix missing install 2024-04-09 10:57:52 -03:00
Sergey Lyubka 03c326a04e Add driver init for IMXRT 2024-04-09 12:07:36 +02:00
Sergio R. Caprile b3312f3761 Merge pull request #2690 from cesanta/rewact
fix Valgrind dependencies
2024-04-05 15:59:14 -03:00
Sergio R. Caprile 2e250ee7aa fix Valgrind dependencies 2024-04-05 15:56:50 -03:00
Sergey Lyubka 924984dde1 Merge pull request #2682 from sasha0552/patch-1
fix typo
2024-04-05 10:17:56 +01:00
Sergio R. Caprile 33b7bb91d9 Merge pull request #2688 from cesanta/rewact
improve test coverage and run time
2024-04-04 17:21:49 -03:00
Sergio R. Caprile f68fe0fb5c improve test coverage and run time 2024-04-04 17:16:38 -03:00
Sergio R. Caprile e6663ec186 Merge pull request #2687 from cesanta/shh
Keepup with Zephyr project's enjoyment of changing headers
2024-04-04 12:55:01 -03:00
Sergio R. Caprile 6ff0f9ccd8 Keepup with Zephyr project's enjoyment of changing headers 2024-04-04 12:49:37 -03:00
sasha0552 48830aa9a9 fix typo 2024-04-03 22:14:47 +00:00
Sergio R. Caprile 9276f764e0 Merge pull request #2681 from cesanta/ub
keep embedded-friendly config API
2024-04-03 15:53:02 -03:00
Sergio R. Caprile 7876d464f2 keep embedded-friendly config API 2024-04-03 15:48:57 -03:00
Sergio R. Caprile 5d0d01c2c1 Merge pull request #2678 from cesanta/noscrsh
no screenshots
2024-04-02 18:12:31 -03:00
Sergio R. Caprile 393418d50d no screenshots 2024-04-02 18:11:11 -03:00
Sergio R. Caprile 23bb912eb5 Merge pull request #2677 from cesanta/noscrsh
no screenshots
closes #2611
2024-04-02 16:38:16 -03:00
Sergio R. Caprile 1d5b5296da no screenshots 2024-04-02 16:37:14 -03:00
Sergey Lyubka 655f5db996 Merge pull request #2675 from dvosully/esp32_device_dashboard_firmware_update
Implement firmware update in ESP32 device-dashboard example
2024-04-02 05:12:26 +01:00
dvosully c20cc4ae09 Implement firmware update in ESP32 device-dashboard example using espressif OTA APIs 2024-03-31 19:40:44 +10:00
Sergey Lyubka 7581229bbf Merge pull request #2669 from cesanta/tls
Squash warnings
2024-03-27 09:05:31 +00:00
Sergey Lyubka d094e090ff Squash warnings 2024-03-27 08:58:48 +00:00
robert c7a13025e4 Added ethernet driver for Infineon XMC4 boards 2024-03-26 10:21:09 -04:00
Sergey Lyubka e4cd6bd824 Cleanup debugging leftovers 2024-03-26 11:33:59 +00:00
Sergio R. Caprile f3ad0572e2 Merge pull request #2667 from cesanta/rewact
code .remove MbedTLS from essentials. Add tests in full
2024-03-25 18:36:53 -03:00
Sergio R. Caprile 406d6cc305 remove MbedTLS from essentials. Add tests in full 2024-03-25 18:35:46 -03:00
Sergio R. Caprile d042697b10 Merge pull request #2663 from cesanta/tls
TLS client implementation
2024-03-25 16:56:43 -03:00
Sergey Lyubka ba678b9ad1 TLS client implementation 2024-03-25 19:20:40 +00:00
Sergio R. Caprile 7a5cf118e9 Merge pull request #2666 from cesanta/ra
silence pedantic new versions
2024-03-25 10:43:37 -03:00
Sergio R. Caprile e9a2da61ef silence pedantic new versions 2024-03-25 10:35:30 -03:00
Sergio R. Caprile d3fe1ef681 Merge pull request #2665 from cesanta/rewact
add RA6 and RT1170 build tests
2024-03-25 09:48:49 -03:00
Sergio R. Caprile 9725bca966 add RA6 and RT1170 build tests 2024-03-25 09:47:27 -03:00
Sergio R. Caprile 1f627e4263 Merge pull request #2664 from cesanta/rewact
add RA6 and RT1170 build tests
2024-03-25 09:41:08 -03:00
Sergio R. Caprile 7ac0c5fc2a add RA6 and RT1170 build tests 2024-03-25 09:34:56 -03:00
Sergey Lyubka 091ebd8a98 Update readme 2024-03-25 08:52:59 +00:00
Sergey Lyubka d9a6e85b65 Merge pull request #2658 from cesanta/rt1170
RT1170
2024-03-23 05:33:46 +00:00
Sergio R. Caprile 7cc3d89980 Add RT1170 example 2024-03-22 13:44:01 -03:00
Sergio R. Caprile f58b90f7ea Merge pull request #2655 from cesanta/z
Zephyr fcntl
2024-03-21 14:03:03 -03:00
Sergio R. Caprile fd84109c1d Zephyr fcntl 2024-03-21 13:57:10 -03:00
Sergio R. Caprile 626f605835 Support RT11, fix RTL PHY, fix RA err cntr 2024-03-20 10:35:05 -03:00
Sergio R. Caprile 943a8a2708 fix references to RM 2024-03-20 10:35:05 -03:00
Sergio R. Caprile d7b2b3f42e Merge pull request #2648 from cesanta/autoinit
Refactor autoinit code
2024-03-17 14:22:25 -03:00
Sergey Lyubka fafc5c8348 Refactor autoinit code 2024-03-15 20:23:37 +00:00
Sergio R. Caprile 15bd8b4fe9 Merge pull request #2647 from cesanta/phy
Split PHY code into phy.{c,h}
2024-03-15 11:04:45 -03:00
Sergio R. Caprile 928aed4342 Split PHY code into phy.{c,h}; add PHY config to STM32H driver 2024-03-15 10:37:54 -03:00
Sergey Lyubka 98782e44c2 Nit changes to the fleet dashboard 2024-03-13 13:41:22 +00:00
Sergio R. Caprile 65b23777b2 Merge pull request #2642 from cesanta/autoinit
Add driver init to mg_mgr_init()
2024-03-12 20:36:59 -03:00
Sergio R. Caprile c8fd3d6d25 Add driver init to mg_mgr_init() 2024-03-12 15:55:35 -03:00
Sergey Lyubka 01e7cd5f13 Merge pull request #2646 from cesanta/tls
Fix #2619 - use mg_tls_pending() API to check for buffered TLS data
2024-03-12 08:49:32 +00:00
Sergey Lyubka 3ac9bd0468 Fix #2619 - use mg_tls_pending() API to check for buffered TLS data 2024-03-12 08:30:04 +00:00
Sergio R. Caprile 9f498d2eea Merge pull request #2645 from cesanta/mp
tie Micropython examples to a stable release
2024-03-11 11:09:39 -03:00
Sergio R. Caprile 2d2d9ad277 tie Micropython examples to a stable release 2024-03-11 11:07:18 -03:00
Sergey Lyubka 2cc18a8ea3 Snippets 2024-03-10 19:00:32 +00:00
Sergey Lyubka 25036d5f48 Link to mongoose.ws 2024-03-10 18:59:02 +00:00
Sergey Lyubka defee39ef9 Link to mongoose.ws 2024-03-10 18:58:14 +00:00
Sergey Lyubka c78afb12a3 Remove dead link 2024-03-10 18:53:02 +00:00
Sergey Lyubka f72b0b5056 Merge pull request #2632 from cesanta/reorg
Reorg skeleton
2024-03-09 16:04:35 +00:00
Sergey Lyubka d46e505a80 Reorg skeleton 2024-03-09 16:01:06 +00:00
Sergey Lyubka 4027bcf7ea Update readme 2024-03-09 10:29:14 +00:00
Sergey Lyubka 2905392665 Update readme 2024-03-09 10:28:43 +00:00
Sergio R. Caprile 98db3360df Merge pull request #2641 from cesanta/aes
prefix macros in tls_aes128
2024-03-06 12:06:09 -03:00
Sergio R. Caprile f26c713482 prefix macros in tls_aes128 2024-03-06 11:59:12 -03:00
Sergey Lyubka 05e55334fc Fix vc98 build 2024-03-06 00:57:31 +00:00
Sergey Lyubka 01fe61276e Add unit test for semicolon in value 2024-03-06 00:49:55 +00:00
Sergey Lyubka 219253ad71 Merge pull request #2636 from cesanta/mg_http_upload
Increase local file buffer size in mg_http_upload()
2024-03-05 06:05:36 +00:00
Sergey Lyubka 7b125558cb Merge pull request #2639 from cesanta/ack2
Better acks
2024-03-05 06:05:20 +00:00
Sergey Lyubka 02120e24b6 Better acks 2024-03-03 10:59:31 +00:00
Sergey Lyubka 91bc79c14c Merge pull request #2638 from cesanta/ack
restart timer when acking
2024-03-02 20:59:04 +00:00
Sergio R. Caprile 5ca552cf1c restart timer when acking 2024-03-02 15:25:02 -03:00
Sergio R. Caprile 2066304b14 Merge pull request #2637 from cesanta/ack
Sending ACK when about to exhaust TCP WIN1
2024-03-02 12:50:29 -03:00
Sergey Lyubka 1c6f8b95eb Sending ACK when about to exhaust TCP WIN1 2024-03-02 15:44:08 +00:00
Sergio R. Caprile 5384591f5b Merge pull request #2635 from cesanta/uploads
Enhance upload example - write uploaded file
2024-03-02 11:21:55 -03:00
Sergey Lyubka 309668ccbc Increase local file buffer size in mg_http_upload() 2024-03-02 10:56:06 +00:00
Sergey Lyubka 06a9fb3f53 Enhance upload example 2024-03-02 10:12:43 +00:00
Sergio R. Caprile 00db56f7d7 Merge pull request #2634 from cesanta/MG_EV_HTTP_HDRS
Introduce MG_EV_HTTP_HDRS
2024-03-01 20:50:57 -03:00
Sergey Lyubka cec06eb25c Introduce MG_EV_HTTP_HDRS 2024-03-01 23:29:12 +00:00
Sergey Lyubka 73a3897e1b Merge pull request #2630 from cesanta/2593-mongoose-closes-the-connection-without-responding-to-post-requests-that-dont-have-explicit-lengths
HTTP: respond to messages which have no explicit lengths
2024-02-28 19:21:06 +00:00
Sergey Lyubka 100c4c15ce 2024 2024-02-28 18:16:00 +00:00
robert c59bf6613a HTTP: respond to messages which have no explicit lengths 2024-02-28 04:01:39 -05:00
Sergio R. Caprile ac435bcb91 Merge pull request #2629 from cesanta/z
Satisfy new Zephyr config
2024-02-27 11:51:45 -03:00
Sergio R. Caprile 5d0bfccbc7 Satisfy new Zephyr config 2024-02-27 11:32:16 -03:00
Sergio R. Caprile 813489dc2f Merge pull request #2627 from cesanta/z
update
2024-02-26 16:59:16 -03:00
Sergio R. Caprile 828f31d5e6 update 2024-02-26 16:58:04 -03:00
Sergio R. Caprile 8130f7f25f Merge pull request #2625 from cesanta/c89
Make net_builtin C89 friendly
2024-02-26 09:20:42 -03:00
Sergey Lyubka 943e1c5f77 Adopt arch_freertos.h for CCRH compiler 2024-02-26 12:05:35 +00:00
Sergey Lyubka ecb3301bcb Make net_builtin C89 friendly 2024-02-25 12:21:06 +00:00
Sergio R. Caprile a0f33aebf7 Merge pull request #2624 from cesanta/2620
test returned content-type for custom 404
2024-02-23 09:15:45 -03:00
Sergio R. Caprile 6862981640 test returned content-type for user page404 2024-02-23 09:11:42 -03:00
Sergey Lyubka f61f2d2e9f Merge pull request #2620 from cesanta/2617
fix wrong MIME type for custom 404
2024-02-23 01:50:02 +00:00
Sergey Lyubka 1743e175cd Merge pull request #2623 from cesanta/r2d2
Add support for RA6M4
2024-02-23 00:45:47 +00:00
Sergio R. Caprile a027f58744 Add support for RA6M4 2024-02-22 20:51:01 -03:00
Sergio R. Caprile c98886402b Merge pull request #2621 from cesanta/ccrh
Adopt CCRH compiler
2024-02-22 20:18:15 -03:00
Sergey Lyubka 112a1e908a Adopt CCRH compiler 2024-02-22 17:53:15 +00:00
Sergey Lyubka 01ae80ecd1 Fix fuzzer call for mg_span() 2024-02-22 08:36:25 +00:00
Sergio R. Caprile 52997c6c51 update version 2024-02-21 08:50:06 -03:00
Sergio R. Caprile 1c114a279e fix wrong MIME type for custom 404 2024-02-20 19:08:07 -03:00
Sergey Lyubka 93148e3223 Merge pull request #2616 from cesanta/upload
Add file upload functionality to the http-server example
2024-02-20 12:07:19 +00:00
Sergey Lyubka f01807ef17 Add file upload functionality to the http-server example 2024-02-20 11:39:28 +00:00
Sergio R. Caprile a4ed740518 Merge pull request #2610 from cesanta/file_read
Change mg_file_read() signature: return mg_str
2024-02-16 09:48:08 -03:00
Sergey Lyubka 0e2f3de154 Change mg_file_read() signature: return mg_str 2024-02-16 12:07:35 +00:00
Sergey Lyubka d128d2146a Online status 2024-02-15 09:49:59 +00:00
Sergey Lyubka c683e1e988 More style changes 2024-02-15 09:46:42 +00:00
Sergey Lyubka 0b7038d44d Fixed layout 2024-02-15 09:38:32 +00:00
Sergey Lyubka 55698b91c0 Disable OTA for now.. 2024-02-15 09:26:37 +00:00
Sergey Lyubka eff54827b2 Fix config reporting 2024-02-14 23:46:43 +00:00
Sergio R. Caprile 2c2c7f6894 Merge pull request #2609 from cesanta/loc
Fill c->loc for outbound connections
2024-02-14 09:51:10 -03:00
Sergey Lyubka 5baa4d969e Fill c->loc for outbound connections 2024-02-14 12:32:26 +00:00
Sergey Lyubka d745c41d5b Merge pull request #2608 from cesanta/mqtt-dash
Update mqtt-dashboard, adopt new UI, break OTA for now..
2024-02-14 12:18:17 +00:00
Sergey Lyubka a86bde7b3f Update mqtt-dashboard, adopt new UI, break OTA for now.. 2024-02-14 12:14:17 +00:00
Sergio R. Caprile 4ab2309a5d Merge pull request #2607 from cesanta/tls
Fix #2603: TLS read path
2024-02-14 08:50:44 -03:00
Sergey Lyubka 9172f62970 Fix #2603: TLS read path 2024-02-13 05:49:15 +00:00
Sergey Lyubka daa47e8272 Merge pull request #2604 from cesanta/pipeline
Fix #2592: do not close pipelined connection prematurely
2024-02-13 05:48:34 +00:00
Sergey Lyubka 2419f02766 Fix #2592: do not close pipelined connection prematurely 2024-02-11 09:05:19 +00:00
Sergio R. Caprile c8d45c9ff1 Merge pull request #2601 from cesanta/dns
cap # responses instead of rejecting
2024-02-09 12:35:15 -03:00
Sergio R. Caprile 0b667ca869 cap # responses instead of rejecting 2024-02-09 12:28:56 -03:00
Sergio R. Caprile 1a5ea930ab Update fuzz.c for mg_commalist -> mg_span 2024-02-04 23:41:16 -03:00
Sergey Lyubka e4bfb2b5b0 Merge pull request #2597 from cesanta/str
mg_split -> mg_span. Remove mg_commalist
2024-02-04 09:39:08 +00:00
Sergey Lyubka 936e7bbc88 mg_split -> mg_span. Remove mg_commalist 2024-02-04 09:26:42 +00:00
Sergey Lyubka 93b5063251 Merge pull request #2599 from cesanta/upload
Allow user specify file in mg_http_upload
2024-02-04 09:07:28 +00:00
Sergey Lyubka e0668bc1c0 Allow user specify file in mg_http_upload 2024-02-04 08:56:32 +00:00
Sergey Lyubka fa5aa308bc Merge pull request #2596 from cesanta/ls
Add helper mg_fs_ls()
2024-02-01 18:25:05 +00:00
Sergey Lyubka cbfa57a955 Add helper mg_fs_ls() 2024-02-01 18:24:37 +00:00
Sergey Lyubka f8898b016e More unit tests for mg_split() 2024-02-01 18:21:46 +00:00
Sergio R. Caprile 8a9630485f fix sorting issues with locales 2024-02-01 10:22:30 -03:00
Sergio R. Caprile 066e4ac332 Merge pull request #2594 from cesanta/mg_json_get_tok
Add helper function mg_json_get_tok
2024-02-01 09:35:08 -03:00
Sergey Lyubka f231760395 Add helper function mg_json_get_tok 2024-02-01 12:05:49 +00:00
Sergey Lyubka ebfa5f0ba7 Add ek-ra6m4 example 2024-01-27 17:06:28 +00:00
Sergio R. Caprile d7754516f0 no diff checks in nightly tests 2024-01-26 14:33:22 -03:00
Sergio R. Caprile 00fd1884ff no diff checks in nightly tests 2024-01-26 12:54:07 -03:00
Sergio R. Caprile b828be4873 no diff checks in nightly tests 2024-01-26 12:48:04 -03:00
Sergio R. Caprile 4045a541ef Merge pull request #2590 from cesanta/rewact
Rework tests
2024-01-26 12:28:48 -03:00
Sergio R. Caprile f7557c9e48 trigger 2024-01-26 12:27:04 -03:00
Sergio R. Caprile 7c62b5005e work in progress 2024-01-26 12:15:48 -03:00
Sergey Lyubka b804217501 Merge pull request #2581 from cesanta/2559
Fix #2559: order of handlers: protocol first, user second
2024-01-26 14:03:54 +00:00
Sergio R. Caprile c6128094b6 rebase and update file-transfer example 2024-01-26 10:40:59 -03:00
Sergey Lyubka 0fc0230364 Changed the order of handlers: protocol first, user second 2024-01-26 10:34:24 -03:00
Sergio R. Caprile dd6458262d Merge pull request #2588 from cesanta/ft
Add file transfer example
2024-01-25 15:12:49 -03:00
Sergio R. Caprile eb68bb2ce1 Add file-transfer example 2024-01-25 15:05:48 -03:00
Sergio R. Caprile 8dc62c25ed Merge pull request #2587 from cesanta/tls
Fix #2570: close only when TLS buffers drained
2024-01-23 14:03:33 -03:00
Sergey Lyubka d8fec13d2c Fix #2570: close only when TLS buffers drained 2024-01-23 11:10:15 +00:00
Sergey Lyubka 922d148ab5 Add misra target 2024-01-23 11:09:16 +00:00
Sergio R. Caprile 08f05d6f8c Merge pull request #2585 from cesanta/fai
prefix PHY-related constants
2024-01-22 18:45:00 -03:00
Sergio R. Caprile 7bec3b4954 Merge pull request #2586 from cesanta/pos9
rename MG_ENABLE_FILE to MG_ENABLE_POSIX_FS
2024-01-22 16:48:17 -03:00
Sergio R. Caprile 4d3fba57d4 rename MG_ENABLE_FILE to MG_ENABLE_POSIX_FS 2024-01-22 16:21:57 -03:00
Sergio R. Caprile 1a8a144726 prefix PHY-related constants 2024-01-22 14:27:22 -03:00
Sergio R. Caprile 00ea3830a7 Merge pull request #2580 from cesanta/2552
Fix #2552 - reject requests with invalid/absent chunk length
2024-01-22 09:20:56 -03:00
Sergey Lyubka 3880300cd9 Add 256/64 build 2024-01-21 12:49:57 +00:00
Sergey Lyubka 6b0e4a425d Fix #2552 - reject requests with invalid/absent chunk length 2024-01-20 09:35:01 +00:00
Sergey Lyubka f883504d2d Fix #2573 - GCC build warning in tls_builtin.c::mul() 2024-01-20 08:51:01 +00:00
robertc2000 a1c5995967 Merge pull request #2562 from cesanta/imxflash-2
RT1020 and RT1060 OTA
2024-01-19 15:55:35 +02:00
robert 8500afbbd4 RT1020 and RT1060 OTA 2024-01-19 02:47:23 -05:00
Sergio R. Caprile 13cb94cf2b Merge pull request #2575 from cesanta/flexsdk
remove flexspi.h
2024-01-18 17:51:02 -03:00
Sergio R. Caprile f26a79d75c remove flexspi.h 2024-01-18 17:47:02 -03:00
Sergey Lyubka 68e2cd9b29 Fix WCH example 2024-01-17 18:07:25 +00:00
Sergio R. Caprile 6e44bab3d5 Merge pull request #2572 from cesanta/armccnodet
change mongoose_custom for Keil
2024-01-16 16:59:23 -03:00
Sergio R. Caprile 677fea7bfa change mongoose_custom for Keil 2024-01-16 16:21:05 -03:00
Sergio R. Caprile 0d2ae10bd9 Merge pull request #2571 from cesanta/dhcpsidfb
Fallback to IP source address on DHCP servers not filling sid
2024-01-16 10:26:34 -03:00
Sergio R. Caprile faa582040b Fallback to IP source address on DHCP servers not filling sid 2024-01-16 09:56:05 -03:00
Sergey Lyubka 0ad4002569 Make TLS less verbose 2024-01-14 23:27:52 +00:00
Sergey Lyubka dfc2e97d5e Squash warning 2024-01-14 22:10:18 +00:00
Sergio R. Caprile 57159dc5c0 Merge pull request #2568 from cesanta/1020flash
default to flash 1020
2024-01-12 14:23:48 -03:00
Sergio R. Caprile 77ff1511ff default to flash 1020 2024-01-12 14:20:46 -03:00
Sergio R. Caprile 124ab99995 Merge pull request #2554 from cesanta/1060flash
1060flash
2024-01-11 16:25:21 -03:00
Sergey Lyubka 8ea08306b8 Update year to 2024 2024-01-10 14:31:09 +00:00
Sergey Lyubka 3e0d20a335 Fix H573 example 2024-01-10 14:25:38 +00:00
Sergio R. Caprile 727b3d4f19 Merge pull request #2565 from cesanta/backlog
Set default listen backlog size back to 128
2024-01-10 08:45:33 -03:00
Sergey Lyubka 80782b289f Set default listen backlog size back to 128 2024-01-10 11:10:43 +00:00
Sergey Lyubka 72127a4bed README 2024-01-10 11:01:20 +00:00
Sergey Lyubka d4a49e00e7 Add Usage section to README 2024-01-10 10:58:30 +00:00
Sergio R. Caprile 5826d0e41c Merge pull request #2560 from cesanta/fn_data
remove fn_data from event handler signature
2024-01-09 15:40:46 -03:00
Sergio R. Caprile 68cb7ce8d9 cleanup 2024-01-09 14:55:04 -03:00
Sergio R. Caprile 514699fc41 cleanup 2024-01-09 14:54:19 -03:00
Sergio R. Caprile deca1aaf46 remove fn_data from event handler signature 2024-01-09 14:51:19 -03:00
Sergey Lyubka b8bfa5565b Merge pull request #2556 from cesanta/mt12m
add multi-threaded one to many example
2024-01-07 19:04:53 +00:00
Sergio R. Caprile 50c7844031 Merge pull request #2557 from cesanta/xpresso
add RT1060 Xpresso example
2024-01-05 18:38:32 -03:00
Sergio R. Caprile cba0d1b2f9 add RT1060 Xpresso example 2024-01-05 18:24:47 -03:00
Sergio R. Caprile 5735ee3269 default to flash 1060
workaround SysTick race condition in FreeRTOS example
2024-01-05 13:49:50 -03:00
Sergio R. Caprile ee3593b887 add multi-threaded one to many example 2024-01-05 12:12:00 -03:00
Sergey Lyubka 9bebe7cf68 Update readme 2024-01-02 10:54:00 +00:00
Sergio R. Caprile bd5e4dba26 Merge pull request #2551 from cesanta/mqttpayload
Avoid calling mg_send on no actual payload
2023-12-29 15:13:02 -03:00
Sergio R. Caprile 2427c40a4c Avoid calling mg_send on no actual payload 2023-12-29 14:58:03 -03:00
Sergey Lyubka 744df7b244 Better checks in skip_chunk() 2023-12-29 11:59:02 +00:00
Sergey Lyubka 3965aecfd4 32/288, no TLS by default 2023-12-27 22:53:48 +00:00
Sergey Lyubka 93bcde0176 Enable TLS and 256/64 mode 2023-12-27 22:45:16 +00:00
Sergio R. Caprile 4b3884a49d Update README.md 2023-12-27 18:34:59 -03:00
Sergey Lyubka 768908ae4a Merge pull request #2547 from cesanta/opta
Add STM32H747I-DISCO example
2023-12-27 20:06:30 +00:00
Sergey Lyubka 1a965d5c43 Add STM32H747I-DISCO example 2023-12-27 20:04:53 +00:00
Sergey Lyubka 01b612cff5 WCH FW build fix. Introduce phy_addr for STM32F driver 2023-12-27 15:38:51 +00:00
Sergio R. Caprile 176db1aedb remove some compiler warning 2023-12-23 19:02:05 -03:00
Sergey Lyubka 06f8238107 Fix TLS codepath for pending data. Reuse c->rtls 2023-12-22 16:17:06 +00:00
Sergio R. Caprile 97127a57da Merge pull request #2542 from cesanta/pair
Add mg_wakeup()
2023-12-21 14:22:10 -03:00
Sergey Lyubka 61825b2390 Add mg_wakeup() 2023-12-21 14:03:33 -03:00
Sergio R. Caprile 669ffe2c74 Merge pull request #2543 from cesanta/gettimeofday
Remove gettimeofday implementation, to avoid clashes
2023-12-21 13:50:09 -03:00
Sergey Lyubka a50b8ff5d7 Remove gettimeofday implementation, to avoid clashes 2023-12-21 15:05:07 +00:00
Sergey Lyubka aae2954c14 Merge pull request #2541 from cesanta/multitls
default again to current doc defaults
2023-12-21 05:10:42 +00:00
Sergio R. Caprile abab569778 default again to current doc defaults 2023-12-20 18:13:09 -03:00
Sergio R. Caprile 365a731574 Merge pull request #2540 from cesanta/reformat_comments
reformat comments
2023-12-20 16:58:56 -03:00
Sergio R. Caprile 285dc63c5c reformat comments 2023-12-20 16:40:31 -03:00
Sergio R. Caprile 24d9fbffae fix MQTT device 2023-12-20 14:49:25 -03:00
Sergey Lyubka 04178ad0f7 Merge pull request #2538 from cesanta/tls13
Add built-in TLS 1.3 stack: server side, EC support
2023-12-20 16:36:04 +00:00
Sergey Lyubka a0e66fb9e6 Add built-in TLS 1.3 stack: server side, EC support 2023-12-20 11:04:31 +00:00
Sergio R. Caprile df3c216315 Merge pull request #2535 from cesanta/hal
Move clock_init() to hal.h
2023-12-18 16:36:51 -03:00
Sergey Lyubka e9a6bad751 Move clock_init() to hal.h 2023-12-18 19:21:12 +00:00
Sergio R. Caprile 4b7d871048 Merge pull request #2537 from cesanta/stm32driver
stm32 -> stm32f
2023-12-18 16:00:27 -03:00
Sergio R. Caprile 2528dd6425 stm32 -> stm32f 2023-12-18 14:33:49 -03:00
Sergey Lyubka b3fcd9c420 Win32 build fixes 2023-12-17 10:14:08 +00:00
Sergey Lyubka 9270fc0b15 Allow to bypass CSS rebuild 2023-12-16 20:42:34 +00:00
Sergey Lyubka 33aa021e96 Allow to bypass CSS rebuild 2023-12-16 20:39:29 +00:00
Sergey Lyubka 1c78ed1fed Prevent main.css rebuild 2023-12-16 20:19:21 +00:00
Sergey Lyubka 562c318648 Recreate packed fs 2023-12-16 20:11:59 +00:00
Sergey Lyubka 65cb894f0d Change TLS port 2023-12-16 20:01:52 +00:00
Sergey Lyubka bbd27a0a9c MQTT dashboard nitpicks 2023-12-16 19:57:18 +00:00
Sergio R. Caprile 79e138ef28 Merge pull request #2534 from cesanta/stm32driver
stm32 -> stm32f
2023-12-15 22:19:20 -03:00
Sergio R. Caprile 387334c8c2 stm32 -> stm32f 2023-12-15 21:55:52 -03:00
Sergio R. Caprile cd021daf79 Merge pull request #2531 from cesanta/mqttrndis
Add MQTT device through RNDIS example
2023-12-15 13:39:21 -03:00
Sergey Lyubka 536aa1fb62 Fix post-OTA status save 2023-12-15 11:32:46 +00:00
Sergio R. Caprile a14a838dab undo leftover from PR 2508 2023-12-14 11:52:19 -03:00
Sergio R. Caprile ad57731ae1 Add MQTT device through RNDIS example 2023-12-13 17:24:52 -03:00
Sergio R. Caprile ad90b0b7b1 fix for new IDF required version 2023-12-13 17:24:16 -03:00
Sergio R. Caprile 18325cb216 Merge pull request #2529 from cesanta/573
Add Discovery STM32H573I-DK examples
2023-12-13 11:45:43 -03:00
Sergio R. Caprile 8df70ba58b Add Discovery STM32H573I-DK examples 2023-12-13 10:50:28 -03:00
Sergey Lyubka ee43a5389f Merge pull request #2522 from cesanta/mqttd
MQTT Dashboard fixes/updates
2023-12-13 11:53:59 +00:00
Sergio R. Caprile 6192573eb8 Merge pull request #2525 from cesanta/bquiet
Be less verbose on unkown eth types
2023-12-10 16:21:50 -03:00
Sergio R. Caprile 92ecef7bd3 Be less verbose on unkown eth types 2023-12-10 15:17:20 -03:00
Sergio R. Caprile 45d7f4ca7e Merge pull request #2523 from cesanta/am
TLS layer: c->rtls to optimise recvd TLS data
2023-12-10 14:54:25 -03:00
cpq 144c2f443e TLS layer: c->rtls to optimise recvd TLS data 2023-12-10 12:18:07 +00:00
Sergey Lyubka 98d877c5f0 Reenable UART logging to fix the test 2023-12-10 12:17:54 +00:00
Sergio R. Caprile 9de31ba816 updates 2023-12-08 18:36:59 -03:00
Sergio R. Caprile 560561c5b7 fixes 2023-12-08 16:35:03 -03:00
Sergey Lyubka ed2d4c1c2b Merge pull request #2519 from cesanta/prof
Add profiling capability
2023-12-08 18:43:14 +00:00
Sergio R. Caprile e70628cbdc Merge pull request #2518 from cesanta/tls
Move TLS API to tls.h, fix builtin handshake codepath
2023-12-08 14:54:50 -03:00
Sergio R. Caprile 161edec195 Merge pull request #2521 from cesanta/z
update to current TLS API
2023-12-08 14:49:45 -03:00
Sergio R. Caprile 2ba4a74762 update to current API 2023-12-08 14:41:10 -03:00
cpq 693316de44 Add profiling capability 2023-12-08 17:00:42 +00:00
cpq 6e68124405 Move TLS API to tls.h, fix builtin handshake codepath 2023-12-08 00:30:09 +00:00
Sergio R. Caprile c8105cffba Merge pull request #2517 from cesanta/mqttest
refactor matrix build tests, add mqtt-dashboard build tests for embed…
2023-12-07 11:44:41 -03:00
Sergio R. Caprile 21f6944fc7 refactor matrix build tests, add mqtt-dashboard build tests for embedded targets 2023-12-07 11:42:45 -03:00
Sergio R. Caprile 5adcba7ba1 Merge pull request #2515 from cesanta/imxflash
fix for flash boot (ROM changes defaults)
2023-12-06 17:52:49 -03:00
Sergio R. Caprile fc8ba744dc fix for flash boot (ROM changes defaults) 2023-12-06 17:45:22 -03:00
Sergey Lyubka 4fc43cfbf7 Merge pull request #2514 from cesanta/mqtt2
Mock LED settings
2023-12-06 09:43:02 +00:00
cpq 22837f93c8 Mock LED settings 2023-12-06 09:41:48 +00:00
cpq b03ececbbb Disable mbedtls, add flash target 2023-12-06 09:10:46 +00:00
Sergio R. Caprile 708908dce5 Merge pull request #2511 from cesanta/workflow
hw tests
2023-12-04 17:23:10 -03:00
Sergio R. Caprile f33302acc9 hw tests 2023-12-04 17:21:48 -03:00
Sergio R. Caprile 7f8cdf1e79 fs ls 2023-12-01 20:43:39 -03:00
Sergey Lyubka dbc7b5e70b Merge pull request #2509 from cesanta/te
Fix #2460 - sanity check of the Transfer-Encoding: chunked header
2023-12-01 13:48:35 +00:00
cpq 4c445453d3 Fix #2460 - sanity check of the Transfer-Encoding: chunked header 2023-12-01 11:24:32 +00:00
cpq 4b8fb23def Typo in v307 makefile 2023-12-01 08:36:18 +00:00
cpq 253bc64c9e Add zip target 2023-12-01 00:03:31 +00:00
cpq 32d3fc6803 Add zip target 2023-12-01 00:02:48 +00:00
Sergey Lyubka 920875ecc9 Merge pull request #2508 from cesanta/v307
Use V307 flash
2023-12-01 00:01:20 +00:00
cpq 85d3e7f375 Use V307 flash 2023-11-30 23:51:34 +00:00
Sergio R. Caprile 4ceb50d485 more Mongoose-style 2023-11-30 12:16:56 -03:00
Sergey Lyubka 7d2fca9574 Merge pull request #2505 from cesanta/mqttdevice
more Mongoose-style
2023-11-30 11:15:39 +00:00
Sergey Lyubka d88e60a525 Merge pull request #2501 from cesanta/opthwtst
test specific hw example
2023-11-30 11:14:43 +00:00
Sergio R. Caprile 4b4dcb20ca more Mongoose-style 2023-11-29 16:14:09 -03:00
Sergio R. Caprile d4ab0aa7fd Merge pull request #2503 from cesanta/imxflash
Generate flash images for RT10xx
2023-11-29 11:04:38 -03:00
Sergio R. Caprile c02c1130ed Generate flash images
TODO(scaprile): check when and if following is needed

  flash_init();                   // setup pins and clocks to access board flash
2023-11-29 10:47:05 -03:00
Sergio R. Caprile f9bbb37721 Merge pull request #2502 from cesanta/fixcubex
fix text
2023-11-28 20:13:28 -03:00
Sergio R. Caprile 57837f285f fix text 2023-11-28 19:55:27 -03:00
Sergio R. Caprile 3379f11b23 test specific hw example 2023-11-28 19:34:05 -03:00
Sergey Lyubka c74534cf5e Merge pull request #2495 from cesanta/modbus
Add modbus dashboard
2023-11-27 21:31:37 +00:00
cpq 64ca1ad787 Add modbus dashboard 2023-11-27 21:26:19 +00:00
Sergey Lyubka 8022635c04 Merge pull request #2494 from cesanta/mqttws
make Mosquitto happy
2023-11-27 13:13:14 +00:00
Sergio R. Caprile 1f37595200 make Mosquitto happy 2023-11-26 15:38:28 -03:00
Sergio R. Caprile 30738f6638 Merge pull request #2493 from cesanta/wake
Fix #2456 - wake up mongoose thread
2023-11-25 09:27:52 -03:00
cpq bd53e46873 Do not allow invalid UTF8 in method, uri, header names 2023-11-25 11:33:07 +00:00
cpq 122115dbea Fix #2456 - wake up mongoose thread 2023-11-25 08:28:39 +00:00
Sergey Lyubka 28162f8034 Merge pull request #2492 from cesanta/xpro
Fix #2487 - correct GMAC_DCFGR, receive size -> full size
2023-11-25 08:05:52 +00:00
cpq 9cfd3124ef Fix #2487 - correct GMAC_DCFGR, receive size -> full size 2023-11-25 08:04:38 +00:00
Sergey Lyubka 36748ee406 Merge pull request #2486 from cesanta/st_v307
Post-IRQ DMASR flags cleanup
2023-11-25 07:49:32 +00:00
Sergey Lyubka 2a25e449a2 Merge pull request #2476 from cesanta/mqtt-dashboard-part-2
Added MQTT Dashboard support for H723ZG
2023-11-24 10:45:49 +00:00
cpq f2f60a7b3b Post-IRQ DMASR flags cleanup 2023-11-24 10:43:56 +00:00
cpq 82916a1cef Wrap dirty IRQ flag cleanup for v307 into a conditional 2023-11-22 15:41:45 +00:00
Sergey Lyubka f86c14abb3 Merge pull request #2485 from cesanta/ch32v307
Add example for ch32v307
2023-11-22 10:23:48 +00:00
cpq fa76312313 Add example for ch32v307 2023-11-22 10:22:10 +00:00
robert 46687f6fe3 Added MQTT Dashboard support for H723ZG 2023-11-20 02:08:07 -05:00
Sergio R. Caprile 6386cdff50 Merge pull request #2478 from cesanta/mg_bit
BIT -> MG_BIT in drivers
2023-11-16 17:32:49 -03:00
Sergio R. Caprile 7c25c0d6f3 BIT -> MG_BIT 2023-11-16 17:11:04 -03:00
Sergio R. Caprile 8ed57f57cb Merge pull request #2475 from cesanta/rt
Rt
2023-11-15 19:28:36 -03:00
Sergio R. Caprile c8f207c277 rename iMX-RT 2023-11-15 19:27:20 -03:00
Sergio R. Caprile d70d9aff11 fix bits not being reset 2023-11-15 16:33:20 -03:00
cpq 1118c997b5 Nitpick - simple handler changed 2023-11-15 18:41:03 +00:00
Sergio R. Caprile b999275550 fix Teensy PHY code in _up 2023-11-15 10:46:44 -03:00
Sergey Lyubka f549646ddd Merge pull request #2474 from cesanta/rtphy
update PHY code in _up
2023-11-15 08:27:38 +00:00
Sergey Lyubka 5ee8552e6c Merge pull request #2472 from cesanta/mqtt-dashboard
Added MQTT Dashboard
2023-11-14 12:34:03 +00:00
robert b0eb7b6dec Added MQTT Dashboard 2023-11-14 05:52:33 -05:00
Sergio R. Caprile a546d360d0 update PHY code in _up 2023-11-13 23:54:37 -03:00
Sergio R. Caprile 3cc8a98b9d Merge pull request #2473 from cesanta/db
update screenshot and README
2023-11-13 11:22:46 -03:00
Sergio R. Caprile 1032f0ade7 update screenshot and README 2023-11-13 09:55:54 -03:00
cpq eb65d269eb Disable noisy debug 2023-11-13 01:57:59 +00:00
cpq b379f81004 Nit picks 2023-11-13 01:56:50 +00:00
Sergey Lyubka d1b0342a18 Merge pull request #2468 from cesanta/teensy
Add teensy41 example
2023-11-11 21:28:28 +00:00
cpq b815e6bc04 Add teensy41 example 2023-11-11 21:22:00 +00:00
Sergio R. Caprile 81bf65954c Merge pull request #2469 from cesanta/std
standardize build options
2023-11-09 14:44:34 -03:00
Sergio R. Caprile 9cfe72af4a standardize build options 2023-11-09 14:40:12 -03:00
Sergey Lyubka 7c2e1e1339 Merge pull request #2459 from cesanta/openssl
Wrap OpenSSL errors in Mongoose log
2023-11-08 17:08:04 +00:00
Sergio R. Caprile 817115cb6c Merge pull request #2467 from cesanta/std
standardize naming and build options
2023-11-08 14:00:52 -03:00
Sergio R. Caprile 7a3734e54d standardize naming and build options 2023-11-08 13:54:44 -03:00
Sergio R. Caprile 79c3341f74 Merge pull request #2465 from cesanta/std
standardize build options
2023-11-07 17:23:44 -03:00
Sergio R. Caprile abdd14b0a1 standardize build options 2023-11-07 17:05:41 -03:00
Sergio R. Caprile 1f77e53b23 Wrap OpenSSL errors in Mongoose log 2023-11-06 17:24:30 -03:00
Sergey Lyubka a619de0508 Merge pull request #2455 from cesanta/micropython
Add Micropython on ESP32 example
2023-11-04 13:31:44 +00:00
Sergio R. Caprile 8faa11585c Add Micropython on ESP32 example 2023-11-03 19:15:57 -03:00
Sergio R. Caprile 13259f8902 Merge pull request #2452 from cesanta/tlsbuiltin
Make tls_builtin build with current API
2023-11-03 15:02:27 -03:00
Sergio R. Caprile bb5aba2e19 Make tls_builtin build with current API 2023-11-03 14:02:41 -03:00
Sergio R. Caprile 22fc01d5f2 workaround warning in mbedTLS code 2023-11-03 14:02:08 -03:00
Sergio R. Caprile 3b4672c109 workaround warning in mbedTLS code 2023-11-03 10:37:14 -03:00
Sergey Lyubka 351bd42bc4 Merge pull request #2450 from cesanta/micropython
Add Micropython example
2023-11-03 06:35:38 +00:00
Sergio R. Caprile e418da4bd8 Merge pull request #2451 from cesanta/fastclose
Allow fast close
2023-11-02 18:52:11 -03:00
Sergio R. Caprile 18d13f9848 Allow fast close 2023-11-02 18:27:39 -03:00
Sergio R. Caprile ee792db6a3 Add Micropython example 2023-11-02 18:17:33 -03:00
Sergio R. Caprile 129bf93b30 Merge pull request #2448 from cesanta/fixh743f
Fix H743 FreeRTOS early SysTick crash
2023-11-02 15:14:27 -03:00
Sergio R. Caprile 1dda8b9e60 Fix H743 FreeRTOS early SysTick crash 2023-11-02 14:58:52 -03:00
Sergey Lyubka 107e303282 Merge pull request #2445 from cesanta/cmsis-driver
Add driver for CMSIS-Driver
2023-11-02 14:55:16 +00:00
Sergey Lyubka 22f76091a2 Merge pull request #2446 from cesanta/o2
Single bank OTA
2023-11-02 14:55:01 +00:00
cpq 376e5ccaae Single bank OTA 2023-11-02 09:30:55 +00:00
Sergio R. Caprile b792304cf8 Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
Sergio R. Caprile b357485523 Merge pull request #2444 from cesanta/mqttst
improve randomness in non-random test environments
2023-10-31 19:24:26 -03:00
Sergio R. Caprile 07936343c8 improve randomness in non-random environments 2023-10-31 19:17:58 -03:00
Sergio R. Caprile 1b93ca0fb2 Merge pull request #2443 from cesanta/h563
fix H563 FreeRTOS Cortex-M33 port SystemInit
2023-10-31 12:43:36 -03:00
Sergio R. Caprile 18cd18d1e5 fix H563 FreeRTOS Cortex-M33 port SystemInit 2023-10-31 12:40:18 -03:00
Sergio R. Caprile deab6772e8 Merge pull request #2442 from cesanta/nerr
honor ifp->nerr
2023-10-31 12:06:44 -03:00
Sergey Lyubka d6d2d7575a Merge pull request #2441 from cesanta/mqttst
improve MQTT test speed
2023-10-30 23:12:30 +00:00
Sergio R. Caprile d63ec65663 honor ifp->nerr 2023-10-30 16:36:35 -03:00
Sergio R. Caprile f0a927831e improve MQTT test speed 2023-10-30 16:20:55 -03:00
Sergey Lyubka ef16a733d2 Merge pull request #2440 from cesanta/h723
Fix H723 FreeRTOS example failing on some compiler versions with optimizer on
2023-10-30 17:55:29 +00:00
Sergio R. Caprile 9044c02edc Fix H723 FreeRTOS example failing on some compiler versions with optimizer on 2023-10-30 14:13:28 -03:00
Sergey Lyubka 2fa98b00f2 Merge pull request #2437 from cesanta/rt1060
Add RT1060 examples
2023-10-27 20:42:42 +01:00
Sergio R. Caprile 15b4d566e7 Add RT1060 examples 2023-10-27 16:19:12 -03:00
Sergio R. Caprile 6dabbe237d unbreak RT1020 examples after removing IMX prefix 2023-10-25 14:56:29 -03:00
cpq 2caff93f83 Remove IMX, imx prefix for NXP 2023-10-24 17:30:22 +01:00
Sergio R. Caprile 2903937cba fix old trashing 2023-10-23 16:32:51 -03:00
Sergey Lyubka c33fd6a7fb Merge pull request #2429 from cesanta/h723
H7 combo
2023-10-17 10:22:00 +01:00
Sergio R. Caprile 64180e8fe8 minor fixes for H743
Clock H723 at 550MHz, fix RNG initialization
Add FreeRTOS example for H723
Add tests
2023-10-16 17:27:02 -03:00
Sergey Lyubka 001134af89 Merge pull request #2424 from cesanta/unit-test-coverage
Improved test coverage
2023-10-14 10:59:01 +01:00
cpq b91044dea7 Update UM 2023-10-14 10:34:41 +01:00
robert 34639f86b0 Improved test coverage 2023-10-13 07:22:21 -04:00
Sergio R. Caprile 32559f15ea fix Github editor line ending creativity 2023-10-12 10:56:38 -03:00
Sergio R. Caprile b10eef1e32 Update version in mongoose.h 2023-10-12 10:44:58 -03:00
Sergio R. Caprile 7c4911598c Update version.h 2023-10-12 10:27:55 -03:00
Sergio R. Caprile efacb20bdc Merge pull request #2423 from cesanta/same
rename same54
2023-10-11 17:36:09 -03:00
Sergio R. Caprile 2e6188205f rename same54 2023-10-11 16:58:21 -03:00
Sergio R. Caprile 83fec2cf45 cleanup 2023-10-11 16:39:24 -03:00
Sergio R. Caprile 9be36eb9cb Merge pull request #2422 from cesanta/tcp
Fix tcp example for 2-way TLS
2023-10-11 16:34:12 -03:00
Sergio R. Caprile a51802ecaf Fix tcp example for 2-way TLS 2023-10-11 16:25:24 -03:00
Sergio R. Caprile b1c220e610 Remove mg_mkpipe() leftovers 2023-10-10 18:16:02 -03:00
Sergey Lyubka 36f6b805e3 Merge pull request #2421 from cesanta/h723
Add h723 example
2023-10-10 19:19:51 +01:00
Sergey Lyubka 64efad9e46 Merge pull request #2419 from cesanta/rt1020
Add FreeRTOS example for RT1020
2023-10-10 07:57:05 +01:00
Sergio R. Caprile 8a8d5ce151 Add FreeRTOS example for RT1020 2023-10-09 17:03:58 -03:00
Sergey Lyubka 907417f9ec Merge pull request #2418 from cesanta/rt1020
Add TRNG
2023-10-09 17:24:39 +01:00
Sergio R. Caprile 0965177e72 Add TRNG 2023-10-09 13:03:52 -03:00
cpq 7d07ca8427 Add drivers 2023-10-09 09:36:43 +01:00
Sergey Lyubka d18b2b390a Merge pull request #2415 from cesanta/json
Add mg_json_next() for iterating objects/arrays
2023-10-09 07:55:44 +01:00
Sergey Lyubka fefe8b1c15 Merge pull request #2416 from cesanta/log
Add MG_ENABLE_CUSTOM_LOG
2023-10-09 07:55:31 +01:00
cpq ea2ff010a9 Add MG_ENABLE_CUSTOM_LOG 2023-10-08 17:09:14 +01:00
cpq e357cb3185 Bump up max DNS responses 10->15 2023-10-08 15:30:18 +01:00
cpq 293ee2162c Add mg_json_next() for iterating objects/arrays 2023-10-07 22:40:51 +01:00
cpq c29ee769bc Fix comment 2023-10-07 17:58:20 +01:00
Sergey Lyubka 82399f1561 Merge pull request #2414 from cesanta/rt1020
Rework  RT1020 driver
2023-10-07 11:21:29 +01:00
Sergio R. Caprile 9255ceaf8a Rework RT1020 driver
Add web server in example
Add to tests
2023-10-06 16:56:00 -03:00
cpq bb9c7c0eb3 Handle ECOS case in accept_conn() 2023-10-06 15:58:26 +01:00
Sergey Lyubka 8ec327f9c7 Merge pull request #2407 from cesanta/rt1020
Add RT1020-EVK baremetal example
2023-10-05 14:19:00 +01:00
Sergio R. Caprile c9b982eaff add update script to Makefile 2023-10-04 16:31:50 -03:00
Sergio R. Caprile 248e7b6e29 Add RT1020-EVK baremetal example 2023-10-04 15:18:57 -03:00
Sergey Lyubka cb1ae312a1 Merge pull request #2404 from cesanta/g031
Add nucleo-g031 baremetal example
2023-10-04 15:39:19 +01:00
cpq aec25cf547 Add h723 example 2023-10-04 11:11:56 +01:00
cpq 4db3fc2515 dd nucleo-g031 baremetal example 2023-10-03 13:55:47 +01:00
Sergey Lyubka 79d6017c56 Merge pull request #2402 from cesanta/bcast
send broadcasts in MIP
2023-10-03 13:53:58 +01:00
Sergio R. Caprile d4c122b17a send broadcasts in MIP 2023-10-02 13:37:27 -03:00
cpq 57fd93eeda Fix ring color 2023-10-01 23:20:42 +01:00
cpq 19cac05747 Enhance components 2023-10-01 23:08:10 +01:00
Sergey Lyubka 5ebede5096 Merge pull request #2395 from cesanta/scopeid
Fix #2192 - honor addr%scopeid ipv6 notation
2023-09-29 15:52:40 +01:00
cpq 46ecb07fc8 Fix #2192 - honor addr%scopeid ipv6 notation 2023-09-29 15:49:47 +01:00
cpq a628a05efb Restore pub. domain notice 2023-09-29 13:09:29 +01:00
cpq fc626bb57f Update pakced fs 2023-09-28 16:27:58 +01:00
cpq 1291839182 Update packed fs 2023-09-28 15:09:34 +01:00
Sergey Lyubka 736e7a2cf9 Merge pull request #2394 from cesanta/chunks
Get rid of MG_EV_HTTP_CHUNK
2023-09-26 20:45:40 +01:00
cpq 7884a2f3c7 Get rid of MG_EV_HTTP_CHUNK 2023-09-26 20:45:24 +01:00
Sergey Lyubka dde699ffda Merge pull request #2393 from cesanta/ota-api-refactoring
OTA API refactoring: renamed files and defines
2023-09-26 14:15:49 +01:00
robert fa54a22aed OTA API refactoring: renamed files and defines 2023-09-26 08:33:39 -04:00
cpq 822b0c011a Add sys_flash.c for common mg_flash_{load,save} 2023-09-25 07:55:35 +01:00
cpq a0f8a197c9 Split sys.h API over MG_SYS_* 2023-09-25 07:33:38 +01:00
Sergey Lyubka 7e75e51332 Merge pull request #2392 from cesanta/flash2
Commonise flash-based OTA. Add h7 support.
2023-09-25 05:21:52 +01:00
cpq b37efbe891 Commonise flash-based OTA. Add h7 support. 2023-09-24 21:55:49 +01:00
cpq 6e648c90b0 Added OTA to the feature list 2023-09-24 21:18:02 +01:00
cpq 377d6acc74 Fix leak in unit test 2023-09-22 08:12:09 +01:00
Sergey Lyubka f552d15fe4 Merge pull request #2390 from cesanta/tickets
Restore tickets support
2023-09-21 19:08:08 +01:00
cpq d1204e8a66 Better chunk length calculation 2023-09-21 19:04:32 +01:00
cpq 9ec48e41f7 Restore tickets support 2023-09-21 18:43:33 +01:00
Sergey Lyubka 9055a83b4f Merge pull request #2388 from cesanta/dns
dns.c slight refactor, no functional changes
2023-09-21 13:38:23 +01:00
cpq dd047b2613 dns.c slight refactor, no functional changes 2023-09-21 13:38:06 +01:00
Sergey Lyubka b7a32069b1 Merge pull request #2389 from cesanta/ipv6
Address discussions/2305 - bind to v6 only / v6 and v4
2023-09-21 13:37:29 +01:00
cpq 00d475bc7e Address https://github.com/cesanta/mongoose/discussions/2305 - bind to v6 only / v6 and v4 2023-09-21 12:35:47 +01:00
Sergio R. Caprile 33ab44430c Merge pull request #2386 from cesanta/timer
Revert to the old TLS API, but keep certs as mg_str for DER
2023-09-19 12:17:56 -03:00
Sergio R. Caprile b355da32b9 Add GA OpenSSL tests back 2023-09-19 12:08:02 -03:00
cpq 3f0366a514 Revert to the old TLS API, but keep certs as mg_str for DER 2023-09-19 11:15:23 +01:00
cpq 7ecbbc517d Using mg_bzero to cleanup memory in mg_close_conn() 2023-09-17 22:25:36 +01:00
cpq a04c94444e Add rt1020 baremetal sketch 2023-09-17 10:41:04 +01:00
Sergio R. Caprile 42b9ac1145 update 2023-09-12 18:30:23 -03:00
Sergio R. Caprile 7be4925c70 Merge pull request #2384 from cesanta/p_open
Do not use CLOEXEC on Windows
2023-09-12 18:28:39 -03:00
Sergio R. Caprile 7b19568683 Do not use CLOEXEC on Windows 2023-09-12 17:11:55 -03:00
Sergio R. Caprile 8f56779855 Merge pull request #2383 from cesanta/poll
Optimize test coverage
2023-09-12 16:41:17 -03:00
Sergio R. Caprile fdfad8462c Optimize test coverage 2023-09-12 16:28:10 -03:00
Sergio R. Caprile 3773ef45e7 Optimize test coverage 2023-09-12 16:22:54 -03:00
Sergio R. Caprile c0ca3cacb4 Fixing test.yml 2023-09-12 15:05:29 -03:00
Sergio R. Caprile bed0630698 Fixing test.yml 2023-09-12 09:13:38 -03:00
Sergey Lyubka 53baa18836 Merge pull request #2380 from cesanta/ip-fragmentation-2
IP fragmentation send path: added TCP/UDP packet splitting to fit within MTU
2023-09-12 12:51:04 +01:00
Sergey Lyubka 32a2144426 Merge pull request #2382 from cesanta/poll
increase test coverage
2023-09-12 12:50:50 +01:00
robert 264026acde added TCP/UDP packet splitting to fit within MTU 2023-09-12 07:05:13 -04:00
Sergio R. Caprile 43503ef73a increase test coverage 2023-09-11 17:46:25 -03:00
Sergio R. Caprile 7f52717e9d increase test coverage 2023-09-11 17:41:36 -03:00
Sergio R. Caprile bd59185ef1 Merge pull request #2381 from cesanta/tls
add host only validation
2023-09-11 16:38:18 -03:00
Sergio R. Caprile 310ffcd4eb add host only validation 2023-09-11 16:34:24 -03:00
cpq d23664a457 Move network code to net.* 2023-09-08 09:39:57 +01:00
Sergio R. Caprile a1e316ddcf make TCP example work with new TLS API 2023-09-06 18:50:33 -03:00
Sergio R. Caprile e328758fc7 Merge pull request #2379 from cesanta/tls
unifomize TLS examples, stage 1
2023-09-06 16:55:46 -03:00
Sergio R. Caprile dbf49255a3 fix 2023-09-06 16:19:21 -03:00
Sergio R. Caprile 1391bdcf8b remove certs.h 2023-09-06 15:49:02 -03:00
Sergio R. Caprile d8106a8ffe use packed ca.pem 2023-09-06 15:21:16 -03:00
Sergio R. Caprile ae55789c4b erase ca.pem 2023-09-06 15:21:16 -03:00
Sergio R. Caprile ec02ccf5b2 Merge pull request #2377 from cesanta/h5
uniformize examples
2023-09-05 13:43:39 -03:00
Sergio R. Caprile f970cd78d7 uniformize examples 2023-09-05 13:36:46 -03:00
Sergio R. Caprile 8140ea16a7 Merge pull request #2371 from cesanta/cloexec
Fix #2369 - set CLOEXEC on epoll and regular file fds
2023-09-05 10:15:58 -03:00
Sergey Lyubka 2883709756 Merge pull request #2370 from cesanta/ota
Add OTA to the device dashboard. Implement for H5
2023-09-05 13:28:22 +01:00
cpq ca4c2c6c41 Set CLOEXEC on epoll and regular file fds 2023-09-05 06:56:41 +01:00
Sergey Lyubka fbc56f4adf Merge pull request #2367 from cesanta/ip-fragmentation
closing connection if a fragmented packet is received
2023-09-05 06:34:29 +01:00
cpq 2f014237b2 Add OTA to the device dashboard. Implement for H5 2023-09-04 22:07:32 +01:00
robert f33e3a7752 closing connection if a fragmented packet is received 2023-08-30 10:30:51 -04:00
cpq d5b5cec797 Make fuzzer faster on large input/output 2023-08-26 00:52:24 +01:00
Sergey Lyubka f8e1f17651 Merge pull request #2366 from cesanta/h5
Add FreeRTOS example on H5
2023-08-25 21:21:41 +01:00
Sergio R. Caprile be58bfe22b Add FreeRTOS example on H5 2023-08-25 17:15:26 -03:00
Sergey Lyubka 995a63dc39 Merge pull request #2364 from cesanta/braces
Style: always braces around if + else
2023-08-25 15:00:52 +01:00
cpq e8d57ac4e1 Style: always braces around if + else 2023-08-25 14:46:38 +01:00
Sergio R. Caprile eab3a83548 Merge pull request #2362 from cesanta/h5
Update H5 HAL, enable RNG, work at 250MHz, add to tests
2023-08-24 13:35:37 -03:00
Sergio R. Caprile 3fb9e5fd56 Update H5 HAL, enable RNG, work at 250MHz, add to tests 2023-08-24 13:32:37 -03:00
Sergio R. Caprile 41448278cf Merge pull request #2360 from cesanta/h7
Fix sysinit in H7
2023-08-23 14:37:21 -03:00
cpq 48516b43c5 Use device 11 2023-08-23 00:38:57 +01:00
Sergio R. Caprile 80b7be0568 Fix sysinit in H7 2023-08-22 19:58:19 -03:00
Sergey Lyubka 4183552aee Merge pull request #2358 from cesanta/b64
Change base64 API
2023-08-22 14:43:33 +01:00
cpq 527e89754e Change base64 API 2023-08-22 12:11:13 +01:00
robertc2000 30e0f42c97 Merge pull request #2357 from cesanta/tcpip-conn-init
improved tcp connection initiation
2023-08-22 09:30:24 +03:00
Sergio R. Caprile 39b40daf5d cleanup 2023-08-21 19:34:04 -03:00
Sergio R. Caprile 94636f4d30 Merge pull request #2355 from cesanta/mqtt54
Add MQTT example and test for SAME54
2023-08-21 19:27:17 -03:00
Sergio R. Caprile fd53548c5e Add MQTT example and test for SAME54 2023-08-21 19:24:33 -03:00
Sergio R. Caprile 354ea30797 Add MQTT example and test for SAME54 2023-08-21 19:11:50 -03:00
Sergio R. Caprile 11303e0dc1 Merge pull request #2354 from cesanta/tst
Add MQTT test for MIP
2023-08-21 17:26:24 -03:00
Sergio R. Caprile b4c645f703 Add MQTT test for MIP 2023-08-21 17:22:42 -03:00
cpq 3256218fd2 Do uri len check after it is finalised 2023-08-21 17:16:48 +01:00
robert a4f14b0ddf improved tcp connection initiation 2023-08-21 10:22:53 -04:00
Sergio R. Caprile e7459d91f9 Merge pull request #2353 from cesanta/certs
Store certs in certs/. Add mg_unpacked()
2023-08-21 09:52:10 -03:00
cpq b32d1c15f0 Store certs in certs/. Add mg_unpacked() 2023-08-20 23:43:04 +01:00
Sergio R. Caprile 1e0d57a832 Merge pull request #2352 from cesanta/mip
Unify naming: all network stacks are in src/net_...
2023-08-18 16:40:57 -03:00
cpq f3617a1cf3 Add integer overflow protection 2023-08-18 20:33:57 +01:00
cpq 89a9a50b96 Unify naming: all network stacks are in src/net_... 2023-08-18 19:59:15 +01:00
cpq 69d2ba7316 Add example for nucleo-h563zi 2023-08-18 16:06:17 +01:00
robertc2000 3ea5f8dbde Merge pull request #2344 from cesanta/tcp-closure
improved tcp closure
2023-08-18 14:06:41 +03:00
Sergio R. Caprile d56152875d Merge pull request #2350 from cesanta/deprecate
deprecate mg_mkpipe()
2023-08-17 18:32:39 -03:00
Sergio R. Caprile 7459d30a28 deprecate mg_mkpipe() 2023-08-17 18:05:03 -03:00
Sergio R. Caprile 16bf9101aa Merge pull request #2349 from cesanta/isclosing
is_closing -> is_draining
2023-08-17 16:52:51 -03:00
Sergio R. Caprile 2b20af36a7 is_closing -> is_draining 2023-08-17 16:45:10 -03:00
robert f5e87cceec improved tcp closure 2023-08-17 10:34:31 -04:00
Sergey Lyubka 36fcb7ed21 Merge pull request #2347 from cesanta/cl
Fix #2322 - stricter Content-Length check, allow 1*DIGIT only
2023-08-17 14:58:01 +01:00
cpq 9fe7807b02 Fix #2322 - stricter Content-Length check, allow 1*DIGIT only 2023-08-17 12:55:08 +01:00
Sergey Lyubka 88e3017ee5 Merge pull request #2348 from cesanta/dns
Fix #2263 - allow multiple errors in DNS handler
2023-08-17 10:12:16 +01:00
cpq 17f3738192 Fix #2263 - allow multiple errors in DNS handler 2023-08-17 10:11:21 +01:00
Sergey Lyubka 6cfdc39005 Merge pull request #2346 from cesanta/regex
Fix #2345 - json parsing of arrays of objects
2023-08-16 22:10:13 +01:00
cpq 58886a9693 Fix #2345 - json parsing of arrays of objects 2023-08-16 22:09:45 +01:00
Sergey Lyubka 66e022c454 Merge pull request #2343 from cesanta/fuz
Add http serve to fuzzer
2023-08-16 20:46:27 +01:00
cpq ea3968601e Add http serve to fuzzer 2023-08-16 20:18:52 +01:00
Sergio R. Caprile 54be13d1d8 Merge pull request #2342 from cesanta/pio
Fix PIO assembly error
2023-08-14 16:17:37 -03:00
Sergio R. Caprile 22ea825d46 Fix PIO assembly error 2023-08-14 16:15:27 -03:00
Sergio R. Caprile 8c03aa2801 nit 2023-08-10 19:37:47 -03:00
Sergio R. Caprile 5bb952260a Merge pull request #2340 from cesanta/same54
SAME54 Ethernet driver
2023-08-10 19:26:50 -03:00
Sergio R. Caprile face6c44c6 SAME54 Ethernet driver
Add tls_builtin.c
2023-08-10 18:59:23 -03:00
Sergio R. Caprile 66c2bfe822 Merge pull request #2339 from cesanta/revert-2336-foo
Revert "Foo"
2023-08-10 18:16:38 -03:00
Sergio R. Caprile 3721bcc790 Revert "Foo" 2023-08-10 17:48:55 -03:00
Sergio R. Caprile cacab6fe4c Merge pull request #2338 from cesanta/keil
Keil
2023-08-09 17:17:57 -03:00
scaprile 6ad8674cd4 Add F4 Keil examples 2023-08-09 14:23:10 -03:00
novlean 847990ce49 Update README.md
Added URL to https://mongoose.ws/integration/
2023-08-09 17:50:57 +01:00
scaprile 1bfdc1f138 Add hw testing 2023-08-08 17:16:15 -03:00
Sergio R. Caprile 58367fe23e Merge pull request #2337 from cesanta/h7f
add H7 FreeRTOS example
2023-08-08 15:32:29 -03:00
Sergio R. Caprile a8712e2307 add H7 FreeRTOS example 2023-08-08 14:38:41 -03:00
robertc2000 8acfae1111 Merge pull request #2336 from cesanta/foo
Foo
2023-08-08 09:26:48 +03:00
cpq 70fc71c6f7 Changes 2023-08-07 06:18:49 -04:00
Sergio R. Caprile dd5118cab0 Merge pull request #2332 from cesanta/cube
update Cube test Makefile to support testing packaged examples
2023-08-04 17:11:22 -03:00
Sergio R. Caprile 2d75a6ccd4 update 2023-08-04 15:37:57 -03:00
Sergio R. Caprile e004ab1693 Merge pull request #2331 from cesanta/makefile
update Makefile
2023-08-04 14:45:56 -03:00
Sergio R. Caprile acddfc3bf4 update Makefile 2023-08-04 14:32:28 -03:00
cpq 519d4b0286 Changes 2023-08-04 13:53:01 +01:00
cpq 8005a5e687 Changes 2023-08-04 13:53:01 +01:00
cpq f5943fe591 Add tls_builtin.c 2023-08-04 13:53:01 +01:00
cpq cea7fcdb37 AVR build fixes 2023-08-04 13:52:59 +01:00
robert b5213c13dd SAME54 Ethernet driver 2023-08-04 13:48:55 +01:00
Sergio R. Caprile 3a06b4833c Merge pull request #2330 from cesanta/timeout
Timeout
2023-08-03 14:52:54 -03:00
Sergio R. Caprile 5cdf6c1d05 Add SYN timeout 2023-08-03 14:23:14 -03:00
Sergio R. Caprile 5754e5dd59 fix ARP timeout 2023-08-03 13:42:56 -03:00
Sergio R. Caprile e5ab1c454b Merge pull request #2329 from cesanta/arp
Implement ARP resolution for local LANs
2023-08-03 11:02:43 -03:00
cpq 697576b63c Implement ARP resolution for local LANs 2023-08-03 13:48:23 +01:00
Sergio R. Caprile 2db41aef09 Merge pull request #2328 from cesanta/ft
standardize example names
2023-08-02 16:20:05 -03:00
Sergio R. Caprile 7f4ad3cade standardize example names 2023-08-02 16:07:54 -03:00
Sergio R. Caprile 74c4c32082 Merge pull request #2327 from cesanta/rndis
standardize example names
2023-08-02 14:24:07 -03:00
Sergio R. Caprile 30d545443c standardize example names 2023-08-02 14:03:11 -03:00
Sergio R. Caprile dedba52315 Merge pull request #2325 from cesanta/fpu
FP unit in H743 is dp
2023-08-01 17:06:54 -03:00
Sergio R. Caprile 481f7b5cff FP unit in H743 is dp 2023-08-01 17:02:05 -03:00
Sergio R. Caprile 6ce4f4930c Merge pull request #2324 from cesanta/fb
standardize example names
2023-08-01 15:46:58 -03:00
Sergio R. Caprile e33a10db75 standardize example names 2023-08-01 15:24:28 -03:00
Sergio R. Caprile ef17055145 Merge pull request #2323 from cesanta/cube
standardize example names
2023-07-31 18:27:34 -03:00
Sergio R. Caprile 6a2fa10a4e standardize example names 2023-07-31 17:47:56 -03:00
Sergio R. Caprile 6b81a5846d Merge pull request #2320 from cesanta/2308collaterals
fix autogenerated
2023-07-28 17:47:49 -03:00
Sergio R. Caprile b54d086fde fix autogenerated 2023-07-28 17:06:58 -03:00
Sergio R. Caprile 5ee9d22263 momentarily disable MacOS OpenSSL tests 2023-07-26 15:53:59 -03:00
Sergio R. Caprile 7dcb097a5d momentarily disable OpenSSL tests 2023-07-26 15:49:03 -03:00
Sergio R. Caprile 29a30239ab momentarily disable OpenSSL tests 2023-07-26 15:33:30 -03:00
Sergio R. Caprile ed54b60ea3 update to new API 2023-07-25 18:41:41 -03:00
Sergio R. Caprile 199af33b30 update to new TLS API 2023-07-25 14:26:14 -03:00
Sergio R. Caprile adfa1d0e20 fix mongoose.h 2023-07-25 13:22:41 -03:00
Sergio R. Caprile ef25c42e86 fix unit tests for older compilers 2023-07-25 11:55:01 -03:00
Sergio R. Caprile 91a638156c Merge branch 'master' of https://github.com/cesanta/mongoose 2023-07-25 11:37:01 -03:00
Sergio R. Caprile 26ce666938 Merge branch 'master' of https://github.com/cesanta/mongoose 2023-07-25 11:35:29 -03:00
cpq 7548af895b H7 mbedtls build fixed 2023-07-25 15:34:22 +01:00
Sergio R. Caprile 9548437a9e update unit tests for new API 2023-07-25 11:27:01 -03:00
cpq 5e50b7104c Unit test fixed 2023-07-25 15:26:47 +01:00
cpq d824cf7dbd Add mbedtls to H7 baremetal 2023-07-25 15:03:01 +01:00
cpq 0613cc62f4 TLS API refactor 2023-07-25 13:07:28 +01:00
Sergey Lyubka d9cbcb5fa8 Merge pull request #2312 from cesanta/arduino
no Docker, in-place build for tests
2023-07-22 01:09:35 +01:00
Sergio R. Caprile a4f5355161 no Docker, in-place build for tests 2023-07-21 16:45:14 -03:00
Sergey Lyubka a24b6c1909 Merge pull request #2309 from cesanta/arduino
move Arduino tests to its dir
2023-07-21 14:33:00 +01:00
Sergio R. Caprile fd7dc72410 Merge pull request #2310 from cesanta/am
Add arduino/w5500-mqtt example
2023-07-21 10:27:20 -03:00
cpq e4f4dfab3b Add arduino/w5500-mqtt example 2023-07-21 13:54:41 +01:00
Sergio R. Caprile 66010be5a6 move Arduino tests to its dir 2023-07-20 20:22:06 -03:00
Sergio R. Caprile 852c42a8f3 static clue 2023-07-20 16:34:13 -03:00
Sergio R. Caprile 132725de7b Merge pull request #2308 from cesanta/nano
AVR build fixes
2023-07-20 14:12:49 -03:00
cpq 0a761c09e3 AVR build fixes 2023-07-20 16:07:53 +01:00
Sergey Lyubka 09ce6ae1c5 Merge pull request #2307 from cesanta/codeql
add CodeQL analysis
2023-07-20 14:37:18 +01:00
Sergio R. Caprile 85e60ed858 force run 2023-07-19 16:21:14 -03:00
Sergio R. Caprile 86fd18324b codeql 2023-07-19 16:14:44 -03:00
Sergio R. Caprile fdf82e5d6c codeql 2023-07-19 15:10:28 -03:00
Sergio R. Caprile eb0b1580d1 nits 2023-07-19 14:53:29 -03:00
Sergio R. Caprile 2d33c545b8 codeql 2023-07-19 14:53:29 -03:00
Sergio R. Caprile cdaf523aa8 codeql 2023-07-19 14:53:29 -03:00
Sergio R. Caprile 3195f2cec2 codeql 2023-07-19 14:53:29 -03:00
cpq ea89a4afab Revert "Integration page"
This reverts commit 3415b62d2d.
2023-07-19 18:50:27 +01:00
cpq 3415b62d2d Integration page 2023-07-19 16:25:14 +01:00
Sergey Lyubka ee80822564 Merge pull request #2306 from cesanta/nits
Nits
2023-07-19 06:00:32 +01:00
cpq 3c9e218d07 Nits 2023-07-19 05:08:28 +01:00
Sergio R. Caprile 387a602885 Merge pull request #2304 from cesanta/addressing
Addressing
2023-07-18 17:30:35 -03:00
Sergio R. Caprile ef0ff43975 static clue 2023-07-18 17:23:50 -03:00
Sergio R. Caprile ae37407369 static clue 2023-07-18 17:10:05 -03:00
cpq e1c91b5763 Merge branch 'master' of github.com:cesanta/mongoose 2023-07-18 17:47:02 +01:00
cpq c49b472f92 Ignore DHCP for static IP config 2023-07-18 17:46:52 +01:00
Sergey Lyubka 0a6b1b9418 Merge pull request #2297 from cesanta/2251-implement-tcp-retransmit-in-mip
implemented tcp retransmission
2023-07-16 04:53:06 +01:00
Sergio R. Caprile ac40673a9e test for retransmitted segment 2023-07-12 11:22:35 -04:00
cpq 818f99b286 Update examples to adopt to the new iface state 2023-07-12 14:09:30 +01:00
robert 320da5e84c implemented tcp retransmission 2023-07-11 06:20:47 -04:00
Sergey Lyubka 6957c379d5 Merge pull request #2294 from cesanta/hdr
Fix #2292 - fail on stray \r character in headers
2023-07-09 23:08:22 +01:00
cpq 88e880f107 Fix #2292 - fail on stray \r character in headers 2023-07-09 18:18:18 +01:00
cpq bf8c4dfc83 Merge branch 'master' of github.com:cesanta/mongoose 2023-07-07 08:44:33 +01:00
cpq 5dff282132 Fix #2293 - stricter header validity check 2023-07-07 08:44:25 +01:00
Sergio R. Caprile 1148ac0ae4 Merge pull request #2289 from cesanta/acl
update `mg_check_ip_acl`
2023-07-05 18:06:28 -03:00
Sergio R. Caprile 59c46fc594 update 2023-07-05 17:49:18 -03:00
cpq 03a94e3a6a Use \r\n for log messages, for terminal apps 2023-07-05 10:26:27 +01:00
Sergio R. Caprile 5c8e05a4fc bump revno up 2023-07-04 12:18:09 -03:00
Sergio R. Caprile d791ce393b remove old examples 2023-07-03 18:34:18 -03:00
Sergio R. Caprile a452231086 Merge pull request #2285 from cesanta/stm32
Stm32
2023-07-03 18:29:30 -03:00
Sergio R. Caprile a392a19c9c name changes 2023-07-03 18:27:32 -03:00
Sergio R. Caprile a864c04702 uniformize 2023-07-03 16:40:33 -03:00
Sergio R. Caprile 8d2f7296a1 remove old examples 2023-07-03 14:19:28 -03:00
robert 040936eb47 fixed mqtt vc98 warning 2023-07-03 10:49:18 -04:00
Sergey Lyubka 101beec3ae Merge pull request #2284 from cesanta/enhance-mg_remove_double_dots
enhanced path sanitizing
2023-07-03 14:43:32 +01:00
robert 2f1a836bf0 enhanced path sanitizing 2023-07-03 06:14:50 -04:00
cpq 62f5e0a1a9 Add SNTP to the list 2023-07-01 20:28:28 +01:00
cpq cca771e70e Stricter check for test_dns_error() 2023-07-01 20:23:59 +01:00
cpq 0c7e6b548f Standardise margin 2023-06-30 11:53:34 +01:00
robertc2000 8b87e8aa92 Merge pull request #2282 from cesanta/paginator
Make paginator bit more compact
2023-06-30 12:17:35 +03:00
Sergey Lyubka 415bbf2932 Merge pull request #2278 from cesanta/httpheaders
fix header truncation
2023-06-29 22:59:51 +01:00
Sergey Lyubka 48df4f18cd Merge pull request #2283 from cesanta/fuzz
Extend fuzzer, access parsed fields
2023-06-29 22:58:21 +01:00
Sergio R. Caprile dc0f9aca4a access only when parsing is valid 2023-06-29 18:37:10 -03:00
cpq 1b9b8e3f6c Extend fuzzer, access parsed fields 2023-06-29 16:34:15 +01:00
cpq 5d10e9dbee Make paginator bit more compact 2023-06-29 13:33:36 +01:00
Sergio R. Caprile 0adc858c85 add unit test 2023-06-28 11:01:59 -03:00
Sergio R. Caprile eda1e8a402 fix header truncation 2023-06-27 14:56:04 -03:00
Sergio R. Caprile 4b0e34cdf4 Merge pull request #2277 from cesanta/httpcodes
Reinstall extra HTTP codes
2023-06-27 14:53:10 -03:00
Sergio R. Caprile c688687ff8 Reinstall extra HTTP codes
the extra strings are not polluting the binary much
2023-06-27 13:44:44 -03:00
Sergio R. Caprile d56e5bea62 Merge pull request #2274 from cesanta/mqtt-var-length-issue
fixed mqtt variable length header issue
2023-06-27 09:48:20 -03:00
robert aed7b6b37a fixed mqtt variable length header issue 2023-06-27 01:00:45 -04:00
Sergio R. Caprile 8114443e97 Merge pull request #2276 from cesanta/keil
Keil
2023-06-26 18:33:43 -03:00
scaprile 8ba0a33f84 add hw test support 2023-06-26 18:29:52 -03:00
Sergio R. Caprile 661ed61779 add hw test support for Keil 2023-06-26 18:20:38 -03:00
robert 427f95337f event table device-dashboard: fixed wrong api call 2023-06-26 10:31:55 -04:00
Sergey Lyubka fa8490fb4e Merge pull request #2272 from WKJay/master
add RT-Thread support
2023-06-26 14:37:49 +01:00
WKJay 5be1c6381b add RT-Thread support 2023-06-26 16:18:40 +08:00
Sergey Lyubka 6794a89f79 Merge pull request #2270 from cesanta/dhcp
improve DHCP in MIP
2023-06-24 13:09:40 +01:00
robert 8f19ee7b97 event table POST request 404 error 2023-06-23 11:35:42 -04:00
robert c63135ec7f device-dashboard: fixed event table POST request 2023-06-23 08:03:44 -04:00
robert 5c87f2f22c improved device dashboard events table 2023-06-23 07:21:24 -04:00
Sergio R. Caprile 6e6e34c423 improve DHCP in MIP 2023-06-22 18:55:48 -03:00
Sergio R. Caprile bb983fb4b2 update tutorial link 2023-06-22 11:00:37 -03:00
Sergio R. Caprile 285bbf50e9 Merge pull request #2268 from cesanta/cube
add more FreeRTOS+lwIP on Cube examples
2023-06-22 10:59:06 -03:00
Sergio R. Caprile c2ad2e1151 add more FreeRTOS+lwIP on Cube examples 2023-06-21 19:00:10 -03:00
Sergio R. Caprile 46e796ffaa Merge pull request #2267 from cesanta/cube
add more FreeRTOS on Cube examples
2023-06-21 11:34:20 -03:00
Sergio R. Caprile 3bf25d86f2 add tests for new Cube examples 2023-06-21 11:32:10 -03:00
Sergio R. Caprile 2dca4805b0 add more FreeRTOS on Cube examples 2023-06-21 11:21:24 -03:00
Sergio R. Caprile 54aa4678d1 Merge pull request #2265 from cesanta/cube
Cube
2023-06-20 14:48:36 -03:00
Sergio R. Caprile 3ab0e6cade add new Cube examples 2023-06-20 14:35:59 -03:00
Sergio R. Caprile 41e3b23253 rename tutorial 2023-06-20 12:04:38 -03:00
Sergio R. Caprile b00d780a50 Merge pull request #2261 from cesanta/dhcp
fix DHCP xid being ignored
2023-06-19 19:07:22 -03:00
Sergio R. Caprile 71b3e26232 fix DHCP xid being ignored 2023-06-19 18:50:51 -03:00
Sergio R. Caprile 40f28c02b9 Merge pull request #2262 from cesanta/cubetests
Cubetests
2023-06-19 17:13:05 -03:00
Sergio R. Caprile 362b22a673 Add hw test to cube examples 2023-06-19 16:58:37 -03:00
Sergio R. Caprile d6be9a2bba wip 2023-06-19 14:36:49 -03:00
Sergey Lyubka 6bfd113a87 Merge pull request #2260 from cesanta/2259-refactor-event-log-page-for-examplesdevice-dashboard
refactored device-dashboard code
2023-06-19 18:24:15 +01:00
robert b7f86ba743 refactored device-dashboard code 2023-06-19 06:28:00 -04:00
cpq 2bab274056 Fix build error 2023-06-16 15:57:18 +01:00
robertc2000 dd6bffdd0d Merge pull request #2256 from cesanta/2253-implement-event-log-page-for-examplesdevice-dashboard
implemented event log page for the device dashboard
2023-06-16 11:44:49 +03:00
robert bcc044eb92 implemented event log page for the device dashboard 2023-06-16 04:32:45 -04:00
robert a7f1982d03 improved device table style from the wifi-router-dashboard 2023-06-14 09:18:07 -04:00
Sergey Lyubka d013e0fc78 Merge pull request #2254 from cesanta/2249-implement-connected-devices-page-for-wifi-router-dashboard
implemented connected devices page
2023-06-14 11:17:06 +01:00
robert 6f69ad93c1 implemented connected devices page 2023-06-13 03:33:11 -04:00
Sergey Lyubka 7ea2093a91 Merge pull request #2250 from cesanta/2241-optimise-struct-mg_addr
optimized mg_addr structure
2023-06-09 14:54:27 +01:00
robert dd32deb2ad optimized mg_addr structure 2023-06-09 09:19:37 -04:00
Sergey Lyubka ad71fb321c Merge pull request #2247 from cesanta/2243-refacrtor-wifi-router-dashboard-example
refactored dashboards
2023-06-08 16:03:11 +01:00
Sergey Lyubka cc6c28a7ff Merge pull request #2248 from cesanta/F746TLS
Improve performance on F746 with MbedTLS
2023-06-08 16:02:24 +01:00
Sergio R. Caprile c763087462 improve performance 2023-06-08 11:29:51 -03:00
robert 63ff4ddea0 refactored dashboards 2023-06-08 10:25:59 -04:00
Sergey Lyubka 4178fc125d Merge pull request #2245 from cesanta/2235-fix
byte-encoded properties issue fixed
2023-06-08 13:32:23 +01:00
Sergio R. Caprile dcfa7ad657 Merge pull request #2246 from cesanta/tst
Improve MQTT tests resiliency
2023-06-07 19:01:23 -03:00
Sergio R. Caprile c061e60664 Improve MQTT tests resiliency 2023-06-07 18:34:55 -03:00
Ubuntu a0dd3ecd68 byte-encoded properties issue fixed 2023-06-07 10:13:21 -04:00
Sergio R. Caprile 0168a312f2 Merge pull request #2240 from cesanta/dhcp
Renew dhcp lease
2023-06-07 09:39:01 -03:00
cpq 92fe5a5b58 Renew dhcp lease 2023-06-07 13:33:28 +01:00
Sergey Lyubka 7f3d450b32 Merge pull request #2242 from cesanta/FEATURE_Add_tls_context_to_mg_mgr
Adding tls_ctx into mg_mgr for storing TLS context shared by all TLS session
2023-06-07 08:44:53 +01:00
Allan Park 8166339920 Adding tls_ctx into mg_mgr for storing TLS context shared by all TLS sessions 2023-06-07 10:21:46 +03:00
Sergio R. Caprile 57424d4a26 Merge pull request #2239 from cesanta/rlcomments
comment
2023-06-06 18:51:31 -03:00
Sergio R. Caprile 6511b6dd5d comment 2023-06-06 18:48:45 -03:00
Sergio R. Caprile 0625b97246 Merge pull request #2238 from cesanta/f7
Improve driver
2023-06-06 18:46:50 -03:00
Sergio R. Caprile 9f8ce82825 Improve driver 2023-06-06 18:32:11 -03:00
Sergey Lyubka c3c925dc84 Merge pull request #2230 from cesanta/rl
RL: fix accept() not looping on BSD_EWOULDBLOCK
2023-06-06 19:42:17 +01:00
Sergio R. Caprile 36f3703499 Merge pull request #2236 from cesanta/devsys
move dependencies
2023-06-06 14:47:27 -03:00
Sergio R. Caprile 6ae59c3711 move dependencies 2023-06-06 14:35:44 -03:00
Sergio R. Caprile c8f5f85635 Merge pull request #2234 from cesanta/tests
speed up MQTT tests
2023-06-06 10:58:54 -03:00
Sergio R. Caprile 4e5e186784 speed up MQTT tests 2023-06-06 10:44:18 -03:00
cpq 828f7a513c Merge branch 'master' of github.com:cesanta/mongoose 2023-06-06 08:38:18 +01:00
cpq 6085998d57 Proper handling {} in JSON array + unit test 2023-06-06 08:38:08 +01:00
Sergio R. Caprile 71e44d5b65 Merge pull request #2233 from cesanta/disambiguate
disambiguate comments
2023-06-05 18:57:25 -03:00
Sergio R. Caprile e762bbdbf8 disambiguate comments 2023-06-05 18:39:13 -03:00
cpq fe0d2272f6 Export mg_json_unescape() 2023-06-03 09:28:59 +01:00
Sergio R. Caprile e017b88adf Merge pull request #2228 from cesanta/tls
Add TLS=1 option
2023-06-02 14:33:34 -03:00
Sergey Lyubka 5f76d9cf33 Merge pull request #2231 from cesanta/Kfixs
standardize header inclusion
2023-06-02 17:35:56 +01:00
Sergio R. Caprile 85a5bdf4dc standardize header inclusion 2023-06-02 13:27:27 -03:00
Sergio R. Caprile 4abc34ffd1 fix accept() not looping on BSD_EWOULDBLOCK 2023-06-02 11:56:27 -03:00
Sergey Lyubka 250b1d511b Merge pull request #2229 from cesanta/mqttst
MQTT QoS + v5
2023-06-02 10:49:49 +01:00
cpq 59e3b0285a Add TLS=mbedtls option 2023-06-02 09:57:36 +01:00
cpq f961f993c8 FD_SETSIZE fix 2023-06-02 06:57:39 +01:00
cpq adf124c00c Dont check fd against FD_SETSIZE if POLL or EPOLL are used 2023-06-01 22:55:15 +01:00
Sergio R. Caprile f8579131e8 MQTT QoS + v5 2023-05-31 21:35:03 -03:00
Sergio R. Caprile 1dde754724 Merge pull request #2223 from cesanta/devdash
Fix Secure
2023-05-31 09:32:57 -03:00
Sergio R. Caprile 771696fda8 Fix Secure 2023-05-31 09:30:24 -03:00
Sergey Lyubka dd5f469c83 Merge pull request #2224 from cesanta/qos2
fix qos=2 handling
2023-05-31 12:07:10 +01:00
Sergio R. Caprile 6d3fda12cd Merge pull request #2225 from cesanta/Kfixs
Add HTTP_URL
2023-05-30 17:13:05 -03:00
Sergio R. Caprile dc32480563 Add HTTP_URL 2023-05-30 16:02:00 -03:00
Sergio R. Caprile 06ac9e18cb fix qos=2 handling 2023-05-30 14:49:32 -03:00
Sergio R. Caprile 0648943220 Merge pull request #2221 from cesanta/Kfixs
Kfixs
2023-05-29 21:30:41 -03:00
Sergio R. Caprile 7a4a82e872 Add HTTP_URL 2023-05-29 20:59:56 -03:00
Sergio R. Caprile 6c0c05cf7f Add missing headers 2023-05-29 14:34:51 -03:00
Sergio R. Caprile efd2db129f Merge pull request #2219 from cesanta/Kfixs
standardize header inclusion
2023-05-29 11:57:00 -03:00
Sergio R. Caprile f4f276f370 standardize header inclusion 2023-05-29 11:44:59 -03:00
cpq bff1462e9e Add config var size check 2023-05-28 17:06:47 +01:00
Sergio R. Caprile 4d06f33089 fixes 2023-05-26 20:58:54 -03:00
Sergio R. Caprile a433d9ef03 Merge pull request #2217 from cesanta/db
Refactor device-dashboard
2023-05-26 20:53:17 -03:00
Sergio R. Caprile 58606e1702 Refactor device-dashboard 2023-05-26 20:45:08 -03:00
Sergey Lyubka 1ccc9aa72e Merge pull request #2205 from cesanta/arbitrary_content-length
improve negative Content-length handling
2023-05-26 17:16:08 +01:00
cpq 49a9bb5a8b Refactor device-dashboard 2023-05-26 16:20:25 +01:00
Sergey Lyubka 380d6ac5c2 Merge pull request #2215 from cesanta/tlsdash
improve TLS behaviour in dashboard
2023-05-26 08:24:53 +01:00
Sergio R. Caprile 7d9f76df05 improve TLS behaviour in dashboard 2023-05-25 15:23:45 -03:00
Sergey Lyubka 96707acb4e Merge pull request #2214 from cesanta/makelinux
make more distro-friendly
2023-05-24 21:02:46 +01:00
cpq 4e504823c0 Merge branch 'master' of github.com:cesanta/mongoose 2023-05-24 21:02:23 +01:00
cpq 82faa2e9c9 Make UI independent of URI 2023-05-24 21:02:15 +01:00
Sergio R. Caprile 1df9cd8071 make more distro-friendly 2023-05-24 15:37:24 -03:00
Sergio R. Caprile a8d5e4dd28 Merge pull request #2213 from cesanta/nitpicks
nitpicks
2023-05-24 15:20:08 -03:00
Sergio R. Caprile e59ea39a33 nitpicks 2023-05-24 15:17:24 -03:00
Sergio R. Caprile 62d1dc1eea Merge pull request #2212 from cesanta/lwipstack
set a more lwIP-friendly minimum stack in FreeRTOS
2023-05-24 14:46:28 -03:00
Sergio R. Caprile 379af7dec2 set a more lwIP-friendly minimum stack in FreeRTOS 2023-05-24 11:30:01 -03:00
cpq 68a45adac7 Update logo 2023-05-24 13:52:52 +01:00
cpq 9ea8e29cb0 Merge branch 'master' of github.com:cesanta/mongoose 2023-05-24 13:22:18 +01:00
cpq 90092c0762 Make WebUI API calls relative, to work under any URI 2023-05-24 13:22:11 +01:00
Sergio R. Caprile b379816178 Merge pull request #2210 from cesanta/devdash
run pack on Win
2023-05-23 11:06:47 -03:00
Sergio R. Caprile e4353255ca run pack on Win 2023-05-23 11:02:24 -03:00
cpq 923f2c7635 Add DHCP settings 2023-05-23 08:43:57 +01:00
cpq a8309ef705 Remove -DSIGPIPE=0 for Windows 2023-05-23 03:50:53 +01:00
cpq bad05485d0 Define SIGPIPE for Win32, fix sleep() for Win32 2023-05-23 03:49:24 +01:00
cpq 38d7799ffa Rename wifi-router -> wifi-router-dashboard 2023-05-23 02:40:45 +01:00
Sergio R. Caprile 6e6696ccd4 Merge pull request #2207 from cesanta/wifi
Add wifi-router example
2023-05-22 19:59:06 -03:00
cpq feb546920e Add wifi-router example 2023-05-22 19:48:34 -03:00
Sergio R. Caprile 81b05b9de4 Merge pull request #2208 from cesanta/fixwbind
fix bind issue in W
2023-05-22 19:46:42 -03:00
Sergio R. Caprile ab10b042be fix bind issue in W 2023-05-22 19:13:48 -03:00
Sergio R. Caprile 26699914cc improve negative Content-length handling 2023-05-22 17:40:08 -03:00
Sergio R. Caprile 45e4b3c423 bump revno up 2023-05-18 12:26:19 -03:00
Sergio R. Caprile 6a5a139e33 Merge pull request #2201 from cesanta/MG_ESC
Update to use MG_ESC()
2023-05-17 14:38:17 -03:00
Sergio R. Caprile 1908d3200e Update to use MG_ESC() 2023-05-17 14:26:45 -03:00
Sergio R. Caprile f4cf40d38f Merge pull request #2200 from cesanta/esc
Add MG_ESC helper macro
2023-05-17 09:41:39 -03:00
cpq 514de84b97 Add MG_ESC helper macro 2023-05-17 11:58:40 +01:00
Sergio R. Caprile 7e7d0bb354 Merge pull request #2199 from cesanta/docinsource
remove stalled doc in header
2023-05-16 18:40:41 -03:00
Sergio R. Caprile e468b90442 remove stalled doc in header 2023-05-16 18:08:48 -03:00
Sergio R. Caprile 926959ab47 Merge pull request #2197 from cesanta/BUGFIX_handle_http_negative_content_length
Added check for negative value for HTTP Content-Length header
2023-05-16 16:11:14 -03:00
Allan Park 4663090a8f Added check for negative value for HTTP Content-Length header 2023-05-16 18:52:33 +03:00
Sergey Lyubka b0868a4d0b Merge pull request #2194 from cesanta/frp
Fix http-reverse-proxy for keep-alive incoming connections
2023-05-16 09:20:21 +01:00
Sergio R. Caprile 9088b00006 Fix keep-alive 2023-05-15 14:11:12 -03:00
Sergio R. Caprile 9c0fe8999d Merge pull request #2193 from cesanta/tuts
link to tutorial
2023-05-12 17:30:52 -03:00
Sergio R. Caprile 901aa5f7c1 link to tutorial 2023-05-12 17:30:06 -03:00
Sergio R. Caprile 3ee28c035b Merge pull request #2191 from cesanta/tuts
link to tutorial
2023-05-12 10:21:42 -03:00
Sergio R. Caprile 1e31b90905 link to tutorial 2023-05-12 10:20:38 -03:00
cpq 48333041f4 Apply SO_EXCLUSIVEADDRUSE and SO_REUSEADDR on windows 2023-05-12 14:08:49 +01:00
cpq 717c9dbe89 On Windows, prefer EXCLADDRINUSE, then REUSEADDR 2023-05-09 11:25:18 +01:00
Sergio R. Caprile fd86eb7aa7 Merge pull request #2184 from cesanta/tuts
link to tutorial
2023-05-08 18:31:50 -03:00
Sergio R. Caprile 9b4b35eff5 link to tutorial 2023-05-08 18:23:35 -03:00
Sergio R. Caprile ac528caf2b Merge pull request #2182 from cesanta/keil
simplify RTOS-related Keil examples
2023-05-05 18:49:27 -03:00
scaprile fbe626e791 simplify RTOS-related Keil examples 2023-05-05 17:41:47 -03:00
Sergio R. Caprile 9ca37d30d8 Merge pull request #2179 from cesanta/tuts
link to tutorials
2023-05-04 19:17:51 -03:00
Sergio R. Caprile 84986898c8 link to tutorials 2023-05-04 19:16:43 -03:00
Sergey Lyubka 5cebce3f4b Merge pull request #2173 from cesanta/arp
Add multicast and local broadcast MAC resolution
2023-04-29 12:01:01 +01:00
Sergey Lyubka bb344b14a8 Merge pull request #2168 from cesanta/udp-listener
Fix UDP listeners in MIP
2023-04-29 12:00:33 +01:00
Sergey Lyubka 20e613b444 Merge pull request #2169 from cesanta/udp-printf
Fix mg_xprint() for UDP in MIP
2023-04-29 11:59:46 +01:00
Sergey Lyubka a0952e0012 Merge pull request #2171 from cesanta/null_fs
Check for calloc() failure in filesystem code
2023-04-29 11:59:03 +01:00
Sergey Lyubka 49e66f809e Merge pull request #2172 from cesanta/null_mip
Check for calloc() failure in MIP
2023-04-29 11:57:25 +01:00
Sergey Lyubka 5152ed8731 Merge pull request #2174 from cesanta/ti-rndis
Add TI RNDIS example
2023-04-29 11:56:29 +01:00
cpq 33811a826f Include TCP/IP API only if enabled 2023-04-29 11:45:28 +01:00
Sergio R. Caprile d33aebfd31 Add TI RNDIS example 2023-04-28 11:23:40 -03:00
Sergio R. Caprile 7d53c52a6b Check for calloc() failure in MIP 2023-04-27 11:34:23 -03:00
Sergio R. Caprile f015a8686e Check for calloc() failure in filesystem code 2023-04-27 11:19:02 -03:00
Sergio R. Caprile ab791d2a2d Add multicast and local broadcast MAC resolution 2023-04-26 19:56:03 -03:00
Sergio R. Caprile a303858da7 Fix mg_xprint() for UDP in MIP 2023-04-26 18:32:54 -03:00
Sergio R. Caprile 4c58c62cfe Fix UDP listeners 2023-04-26 15:09:27 -03:00
Sergey Lyubka 4593332204 Merge pull request #2166 from cesanta/gzip
Fix #1927: respect Accept-Encoding when serving .gz files
2023-04-26 10:01:24 +01:00
cpq 9f5d8c4280 Fix #1927: respect Accept-Encoding when serving .gz files 2023-04-26 09:07:43 +01:00
Sergey Lyubka b0d44bf0ba Merge pull request #2165 from cesanta/mqtt
mqtt fixes
2023-04-25 08:27:01 +01:00
cpq 59b8434e36 mqtt fixes 2023-04-25 07:48:33 +01:00
Sergey Lyubka e6f27cbaf3 Merge pull request #2160 from robertc2000/master
MQTT: support for user properties feature added
2023-04-23 18:33:56 +01:00
robert 6c13df1aff MQTT: support for properties feature added 2023-04-23 16:35:50 +03:00
Sergey Lyubka 44bf059b2f Merge pull request #2158 from cesanta/ipv6
Fix #2089 - allow to bind v4 and v6 sockets on the same port
2023-04-18 08:26:47 +01:00
cpq 9ade464c2e Fix #2089 - allow to bind v4 and v6 sockets on the same port 2023-04-18 08:26:18 +01:00
Sergio R. Caprile aed5d4e05b Merge pull request #2159 from cesanta/testf7ft
Testf7ft
2023-04-17 17:04:31 -03:00
Sergio R. Caprile b57648df14 Update test.yml 2023-04-17 17:02:52 -03:00
Sergio R. Caprile 7bce887077 Relax test time 2023-04-17 16:59:36 -03:00
Sergio R. Caprile cacd9c7f95 Merge pull request #2156 from cesanta/xprintf
Remove %H %V %Q %q modifiers
2023-04-14 14:24:46 -03:00
Sergio R. Caprile cd64bfe84b Remove %H %V %Q %q modifiers 2023-04-14 10:13:22 -03:00
Sergio R. Caprile 52ed68ed24 Merge pull request #2154 from cesanta/keil
Add Keil examples and preliminary test
2023-04-12 10:16:12 -03:00
Sergey Lyubka 20577021a6 Merge pull request #2151 from cesanta/multi-threaded
Fix for some compilers
2023-04-12 10:02:27 +01:00
scaprile 838a2236a1 Add preliminary test 2023-04-11 17:47:38 -03:00
scaprile d03941b792 Add Keil examples 2023-04-11 17:46:28 -03:00
Sergio R. Caprile 92299c3079 Fix for some compilers 2023-04-11 08:41:14 -03:00
cpq d9f05532cd Address #2125: treat negative poll time as infinite wait 2023-04-10 15:04:37 +01:00
Sergio R. Caprile 2fd2dff126 Merge pull request #2138 from cesanta/printh
Add printf.h
2023-04-07 19:53:07 -03:00
Sergio R. Caprile 8e14ad0536 Add printf.h 2023-04-07 19:28:00 -03:00
Sergio R. Caprile 2b325102f3 Merge pull request #2143 from cesanta/dbl
Fix #2104 - %.*f formatting
2023-04-07 12:27:15 -03:00
Sergio R. Caprile 1f2be606fa Fix wildcard usage 2023-04-07 12:21:14 -03:00
cpq 6b29a2a724 Fix #2104 - %.*f formatting 2023-04-07 08:38:28 +01:00
Sergey Lyubka f79edeb053 Merge pull request #2145 from cesanta/cube
Cube
2023-04-07 08:29:54 +01:00
Sergio R. Caprile 84b92096d4 Add STM32CubeIDE examples and test for build 2023-04-06 17:33:45 -03:00
Sergio R. Caprile 70f4814cb1 Merge pull request #2144 from cesanta/test
Test TLS host verif with no CA
2023-03-31 17:04:39 -03:00
Sergio R. Caprile 49579eb2b4 Test host only TLS mode 2023-03-31 17:00:05 -03:00
Sergey Lyubka cc6caeeca9 Merge pull request #2139 from cesanta/freertos-tcp
FreeRTOS+ TCP support
2023-03-30 10:51:52 +01:00
Sergey Lyubka 90af22eba1 Merge pull request #2141 from cesanta/hc1
fix outdated comment
2023-03-30 10:51:25 +01:00
cpq f4b4b41264 Merge branch 'master' of github.com:cesanta/mongoose 2023-03-30 10:50:27 +01:00
cpq 9918b03c11 Enhance MQTT client 2023-03-30 10:49:16 +01:00
Sergio R. Caprile 95f44246bf fix old comment 2023-03-29 11:46:40 -03:00
Sergio R. Caprile b098723f78 Update test.yml 2023-03-27 18:19:48 -03:00
Sergio R. Caprile a819513a92 Remove old example and its breadcrumbs 2023-03-27 18:14:55 -03:00
Sergio R. Caprile 7531b28b4c Add refactored FreeRTOS-Plus-TCP example 2023-03-25 13:07:31 -03:00
Sergio R. Caprile 2b8586d1b7 Merge pull request #2134 from cesanta/freertos-tcp
Fix FreeRTOS-Plus-TCP
2023-03-24 16:42:59 -03:00
Sergio R. Caprile 8167291ffc Fix FreeRTOS-Plus-TCP 2023-03-24 15:28:32 -03:00
Sergio R. Caprile 0dfcf9607a Merge pull request #2132 from cesanta/freertos-tcp
Let FreeRTOS-Plus-TCP build on Keil
2023-03-23 22:02:44 -03:00
Sergio R. Caprile 4827831107 Let FreeRTOS-Plus-TCP build on Keil 2023-03-23 17:13:02 -03:00
Sergio R. Caprile 0ebb6d5d30 Merge pull request #2131 from cesanta/cmsis-rtos
Add arch for CMSIS-RTOS v1 and v2
2023-03-22 11:18:37 -03:00
Sergio R. Caprile f4ed5062f6 Add arch for CMSIS-RTOS v1 and v2 2023-03-21 19:32:56 -03:00
Sergio R. Caprile 434b129746 Merge pull request #2129 from cesanta/frerrno
Remove no longer necessary includes
2023-03-21 14:13:35 -03:00
Sergio R. Caprile 2f5041ac7d Remove no longer necessary includes 2023-03-21 14:08:35 -03:00
Sergio R. Caprile 24f9766b39 Merge pull request #2128 from cesanta/keil
Let lwIP and FreeRTOS build on Keil
2023-03-21 13:58:09 -03:00
Sergio R. Caprile ba872217d7 Let lwIP and FreeRTOS build on Keil 2023-03-21 12:09:00 -03:00
Sergey Lyubka b2ae517dac Merge pull request #2119 from cesanta/armcc
Add MG_ARCH_ARMCC
2023-03-20 22:01:40 +00:00
Sergio R. Caprile 32b52dc0c8 Merge pull request #2121 from cesanta/nomip-collateral
remove references to MIP in examples (comments)
2023-03-15 10:10:46 -03:00
Sergio R. Caprile 33a3fe9bbd remove references to MIP in examples (comments) 2023-03-15 09:43:22 -03:00
Sergio R. Caprile 245dc76503 Add MG_ARCH_ARMCC 2023-03-15 09:39:36 -03:00
Sergio R. Caprile 21dbfd79d8 Merge pull request #2120 from cesanta/chaudocs
Move docs to website
2023-03-14 09:55:52 -03:00
Sergio R. Caprile b9f2250278 Move docs to website 2023-03-14 09:54:29 -03:00
Sergio R. Caprile a0601f1891 Merge pull request #2118 from cesanta/testTM4c
update Makefile
2023-03-10 10:58:51 -03:00
Sergio R. Caprile 70403ee433 update Makefile 2023-03-10 10:45:30 -03:00
Sergio R. Caprile f3cde58c8f Merge pull request #2117 from cesanta/testTM4C
test only TM4C examples that have changes
2023-03-10 10:20:18 -03:00
Sergio R. Caprile 71c267776a Update test.yml 2023-03-10 10:19:39 -03:00
Sergio R. Caprile 359ff94a8c Merge pull request #2116 from cesanta/testTM4c
Test TM4C
2023-03-10 10:01:48 -03:00
Sergio R. Caprile efe1c1492f Merge pull request #2115 from cesanta/scaprile-patch-1
test TM4C
2023-03-10 10:00:28 -03:00
Sergio R. Caprile 2aaaf7c358 test TM4C 2023-03-10 09:59:56 -03:00
Sergio R. Caprile cefaffa0f0 update Makefile 2023-03-10 09:54:26 -03:00
Sergio R. Caprile a22d56dc41 Merge pull request #2114 from cesanta/standex
update
2023-03-10 09:37:36 -03:00
Sergio R. Caprile 51eca94504 update 2023-03-10 09:35:29 -03:00
Sergio R. Caprile 2b6d24d328 Merge pull request #2112 from cesanta/nomip-collateral
MIP_STATE_* -> MG_TCPIP_STATE_*
2023-03-10 09:27:11 -03:00
Sergio R. Caprile 4932025423 Merge pull request #2113 from cesanta/scaprile-patch-1
Update test.yml
2023-03-09 11:44:11 -03:00
Sergio R. Caprile c466abf4d0 Update test.yml 2023-03-09 11:43:32 -03:00
Sergio R. Caprile 2ece3a8b4c MIP_STATE_* -> MG_TCPIP_STATE_* 2023-03-09 11:25:02 -03:00
Sergio R. Caprile 3f760e1875 Merge pull request #2111 from cesanta/standex
standardize Zephyr examples
2023-03-08 17:35:39 -03:00
Sergio R. Caprile 1da134c38c Merge pull request #2110 from cesanta/pico-w5500
Gen MAC from board ID, standardize
2023-03-08 17:30:54 -03:00
Sergio R. Caprile 0bf96e9864 standardize Zephyr examples 2023-03-08 16:41:21 -03:00
Sergio R. Caprile 1f5c19306e Gen MAC from board ID, standardize 2023-03-08 11:51:55 -03:00
Sergio R. Caprile db10b3821c Merge pull request #2109 from cesanta/standex
Standex
2023-03-08 11:50:30 -03:00
Sergio R. Caprile 4245a6d04d update 2023-03-08 11:44:34 -03:00
Sergio R. Caprile 6920c1159b rework serial config 2023-03-07 16:02:02 -03:00
Sergio R. Caprile 3801e1eade Merge pull request #2107 from cesanta/standex
read MAC from flash
2023-03-07 15:59:14 -03:00
Sergio R. Caprile 3e419303a7 read MAC from flash 2023-03-06 17:33:17 -03:00
Sergio R. Caprile 0de1e6a3af Merge pull request #2106 from cesanta/standex
Standardize TM4C FreeRTOS
2023-03-06 16:01:49 -03:00
Sergio R. Caprile 99c415f898 Standardize TM4C FreeRTOS 2023-03-06 15:57:51 -03:00
Sergio R. Caprile f68d83dbf0 Merge pull request #2103 from cesanta/standex
standardize TM4C baremetal
2023-03-02 20:57:41 -03:00
Sergio R. Caprile 6e97905bce standardize TM4C baremetal 2023-03-02 20:44:35 -03:00
Sergio R. Caprile 572a10d5a0 Merge pull request #2100 from cesanta/standex
Update Makefiles and READMEs
2023-03-01 11:30:08 -03:00
Sergio R. Caprile eaa6199de0 Update Makefiles and READMEs 2023-03-01 11:28:24 -03:00
Sergio R. Caprile 70799101e4 Merge pull request #2099 from cesanta/standex
Update symlinks and Makefiles
2023-02-28 18:25:24 -03:00
Sergio R. Caprile 9cc70d0323 Update symlinks and Makefiles 2023-02-28 18:18:26 -03:00
cpq 20c5da6e55 Fix build - NULL pointer check 2023-02-28 17:55:25 +00:00
cpq 4c356bc368 Merge branch 'master' of github.com:cesanta/mongoose 2023-02-28 17:41:37 +00:00
Sergio R. Caprile aeb04deae4 Merge pull request #2098 from cesanta/tstexmac 2023-02-28 14:22:05 -03:00
Sergio R. Caprile 873e4d6547 Update Makefile 2023-02-28 14:18:39 -03:00
Sergio R. Caprile 9ba20304c2 Update test.yml 2023-02-28 14:14:57 -03:00
Sergio R. Caprile 252619b1a0 Merge pull request #2097 from cesanta/tstexwin
Test some examples on Windows
2023-02-28 14:07:10 -03:00
Sergio R. Caprile 38b129de66 Test some examples on Windows
closes #2047
2023-02-28 14:04:02 -03:00
Sergey Lyubka da028d1af9 Merge pull request #2096 from cesanta/fixrmii
Update RMII example, enhance MIP
2023-02-28 08:34:20 +00:00
Sergio R. Caprile bba361016d Update RMII ex, enhance MIP 2023-02-27 18:30:53 -03:00
Sergio R. Caprile c362af1f81 Merge pull request #2095 from cesanta/fixrndis
Fix RNDIS examples
2023-02-27 11:35:05 -03:00
Sergio R. Caprile 520507afd9 unbreak RNDIS examples 2023-02-27 11:28:42 -03:00
Sergio R. Caprile 4e7584167b force check and failures 2023-02-27 10:54:32 -03:00
Sergio R. Caprile 112bd61a25 Merge pull request #2094 from cesanta/fixwf
Update test.yml
2023-02-27 10:23:52 -03:00
Sergio R. Caprile 1df8bc0dfe Update test.yml
Fix embedded matrix workflow not signalling changes and not running
2023-02-27 10:22:52 -03:00
cpq f2076fe309 Add more tests for mg_strstr() 2023-02-26 01:32:03 +00:00
Sergey Lyubka 67dea15bf2 Merge pull request #2076 from cesanta/q
Use mg_queue in mip
2023-02-24 19:57:20 +00:00
cpq 910f19fe55 Use mg_queue in mip 2023-02-24 19:40:31 +00:00
Sergio R. Caprile 290bf0b6d2 Merge pull request #2093 from cesanta/standex
update Makefiles and symlinks
2023-02-24 15:49:35 -03:00
Sergio R. Caprile 4c87a776e6 updated Makefiles and symlinks 2023-02-24 13:46:31 -03:00
Sergio R. Caprile 4436093816 Merge pull request #2092 from cesanta/standex
standardize examples
2023-02-23 19:07:44 -03:00
Sergio R. Caprile b85aa7b084 Merge pull request #2090 from cesanta/tcp
mark we consumed data
2023-02-23 14:38:14 -03:00
Sergio R. Caprile 99e28b639d mark we consumed data 2023-02-23 14:35:26 -03:00
Sergio R. Caprile 9b94b4da26 fix build for Windows
(read from stdin does not work)
2023-02-23 14:04:10 -03:00
Sergio R. Caprile 5b46986628 update Makefiles and symlinks 2023-02-23 11:32:53 -03:00
Sergio R. Caprile d0e5690bfd Merge pull request #2088 from cesanta/standex
update Makefiles and symlinks
2023-02-22 16:58:49 -03:00
Sergio R. Caprile ddbfa06bcc update Makefiles and symlinks 2023-02-22 16:38:21 -03:00
Sergio R. Caprile 2c6fc99c68 Merge pull request #2084 from cesanta/standex
updated Makefiles and symlinks
2023-02-21 17:31:02 -03:00
Sergio R. Caprile d8ad0ac72c updated Makefiles and symlinks 2023-02-21 16:05:25 -03:00
Sergio R. Caprile 9de50d7981 Merge pull request #2083 from cesanta/standex
#2046 #2047
2023-02-21 14:53:04 -03:00
Jean-François SimonandJean-Francois Simon 2c5c46dc48 Fix headers (drivers) (#2081)
Co-authored-by: Jean-Francois Simon <jfsimon@startmail.com>
2023-02-21 16:39:53 +01:00
Jean-François SimonandJean-Francois Simon 6423b4cbb9 rt1020 driver check frame crc/truncated (#2080)
Co-authored-by: Jean-Francois Simon <jfsimon@startmail.com>
2023-02-21 16:27:04 +01:00
Sergio R. Caprile 2566aa725a http-proxy-client Makefile 2023-02-21 12:16:39 -03:00
Sergio R. Caprile eb463bbb2b READMEs, golden update collaterals, etc 2023-02-21 12:07:48 -03:00
Sergio R. Caprile 1a8a559d84 Merge pull request #2079 from cesanta/time
Fix #2075. Add MG_HTTP_DIRLIST_TIME_FMT, remove MG_HTTP_DIRLIST_TIME and MG_HTTP_DIRLIST_TIME_UTC
2023-02-20 20:13:56 -03:00
cpq 57c1d787e3 Fix #2075. Add MG_HTTP_DIRLIST_TIME_FMT, remove MG_HTTP_DIRLIST_TIME and MG_HTTP_DIRLIST_TIME_UTC 2023-02-20 21:25:55 +00:00
Sergey Lyubka 999a32424f Merge pull request #2078 from cesanta/standex
Golden Makefiles
2023-02-20 19:54:02 +00:00
Sergio R. Caprile c2ed20ba23 Golden Makefiles 2023-02-20 16:20:28 -03:00
Sergio R. Caprile 01cbb37359 Merge pull request #2077 from cesanta/standex
huge response
2023-02-20 16:17:15 -03:00
Sergio R. Caprile 3e205e9536 huge response 2023-02-20 16:15:30 -03:00
Sergio R. Caprile b29d6b4478 _sbrk in TI 2023-02-17 11:11:31 -03:00
Sergey Lyubka b9424e4c21 Merge pull request #2073 from cesanta/sbrk
Fix _sbrk()
2023-02-17 14:00:32 +00:00
Sergio R. Caprile 87fe912d8d Merge pull request #2074 from cesanta/standex
Standardize examples and make them Windows friendly
2023-02-17 10:59:55 -03:00
Sergio R. Caprile 59343c2f82 http-client 2023-02-17 10:57:54 -03:00
Sergio R. Caprile 700fc64383 update devdash README 2023-02-17 10:40:53 -03:00
Sergio R. Caprile ca256b9949 Win friendly #2047 2023-02-17 10:40:53 -03:00
cpq 68750f3455 Expand on integration steps 2023-02-17 10:49:05 +00:00
cpq 906fc417c8 Expand on crossplatform ability 2023-02-17 10:46:45 +00:00
cpq ac203c56df Expand on crossplatform ability 2023-02-17 10:46:16 +00:00
cpq 734ad45f1c Expand on crossplatform ability 2023-02-17 10:44:55 +00:00
cpq 4a1f2e0dd3 Fix mg_fs_posix.st() for Windows symlinks using ftell 2023-02-17 10:36:06 +00:00
cpq 24e3514640 Fix mg_fs_posix.st() for Windows symlinks 2023-02-17 10:20:33 +00:00
Sergio R. Caprile dadb05e022 Add heap limit 2023-02-16 15:17:19 -03:00
cpq ca3dfb3c07 Docs notes 2023-02-16 16:41:26 +00:00
cpq cf452942fa More windows-friendly makefile for rp2040/pico-w5500 2023-02-16 14:23:52 +00:00
Sergey Lyubka 28ee40bebe Merge pull request #2067 from cesanta/pico
Use RNG in examples/pico-w5500
2023-02-16 08:01:11 +00:00
cpq 6267752a2a Use RNG in examples/pico-w5500 2023-02-16 07:53:11 +00:00
Sergey Lyubka 2ece24e077 Merge pull request #2066 from cesanta/queue
Refactor queue
2023-02-15 22:33:07 +00:00
Sergio R. Caprile 59013e62d3 Merge pull request #2072 from cesanta/standex
Standardize examples
2023-02-15 18:07:54 -03:00
Sergio R. Caprile 824763aae9 standardize 2023-02-15 18:04:48 -03:00
Sergey Lyubka a8c5b04feb Merge pull request #2070 from cesanta/fixcl
Fix content-length header in mg_http_reply()
2023-02-15 19:22:03 +00:00
Sergey Lyubka 64f069ec24 Merge pull request #2043 from cesanta/randomize
Seed fallback clib PRNG with some entropy
2023-02-15 19:20:50 +00:00
cpq 515e438d4f Refactor queue 2023-02-15 18:53:44 +00:00
Sergio R. Caprile 9ec064f9d9 symlinks 2023-02-15 15:22:46 -03:00
Sergio R. Caprile 60c6b04a01 Add mg_srand() and seed with some entropy 2023-02-15 14:29:02 -03:00
Sergio R. Caprile 9deaa81a72 Merge pull request #2071 from cesanta/standex
captive-dns
2023-02-15 14:27:15 -03:00
Sergio R. Caprile ae703db6ee captive-dns 2023-02-15 14:22:48 -03:00
Sergio R. Caprile 267f54bc0e Fix content-length header in mg_http_reply() 2023-02-15 11:28:14 -03:00
cpq 8aa26fb2cd Fix fuzzer workflow 2023-02-15 14:25:04 +00:00
cpq e7667f2537 Merge branch 'master' of github.com:cesanta/mongoose 2023-02-14 15:12:59 +00:00
cpq bac15d2ecf Fix #2063 - a typo 2023-02-14 15:12:51 +00:00
Sergio R. Caprile ae27e07903 Merge pull request #2068 from cesanta/stm32-rndis
Standardize STM32 RNDIS examples
2023-02-14 12:10:55 -03:00
Sergio R. Caprile 605dfa7366 Standardize STM32 RNDIS examples 2023-02-13 18:40:09 -03:00
Sergio R. Caprile 85db19e33f Merge pull request #2064 from cesanta/renaming-stm32
simplify names
2023-02-13 17:00:40 -03:00
Sergio R. Caprile 052bc6b356 Merge pull request #2065 from cesanta/scaprile-patch-1
Update test.yml
2023-02-13 16:59:09 -03:00
Sergio R. Caprile 24985e2bca Update test.yml 2023-02-13 16:58:33 -03:00
Sergio R. Caprile 8e3eb8b3d2 simplify names 2023-02-13 16:54:26 -03:00
Sergio R. Caprile 2be44dbd94 Merge pull request #2061 from cesanta/efe4f
Update and standardize F4 FreeRTOS
2023-02-13 11:08:31 -03:00
Sergio R. Caprile 7c6b26faa2 Merge pull request #2062 from cesanta/scaprile-patch-2
Update test.yml
2023-02-13 11:07:41 -03:00
Sergio R. Caprile cfc42512ed Update test.yml 2023-02-13 11:07:16 -03:00
Sergio R. Caprile 50f5834296 Update and standardize F4 FreeRTOS 2023-02-13 10:53:59 -03:00
Jean-François SimonandJean-Francois Simon 07e91bb73a Fix build mip -> mg_tcpip (#2060)
Co-authored-by: Jean-Francois Simon <jfsimon@startmail.com>
2023-02-13 12:02:57 +01:00
Sergey Lyubka 3c547eeed8 Merge pull request #2059 from cesanta/test
Serialize HW tests
2023-02-13 08:16:57 +00:00
cpq 6f011fce3b Serialize HW tests 2023-02-13 03:10:09 +00:00
cpq 5aebed95a4 Fix VC98 build 2023-02-12 10:41:51 +00:00
Sergey Lyubka 8321f9f6e9 Merge pull request #2034 from cesanta/queue
Add struct mg_queue and API, change examples/multi-threaded, add tests
2023-02-12 10:04:13 +00:00
cpq bf9d69ab56 Add struct mg_queue and API, change examples/multi-threaded, add tests 2023-02-11 13:24:26 +00:00
Sergio R. Caprile faaff57d2b update Makefile 2023-02-10 21:24:42 -03:00
Sergio R. Caprile 40667ef1c1 Update Makefile 2023-02-10 20:52:55 -03:00
Sergio R. Caprile 04b4e3298b Merge pull request #2056 from cesanta/f7f
Make example as README says
2023-02-10 20:30:06 -03:00
Sergio R. Caprile 43cbd3a61e Merge pull request #2058 from cesanta/scaprile-patch-1
make F7 FreeRTOS testable
2023-02-10 20:24:04 -03:00
Sergio R. Caprile bfb091f2f4 make F7 FreeRTOS testable 2023-02-10 20:23:39 -03:00
Sergio R. Caprile 4974303e6b Make example as README says 2023-02-10 20:06:25 -03:00
Sergio R. Caprile 664bb0a663 Merge pull request #2055 from cesanta/makefiles
minor updates
2023-02-10 19:45:09 -03:00
Sergio R. Caprile 491596d03d minor updates 2023-02-10 19:41:27 -03:00
Sergio R. Caprile 75538be235 Merge pull request #2054 from cesanta/efe4
Standardize F4 baremetal
2023-02-10 17:28:05 -03:00
Sergio R. Caprile 1cb99ea2fc Standardize F4 baremetal 2023-02-10 15:53:55 -03:00
Sergey Lyubka c0f4bde5fc Merge pull request #2051 from cesanta/fmt
Split mg_*printf* functions into src/printf.c/h
2023-02-10 16:52:34 +00:00
cpq a4430dd49d Split mg_*printf* functions into src/printf.c/h 2023-02-10 15:47:23 +00:00
Jean-François SimonandJean-Francois Simon b513d40bd6 add coverage ws.c (#2050)
Co-authored-by: Jean-Francois Simon <jfsimon@startmail.com>
2023-02-10 15:51:44 +01:00
cpq fbaaf89a21 Update screenshot 2023-02-09 22:47:48 +00:00
cpq 7625a0154e Using webp for screenshots 2023-02-09 22:41:49 +00:00
cpq 396ee803b2 Remove -c core.symlinks arg from the clone command 2023-02-09 20:06:53 +00:00
cpq 5a42319a07 Add readme rule 2023-02-09 20:04:59 +00:00
cpq 61b9820f78 Update READMEs 2023-02-09 20:04:07 +00:00
Sergio R. Caprile a383a45269 Merge pull request #2044 from cesanta/eph1
Fix ifp->eport init
2023-02-09 16:41:25 -03:00
Sergio R. Caprile 7bd4869ae6 Merge pull request #2048 from cesanta/rules
Add a rule on symlink
2023-02-09 16:12:23 -03:00
cpq 49a6559453 Add a rule on symlink 2023-02-09 19:00:10 +00:00
cpq 2e16a10720 Fix ifp->eport init 2023-02-09 18:39:14 +00:00
Sergey Lyubka cd973b50ff Merge pull request #2042 from cesanta/eph
Use linux ephemeral range (start from 32768). More TCP debug
2023-02-09 17:40:49 +00:00
cpq b6fc67fff2 Use linux ephemeral range (start from 32768). More TCP debug 2023-02-09 15:20:08 +00:00
Jean-François Simon 12f00d785d mg_tcpip_imxrt1020 (#2033)
MG_TCPIP driver for NXP i.MX RT1020
2023-02-09 15:31:59 +01:00
Jean-François Simon de1ff6ed49 Add test to mqtt (#2041)
Test coverage mqtt
2023-02-09 15:05:55 +01:00
Sergio R. Caprile d0a6cbe5dd Merge pull request #2038 from cesanta/h7
Use CMSIS for H7
2023-02-09 09:18:09 -03:00
cpq 35924ce550 Use CMSIS for H7 2023-02-09 11:08:22 +00:00
Jean-François Simon ad1d8cbedd Add test to mqtt (#2040)
coverage: mqtt
2023-02-09 11:36:08 +01:00
Sergey Lyubka 6294ce59f7 Merge pull request #2035 from cesanta/rndismass
Add mass-storage disk with an index file
2023-02-08 15:58:18 +00:00
Sergio R. Caprile d445ff40c2 Add mass-storage disk with an index file 2023-02-08 12:38:11 -03:00
Sergey Lyubka c6010c3ab4 Merge pull request #2031 from cesanta/sym
Note about symlinks
2023-02-08 12:56:16 +00:00
Sergio R. Caprile 9da80d7b7d Merge pull request #2032 from cesanta/move
Move mip/ -> src/tcpip/, rename mip_ -> mg_tcpip_
2023-02-08 09:49:06 -03:00
cpq 2c62e58dbd Move mip/ -> src/tcpip/, rename mip_ -> mg_tcpip_ 2023-02-07 21:35:37 +00:00
Sergio R. Caprile efc54375dd Merge pull request #2028 from cesanta/mip
Kill ARP cache, kill qprofile
2023-02-07 15:42:20 -03:00
cpq 0c3946033b Note about symlinks 2023-02-07 15:42:17 +00:00
cpq 9dc86aa77d Kill ARP cache, kill qprofile 2023-02-07 14:26:03 +00:00
Sergey Lyubka 0cbe320a5f Merge pull request #2029 from cesanta/rules
Add examples/readme with rules
2023-02-07 13:41:37 +00:00
cpq 1c749a5310 Add filter for cifuzz 2023-02-07 12:17:46 +00:00
cpq a647a69791 Add examples/readme with rules 2023-02-07 12:15:50 +00:00
Sergey Lyubka 12db089c73 Merge pull request #2027 from cesanta/mip
Introduce sysinit.c, better debug log, more verbose Makefile
2023-02-06 22:38:33 +00:00
cpq f5ff7cfcf1 Introduce sysinit.c, better debug log, more verbose Makefile 2023-02-06 21:26:14 +00:00
Sergey Lyubka 2ddf71ec46 Merge pull request #2024 from cesanta/cmsis
Use CMSIS headers for f429 and f746 baremetal examples
2023-02-06 19:16:24 +00:00
Sergio R. Caprile 9017374292 Merge pull request #2025 from cesanta/ga
Tune GA checker
2023-02-06 14:28:26 -03:00
cpq 633f50cf5b Tune GA checker 2023-02-06 15:18:40 +00:00
cpq 1993e9c65b Use CMSIS headers for f429 and f746 baremetal examples 2023-02-06 15:00:09 +00:00
Sergio R. Caprile 8edc8610dc Merge pull request #2023 from cesanta/push
Reduce the number of redundant test runs. Disable SNTP test on macos …
2023-02-06 11:25:33 -03:00
Sergey Lyubka 6700b373cd Merge pull request #2022 from cesanta/win
Adopt Makefile for Windows. Update examples readme section
2023-02-06 14:21:56 +00:00
cpq 8d824799a0 Reduce the number of redundant test runs. Disable SNTP test on macos - it is flaky 2023-02-05 01:11:22 +00:00
cpq dc86c62d8b Adopt Makefile for Windows. Update examples readme section 2023-02-04 14:15:53 +00:00
Sergio R. Caprile 4ae4ff72e3 Merge pull request #2020 from cesanta/h743zi
Add STM32H743ZI driver and example
2023-02-03 18:33:46 -03:00
Sergio R. Caprile 958eebb16c Add STM32H743ZI driver and example 2023-02-03 18:04:29 -03:00
Sergio R. Caprile 43e48d2ba6 Merge pull request #2017 from cesanta/mipneat
qprofile related fixes
2023-02-02 17:34:28 -03:00
Sergio R. Caprile b6d8099c74 small tweaks
fix qprofile with latest changes

minor tweaks and qpfrofile related fixes
2023-02-02 17:09:27 -03:00
Sergio R. Caprile 25bac7c5ce Merge pull request #2016 from cesanta/percentia
Docs update, remove %I and %A extensions
2023-02-02 16:33:18 -03:00
Sergio R. Caprile 5d7a080e39 Remove %I and %A 2023-02-02 16:28:24 -03:00
Sergio R. Caprile b2a76dba98 Merge pull request #2014 from cesanta/halfnofast
Add support for 10M and half-duplex in STM32 and TM4C drivers
2023-02-02 13:30:35 -03:00
cpq 15ad69c8cb Add How to build examples section 2023-02-02 15:34:27 +00:00
Sergio R. Caprile e3ca006265 Add support for 10M and half-duplex in STM32 and TM4C drivers 2023-02-02 12:02:44 -03:00
cpq 961cc13948 Nits: fix DNS resolution message. Add Makefile comment for testing targets 2023-02-02 10:33:00 +00:00
Sergio R. Caprile 50da233258 Merge pull request #2011 from cesanta/test-f746
Update test.yml
2023-02-01 20:14:24 -03:00
Sergio R. Caprile 15ad58b5cc Merge pull request #2010 from cesanta/f429-debug-uart
Use UART_DEBUG
2023-02-01 19:53:53 -03:00
Sergio R. Caprile 61a27ff430 Update test.yml
closes #1999
( mods in #2009 )
2023-02-01 19:49:14 -03:00
Sergio R. Caprile befdb0a708 Merge pull request #2009 from cesanta/test-f746
Mods to be testable
2023-02-01 19:39:53 -03:00
Sergio R. Caprile 06b79600ac Use UART_DEBUG 2023-02-01 19:37:35 -03:00
Sergio R. Caprile b9e633ad06 Mods to be testable 2023-02-01 19:26:47 -03:00
Sergio R. Caprile 736a78faed Merge pull request #2007 from cesanta/rl
Better error handling for RL NET
2023-02-01 18:23:13 -03:00
cpq d76e69f9a7 Use UART_DEBUG 2023-02-01 21:08:24 +00:00
cpq 1612e1d142 Better error handling for RL NET 2023-02-01 13:59:47 +00:00
Sergio R. Caprile 56a33fd4c5 Merge pull request #2003 from cesanta/mip-percentia
Do not use %I %A in MIP
2023-02-01 09:15:15 -03:00
Sergio R. Caprile 1ca3244868 Merge pull request #2005 from cesanta/nosymlink
Remove symlinks in pico example
2023-01-31 15:40:37 -03:00
Sergio R. Caprile 8f358f09b8 Remove symlinks in pico example 2023-01-31 15:34:15 -03:00
Sergio R. Caprile d903de6526 Merge pull request #2004 from cesanta/nodupfiles
Remove dups in Zephyr dirs
2023-01-31 15:14:10 -03:00
Sergio R. Caprile c41ade2983 Remove dups in Zephyr dirs 2023-01-31 14:51:48 -03:00
Sergio R. Caprile 99dbbc7f39 Do not use %I %A in MIP 2023-01-31 14:37:00 -03:00
Sergio R. Caprile 4dd51cc889 Merge pull request #2002 from cesanta/print_mac
Add mg_print_mac()
2023-01-31 13:49:42 -03:00
Sergio R. Caprile 54c651f7e2 Add mg_print_mac() 2023-01-31 13:31:46 -03:00
Sergio R. Caprile d1c9d7ffdc Merge pull request #2000 from cesanta/tls
Add TLS to pico-w5500 baremetal example
2023-01-30 18:37:00 -03:00
cpq 052b40680d Add TLS to pico-w5500 baremetal example 2023-01-30 21:30:10 +00:00
Sergio R. Caprile b0d2519192 Merge pull request #2001 from cesanta/examples-percentia
do not use %I in examples
2023-01-30 18:21:18 -03:00
Sergio R. Caprile 997da11cc5 do not use %I 2023-01-30 17:13:38 -03:00
Sergio R. Caprile 476232ea22 Merge pull request #1995 from cesanta/mg_print_ip
Add mg_print_ip, mg_print_ip_port helper functions
2023-01-30 16:57:45 -03:00
Sergey Lyubka 4c83f4e2de Merge pull request #1987 from hakabahitoyo/bugfix-openssl-tls-sni
Bugfix OpenSSL TLS SNI
2023-01-30 11:43:43 +00:00
cpq 4bf39e18d9 Add mg_print_ip, mg_print_ip_port helper functions 2023-01-29 14:30:06 +00:00
cpq edfa533a4d Correct the description 2023-01-27 22:45:35 +00:00
cpq 28262145ab Better upload flow 2023-01-27 22:16:24 +00:00
cpq 51136ce982 Merge branch 'master' of github.com:cesanta/mongoose 2023-01-27 09:36:24 +00:00
cpq 84893ec582 Small usability nits 2023-01-27 09:36:16 +00:00
Hakaba Hitoyo 382362668e bugfix openssl tls sni 2023-01-22 14:27:44 +09:00
4275 changed files with 1974073 additions and 223771 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
blank_issues_enabled: false
+21
View File
@@ -0,0 +1,21 @@
---
name: Issue template
about: Please fill this issue template for reporting Mongoose issues
#title:
#labels:
#assignees:
---
- My goal is: _describe_
- My actions were: _describe_
- My expectation was: _describe_
- The result I saw: _provide logs or description_
- My question is: _your question_
# Environment
- mongoose version: _X.Y_
- Compiler/IDE and SDK: ZZZ version _X.Y_
- Target hardware/board: _?_
- Connectivity chip/module: _?_
- Target RTOS/OS (if applicable): _?_
-13
View File
@@ -1,13 +0,0 @@
- My goal is: _describe_
- My actions were: _describe_
- My expectation was: _describe_
- The result I saw: _provide logs or description_
- My question is: _your question_
# Environment
- mongoose version: _X.Y_
- Compiler/IDE and SDK: ZZZ version _X.Y_
- Target hardware/board: _?_
- Connectivity chip/module: _?_
- Target RTOS/OS (if applicable): _?_
+9 -2
View File
@@ -1,9 +1,16 @@
name: CIFuzz name: CIFuzz
on: [pull_request] on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
# Allow manual runs
workflow_dispatch:
jobs: jobs:
Fuzzing: Fuzzing:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: Build Fuzzers - name: Build Fuzzers
id: build id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
@@ -19,7 +26,7 @@ jobs:
dry-run: false dry-run: false
language: c++ language: c++
- name: Upload Crash - name: Upload Crash
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v4
if: failure() && steps.build.outcome == 'success' if: failure() && steps.build.outcome == 'success'
with: with:
name: artifacts name: artifacts
+32
View File
@@ -0,0 +1,32 @@
name: "CodeQL Scanning"
# https://github.com/github/codeql-action
on:
#schedule:
# - cron: '30 23 * * *' # run at 11:30 PM UTC
# Allow manual runs
workflow_dispatch:
env:
IPV6: 0
jobs:
CodeQL-Build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp
- run: |
make -C test test CC=gcc ASAN= ASAN_OPTIONS=
./test/setup_ga_network.sh && make -C test mip_test CC=gcc ASAN= ASAN_OPTIONS=
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
+24
View File
@@ -0,0 +1,24 @@
name: Fuzz
on:
schedule:
- cron: '0 21 * * *' # run at 9 PM UTC
# Allow manual runs
workflow_dispatch:
env:
CC: clang
jobs:
fuzz:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [fuzz, fuzz_tls]
name: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: make -C test ${{ matrix.target }} ARGS="-max_total_time=7200"
# as we're not getting access to test units causing a problem, convert from the log:
# base64 -d > dataofdeath
# then paste the base64 data, enter, Ctrl-D; maybe check with hexdump -C dataofdeath
+590
View File
@@ -0,0 +1,590 @@
name: Full build and test
on:
schedule:
- cron: '0 22 * * *' # run at 10 PM UTC
# Allow manual runs
workflow_dispatch:
env:
IPV6: 0
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [gcc, clang, g++, clang++]
target: [test]
ssl: ["", BUILTIN, MBEDTLS, OPENSSL, WOLFSSL]
select: ["-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0", "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0", "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=1"]
exclude:
- ssl: MBEDTLS
select: "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0"
- ssl: MBEDTLS
select: "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0"
- ssl: OPENSSL
select: "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0"
- ssl: OPENSSL
select: "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0"
- ssl: WOLFSSL
select: "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0"
- ssl: WOLFSSL
select: "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0"
name: linux ${{ matrix.target }} CC=${{ matrix.cc }} SSL=${{ matrix.ssl }} TFLAGS=${{ matrix.select }}
env:
CC: ${{ matrix.cc }}
SSL: ${{ matrix.ssl }}
TFLAGS: ${{ matrix.select }} -DMQTT_LOCALHOST
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install libmbedtls-dev libwolfssl-dev && test/setup_mqtt_server.sh && make -C test ${{ matrix.target }}
mip:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [gcc, clang, g++, clang++]
target: [mip_test, mip_tap_test]
ssl: ["", BUILTIN, MBEDTLS, OPENSSL, WOLFSSL]
# #3226: built-in TCP is currently not working with WolfSSL (builds fine)
exclude:
- ssl: WOLFSSL
target: mip_tap_test
name: ${{ matrix.target }} CC=${{ matrix.cc }} SSL=${{ matrix.ssl }}
env:
CC: ${{ matrix.cc }}
SSL: ${{ matrix.ssl }}
TFLAGS: -DMQTT_LOCALHOST
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if [ "${{ matrix.target }}" == "mip_tap_test" ]; then ./test/setup_ga_network.sh ; fi && sudo apt -y update ; sudo apt -y install libmbedtls-dev libwolfssl-dev && make -C test ${{ matrix.target }} IPV6=0
mip89:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1 # no parallel runs, to minimize MQTT errors
matrix:
target: [mip_vc98]
name: mip89 ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: make -C test ${{ matrix.target }}
s390:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN]
name: S390 SSL=${{ matrix.ssl }}
env:
TFLAGS: -DMQTT_LOCALHOST
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install binfmt-support qemu-user-static && ./test/setup_mqtt_server.sh && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test s390 SSL=${{ matrix.ssl }} MULTIREC=NO
armhf:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN]
name: ArmHF SSL=${{ matrix.ssl }}
env:
TFLAGS: -DMQTT_LOCALHOST
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install binfmt-support qemu-user-static && ./test/setup_mqtt_server.sh && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test armhf SSL=${{ matrix.ssl }} MULTIREC=NO
unamalgamated-mg_prefix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN, MBEDTLS, OPENSSL, WOLFSSL]
name: unamalgamated-mg_prefix SSL=${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install libmbedtls-dev libwolfssl-dev
- run: make -C test unamalgamated SSL=${{ matrix.ssl }} && make -C test mg_prefix
valgrind:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN, MBEDTLS, OPENSSL, WOLFSSL]
name: Valgrind SSL=${{ matrix.ssl }}
env:
TFLAGS: -DMQTT_LOCALHOST
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install libmbedtls-dev libwolfssl-dev valgrind
- run: ./test/setup_mqtt_server.sh && make -C test valgrind SSL=${{ matrix.ssl }}
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
# Mongoose does not work with WolfSSL version in MacOS
ssl: ["", BUILTIN, MBEDTLS, OPENSSL] # , WOLFSSL]
select: [-DMG_ENABLE_POLL=0, -DMG_ENABLE_POLL=1]
include:
- ssl: MBEDTLS
env:
# MbedTLS version in MacOS refuses to validate a certificate without a hostname, causing MQTT tests to fail when using MQTT_LOCALHOST
tflags: -DNO_MQTT_TESTS
exclude:
- ssl: MBEDTLS
select: -DMG_ENABLE_POLL=0
- ssl: OPENSSL
select: -DMG_ENABLE_POLL=0
#- ssl: WOLFSSL
# select: -DMG_ENABLE_POLL=0
name: macos SSL=${{ matrix.ssl }} TFLAGS=${{ matrix.select }}
env:
SSL: ${{ matrix.ssl }}
TFLAGS: ${{ matrix.select }} -DMQTT_LOCALHOST ${{ matrix.env.tflags }} -Wno-sign-conversion # Workaround for MbedTLS 3.5.0
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: brew install mbedtls wolfssl mosquitto # jq openssl already pre-installed
- run: /opt/homebrew/opt/mosquitto/sbin/mosquitto -c /Users/runner/work/mongoose/mongoose/test/mosquitto.conf.macos &
- run: make -C test test ASAN_OPTIONS= MBEDTLS=$(echo $(brew --cellar)/mbedtls*/*) OPENSSL=$(echo $(brew --cellar)/openssl*/*) WOLFSSL=$(echo $(brew --cellar)/wolfssl*/*)
windows:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1 # no parallel runs, to minimize MQTT errors
matrix:
target: [vc98, vc17, vc22, mingw, mingw++]
ssl: ["", BUILTIN]
select: [-DMG_ENABLE_POLL=0, -DMG_ENABLE_POLL=1]
exclude:
- target: vc98
select: -DMG_ENABLE_POLL=1
name: windows ${{ matrix.target }} SSL=${{ matrix.ssl }} TFLAGS=${{ matrix.select }}
env:
SSL: ${{ matrix.ssl }}
TFLAGS: ${{ matrix.select }} -DMQTT_LOCALHOST
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: ./test/setup_mqtt_server.sh && make -C test ${{ matrix.target }}
arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN]
name: Arm SSL=${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: make -C test arm SSL=${{ matrix.ssl }}
riscv:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN]
name: RISC-V SSL=${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: make -C test riscv SSL=${{ matrix.ssl }}
tutorials:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: [-DMG_TLS=MG_TLS_NONE, -DMG_TLS=MG_TLS_BUILTIN]
name: tutorials ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: sudo apt -y install libpcap-dev
- run: make -C test tutorials CFLAGS_EXTRA="${{ matrix.ssl }}"
- run: make -C test clean_tutorials
tutorials_win:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
ssl: [-DMG_TLS=MG_TLS_NONE, -DMG_TLS=MG_TLS_BUILTIN]
name: tutorials_win ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
# - uses: egor-tensin/setup-mingw@v2
# with:
# platform: x64
- name: test they build
run: make -C test tutorials_win CFLAGS_EXTRA="${{ matrix.ssl }}"
shell: cmd
- name: test they clean
run: make -C test clean_tutorials_win
shell: cmd
tutorials_mac:
runs-on: macos-latest
env: { HOMEBREW_NO_AUTO_UPDATE: 1 }
strategy:
fail-fast: false
matrix:
ssl: [-DMG_TLS=MG_TLS_NONE, -DMG_TLS=MG_TLS_BUILTIN]
name: tutorials_mac ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
- run: make -C test tutorials_mac CFLAGS_EXTRA="${{ matrix.ssl }}"
- run: make -C test clean_tutorials_mac
arduino:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: echo # nothing specific to install or do
- run: make -C test/arduino
- run: make -C test/arduino cleanall
# wizard_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path: esp32/esp32-idf
# name: ${{ matrix.example.path }}
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - run: echo # nothing specific to install or do
# fi
# - run: make -C tutorials/${{ matrix.example.path }} build
wizard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: infineon/xmc47_relax-make-baremetal-builtin
- path: infineon/xmc_plt2go_4400-make-baremetal-builtin
- path: infineon/xmc72_evk-make-baremetal-builtin
- path: nxp/frdm-mcxn947-make-baremetal-builtin
- path: nxp/frdm-mcxn947-make-freertos-builtin
- path: nxp/rt1020-evk-make-baremetal-builtin
- path: nxp/rt1060-evk-make-baremetal-builtin
- path: nxp/rt1170-evk-make-baremetal-builtin
- path: pico-sdk/pico-w-picosdk-baremetal-builtin
- path: pico-sdk/pico-2-w-picosdk-baremetal-builtin
- path: pico-sdk/w5500-evb-pico-picosdk-baremetal-builtin
- path: pico-sdk/w5500-evb-pico2-picosdk-baremetal-builtin
- path: stm32/nucleo-f429zi-make-baremetal-builtin
- path: stm32/nucleo-f429zi-make-freertos-builtin
- path: stm32/nucleo-f746zg-make-baremetal-builtin
- path: stm32/nucleo-f746zg-make-freertos-builtin
- path: stm32/nucleo-h563zi-make-baremetal-builtin
- path: stm32/nucleo-h563zi-make-freertos-builtin
- path: stm32/nucleo-h723zg-make-baremetal-builtin
- path: stm32/nucleo-h723zg-make-freertos-builtin
- path: stm32/nucleo-h743zi-make-baremetal-builtin
- path: stm32/nucleo-h743zi-make-freertos-builtin
- path: stm32/stm32h573i-dk-make-baremetal-builtin
- path: stm32/stm32h573i-dk-make-freertos-builtin
- path: ti/ek-tm4c1294xl-make-baremetal-builtin
- path: ti/ek-tm4c1294xl-make-freertos-builtin
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/${{ matrix.example.path }} build
generic_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: micropython/esp32
- path: http/uart-bridge/esp32
- path: http/http-client/esp8266/http-client-server
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: echo # nothing specific to install or do
- run: make -C tutorials/${{ matrix.example.path }} build
generic_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: mqtt/mqtt-client/microchip/same54-xpro
- path: nxp/nxp-frdmk66f-freertos
- path: nxp/nxp-lpcxpresso54s018m-freertos
- path: nxp/nxp-mimxrt1020-freertos
- path: nxp/nxp-evkbimxrt1050-lwip-freertos
- path: nxp/nxp-evkmimxrt1020-lwip-freertos
- path: nxp/nxp-evkmimxrt1024-lwip-freertos
- path: nxp/nxp-evkmimxrt1060-lwip-freertos
- path: nxp/nxp-evkmimxrt1064-lwip-freertos
- path: nxp/nxp-evkmimxrt1160-cm7-lwip-freertos
- path: nxp/nxp-evkmimxrt1170-cm7-lwip-freertos
- path: nxp/nxp-frdmk64f-lwip-freertos
- path: nxp/nxp-frdmk66f-lwip-freertos
- path: nxp/nxp-lpcxpresso54018-lwip-freertos
- path: nxp/nxp-lpcxpresso54608-lwip-freertos
- path: nxp/nxp-lpcxpresso54618-lwip-freertos
- path: nxp/nxp-lpcxpresso54628-lwip-freertos
- path: nxp/nxp-twrk65f180m-lwip-freertos
- path: nxp/nxp-twrkv58f220m-lwip-freertos
- path: pico-sdk/pico-rmii
- path: stm32/nucleo-f429zi-make-baremetal-builtin-rndis
- path: stm32/nucleo-f746zg-make-baremetal-builtin-rndis
- path: stm32/nucleo-g031-make-baremetal-builtin
- path: ti/ti-ek-tm4c1294xl-http-server
- path: ti/ek-tm4c1294xl-make-baremetal-builtin-rndis
name: ${{ matrix.example.path }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/${{ matrix.example.path }} build
device_dashboard_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: esp32
name: ${{ matrix.example.path }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: echo # nothing specific to install or do
- run: make -C tutorials/http/device-dashboard/${{ matrix.example.path }} build
device_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
example:
- path: http/device-dashboard/microchip/same54-xpro
- path: nxp/rt1020-evk-make-freertos-builtin
- path: nxp/rt1060-evk-make-freertos-builtin
- path: nxp/rt1170-evk-make-freertos-builtin
- path: renesas/ek-ra6m4-make-baremetal-builtin
- path: pico-sdk/pico-rndis-dashboard
- path: pico-sdk/pico-w-picosdk-freertos-lwip
- path: pico-sdk/pico-2-w-picosdk-freertos-lwip
- path: stm32/nucleo-f746zg-make-freertos-tcp
- path: stm32/nucleo-f746zg-make-baremetal-builtin-cmsis_driver
name: ${{ matrix.example.path }} ${{ matrix.ssl }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/${{ matrix.example.path }} build CFLAGS_EXTRA="${{ matrix.ssl }}"
# mqtt_dashboard_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path:
# name: ${{ matrix.example.path }}
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - run: echo # nothing specific to install or do
# - run: make -C tutorials/${{ matrix.example.path }} build
mqtt_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: pico-sdk/pico-rndis-device
name: ${{ matrix.example.path }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/${{ matrix.example.path }} build
# dual_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path:
# name: ${{ matrix.example.path }}
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - run: echo # nothing specific to install or do
# - run: make -C tutorials/${{ matrix.example.path }} device_dashboard
# - run: make -C tutorials/${{ matrix.example.path }} mqtt_dashboard
cube_examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: sudo pip install yq
- run: cd test/cube && make
test_f7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/stm32/nucleo-f746zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C tutorials/stm32/nucleo-f746zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C tutorials/stm32/nucleo-f746zg-make-freertos-tcp test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- name: Cube
run: echo # nothing specific to install or do
# - run: make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f746zg-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
# - run: make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f746zg-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
- run: make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f746zg-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
test_f4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/stm32/nucleo-f429zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C tutorials/stm32/nucleo-f429zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- name: Cube
run: echo # nothing specific to install or do
# - run: make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f429zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
# - run: make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f429zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
- run: make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f429zi-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
test_h743:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/stm32/nucleo-h743zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C tutorials/stm32/nucleo-h743zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# - name: Cube
# run: echo # nothing specific to install or do
# - run: make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-h743zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
# - run: make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-h743zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
test_h723:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/stm32/nucleo-h723zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C tutorials/stm32/nucleo-h723zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_h5:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/stm32/nucleo-h563zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C tutorials/stm32/nucleo-h563zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_rt1020:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/nxp/rt1020-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C tutorials/nxp/rt1020-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_rt1060:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/nxp/rt1060-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C tutorials/nxp/rt1060-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_rt1170:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/nxp/rt1170-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C tutorials/nxp/rt1170-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_ra6m4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 3 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/renesas/ek-ra6m4-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# - run: make -C tutorials/renesas/ek-ra6m4-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_tm4c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C tutorials/ti/ek-tm4c1294xl-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_same54:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: baremetal
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/http/device-dashboard/microchip/same54-xpro test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: make -C tutorials/mqtt/mqtt-client/microchip/same54-xpro test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_pico_w5500:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- name: SDK
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- run: make -C tutorials/pico-sdk/w5500-evb-pico-picosdk-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
+706
View File
@@ -0,0 +1,706 @@
name: Build and test - essentials
on:
push:
paths:
- "**Makefile"
- "**.c"
- "**.h"
# Allow manual runs
workflow_dispatch:
env:
IPV6: 0
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [gcc, clang++]
target: [test, mip_test]
ssl: ["", BUILTIN]
name: linux ${{ matrix.target }} CC=${{ matrix.cc }} SSL=${{ matrix.ssl }}
env:
CC: ${{ matrix.cc }}
SSL: ${{ matrix.ssl }}
TFLAGS: -DMQTT_LOCALHOST
steps:
- uses: actions/checkout@v4
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: if [ "${{ matrix.target }}" == "test" ]; then ./test/setup_mqtt_server.sh ; fi && make -C test ${{ matrix.target }}
s390:
runs-on: ubuntu-latest
env:
TFLAGS: -DMQTT_LOCALHOST
steps:
- uses: actions/checkout@v4
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 binfmt-support qemu-user-static && ./test/setup_mqtt_server.sh && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test s390
armhf:
runs-on: ubuntu-latest
env:
TFLAGS: -DMQTT_LOCALHOST
steps:
- uses: actions/checkout@v4
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 binfmt-support qemu-user-static && ./test/setup_mqtt_server.sh && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test armhf
unamalgamated-mg_prefix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
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: make -C test unamalgamated && make -C test mg_prefix
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
ssl: ["", BUILTIN]
name: macos SSL=${{ matrix.ssl }}
env:
SSL: ${{ matrix.ssl }}
TFLAGS: -DMQTT_LOCALHOST # -DNO_SNTP_CHECK
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- uses: actions/checkout@v4
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: |
brew install mosquitto
/opt/homebrew/opt/mosquitto/sbin/mosquitto -c /Users/runner/work/mongoose/mongoose/test/mosquitto.conf.macos &
make -C test test ASAN_OPTIONS=
windows:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [vc98, vc22, mingw++]
name: windows ${{ matrix.target }}
env:
TFLAGS: -DMQTT_LOCALHOST
steps:
- uses: actions/checkout@v4
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: ./test/setup_mqtt_server.sh && make -C test ${{ matrix.target }}
arm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make -C test arm
riscv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make -C test riscv
tutorials:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make -C test tutorials_essential
- run: make -C test clean_tutorials_essential
tutorials_win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
# - uses: egor-tensin/setup-mingw@v2
# with:
# platform: x64
- name: test they build
run: make -C test tutorials_win
shell: cmd
- name: test they clean
run: make -C test clean_tutorials_win
shell: cmd
tutorials_mac:
runs-on: macos-latest
env: { HOMEBREW_NO_AUTO_UPDATE: 1 }
steps:
- uses: actions/checkout@v4
- run: make -C test tutorials_mac
- run: make -C test clean_tutorials_mac
# wizard_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path: esp32/esp32-idf
# name: ${{ matrix.example.path }}
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - run: |
# if ./test/match_changed_files.sh '^src'; then
# echo GO=1 >> $GITHUB_ENV
# # nothing specific to install or do
# fi
# - if: ${{ env.GO == 1 }}
# run: make -C tutorials/${{ matrix.example.path }} build
wizard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: infineon/xmc47_relax-make-baremetal-builtin
- path: infineon/xmc_plt2go_4400-make-baremetal-builtin
- path: infineon/xmc72_evk-make-baremetal-builtin
- path: nxp/frdm-mcxn947-make-baremetal-builtin
- path: nxp/frdm-mcxn947-make-freertos-builtin
- path: nxp/rt1020-evk-make-baremetal-builtin
- path: nxp/rt1060-evk-make-baremetal-builtin
- path: nxp/rt1170-evk-make-baremetal-builtin
- path: pico-sdk/pico-w-picosdk-baremetal-builtin
- path: pico-sdk/pico-2-w-picosdk-baremetal-builtin
- path: pico-sdk/w5500-evb-pico-picosdk-baremetal-builtin
- path: pico-sdk/w5500-evb-pico2-picosdk-baremetal-builtin
- path: stm32/nucleo-f429zi-make-baremetal-builtin
- path: stm32/nucleo-f429zi-make-freertos-builtin
- path: stm32/nucleo-f746zg-make-baremetal-builtin
- path: stm32/nucleo-f746zg-make-freertos-builtin
- path: stm32/nucleo-h563zi-make-baremetal-builtin
- path: stm32/nucleo-h563zi-make-freertos-builtin
- path: stm32/nucleo-h723zg-make-baremetal-builtin
- path: stm32/nucleo-h723zg-make-freertos-builtin
- path: stm32/nucleo-h743zi-make-baremetal-builtin
- path: stm32/nucleo-h743zi-make-freertos-builtin
- path: stm32/stm32h573i-dk-make-baremetal-builtin
- path: stm32/stm32h573i-dk-make-freertos-builtin
- path: ti/ek-tm4c1294xl-make-baremetal-builtin
- path: ti/ek-tm4c1294xl-make-freertos-builtin
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C tutorials/${{ matrix.example.path }} build
generic_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: http/uart-bridge/esp32
- path: http/http-client/esp8266/http-client-server
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^src|^tutorials/http/uart-bridge|^tutorials/${{ matrix.example.path }}'; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: |
# nothing specific to install or do
- if: ${{ env.GO == 1 }}
run: make -C tutorials/${{ matrix.example.path }} build
generic_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: stm32/nucleo-g031-make-baremetal-builtin
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^src|^tutorials/${{ matrix.example.path }}'; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- if: ${{ env.GO == 1 }}
run: make -C tutorials/${{ matrix.example.path }} build
device_dashboard_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: esp32
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: make -C tutorials/http/device-dashboard/${{ matrix.example.path }} build
device_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: http/device-dashboard/microchip/same54-xpro
- path: nxp/rt1020-evk-make-freertos-builtin
- path: nxp/rt1060-evk-make-freertos-builtin
- path: nxp/rt1170-evk-make-freertos-builtin
- path: renesas/ek-ra6m4-make-baremetal-builtin
- path: pico-sdk/pico-rndis-dashboard
- path: pico-sdk/pico-w-picosdk-freertos-lwip
- path: pico-sdk/pico-2-w-picosdk-freertos-lwip
- path: stm32/nucleo-f746zg-make-freertos-tcp
- path: stm32/nucleo-f746zg-make-baremetal-builtin-cmsis_driver
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard|^tutorials/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C tutorials/${{ matrix.example.path }} build
# mqtt_dashboard_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path:
# name: ${{ matrix.example.path }}
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - run: |
# if ./test/match_changed_files.sh '^src|tutorials/mqtt/mqtt-dashboard/device|^tutorials/${{ matrix.example.path }}'; then
# echo GO=1 >> $GITHUB_ENV
# # nothing specific to install or do
# fi
# - if: ${{ env.GO == 1 }}
# run: make -C tutorials/${{ matrix.example.path }} build
mqtt_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: pico-sdk/pico-rndis-device
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|tutorials/mqtt/mqtt-dashboard/device|^tutorials/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C tutorials/${{ matrix.example.path }} build
cube_examples:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|tutorials/stm32/nucleo-*-cube-*'; then
echo GO=1 >> $GITHUB_ENV
sudo pip install yq
fi
- if: ${{ env.GO == 1 }}
run: cd test/cube && make
# test_f7:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - name: baremetal
# run: |
# if ./test/match_changed_files.sh "^src|tutorials/http/device-dashboard|tutorials/stm32/nucleo-f7.*-make-" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# # always run baremetal on core or dashboard or specific example changes; other examples only on specific example changes
# - if: ${{ env.GO == 1 }}
# continue-on-error: true # continue so next test has a chance to re-flash and exit from collisions and flash failures
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard|tutorials/stm32/nucleo-f746zg-make-baremetal-builtin'; then
# make -C tutorials/stm32/nucleo-f746zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-f746zg-make-freertos-builtin'; then
# make -C tutorials/stm32/nucleo-f746zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-f746zg-make-freertos-tcp'; then
# make -C tutorials/stm32/nucleo-f746zg-make-freertos-tcp test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - name: Cube
# run: |
# echo GO=0 >> $GITHUB_ENV
# if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-f7.*-cube-'; then
# echo GO=1 >> $GITHUB_ENV
# # nothing specific to install or do
# fi
## - if: ${{ env.GO == 1 }}
## run: |
## if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-f746zg-cube-baremetal-builtin'; then
## make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f746zg-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
## fi
## - if: ${{ env.GO == 1 }}
## run: |
## if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-f746zg-cube-freertos-builtin'; then
## make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f746zg-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
## fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-f746zg-cube-freertos-lwip'; then
# make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f746zg-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
# fi
#
#
# test_f4:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - name: baremetal
# run: |
# if ./test/match_changed_files.sh "^src|tutorials/http/device-dashboard|tutorials/stm32/nucleo-f4.*-make-" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# - if: ${{ env.GO == 1 }}
# continue-on-error: true
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard|tutorials/stm32/nucleo-f429zi-make-baremetal-builtin'; then
# make -C tutorials/stm32/nucleo-f429zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-f429zi-make-freertos-builtin'; then
# make -C tutorials/stm32/nucleo-f429zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - name: Cube
# run: |
# echo GO=0 >> $GITHUB_ENV
# if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-f4.*-cube-'; then
# echo GO=1 >> $GITHUB_ENV
# # nothing specific to install or do
# fi
## - if: ${{ env.GO == 1 }}
## run: |
## if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-f429zi-cube-baremetal-builtin'; then
## make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f429zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
## fi
## - if: ${{ env.GO == 1 }}
## run: |
## if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-f429zi-cube-freertos-builtin'; then
## make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f429zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
## fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-f429zi-cube-freertos-lwip'; then
# make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-f429zi-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
# fi
#
# test_h743:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 3 }
# - name: baremetal
# run: |
# if ./test/match_changed_files.sh "^src|tutorials/http/device-dashboard|tutorials/stm32/nucleo-h74.*-make-" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# - if: ${{ env.GO == 1 }}
# continue-on-error: true
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard|tutorials/stm32/nucleo-h743zi-make-baremetal-builtin'; then
# make -C tutorials/stm32/nucleo-h743zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-h743zi-make-freertos-builtin'; then
# make -C tutorials/stm32/nucleo-h743zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
## - name: Cube
## run: |
## echo GO=0 >> $GITHUB_ENV
## if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-h74.*-cube-'; then
## echo GO=1 >> $GITHUB_ENV
## # nothing specific to install or do
## fi
## - if: ${{ env.GO == 1 }}
## run: |
## if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-h743zi-cube-baremetal-builtin'; then
## make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-h743zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
## fi
## - if: ${{ env.GO == 1 }}
## run: |
## if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-h743zi-cube-freertos-builtin'; then
## make -C test/cube test PROJECTS=../../tutorials/stm32/nucleo-h743zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
## fi
#
# test_h723:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 3 }
# - name: baremetal
# run: |
# if ./test/match_changed_files.sh "^src|tutorials/http/device-dashboard|tutorials/stm32/nucleo-h72.*-make-" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# - if: ${{ env.GO == 1 }}
# continue-on-error: true
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard|tutorials/stm32/nucleo-h723zg-make-baremetal-builtin'; then
# make -C tutorials/stm32/nucleo-h723zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-h723zg-make-freertos-builtin'; then
# make -C tutorials/stm32/nucleo-h723zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
#
# test_h5:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 3 }
# - name: baremetal
# run: |
# if ./test/match_changed_files.sh "^src|tutorials/http/device-dashboard|tutorials/stm32/nucleo-h5.*-make-" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# - if: ${{ env.GO == 1 }}
# continue-on-error: true
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard|tutorials/stm32/nucleo-h563zi-make-baremetal-builtin'; then
# make -C tutorials/stm32/nucleo-h563zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/stm32/nucleo-h563zi-make-freertos-builtin'; then
# make -C tutorials/stm32/nucleo-h563zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
#
# test_rt1020:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 3 }
# - name: baremetal
# run: |
# if ./test/match_changed_files.sh "^src|tutorials/http/device-dashboard|tutorials/nxp/rt1020.*-make-" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# - if: ${{ env.GO == 1 }}
# continue-on-error: true
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard|tutorials/nxp/rt1020-evk-make-baremetal-builtin'; then
# make -C tutorials/nxp/rt1020-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/nxp/rt1020-evk-make-freertos-builtin'; then
# make -C tutorials/nxp/rt1020-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
#
# test_rt1060:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 3 }
# - name: baremetal
# run: |
# if ./test/match_changed_files.sh "^src|tutorials/http/device-dashboard|tutorials/nxp/rt1060.*-make-" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# - if: ${{ env.GO == 1 }}
# continue-on-error: true
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard|tutorials/nxp/rt1060-evk-make-baremetal-builtin'; then
# make -C tutorials/nxp/rt1060-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/nxp/rt1060-evk-make-freertos-builtin'; then
# make -C tutorials/nxp/rt1060-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
#
# test_rt1170:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 3 }
# - name: baremetal
# run: |
# if ./test/match_changed_files.sh "^src|tutorials/http/device-dashboard|tutorials/nxp/rt1170.*-make-" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# - if: ${{ env.GO == 1 }}
# continue-on-error: true
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard|tutorials/nxp/rt1170-evk-make-baremetal-builtin'; then
# make -C tutorials/nxp/rt1170-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/nxp/rt1170-evk-make-freertos-builtin'; then
# make -C tutorials/nxp/rt1170-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
#
# test_ra6m4:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 3 }
# - name: baremetal
# run: |
# if ./test/match_changed_files.sh "^src|tutorials/http/device-dashboard|tutorials/renesas/ek-ra6m4.*-make-" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# - if: ${{ env.GO == 1 }}
# continue-on-error: true
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard|tutorials/renesas/ek-ra6m4-make-baremetal-builtin'; then
# make -C tutorials/renesas/ek-ra6m4-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
## - if: ${{ env.GO == 1 }}
## run: |
## if ./test/match_changed_files.sh 'tutorials/renesas/ek-ra6m4-make-freertos-builtin'; then
## make -C tutorials/renesas/ek-ra6m4-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
## fi
#
# test_tm4c:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - name: baremetal
# run: |
# if ./test/match_changed_files.sh "^src|tutorials/http/device-dashboard|tutorials/ti/ek-tm4c.*-make-" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard|tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin'; then
# make -C tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh 'tutorials/ti/ek-tm4c1294xl-make-freertos-builtin'; then
# make -C tutorials/ti/ek-tm4c1294xl-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
#
# test_same54:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - name: baremetal
# run: |
# if ./test/match_changed_files.sh "^src|tutorials/http/device-dashboard|tutorials/mqtt/mqtt-client" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard'; then
# make -C tutorials/http/device-dashboard/microchip/same54-xpro test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh '^src|tutorials/mqtt/mqtt-client'; then
# make -C tutorials/mqtt/mqtt-client/microchip/same54-xpro test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# fi
#
# test_pico_w5500:
# runs-on: ubuntu-latest
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v4
# with: { fetch-depth: 2 }
# - name: SDK
# run: |
# if ./test/match_changed_files.sh "^src" ; then
# echo GO=1 >> $GITHUB_ENV
# sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
# fi
# - if: ${{ env.GO == 1 }}
# run: make -C tutorials/pico-sdk/w5500-evb-pico-picosdk-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
+654 -71
View File
@@ -1,5 +1,6 @@
name: build name: original workflow, outdated # *** YES, OUTDATED *** kept for hystorical/reference purposes, attachment, etc.
on: [push, pull_request] on:
workflow_dispatch:
env: env:
IPV6: 0 IPV6: 0
jobs: jobs:
@@ -10,69 +11,100 @@ jobs:
matrix: matrix:
cc: [gcc, clang, g++, clang++] cc: [gcc, clang, g++, clang++]
target: [test, mip_test] target: [test, mip_test]
# target: [test] ssl: ["", MBEDTLS, OPENSSL]
ssl: [MBEDTLS, OPENSSL] select: ["-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0", "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0", "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=1"]
name: linux ${{ matrix.target }} CC=${{ matrix.cc }} SSL=${{ matrix.ssl }} exclude:
- ssl: MBEDTLS
select: "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0"
- ssl: MBEDTLS
select: "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0"
- ssl: OPENSSL
select: "-DMG_ENABLE_POLL=0 -DMG_ENABLE_EPOLL=0"
- ssl: OPENSSL
select: "-DMG_ENABLE_POLL=1 -DMG_ENABLE_EPOLL=0"
name: linux ${{ matrix.target }} CC=${{ matrix.cc }} SSL=${{ matrix.ssl }} TFLAGS=${{ matrix.select }}
env: env:
CC: ${{ matrix.cc }} CC: ${{ matrix.cc }}
SSL: ${{ matrix.ssl }} SSL: ${{ matrix.ssl }}
TFLAGS: ${{ matrix.select }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: ./test/setup_ga_network.sh with: { fetch-depth: 2 }
- run: sudo apt-get update ; sudo apt-get install libmbedtls-dev - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: make ${{ matrix.target }} - if: ${{ env.GO == 1 }}
run: ./test/setup_ga_network.sh && sudo apt -y update ; sudo apt -y install libmbedtls-dev && make ${{ matrix.target }}
s390: s390:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get install qemu binfmt-support qemu-user-static with: { fetch-depth: 2 }
- run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: make s390 - 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 s390
armhf: armhf:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get install qemu binfmt-support qemu-user-static with: { fetch-depth: 2 }
- run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: make armhf - 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 armhf
linux2: linux2:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: sudo apt-get update ; sudo apt-get install libmbedtls-dev valgrind with: { fetch-depth: 2 }
- run: make unamalgamated - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: make valgrind - if: ${{ env.GO == 1 }}
- run: make mg_prefix run: sudo apt -y update ; sudo apt -y install libmbedtls-dev valgrind
examples: - if: ${{ env.GO == 1 }}
runs-on: ubuntu-latest run: make unamalgamated && make valgrind && make mg_prefix
steps:
- uses: actions/checkout@v3
- run: sudo apt -y install libmbedtls-dev libpcap-dev
- run: make clean examples
- run: make clean test MG_ENABLE_POLL=1
macos: macos:
runs-on: macos-latest runs-on: macos-latest
strategy:
fail-fast: false
matrix:
ssl: ["", MBEDTLS, OPENSSL]
select: [-DMG_ENABLE_POLL=0, -DMG_ENABLE_POLL=1]
exclude:
- ssl: MBEDTLS
select: -DMG_ENABLE_POLL=0
- ssl: OPENSSL
select: -DMG_ENABLE_POLL=0
name: macos SSL=${{ matrix.ssl }} TFLAGS=${{ matrix.select }}
env:
SSL: ${{ matrix.ssl }}
TFLAGS: ${{ matrix.select }} -DNO_SNTP_CHECK -Wno-sign-conversion # Workaround for MbedTLS 3.5.0
HOMEBREW_NO_AUTO_UPDATE: 1
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: HOMEBREW_NO_AUTO_UPDATE=1 brew install jq mbedtls openssl with: { fetch-depth: 2 }
- run: make test upload-coverage SSL=OPENSSL ASAN_OPTIONS= OPENSSL=`echo /usr/local/Cellar/openssl*/*` - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: make test SSL=MBEDTLS ASAN_OPTIONS= MBEDTLS=`echo /usr/local/Cellar/mbedtls*/*` - if: ${{ env.GO == 1 }}
#- run: make mip_test ASAN_OPTIONS= run: brew install jq mbedtls openssl
- run: make mg_prefix - if: ${{ env.GO == 1 }}
run: make test ASAN_OPTIONS= MBEDTLS=`echo /usr/local/Cellar/mbedtls*/*` OPENSSL=`echo /usr/local/Cellar/openssl*/*`
- if: ${{ env.GO == 1 }}
run: make mg_prefix
windows: windows:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [vc98, vc17, vc22, mingw, mingw++]
select: [-DMG_ENABLE_POLL=0, -DMG_ENABLE_POLL=1]
exclude:
- target: vc98
select: -DMG_ENABLE_POLL=1
name: windows ${{ matrix.target }} TFLAGS=${{ matrix.select }}
env:
TFLAGS: ${{ matrix.select }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: make vc98 with: { fetch-depth: 2 }
- run: make vc17 - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: make vc22 - if: ${{ env.GO == 1 }}
- run: make mingw run: make ${{ matrix.target }}
- run: make mingw++
arduino-xiao:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make arduino-xiao
arm: arm:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -83,29 +115,92 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: make riscv - run: make riscv
matrix_examples:
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt -y install libmbedtls-dev libpcap-dev
- run: make examples
- run: make clean
examples_win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
# - uses: egor-tensin/setup-mingw@v2
# with:
# platform: x64
- name: test they build
run: make examples_win
shell: cmd
- name: test they clean
run: make clean_examples_win
shell: cmd
examples_mac:
runs-on: macos-latest
env: { HOMEBREW_NO_AUTO_UPDATE: 1 }
steps:
- uses: actions/checkout@v3
- run: make examples_mac
- run: make clean_examples_mac
arduino:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/arduino" ; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/arduino'; then
make -C examples/arduino arduino-xiao
fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh '^src|examples/arduino'; then
# make -C examples/arduino arduino-nano
# fi
- if: ${{ env.GO == 1 }}
run: make -C examples/arduino clean
generic_examples:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
example: example:
- path: esp32/device-dashboard
- path: esp32/uart-bridge - path: esp32/uart-bridge
- path: esp32/micropython
- path: esp8266/http-client-server - path: esp8266/http-client-server
- path: stm32/nucleo-h743zi-baremetal name: ${{ matrix.example.path }}
target: test env:
- path: stm32/stm32-freertos-tcp GO: 0
- path: stm32/stm32-nucleo-f746z steps:
- path: stm32/stm32-nucleo-f746zg - uses: actions/checkout@v3
- path: stm32/stm32-nucleo-f429z with: { fetch-depth: 2 }
- path: stm32/stm32-nucleo-h743z - run: if ./test/match_changed_files.sh '^src|^examples/${{ matrix.example.path }}'; then echo GO=1 >> $GITHUB_ENV ; fi
- path: stm32/nucleo-f429zi-baremetal - if: ${{ env.GO == 1 }}
target: test run: |
- path: stm32/nucleo-f429zi-freertos-mip # nothing specific to install or do
- path: stm32/nucleo-f429zi-usb-rndis - if: ${{ env.GO == 1 }}
- path: stm32/nucleo-f746zg-baremetal run: make -C examples/${{ matrix.example.path }} build
- path: stm32/nucleo-f746zg-freertos-mip
- path: stm32/nucleo-f746zg-usb-rndis generic_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: microchip/same54-xpro/mqtt-client
- path: infineon/infineon-xmc4700_4800-lwip-rtx-rtos
- path: nxp/nxp-mimxrt1020-azurertos - path: nxp/nxp-mimxrt1020-azurertos
- path: nxp/nxp-frdmk66f-freertos - path: nxp/nxp-frdmk66f-freertos
- path: nxp/nxp-lpcxpresso54s018m-freertos - path: nxp/nxp-lpcxpresso54s018m-freertos
@@ -125,33 +220,521 @@ jobs:
- path: nxp/nxp-lpcxpresso54628-lwip-freertos - path: nxp/nxp-lpcxpresso54628-lwip-freertos
- path: nxp/nxp-twrk65f180m-lwip-freertos - path: nxp/nxp-twrk65f180m-lwip-freertos
- path: nxp/nxp-twrkv58f220m-lwip-freertos - path: nxp/nxp-twrkv58f220m-lwip-freertos
- path: infineon/infineon-xmc4700_4800-lwip-rtx-rtos
- path: ti/ti-ek-tm4c1294xl-http-server
- path: ti/ek-tm4c1294xl-baremetal
- path: ti/ek-tm4c1294xl-freertos-mip
- path: rp2040/pico-rmii - path: rp2040/pico-rmii
- path: stm32/nucleo-f429zi-make-baremetal-builtin-rndis
- path: stm32/nucleo-f746zg-make-baremetal-builtin-rndis
- path: stm32/nucleo-g031-make-baremetal-builtin
- path: ti/ti-ek-tm4c1294xl-http-server
- path: ti/ek-tm4c1294xl-make-baremetal-builtin-rndis
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^src|^examples/${{ matrix.example.path }}'; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
device_dashboard_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: esp32/device-dashboard
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
device_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: microchip/same54-xpro/device-dashboard
- path: nxp/rt1020-evk-make-baremetal-builtin
- path: nxp/rt1020-evk-make-freertos-builtin
- path: nxp/rt1060-evk-make-baremetal-builtin
- path: nxp/rt1060-evk-make-freertos-builtin
- path: rp2040/pico-rndis-dashboard - path: rp2040/pico-rndis-dashboard
- path: rp2040/pico-w - path: rp2040/pico-w
- path: rp2040/pico-w5500 - path: rp2040/pico-w5500
target: test - path: stm32/nucleo-f429zi-make-baremetal-builtin
- path: stm32/nucleo-f429zi-make-freertos-builtin
- path: stm32/nucleo-f746zg-make-baremetal-builtin
- path: stm32/nucleo-f746zg-make-freertos-builtin
- path: stm32/nucleo-f746zg-make-freertos-tcp
- path: stm32/nucleo-f746zg-make-baremetal-builtin-cmsis_driver
- path: stm32/nucleo-h563zi-make-baremetal-builtin
- path: stm32/nucleo-h563zi-make-freertos-builtin
- path: stm32/nucleo-h723zg-make-freertos-builtin
- path: stm32/nucleo-h743zi-make-baremetal-builtin
- path: stm32/nucleo-h743zi-make-freertos-builtin
- path: stm32/stm32h573i-dk-make-baremetal-builtin
- path: stm32/stm32h573i-dk-make-freertos-builtin
- path: ti/ek-tm4c1294xl-make-baremetal-builtin
- path: ti/ek-tm4c1294xl-make-freertos-builtin
name: ${{ matrix.example.path }} name: ${{ matrix.example.path }}
env:
GO: 0
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: sudo apt -y install gcc-arm-none-eabi with: { fetch-depth: 2 }
- name: ${{ matrix.example.path }} - run: |
run: make -C examples/${{ matrix.example.path }} ${{ matrix.example.target || 'build' }} VCON_API_KEY=${{secrets.VCON_API_KEY}} if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
# mqtt_dashboard_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path:
# name: ${{ matrix.example.path }}
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v3
# with: { fetch-depth: 2 }
# - run: |
# if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
# echo GO=1 >> $GITHUB_ENV
# # nothing specific to install or do
# fi
# - if: ${{ env.GO == 1 }}
# run: make -C examples/${{ matrix.example.path }} build
mqtt_dashboard_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: rp2040/pico-rndis-device
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/${{ matrix.example.path }} build
# dual_examples:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# example:
# - path:
# name: ${{ matrix.example.path }}
# env:
# GO: 0
# steps:
# - uses: actions/checkout@v3
# with: { fetch-depth: 2 }
# - run: |
# if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
# echo GO=1 >> $GITHUB_ENV
# # nothing specific to install or do
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
# make -C examples/${{ matrix.example.path }} device_dashboard
# fi
# - if: ${{ env.GO == 1 }}
# run: |
# if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
# make -C examples/${{ matrix.example.path }} mqtt_dashboard
# fi
dual_examples_arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: stm32/nucleo-h723zg-make-baremetal-builtin
name: ${{ matrix.example.path }}
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|^examples/${{ matrix.example.path }}'; then
make -C examples/${{ matrix.example.path }} device_dashboard
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/mqtt-dashboard/device|^examples/${{ matrix.example.path }}'; then
make -C examples/${{ matrix.example.path }} mqtt_dashboard
fi
cube_examples:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src|examples/stm32/nucleo-*-cube-*'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: cd test/cube && make
zephyr_examples: zephyr_examples:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
GO: 0
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: make -C examples/zephyr init with: { fetch-depth: 2 }
- run: |
if ./test/match_changed_files.sh '^src/.*.[ch]|^examples/zephyr'; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr init
- name: minify manifest - name: minify manifest
if: ${{ env.GO == 1 }}
uses: mikefarah/yq@master uses: mikefarah/yq@master
with: with:
cmd: yq -i eval '(.manifest.defaults, .manifest.remotes, .manifest.projects[] | select(.name == "cmsis" or .name == "hal_stm32" or .name == "mbedtls" or .name == "mcuboot" or .name == "picolibc" | del(.null) ), .manifest.self) as $i ireduce({};setpath($i | path; $i)) | del(.manifest.projects.[].null) | del(..|select(length==0))' examples/zephyr/zephyrproject/zephyr/west.yml cmd: yq -i eval '(.manifest.defaults, .manifest.remotes, .manifest.projects[] | select(.name == "cmsis" or .name == "hal_stm32" or .name == "mbedtls" or .name == "mcuboot" or .name == "picolibc" | del(.null) ), .manifest.self) as $i ireduce({};setpath($i | path; $i)) | del(.manifest.projects.[].null) | del(..|select(length==0))' examples/zephyr/zephyrproject/zephyr/west.yml
- run: make -C examples/zephyr update - if: ${{ env.GO == 1 }}
- run: make -C examples/zephyr/device-dashboard build run: make -C examples/zephyr update
- run: make -C examples/zephyr/http-client build - if: ${{ env.GO == 1 }}
- run: make -C examples/zephyr/http-server build run: make -C examples/zephyr/device-dashboard build
- run: make -C examples/zephyr/mqtt-aws-client build - if: ${{ env.GO == 1 }}
- run: make -C examples/zephyr/websocket-server build run: make -C examples/zephyr/http-client build
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr/http-server build
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr/mqtt-aws-client build
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr/websocket-server build
test_f7:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-f7.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-f746zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-make-freertos-builtin'; then
make -C examples/stm32/nucleo-f746zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-make-freertos-tcp'; then
make -C examples/stm32/nucleo-f746zg-make-freertos-tcp test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- name: Cube
run: |
echo GO=0 >> $GITHUB_ENV
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f7.*-cube-'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-cube-baremetal-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-cube-freertos-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f746zg-cube-freertos-lwip'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
fi
test_f4:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-f4.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f429zi-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-f429zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f429zi-make-freertos-builtin'; then
make -C examples/stm32/nucleo-f429zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- name: Cube
run: |
echo GO=0 >> $GITHUB_ENV
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f4.*-cube-'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f429zi-cube-baremetal-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f429zi-cube-freertos-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-f429zi-cube-freertos-lwip'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
fi
test_h743:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h74.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h743zi-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-h743zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h743zi-make-freertos-builtin'; then
make -C examples/stm32/nucleo-h743zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- name: Cube
run: |
echo GO=0 >> $GITHUB_ENV
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h74.*-cube-'; then
echo GO=1 >> $GITHUB_ENV
# nothing specific to install or do
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h743zi-cube-baremetal-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-h743zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h743zi-cube-freertos-builtin'; then
make -C test/cube test PROJECTS=../../examples/stm32/nucleo-h743zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
fi
test_h723:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h72.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h723zg-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-h723zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h723zg-make-freertos-builtin'; then
make -C examples/stm32/nucleo-h723zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_h5:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h5.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h563zi-make-baremetal-builtin'; then
make -C examples/stm32/nucleo-h563zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h563zi-make-freertos-builtin'; then
make -C examples/stm32/nucleo-h563zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_rt1020:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/nxp/rt1020.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
#if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/nxp/rt1020-evk-make-baremetal-builtin'; then
if ./test/match_changed_files.sh '^src|examples/nxp/rt1020-evk-make-baremetal-builtin'; then
make -C examples/nxp/rt1020-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
#if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/nxp/rt1020-evk-make-freertos-builtin'; then
if ./test/match_changed_files.sh '^src|examples/nxp/rt1020-evk-make-freertos-builtin'; then
make -C examples/nxp/rt1020-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_rt1060:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/nxp/rt1060.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/nxp/rt1060-evk-make-baremetal-builtin'; then
make -C examples/nxp/rt1060-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
- if: ${{ env.GO == 1 }}
run: |
if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/nxp/rt1060-evk-make-freertos-builtin'; then
make -C examples/nxp/rt1060-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
fi
test_tm4c:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/ti/ek-tm4c.*-make-" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/ti/ek-tm4c1294xl-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- if: ${{ env.GO == 1 }}
run: make -C examples/ti/ek-tm4c1294xl-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_same54:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: baremetal
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/microchip/same54-xpro" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/microchip/same54-xpro/device-dashboard test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- if: ${{ env.GO == 1 }}
run: make -C examples/microchip/same54-xpro/mqtt-client test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_pico_w5500:
runs-on: ubuntu-latest
env:
GO: 0
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: SDK
run: |
if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/rp2040/pico-w5500" ; then
echo GO=1 >> $GITHUB_ENV
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
fi
- if: ${{ env.GO == 1 }}
run: make -C examples/rp2040/pico-w5500 test VCON_API_KEY=${{secrets.VCON_API_KEY}}
+26
View File
@@ -0,0 +1,26 @@
name: Zephyr
on:
schedule:
- cron: '0 0 * * *' # run at 12 AM UTC
# Allow manual runs
workflow_dispatch:
jobs:
zephyr_examples:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
revno: ["--mr v3.7-branch", "--mr v4.2.0"] # LTS, latest stable
name: Zephyr ${{ matrix.revno }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 }
- run: test/setup_ga_docker_filesystem.sh
- run: make -C tutorials/zephyr init REPO=zephyrprojectrtos/ci REVNO="${{ matrix.revno }}"
- run: make -C tutorials/zephyr minify REVNO="${{ matrix.revno }}"
- run: make -C tutorials/zephyr update
- run: make -C tutorials/zephyr/device-dashboard build
- run: make -C tutorials/zephyr/http-client build
- run: make -C tutorials/zephyr/http-server build
- run: make -C tutorials/zephyr/mqtt-aws-client build
- run: make -C tutorials/zephyr/websocket-server build
+1 -1
View File
@@ -1,5 +1,5 @@
Copyright (c) 2004-2013 Sergey Lyubka Copyright (c) 2004-2013 Sergey Lyubka
Copyright (c) 2013-2023 Cesanta Software Limited Copyright (c) 2013-2025 Cesanta Software Limited
All rights reserved All rights reserved
This software is dual-licensed: you can redistribute it and/or modify This software is dual-licensed: you can redistribute it and/or modify
-186
View File
@@ -1,186 +0,0 @@
SRCS = mongoose.c test/unit_test.c test/packed_fs.c
HDRS = $(wildcard src/*.h) $(wildcard mip/*.h)
DEFS ?= -DMG_MAX_HTTP_HEADERS=7 -DMG_ENABLE_LINES -DMG_ENABLE_PACKED_FS=1 -DMG_ENABLE_SSI=1
WARN ?= -pedantic -W -Wall -Werror -Wshadow -Wdouble-promotion -fno-common -Wconversion -Wundef
OPTS ?= -O3 -g3
INCS ?= -Isrc -I.
SSL ?=
CWD ?= $(realpath $(CURDIR))
ENV ?= -e Tmp=. -e WINEDEBUG=-all
DOCKER ?= docker run --platform linux/amd64 --rm $(ENV) -v $(CWD):$(CWD) -w $(CWD)
VCFLAGS = /nologo /W3 /O2 /MD /I. $(DEFS) $(TFLAGS)
IPV6 ?= 1
ASAN ?= -fsanitize=address,undefined,alignment -fno-sanitize-recover=all -fno-omit-frame-pointer -fno-common
ASAN_OPTIONS ?= detect_leaks=1
EXAMPLES := $(dir $(wildcard examples/*/Makefile))
PREFIX ?= /usr/local
VERSION ?= $(shell cut -d'"' -f2 src/version.h)
COMMON_CFLAGS ?= $(C_WARN) $(WARN) $(INCS) $(DEFS) -DMG_ENABLE_IPV6=$(IPV6) $(TFLAGS)
CFLAGS ?= $(OPTS) $(ASAN) $(COMMON_CFLAGS)
VALGRIND_CFLAGS ?= $(OPTS) $(COMMON_CFLAGS)
VALGRIND_RUN ?= valgrind --tool=memcheck --gen-suppressions=all --leak-check=full --show-leak-kinds=all --leak-resolution=high --track-origins=yes --error-exitcode=1 --exit-on-first-error=yes
.PHONY: examples test valgrind mip_test
ifeq "$(findstring ++,$(CC))" ""
# $(CC) does not end with ++, i.e. we're using C. Apply C flags
C_WARN ?= -Wmissing-prototypes -Wstrict-prototypes
else
# $(CC) ends with ++, i.e. we're using C++. Apply C++ flags
C_WARN ?= -Wno-deprecated
endif
ifeq "$(SSL)" "MBEDTLS"
MBEDTLS ?= /usr/local
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -I/usr/include
LDFLAGS ?= -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509
endif
ifeq "$(SSL)" "OPENSSL"
OPENSSL ?= /usr/local
CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include
LDFLAGS ?= -L$(OPENSSL)/lib -lssl -lcrypto
endif
all:
$(MAKE) -C examples/http-server
tall: mg_prefix unamalgamated test mip_test arm examples vc98 vc17 vc22 mingw mingw++ fuzz
mip_test: test/mip_test.c mongoose.c mongoose.h Makefile mip_tap_test
$(CC) test/mip_test.c $(INCS) $(WARN) $(OPTS) $(C_WARN) $(ASAN) -o $@
ASAN_OPTIONS=$(ASAN_OPTIONS) $(RUN) ./$@
mip_tap_test: test/mip_tap_test.c mongoose.c mongoose.h Makefile
$(CC) test/mip_tap_test.c $(INCS) $(WARN) $(OPTS) $(C_WARN) $(ASAN) -o $@
ASAN_OPTIONS=$(ASAN_OPTIONS) $(RUN) ./$@
examples:
@for X in $(EXAMPLES); do test -f $$X/Makefile || continue; $(MAKE) -C $$X example || exit 1; done
test/packed_fs.c: Makefile src/ssi.h test/fuzz.c test/data/a.txt
$(CC) $(CFLAGS) test/pack.c -o pack
$(RUN) ./pack Makefile src/ssi.h test/fuzz.c test/data/a.txt test/data/range.txt > $@
DIR ?= test/data
OUT ?= packed_fs.c
mkfs:
$(CC) $(CFLAGS) test/pack.c -o pack
$(RUN) ./pack -s $(DIR) `find $(DIR) -type f` > $(OUT)
# find $(DIR) -type f | sed -e s,^$(DIR),,g -e s,^/,,g
# Check that all external (exported) symbols have "mg_" prefix
mg_prefix: mongoose.c mongoose.h
$(CC) mongoose.c $(CFLAGS) -c -o /tmp/x.o && nm /tmp/x.o | grep ' T ' | grep -v 'mg_' ; test $$? = 1
musl: test
musl: ASAN =
musl: WARN += -Wno-sign-conversion
musl: CC = $(DOCKER) mdashnet/cc1 gcc
musl: RUN = $(DOCKER) mdashnet/cc1
# Make sure we can build from an unamalgamated sources
unamalgamated: $(HDRS) Makefile test/packed_fs.c
$(CC) src/*.c test/packed_fs.c test/unit_test.c $(CFLAGS) $(LDFLAGS) -g -o unit_test
fuzz: ASAN = -fsanitize=fuzzer,signed-integer-overflow,address,undefined
fuzz: mongoose.c mongoose.h Makefile test/fuzz.c
$(CC) test/fuzz.c $(OPTS) $(WARN) $(INCS) $(TFLAGS) $(ASAN) -o fuzzer
$(RUN) ./fuzzer
FUZZDATA ?= /tmp/fuzzdata
fuzz2: mongoose.c mongoose.h Makefile test/fuzz.c
$(CC) test/fuzz.c -DMAIN $(OPTS) $(WARN) $(ASAN) $(INCS) -o fuzzer
$(RUN) ./fuzzer $(FUZZDATA)
test: Makefile mongoose.h $(SRCS)
$(CC) $(SRCS) $(CFLAGS) $(LDFLAGS) -o unit_test
ASAN_OPTIONS=$(ASAN_OPTIONS) $(RUN) ./unit_test
coverage: CFLAGS += -coverage
coverage: test
gcov -l -n *.gcno | sed '/^$$/d' | sed 'N;s/\n/ /'
gcov -t mongoose.c > mongoose.gcov
upload-coverage: coverage
curl -s https://codecov.io/bash | /bin/bash
valgrind: Makefile mongoose.h mongoose.c
$(CC) $(SRCS) $(VALGRIND_CFLAGS) $(LDFLAGS) -g -o unit_test
$(VALGRIND_RUN) ./unit_test
armhf: ASAN=
armhf: IPV6=0
armhf: CC = $(DOCKER) mdashnet/armhf cc
armhf: RUN = $(DOCKER) mdashnet/armhf
armhf: test
s390: ASAN=
s390: IPV6=0
s390: CC = $(DOCKER) mdashnet/s390 cc
s390: RUN = $(DOCKER) mdashnet/s390
s390: test
arm: DEFS += -DMG_ENABLE_FILE=0 -DMG_ENABLE_MIP=1 -DMG_ARCH=MG_ARCH_NEWLIB
arm: mongoose.h $(SRCS)
$(DOCKER) mdashnet/armgcc arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb $(SRCS) $(OPTS) $(WARN) $(INCS) $(DEFS) $(TFLAGS) -o unit_test -nostartfiles --specs nosys.specs -e 0
riscv: DEFS += -DMG_ENABLE_FILE=0 -DMG_ENABLE_MIP=1 -DMG_ARCH=MG_ARCH_NEWLIB
riscv: mongoose.h $(SRCS)
$(DOCKER) mdashnet/riscv riscv-none-elf-gcc -march=rv32imc -mabi=ilp32 $(SRCS) $(OPTS) $(WARN) $(INCS) $(DEFS) $(TFLAGS) -o unit_test
vc98: Makefile mongoose.h $(SRCS)
$(DOCKER) mdashnet/vc98 wine cl $(SRCS) $(VCFLAGS) ws2_32.lib /Fe$@.exe
$(DOCKER) mdashnet/vc98 wine $@.exe
vc17: Makefile mongoose.h $(SRCS)
$(DOCKER) mdashnet/vc17 wine64 cl $(SRCS) $(VCFLAGS) ws2_32.lib /Fe$@.exe
$(DOCKER) mdashnet/vc17 wine64 $@.exe
vc22: Makefile mongoose.h $(SRCS)
$(DOCKER) mdashnet/vc22 wine64 cl $(SRCS) $(VCFLAGS) ws2_32.lib /Fe$@.exe
$(DOCKER) mdashnet/vc22 wine64 $@.exe
mingw: Makefile mongoose.h $(SRCS)
$(DOCKER) mdashnet/mingw x86_64-w64-mingw32-gcc $(SRCS) -W -Wall -Werror -I. $(DEFS) -lwsock32 -o $@.exe
$(DOCKER) mdashnet/mingw wine64 $@.exe
arduino: ENV = -v $(CWD)/arduino:/root
arduino:
curl -sL http://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz | unxz | tar -xf -
mv arduino-* $@
$(DOCKER) mdashnet/cc2 ./arduino/arduino --pref "boardsmanager.additional.urls=https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json" --save-prefs
$(DOCKER) mdashnet/cc2 ./arduino/arduino --pref "compiler.warning_level=all" --save-prefs
$(DOCKER) mdashnet/cc2 ./arduino/arduino --install-boards Seeeduino:samd
arduino-xiao: ENV = -v $(CWD)/arduino:/root
arduino-xiao: arduino
rm -rf tmp; mkdir tmp
cp examples/arduino/w5500/w5500.ino tmp/tmp.ino
cp mongoose.c mongoose.h examples/arduino/w5500/mongoose_custom.h tmp/
$(DOCKER) mdashnet/cc2 ./arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 tmp/tmp.ino
mingw++: Makefile mongoose.h $(SRCS)
$(DOCKER) mdashnet/mingw x86_64-w64-mingw32-g++ $(SRCS) -W -Wall -Werror -I. $(DEFS) -lwsock32 -o $@.exe
linux-libs: CFLAGS += -fPIC
linux-libs: mongoose.o
$(CC) mongoose.o $(LDFLAGS) -shared -o libmongoose.so.$(VERSION)
$(AR) rcs libmongoose.a mongoose.o
install: linux-libs
install -Dm644 libmongoose.a libmongoose.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib
ln -s libmongoose.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libmongoose.so
install -Dm644 mongoose.h $(DESTDIR)$(PREFIX)/include/mongoose.h
uninstall:
rm -rf $(DESTDIR)$(PREFIX)/lib/libmongoose.a $(DESTDIR)$(PREFIX)/lib/libmongoose.so.$(VERSION) $(DESTDIR)$(PREFIX)/include/mongoose.h $(DESTDIR)$(PREFIX)/lib/libmongoose.so
mongoose.c: Makefile $(wildcard src/*) $(wildcard mip/*.c)
(cat src/license.h; echo; echo '#include "mongoose.h"' ; (for F in src/*.c mip/*.c ; do echo; echo '#ifdef MG_ENABLE_LINES'; echo "#line 1 \"$$F\""; echo '#endif'; cat $$F | sed -e 's,#include ".*,,'; done))> $@
mongoose.h: $(HDRS) Makefile
(cat src/license.h; echo; echo '#ifndef MONGOOSE_H'; echo '#define MONGOOSE_H'; echo; cat src/version.h ; echo; echo '#ifdef __cplusplus'; echo 'extern "C" {'; echo '#endif'; cat src/arch.h src/arch_*.h src/net_*.h src/config.h src/str.h src/fmt.h src/log.h src/timer.h src/fs.h src/util.h src/url.h src/iobuf.h src/base64.h src/md5.h src/sha1.h src/event.h src/net.h src/http.h src/ssi.h src/tls.h src/tls_mbed.h src/tls_openssl.h src/ws.h src/sntp.h src/mqtt.h src/dns.h src/json.h src/rpc.h mip/mip.h mip/driver_*.h | sed -e '/keep/! s,#include ".*,,' -e 's,^#pragma once,,'; echo; echo '#ifdef __cplusplus'; echo '}'; echo '#endif'; echo '#endif // MONGOOSE_H')> $@
clean:
rm -rf $(PROG) *.exe *.o *.dSYM *_test* ut fuzzer *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb slow-unit* _CL_* infer-out data.txt crash-* test/packed_fs.c pack arduino tmp
find examples -maxdepth 3 -name zephyr -prune -o -name Makefile -print | xargs dirname | xargs -n1 make clean -C
+165 -24
View File
@@ -1,36 +1,165 @@
# Mongoose - Embedded Web Server / Embedded Networking Library # Mongoose - Embedded Web Server / Embedded Network Library
[![License: GPLv2/Commercial](https://img.shields.io/badge/License-GPLv2%20or%20Commercial-green.svg)](https://opensource.org/licenses/gpl-2.0.php) [![License: GPLv2/Commercial](https://img.shields.io/badge/License-GPLv2%20or%20Commercial-green.svg)](https://opensource.org/licenses/gpl-2.0.php)
[![Build Status]( https://github.com/cesanta/mongoose/workflows/build/badge.svg)](https://github.com/cesanta/mongoose/actions) [![Build Status]( https://github.com/cesanta/mongoose/actions/workflows/quicktest.yml/badge.svg)](https://github.com/cesanta/mongoose/actions)
[![Code Coverage](https://codecov.io/gh/cesanta/mongoose/branch/master/graph/badge.svg)](https://codecov.io/gh/cesanta/mongoose) [![Code Coverage](https://codecov.io/gh/cesanta/mongoose/branch/master/graph/badge.svg)](https://codecov.io/gh/cesanta/mongoose)
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/mongoose.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:mongoose) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/mongoose.svg)](https://issues.oss-fuzz.com/issues?sort=-opened&can=1&q=proj:mongoose)
Mongoose is a networking library for C/C++. It implements event-driven Mongoose is a network library for C/C++. It provides event-driven non-blocking
non-blocking APIs for TCP, UDP, HTTP, WebSocket, MQTT. It is designed for APIs for TCP, UDP, HTTP, WebSocket, MQTT, and other protocols. It is designed
connecting devices and bringing them online. On the market since 2004, used by for connecting devices and bringing them online. On the market since 2004, used
vast number of open source and commercial products - it even runs on the by vast number of open source and commercial products - it even runs on the
International Space Station! Mongoose makes embedded network programming fast, International Space Station! Mongoose makes embedded network programming fast,
robust, and easy. Features include: robust, and easy. Features include:
- Cross-platform: works on Linux/UNIX, MacOS, Windows, Android, FreeRTOS, etc. - Cross-platform:
- Supported embedded architectures: ESP32, NRF52, STM32, NXP, and more - works on Linux/UNIX, MacOS, Windows, Android
- Built-in protocols: plain TCP/UDP, HTTP, MQTT, Websocket - works on ST, NXP, ESP32, Nordic, TI, Microchip, Infineon, Renesas and other chips
- SSL/TLS support: mbedTLS, OpenSSL or custom (via API) - write code once - and it'll work everywhere
- ideal for the unification of the network infrastructure code across company
- Built-in protocols: plain TCP/UDP, SNTP, HTTP, MQTT, Websocket, and other
- Asynchronous DNS resolver - Asynchronous DNS resolver
- Tiny static and run-time footprint - Tiny static and run-time footprint
- Source code is both ISO C and ISO C++ compliant - Source code is both ISO C and ISO C++ compliant
- Works with any network stack with socket API, like LwIP or FreeRTOS-Plus-TCP - Easy to integrate: just copy [mongoose.c](https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.c)
- Very easy to integrate: just copy `mongoose.c` and `mongoose.h` files to your build tree and [mongoose.h](https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.h) files to your source tree
- Optional built-in TCP/IP stack with drivers for bare metal or RTOS firmwares - Built-in TCP/IP stack with drivers for bare metal or RTOS systems
- A full device dashboard - Available drivers: STM32F, STM32H; NXP RT1xxx; TI TM4C; Microchip SAME54; Wiznet W5500
[bare metal example on Nucleo-F429ZI](examples/stm32/nucleo-f429zi-baremetal) - A complete Web device dashboard on bare metal ST Nucleo boards is only 6 files
is only 6 files
- For comparison, a CubeIDE generated HTTP example is 400+ files - For comparison, a CubeIDE generated HTTP example is 400+ files
- Detailed [documentation](https://mongoose.ws/documentation/) and - Can run on top of an existing TCP/IP stack with BSD API, e.g. lwIP, Zephyr, Azure, etc
[tutorials](https://mongoose.ws/tutorials/) - Built-in TLS 1.3 ECC stack. Also can use external TLS libraries - mbedTLS, OpenSSL, or other
- Does not depend on any other software to implement networking
- Built-in firmware updates for STM32 H5, STM32 H7
See https://mongoose.ws/ for complete documentation, videos, case studies, etc.
# Commercial use ## Supported platforms
Mongoose can work on top of any TCP/IP stack that supports BSD sockets API.
Platforms supported by the 3rd party TCP/IP stacks:
| TCP/IP stack | Notes |
| :-------------- | :------- |
| **lwIP** | All devices running lwIP, for example ESP32, ESP32S3, ESP32C3, ESP32C6, etc |
| **Zephyr** | All devices supported by Zephyr |
| **Other** | Any other TCP/IP stack that supports BSD socket API, for example Amazon FreeRTOS-TCP |
| **Linux, Mac, Windows** | Workstations, server, single board computers, embedded Linux devices running on MPUs or FPGAs |
Optionally, Mongoose provides its own built-in TCP/IP stack, eliminating the
need for additional software to implement networking functionality. The
built-in stack supports operation in both bare-metal and RTOS environments.
Platforms supported by the Mongoose built-in TCP/IP stack:
| Hardware | Notes |
| :------------- | :------- |
| **STM32** | All STM32 MCUs with built-in Ethernet: STM32Fxx, STM32H5xx, STM32H7xx |
| **NXP** | All NXP MCUs with built-in Ethernet: IMXRT102x, IMXRT104x, IMXRT105x, IMXRT106x, IMXRT117x, RW612, MCXN94x |
| **Microchip** | ATSAME54 MCUs with built-int Ethernet |
| **Renesas** | RA5M, RA6M, RA8M MCUs with built-in Ethernet |
| **Infineon** | XMC4, XMC7 MCUs with built-in Ethernet |
| **Texas Instruments** | TM4C, TMS570 MCUs with built-in Ethernet |
| **Cypress WiFi** | Any MCU with CY43xx WiFi chips, like RP2040 Pico-W, RP2350 Pico2-W, Arduino Portenta |
| **Wiznet Ethernet** | Any MCU that use Wiznet W5500 or Wiznet 5100 MAC+PHY chips |
| **Cellular** | NRF9160, SIM800 |
## Usage Examples
Below are quick snippets that should give an idea how simple the API is and
how easy it is to create applications with it.
Create a simple web server that serves a directory. The behavior of the
HTTP server is specified by its event handler function:
```c
#include "mongoose.h" // To build, run: cc main.c mongoose.c
// HTTP server event handler function
void ev_handler(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
struct mg_http_serve_opts opts = { .root_dir = "./web_root/" };
mg_http_serve_dir(c, hm, &opts);
}
}
int main(void) {
struct mg_mgr mgr; // Declare event manager
mg_mgr_init(&mgr); // Initialise event manager
mg_http_listen(&mgr, "http://0.0.0.0:8000", ev_handler, NULL); // Setup listener
for (;;) { // Run an infinite event loop
mg_mgr_poll(&mgr, 1000);
}
return 0;
}
```
HTTP server implements a REST API that returns current time. JSON formatting:
```c
static void ev_handler(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
if (mg_match(hm->uri, mg_str("/api/time/get"), NULL)) {
mg_http_reply(c, 200, "", "{%m:%lu}\n", MG_ESC("time"), time(NULL));
} else {
mg_http_reply(c, 500, "", "{%m:%m}\n", MG_ESC("error"), MG_ESC("Unsupported URI"));
}
}
}
```
MQTT client that subscribes to a topic `device1/rx` and
echoes incoming messages to `device1/tx`:
```c
#include "mongoose.h"
static const char *s_mqtt_url = "mqtt://broker.hivemq.com:1883";
static struct mg_connection *s_mqtt_conn = NULL;
// MQTT connection event handler function
static void ev_handler(struct mg_connection *c, int ev, void *ev_data) {
if (ev == MG_EV_OPEN) {
MG_INFO(("%lu created, connecting to %s ...", c->id, s_mqtt_url));
} else if (ev == MG_EV_MQTT_OPEN) {
struct mg_mqtt_opts opts = {.qos = 1, .topic = mg_str("device1/rx")};
mg_mqtt_sub(c, &opts);
MG_INFO(("%lu connected, subscribing to %s", c->id, opts.topic.buf));
} else if (ev == MG_EV_MQTT_MSG) {
char response[100];
struct mg_mqtt_message *mm = (struct mg_mqtt_message *) ev_data;
struct mg_mqtt_opts opts = {.qos = 1, .topic = mg_str("device1/tx")};
mg_snprintf(response, sizeof(response), "Received [%.*s] / [%.*s]",
mm->topic.len, mm->topic.buf, mm->data.len, mm->data.buf);
opts.message = mg_str(response);
mg_mqtt_pub(c, &opts);
} else if (ev == MG_EV_CLOSE) {
MG_INFO(("%u closing", c->id));
s_mqtt_conn = NULL;
}
}
// Reconnection timer function. If we get disconnected, reconnect again
static void timer_fn(void *arg) {
struct mg_mgr *mgr = (struct mg_mgr *) arg;
if (s_mqtt_conn == NULL) {
struct mg_mqtt_opts opts = {.clean = true};
s_mqtt_conn = mg_mqtt_connect(mgr, s_mqtt_url, &opts, ev_handler, NULL);
}
}
int main() {
struct mg_mgr mgr; // Mongoose event manager. Holds all connections
mg_mgr_init(&mgr); // Initialise event manager
mg_timer_add(&mgr, 3000, MG_TIMER_REPEAT | MG_TIMER_RUN_NOW, timer_fn, &mgr);
for (;;) {
mg_mgr_poll(&mgr, 1000); // Infinite event loop
}
return 0;
}
```
## Commercial use
- Mongoose is used by hundreds of businesses, from Fortune500 giants like - Mongoose is used by hundreds of businesses, from Fortune500 giants like
Siemens, Schneider Electric, Broadcom, Bosch, Google, Samsung, Qualcomm, Caterpillar to the small businesses Siemens, Schneider Electric, Broadcom, Bosch, Google, Samsung, Qualcomm, Caterpillar to the small businesses
- Used to solve a wide range of business needs, like implementing Web UI - Used to solve a wide range of business needs, like implementing Web UI
@@ -40,11 +169,11 @@ robust, and easy. Features include:
- See [Case Studies](https://mongoose.ws/case-studies/) from our respected - See [Case Studies](https://mongoose.ws/case-studies/) from our respected
customers like [Schneider Electric](https://mongoose.ws/case-studies/schneider-electric/) (industrial automation), [Broadcom](https://mongoose.ws/case-studies/broadcom/) (semiconductors), [Pilz](https://mongoose.ws/case-studies/pilz/) (industrial automation), and others customers like [Schneider Electric](https://mongoose.ws/case-studies/schneider-electric/) (industrial automation), [Broadcom](https://mongoose.ws/case-studies/broadcom/) (semiconductors), [Pilz](https://mongoose.ws/case-studies/pilz/) (industrial automation), and others
- See [Testimonials](https://mongoose.ws/testimonials/) from engineers that integrated Mongoose in their commercial products - See [Testimonials](https://mongoose.ws/testimonials/) from engineers that integrated Mongoose in their commercial products
- We provide [Evaluation and Commercial licensing](https://mongoose.ws/licensing/), [support](https://mongoose.ws/support/), consultancy and integration - We provide [Evaluation and Commercial licensing](https://mongoose.ws/licensing/), [support](https://mongoose.ws/support/), consultancy and [integration
assistance - don't hesitate to [contact us](https://mongoose.ws/contact/) services](https://mongoose.ws/integration/) - don't hesitate to [contact us](https://mongoose.ws/contact/)
# Security ## Security
We take security seriously: We take security seriously:
1. Mongoose repository runs a 1. Mongoose repository runs a
@@ -70,7 +199,19 @@ We take security seriously:
of which we get notified and in case of any issue, act similar to (3). of which we get notified and in case of any issue, act similar to (3).
# Contributions ## Articles
Technical guides and deep dives into embedded web servers, WebUI integration and embedded networking technologies:
- [Embedded Web Server: A Comprehensive Guide for Modern Connected Devices](https://mongoose.ws/articles/embedded-web-server-a-comprehensive-guide-for-modern-connected-devices/)
- [Building Embedded Web Device Dashboards](https://mongoose.ws/articles/building-embedded-web-device-dashboard/)
- [ESP32 Device Dashboard: A Step-by-Step Guide for Developers](https://mongoose.ws/articles/esp32-device-dashboard/)
- [How to build an STM32 Web Dashboard](https://mongoose.ws/articles/stm32-device-dashboard/)
- [STM32 WebSocket Guide](https://mongoose.ws/articles/stm32-websocket-guide/)
- [Web File Manager on STM32, ESP32 and Embedded Linux](https://mongoose.ws/articles/building-a-web-file-manager-on-stm32-esp32-embedded-linux/)
- [Web dashboard on Zephyr RTOS](https://mongoose.ws/articles/web-dashboard-on-zephyr-rtos/)
## Contributions
Contributions are welcome! Please follow the guidelines below: Contributions are welcome! Please follow the guidelines below:
-4172
View File
File diff suppressed because it is too large. Load diff
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="-5.229 8.358 512.162 263.062" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<image width="512.162" height="263.062" x="-5.229" y="8.358" style="" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArkAAAFmCAYAAABp3oLTAAAAAXNSR0IArs4c6QAAIABJREFUeF7sXQdYFUcXva9TBQEr9t4ARewFNVbsGhG7wRI1UeyixhLRoGLsXZNYYu8NxQJ2FMGKBcWCSAdp0l79v7PPMe8nqEhRILvfh+B7u7MzZ2Z3ztw5914B8QePAI8AjwCPAI8AjwCPAI8Aj0ARQ0BQxNrDN4dHgEeAR4BHgEeAR4BHgEeAR4B4kssPAh4BHgEeAR4BHgEeAR4BHoEihwBPcotcl/IN4hHgEeAR4BHgEeAR4BHgEeBJLj8GeAR4BHgEeAR4BHgEeAR4BIocAjzJLUJdOmnSpIFxcTGW27fv/F0gEKiLUNP4pvAI8AjwCPAI8AjwCPAIfBECPMn9IrgK9snW1tYX79+/39rYxPh1N4duG4cMGbLewcEhqWDXmq8djwCPAI8AjwCPAI8Aj0DeI8CT3LzH9JuVWL9+/YfPX72s06qVPb18+UoTFR4RbN+23YlxY0Yu6NChQ+I3qxh/Yx4BHgEeAR4BHgEeAR6Br4wAT3K/MuD5eTsrG+ug9Ax1jV/d3EgpV9DVq9fp6pUrFBMVGdisRbMj/fsN2DZoUN8X+VkHvmweAR4BHgEeAR4BHgEegYKAAE9yC0Iv5FEdrKxsglIz1DXmL3AjIgHJpHqUnJREd+/cIW/v8xQVFfHStr6198iRwxY4Ojq+zqPb8sXwCPAI8AjwCPAI8AjwCBQ4BHiSW+C6JOcVsrJu8FiuEtea7jqLRAIRqVVqkojFJJNJSalUkN/Na3ThwlmKjAx7ZtfE7tTg4cPXDOrLW3Zzjjh/JY8AjwCPAI8AjwCPQEFFgCe5BbVnclAvKyubh2lKYZ3ZcxaQQEOkUROJxSKSy+WED4oZG5I8PZXu3r9HFy6cp5BXL17XqV372kjnkfOHDXN6moNb8pfwCPAI8AjwCPAI8AjwCBRIBHiSWyC7JWeVqmdl/SBDLao3a/Y8juASCUmtIRIKhKTRqEmjUZKABGRsbEzv3qXQ06eP6OqVi/Tgwf2whg3rew4Z4Lj8hx9+eJKzu/NX8QjwCPAI8AjwCPAI8AgUHAR4kltw+iLXNalnZX0/Qy2y0iW5GpBcoYg0GhVHdAUCAalUahKLxaQnk1BGeiqFvnlN3hfO0f17dyOq16zuPbj/9+4///zzw1xXiC+AR4BHgEeAR4BHgEeAR+AbIcCT3G8EfH7c9lMkl0hNarWKky/AwqtQKEggIJKIRSQSCUmjVtHz4Gd07rwXBT64H1q5UgUv5+FDfh8/fjxv2c2PzuLL5BHgEeAR4BHgEeARyFcEeJKbr/B+3cKzkitoLblauQKIrlKpJJFI8t6iC9Ir5qy8GAgymYwU8gwKCwuliz4X6Kafb2T5cqWv9e7b181t7tx7X7c1/N14BHgEeAR4BHgEeAR4BHKOAE9yc45dgbvSyso6MF0tqptZriAQCEmtVpJYLOTqrNEISKPRcORXrdaQSoXvxCQSibR/i0QkEhKFhLygS5cvUkDArQjz4qbnBjkNWjxnzozHBa7hfIV4BHgEeAR4BHgEeAR4BDIhwJPcIjQk6llZPZRrJHVmzZrLEVnO8UxNnNUWVlytJldLcrWHhvsO5BbyBcTWhX5XpVJxMgapVEwqlZzevHlDvtev0PWrlyNLlyxxxdGxr9vcuXMfFCHo+KbwCPAI8AjwCPAI8AgUMQR4kluEOrSelfUjhUZce+ZHSC5IrfZHa9EF8dXGGsMwYD9CsGIu/hhHijVEBoZ6XJzdmOgIunzxAt28cSNcX1//yvd9+6xesmTR9SIEId8UHgEeAR4BHgEeAR6BIoIAT3KLSEeiGfWsrB8rNOJaOSO5DAghZ92FBVir19WQQiHXOqgJ1Zx1Nzo6mi6cP093bgfEaTQq/8EDB3j89tuCC0UISr4pPAI8AjwCPAI8AjwChRwBnuQW8g7UrX49K+snCo24ZvZJLq6GZZcd+Fur14XDGrS8IpH4PelVEWmUpNaoSCKRklQsotDQ13TnTgD5eJ9P0NfT83Xo6rBq7arfvYoQpHxTvjICPj4+eqmpqabp6elikUgk0NPTSylfvvy7unXryr9yVfjb8QjwCPAI8AgUcgR4klvIO1C3+nWtrIOUGnGNLyG5SA6hpbpMyqAhlRqaXDERibhoDNDpqtVqEomFJBQKSKlQkFBAJJVKQYkpOSmBrl27QhcvXkxSKxT+ffr0XLt69YojRQhavin5gIC/v7/k8uXLTZ88edLh2bNnjRISEsySkpKMU1JS9BQKhVAgEKgNDQ3lUqk0w8TEJMXS0jKsevXqV6pVq3ZrzJgxvvlQJb5IHgEeAR4BHoEihABPcotQZ9arZ/1UQeLq2SW5ILiC905oILkagYYEpCYVtLhQ7Ko1nFMaky9oBAIuexq9TywhEuJ6LT02MJBR/Ns4juz6+fklJycnXOndo9uWtWvXHi1CEPNNyQME1q5da3vu3LnxT548qR8eHl4xOTm5uE6xiHWHIcXl7HsvFoeInBOSS6VSTbFixaIrVKjwxNra2qdz5857nJz4lNR50C3frIi7d+/WDQ0NbfjmzZsaISEhFeLi4iwSExMN09PTEQEmUU9PL8TY2DiqdOnSTytUqPDa0tLyjYODw5tvVmH+xjwCPAKFBgGe5Baarvp8RRnJRQgxaGoRRQG/ESpMyxkyO55lXSYXjIEjuYjGwJzUtFEa1NAxvA8/pj1H9U+UBqGQZFIJxcW9pUePHpDXmZPvMlKT73Xp1m3L5g3rtn++BfwZRRkBd3f3NidPnpwWGBhok5iYaPm+rSpjY+NQc3PzpyVKlHhXunTpRGNjY5WBgYEIx9u3bw0SEhKMo6KiikdGRprEx8eXUSgUxiC/GI9ly5aNsLa2vjlo0KC5gwcP5iN+FIIBpNFoBK9fvx7i4+Mz/PLlyy38/f2l0PmnpKQQiC3eO5BMoX/x7kK0FxxisViur6+fUKxYsYQqVaqE29raXm7WrNkRR0fHu4Wg2XwVc4jAw4cPpS9evCiRnJxsnJaWJhMIBCI9Pb1UExOTBAcHhyiBAO7R/MEj8BE+wwNTdBAAyVUKJJwlNzck90sRYRMSF3pMIuEc1lQqBSkyUunevTt07uzZjKioiBs9uzls3rbtj91fWj5/fuFGYOfOndW2b9++zM/Pr2lycnIpjUajNjMze1KtWrUXzZo1S6pXr16V+vXrNzQxMZEUK1aMS0qCMYRDLpdzP/Hx8fT8+XO6f/8+PXv27K2fn1/GmzdvDJOSkophzJUtWzasffv224YPH/57q1at4gs3YkWz9iC39+/fn3X27Nlpnp6eJkFBQVy/pqWlcWQW/a6vr096enrcb/Qr3ikIb5iRkcERYJyLv1mcbzMzs0g7Ozu/Ll26bHBxcTlTNJH7b7XqxIkTlrdu3er86NGjjmFhYSVjY2PNEhMTTdLS0vQVCoUEq1uZTKbU09NLNjIyijM3N48uV67cyyZNmpysUaPGw169eoX+txDjW/spBHhLbhEaH9Y29Z8qSVJ9husvpFKxUGFwJIPZ6x/N7T8hxPKm8bC44AcTEou7q4EVmNSkpyejlHfJdOeOP13wvpARGx15r327trsmT3bZYGdnh+C8/FGEEZg2bdqAw4cPz3n+/HltmPwtLCzu29vbB3Tr1q2Kra1tm/Lly5OhoSFHchixhSUPPxhPID7swP9BdGDxA0Hy9fUlLy+v9Js3b2pSUlL0oRG3tbW9MWzYMJexY8f6FWFYC13THj161Mvb23v1vn37yqPv4uLiOKJqampKlpaWVLVqVapSpQr3u0yZMoTFDsguDvR3QkIChYWF0evXr+np06cUHBycERYWpkpJSTHAOSYmJolNmjS57uzs/IuTk9PtQgcQX2Fyd3fv5+PjM/bx48e1oqOjS2ZkZIgwn2Cc4N0hEok0EokEc4ZGoVBIVSoVi3vJoWdgYJBYsmTJ6Dp16jy1t7f/c8aMGYd5WHkEeJJbhMZA/QYNgxQkrjF9+ixSKrHdB6lB/pNcQAjtLiMnDFKRSEhKhZJEYhEZ6EkpJeUdPX70kC6c96LwyDDfFi2bHRg6YMDWnj17JhehbuCbQkQ+Pj7iLVu2/H706NFBqamp5sWKFXtlZ2d3w9nZuXybNm1agNiwA5Y5zomR6WSyQJCNLbagYtvYgYGBdOTIETpw4IAa5EmlUglh1Rk6dKjrb7/9tp/vjG+PwNmzZ5ft3LlzyokTJzjCisWKubk5NWjQgNq0aUOtWrWimjVrcp9ppVUfP7DISUpKoocPH9KFCxfo2rVrbwIDAxWxsbGVcVX58uVfd+3adevgwYNXtmzZkn+vfPvu/2wNXF1dB3l7e4978uSJbVJSkh6ecbFYrDI0NBSUKlVKiHdFiRIlyNjYmIyMjLh5hi18sFiKiIhAWMuMd+/eCZVKpQSk2MTEJLVmzZq3O3fuvPHXX3/dzUsaPtsNRfYEnuQWoa5taNcoSEGSGlOmupJSoX5PPDkJbb5acrXaXW3mNLxg8H8cAkxYXDgyDYmFQhLAUY3wvYIeBj6gs+fO0Juw0KB2rdp4OjkNX9SnT/u4ItQd/9mm+Pj4mC5atGjb1atXu6Snp0urVKlyrWfPnqEDBgxwql27NkdoMVYYoXlvqeHGEJO+ALwP4+j9TgEjwex8kCWUk5iYCFJNhw8fpvPnz8sjIyOlJUqUiHV0dFy0bt26lf/ZjigADd+2bdu+rVu3Ovr7+3N9W7x4cWrRogV1796dmjdvTuXKlfuwwGH9qjsGuPfI+/7XhjbU/qDfU1NTKSQkhLy9veXHjx9/fPPmzdJJSUmlIHNo2rTppfHjx493dHTkddoFYBxkVYWNGzfa7NixY+n9+/ebvHv3zLine truncated
</svg>

Before

Width:  |  Height:  |  Size: 163 KiB

-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="-11.551 4.783 524.391 265.184" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<image width="524.391" height="265.184" style="" x="-11.551" y="4.783" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAr4AAAFjCAYAAADbzwgZAAAAAXNSR0IArs4c6QAAIABJREFUeF7sXQdYVEcXvVvYpQqiYsUWuyJgb7E3sJcQo7Fgxd4FrFhjrLF3FHuLDewFRMUGCip2QRQRFaV3dvf/zuDohh8EpAjyJh8fxH1v3syZ2Tdn7px7r4iEIiAgICAgICAgICAgICAgICAgUAAQEBWAPgpdFBAQEBAQEBAQEBAQEBAQEBAQIIH4CpNAQEBAQEBAQEBAQEBAQEBAoEAgIBDfAjHMQicFBAQEBAQEBAQEBAQEBAQEBOIrzAEBAQEBAQEBAQEBAQEBAQGBAoGAQHwLxDALnRQQEBAQEBAQEBAQEBAQEBAQiK8wBwQEBAQEBAQEBAQEBAQEBAQKBAIC8S0Qwyx0UkBAQEBAQEBAQEBAQEBAQEAgvgVgDhw/flxv5syZ66tWrRrcr1+/hT169AgrAN0WuiggICAgICAgICAgICAg8B8EBOJbACaEk5NT6YEDB/pLpVJp0aJFnjRp0vR4nz59lltZWX0oAN0XuiggICAgICAgICAgICAgwBAQiG8BmAhbt24tZ2Nj49utW3ed4sWLk4eHB717F/yscePG5/v06fO3lZXVqwIAg9BFAQEBAQEBAQEBAQGBAo6AQHwLwATYsmVLhWHDhj+bPM1e0qJFGwoJCSHf+z50yfUiBb4JfF7XzPzw4MED1lpZWb0pAHAIXRQQEBAQEBAQEBAQECigCAjEtwAM/I4dO34ZNGjIk/GT7ST1GzalxIRE0tHWpMjISHr69BGdPXuGAl48e1K3bh3n4cMHQwIRXABgEbooICAgICAgICAgICBQwBAQiG8BGPCtW7dWGjp0xGNGfBs1o4T4BFIpFSQRi0lbW5tiYiLp2dPHdOH8OfLze36/Vo0axwYPttnQv3+vtwUAHqGLAgICAgICAgICAgICBQQBgfgWgIF2cnKqMnDg4EfjJ9uJGzRsRgkJiUzdDeKbkJhAEpGItOQyUqiU9ND3AV29cpke+D54WrNmjTOD+vdZMHjwYMEJrgDME6GLAgICAgICAgICAj87AgLx/dlHmIi2b99ezdp66MPxk+1EjPgmJVFSkoJEIhFpSCWkVCpIpVQxJDQ1ZSRSqejJ06d0xf0yPX784H7FCsb7f/+t16YxY8Z8LABwCV0UEBAQEBAQEBAQEBD4SREQiO9POrDq3XJ0dKwxePAw3/GT7ahBo2YUG5dAYomYFAoFScUSUqmSSS+KWESkTEokbR0dUiqV5Of3jK5dcaW7d7weGhuXdu77x++LJ06cKMQBLgDzRuiigICAgICAgICAwM+GgEB8f7YRTaU/27dvN7G2HnZv4lR7qtegKcXGxzNrr3rB/6sUSpJIQISVjPRKxBKSSsQklRAFBLykixfPk7f3XS+jYkWODhrQd9OUKVNCCgB8QhcFBAQEBAQEBAQEBAR+EgQE4vuTDOS3urFli1PtYcOG+HDiG5eQkOrlmAww/v5nUqhUzAoMSYREIqagt0F0/twZuuN167Gevt7FP/v8NtPBwUGwABeAeSR0UUBAQEBAQEBAQCC/IyAQ3/w+ghlo//bt282srYfdTY/48qpEX5UPzDKMH8giJCIiOZzgFEkUHPyGPDyukdvlSz6G+voH/+xr9Y+Dg0NMBpojXCIgICAgICAgICAgICAg8EMQEIjvD4E9dx+6dauT+dChQ+5w4hsfn7rFV71Vqi8zAxIIIpUIxFdMKkggpGKSSsWkIZFQ8LtguuzmRrdv3nygrS073qVT+7+WLVsWnbs9FJ4mICAgICAgICAgICAgIJA+AgLxTR+jfH+Fo6NjncGDh3t9Jb6J6fTpq8lXxbTAKlKSiml+SakkpUr52SlOycivXC6noDdv6NatG3TZ9aynplxy2MLCYsOaNWsi8j14QgcEBAQEBAQEBAQEBAR+GgQE4vvTDGXaHeHEd9JUe6rboCnFx4P4pjX0IL1qxJdUJBKLSCSWkFKhYHcplEoSi0SMCCuTFMwRTltbi90XFRFCV69eVrlfdnuWpEhy69Wj2+xVq1a9KwAwC13MQQRUKpVIJFIX4eTgw4SqBQQEBAQEBAR+WgQE4vvTDu3XjjHiO8TGa8o0ezKv1+gz8c3+jmMySSUiksmkLB3y1SvuSIbxKDY25kgfq+7/LF++XIgCkf2w/zQ1qlQqDQ8Pj5qvXr2q8erVq9oBAQHmERERhWJjY2WJiYkiqVSqKFKkSHThwoUDy5Qpc7dSpUoPS5cufd/U1DTwpwFB6IiAgICAgICAQI4iIBDfHIU3b1SeW8QXvU1WRihZQgwdHS0KDw+lO163ydX10ovYmMgr7dq0W75t28YHeQMZoRV5AYFz587V8/Dw+NPT07P1y5cvSwUGBupHRkZKcZLAC481zcPwyWQyhaGhYXS5cuXCTE1NnzVo0GBno0aNXGrWrPkpL/RJaMP3IfDhwwe9z3OgelRUVOHo6OhCRKTU0dGJ0tPTCylcuPDLEiVKvK1ataqwif4+iIW7BAQKPAIC8S0AUyA3iS9EEkiBDCkEMsKBCMtlUoqOjmIE+NKliwEfQz6e69DJYvMux02eBQB+oYtpIODs7Nz4yJEjM93c3OoHBAQUA7kFsUUsaW1tbdLS0mI/0JBLpVJKSkqi6Ohoio2Npfj4ePaTmJisV9fX14+qXr36406dOu3r1q3bHhMTE0Fekw9mnq+vr+zt27fV7t+/3/7evXttnz17Vubt27eGMTExenFxcZpxcXESSFzkcnmSTCaL19TUjDI0NAyrUKHCm7p167qbmpperV69+p1ffvklPB90V2jidyDg7++vqVQq5UqlUpaUlKSUyWSYCwnGxsax31GdcIuAQJpCTwGanwiBXCW+KjGRCBZfJYnEYpKKYQBWMgKspanJJBDe3nfIze3yu48hwbfbtGq6YdeuXad+IriFrqSDwKVLl6oeOnRoyqlTpzq/fv26BAivjo4OFS5cmKpWrcp+qlevTuXKlQOhJU1NTRKLxZSQkEARERFsDj148ICeP39Ojx8/Jn9/fwoPT+Y9mpqaCSYmJj4DBw78a+TIkUeFwcibCLx48ULf3d29vbOz87gHDx5UDgoKMoqKivqPIQabIJlMxjqAsVfPMIl/09HRURYuXPhjrVq1nrVo0eJI69atjzRs2NA/b/ZYaFVGEbh8+XIFf3//On5+fi3evn1rFhQUZBgVFSWPj4+XiMVilba2dlKhQoXiSpQo8bp06dKe5cuXv161atVH9erVe5XRZwjXFWwEBItvARj/3CS+iUlKFutXJCZSJCYxCx4sdWI4yKmgARaTXFNGUVHR9OD+Xbrkejbs/bt3l5s1buJ46ND+EwVgOApsF2G5OXLkSJ9t27ZNffr0aTWFQiE2MDAgExMTRnR79OjB/jYyMmJW35TZBdWBAwmC9Rfk9/r16+Tu7k5XrlxhpDgqKooKFSoU2rFjxzODBg2a3bFjx+cFFvQ81vHg4GCdf//99zdnZ+fR169frx4eHq6DJsKiX6xYsYjixYtHFStWLL5s2bKKQoUKgdzCq5FiYmKkYWFh0qCgIMnHjx813r17p/n27VvdhIQEtobp6OhEmpmZPWnXrt2+Xr16CRb/PDbu6TXn2rVr5c6fP9//7t27HR8+fFguMDCwWGxsrDy9+zBvihQpEleuXLm31apVu9+oUaNDTZs2dRN0/+khV7A/F4hvARh/xPEdYWNzZ9IUWzKt04ASEpJyrNdiiZSSFElM5sDJC/S+mGhikZhFgED0B2SBQyxgRVIc+T54QBcvXIh+GeB/u3XrlhsO7tt9MMcaKFT8QxDw9fUtsWTJkvXHjx9vFR4ebgD5Qu3atal79+7UsWNHqlatGmloaHxOmZ0cVYQnT0mtwZA4YH7BEoyN1du3b+nJkye0a9cucnV1pTdv3rDPzM3NPW1sbCYOGTLk6g/puPDQLwicOXOmwbZt2xZfunSpwcePHxnhLVSoUJSJiUlE06ZNk8zNzUtWqlRJo2TJkkzqAmsv5gQKxhg/kLl8+PCB/Pz8YPVP8vDwiHzw4IE4ICBAH9dpa2tHt2jR4vaff/65uF+/fmcF+PM2Aq6urpWcnZ0nnTp1ysLf37885Eu86OnpJRQqVChGX18/XldXN0lHR0eB9SMqKkocFhYmiYiIkOFdkpCQIOHvC2yWqlWr9qRbt26OHTt23F2nTp2gvI2A0LofgYBAfH8E6rn8TGRuG24z5u6kybZkYlYvR4kvidkr6P97qFRLB/f502QyrCKxBPGBFfTk8SM6f/Fs7KuX/lcbNai7Z/DgQYe6dOkiZIPL5fmS3Y+7fft2xSVLlmw7ceJESxxZ6+npUf/+/alfv35kZmbGpAwgNbDepCxpWX1TOrtxYgQpxMmTJ2nnzp3MEoznVapU6fmQIUMm2dnZOWd334T6MobAypUrh+/bt2/q7du3K2HsDAwMEhs3bvxx9OjRhapVq6ZtbGzMSC7Gm2u906oZWST5vAgJCaE7d+7QoUOHkk6ePJn47t07xFWkihUr+ltZWW3p37//JsHhMWNjlJtX4fRn/fr105ydnQc+fvy4IieuhoaGH83NzRPMzMxkNWvWLAK5U6lSpdg7Aj8oOOnBqQ42u8+fPw++f/9+hI+Pj9zX19cgMjKSbYAgnTI1NfXp37//Ihsbm8Mikeirp2xudlR4Vp5EQCC+eXJYsrdR27btMrUZZeMNi29ts/o5Fs6MtVr8/wQX/8wWs/98BOuvilnlxBIRiZQq0pRrUFxCHPn7PafzZ08rnj9/+qBuXXPnoYMH/dOzZ8+P2YuKUFtuIHDt2rVf5syZs+fSpUsNMdY1atSg4cOHU6dOnahs2bKfZTBiZr1NrXxL7qB+PSxBLine truncated
</svg>

Before

Width:  |  Height:  |  Size: 158 KiB

-97
View File
@@ -1,97 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1034 239" style="enable-background:new 0 0 1034 239;" xml:space="preserve">
<style type="text/css">
.st0{fill:#576174;}
.st1{fill:#FFFFFF;}
.st2{font-family:'Courier-Bold';}
.st3{font-size:16.7604px;}
.st4{fill:#00983A;}
.st5{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st6{fill:#45CFFF;}
.st7{fill:none;stroke:#A000FF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st8{fill:#A000FF;}
.st9{fill:none;stroke:#FFDE00;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st10{fill:#FFDE00;}
.st11{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st12{fill:#EA5B0C;}
</style>
<g>
<path class="st0" d="M485.3,224.22H8.5c-4.7,0-8.5-3.8-8.5-8.5V27.22c0-4.7,3.8-8.5,8.5-8.5h476.8c4.7,0,8.5,3.8,8.5,8.5v188.5
C493.8,220.32,490,224.22,485.3,224.22z"/>
<g>
<g>
<g>
<text transform="matrix(1 0 0 1 21.294 60.1267)" class="st1 st2 st3">struct mg_str k,v,s = mg_str(”a=333, b=777”);</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 21.294 136.2499)" class="st1 st2 st3">mg_commalist(&amp;s, &amp;k, &amp;v); </text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 21.294 197.1485)" class="st1 st2 st3">mg_commalist(&amp;s, &amp;k, &amp;v); </text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 291.5096 140.18)" class="st4 st2 st3">// 1st call</text>
<text transform="matrix(1 0 0 1 291.5096 199.8101)" class="st4 st2 st3">// 2nd call</text>
</g>
</g>
</g>
<g>
<polyline class="st5" points="336.4,64.52 336.4,68.52 317.8,68.52 317.8,64.52 "/>
<g>
<path class="st5" d="M122.3,59.62"/>
<g>
<polyline class="st5" points="327.5,76.82 327.6,94.02 203.3,94.02 203.3,116.12 "/>
<path class="st6" d="M331,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C329.5,74.42,331,75.92,331,77.62z"/>
</g>
</g>
<path class="st6" d="M203.2,114.92c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C206.5,116.32,205,114.92,203.2,114.92z"/>
</g>
<g>
<polyline class="st7" points="407.4,64.52 407.4,68.52 388.8,68.52 388.8,64.52 "/>
<g>
<path class="st5" d="M193.4,59.62"/>
<g>
<polyline class="st7" points="398.6,76.82 398.6,149.02 203.4,149.02 203.4,177.12 "/>
<path class="st8" d="M402,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C400.6,74.42,402,75.92,402,77.62z"/>
</g>
</g>
<path class="st8" d="M203.2,175.42c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C206.5,176.82,205,175.42,203.2,175.42z"/>
</g>
<g>
<polyline class="st9" points="440.8,64.52 440.8,68.52 414.2,68.52 414.2,64.52 "/>
<g>
<path class="st5" d="M218.8,59.62"/>
<g>
<polyline class="st9" points="428,76.82 428,163.02 245.7,163.02 245.7,176.12 "/>
<path class="st10" d="M431.4,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C430,74.42,431.4,75.92,431.4,77.62z"/>
</g>
</g>
<path class="st10" d="M245.4,175.42c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C248.7,176.82,247.2,175.42,245.4,175.42z
"/>
</g>
<g>
<polyline class="st11" points="372.8,64.52 372.8,68.52 343.2,68.52 343.2,64.52 "/>
<g>
<path class="st5" d="M164.7,59.62"/>
<g>
<polyline class="st11" points="358.3,76.62 358.3,104.82 245.7,105.02 245.7,116.12 "/>
<path class="st12" d="M361.4,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C359.9,74.42,361.4,75.92,361.4,77.62z"/>
</g>
</g>
<path class="st12" d="M245.7,114.92c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C248.9,116.32,247.4,114.92,245.7,114.92z
"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.9 KiB

-48
View File
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1034 158.07" style="enable-background:new 0 0 1034 158.07;" xml:space="preserve">
<style type="text/css">
.st0{fill:#67748A;}
.st1{fill:#FFFFFF;}
.st2{font-family:'Courier-Bold';}
.st3{font-size:16.7604px;}
.st4{fill:none;stroke:#45CFFF;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st5{fill:#45CFFF;}
.st6{font-family:'Arial-BoldMT';}
</style>
<g>
<path class="st0" d="M516.7,39.8v56.33c0,4.17-3.8,7.54-8.5,7.54H14.6H8.5c-4.7,0-8.5-3.37-8.5-7.54V39.8c0-4.17,3.8-7.54,8.5-7.54
h499.7C512.9,32.26,516.7,35.63,516.7,39.8z"/>
<text transform="matrix(1 0 0 1 51.0379 69.3318)" class="st1 st2 st3">GET /test \n\nGET /test \n\nGET test \n\n</text>
<g>
<polyline class="st4" points="189.5,76.47 189.5,80.47 51.8,80.47 51.8,76.47 "/>
<polyline class="st4" points="331.3,76.47 331.3,80.47 195.6,80.47 195.6,76.47 "/>
<polyline class="st4" points="462.7,76.47 462.7,80.47 336.9,80.47 336.9,76.47 "/>
</g>
<g>
<text transform="matrix(1 0 0 1 78.8909 148.8896)" class="st5 st6 st3">1st request</text>
<g>
<line class="st4" x1="120.2" y1="93.57" x2="120.3" y2="129.57"/>
<path class="st5" d="M117.1,92.57c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C118.5,95.77,117.1,94.37,117.1,92.57z"/>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 217.3594 148.8891)" class="st5 st6 st3">2nd request </text>
<g>
<line class="st4" x1="263.8" y1="93.57" x2="263.9" y2="129.57"/>
<path class="st5" d="M260.7,92.57c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C262.1,95.77,260.7,94.37,260.7,92.57z"/>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 354.7297 148.8896)" class="st5 st6 st3">3rd request </text>
<g>
<line class="st4" x1="399.4" y1="93.57" x2="399.4" y2="129.57"/>
<path class="st5" d="M396.2,92.57c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C397.7,95.77,396.2,94.37,396.2,92.57z"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

-113
View File
@@ -1,113 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1035.4 429.9" style="enable-background:new 0 0 1035.4 429.9;" xml:space="preserve">
<style type="text/css">
.st0{fill:#576174;}
.st1{fill:#67748A;}
.st2{fill:none;stroke:#87005B;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st3{fill:#87005B;}
.st4{fill:#FFFFFF;}
.st5{font-family:'Courier-Bold';}
.st6{font-size:16.7604px;}
.st7{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st8{fill:#EA5B0C;}
.st9{fill:none;stroke:#CA70FF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st10{fill:#CA70FF;}
.st11{fill:none;stroke:#FFDE00;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st12{fill:#FFDE00;}
.st13{fill:none;stroke:#00CF4F;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st14{fill:#00CF4F;}
.st15{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st16{fill:none;stroke:#EA5B0C;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st17{font-family:'Arial-BoldMT';}
.st18{font-size:24px;}
.st19{fill:#45CFFF;}
</style>
<g>
<path class="st0" d="M755.8,391.8H8.5c-4.7,0-8.5-3.8-8.5-8.5v-153c0-4.7,3.8-8.5,8.5-8.5h747.3c4.7,0,8.5,3.8,8.5,8.5v153
C764.3,388,760.5,391.8,755.8,391.8z"/>
<path class="st1" d="M996.9,261.5h-427c-4.7,0-8.5-3.8-8.5-8.5V81.2c0-4.7,3.8-8.5,8.5-8.5h427c4.7,0,8.5,3.8,8.5,8.5V253
C1005.4,257.7,1001.5,261.5,996.9,261.5z"/>
<g>
<polyline class="st2" points="598.1,238.2 598.1,242.3 787.7,242.3 787.7,238.2 "/>
<g>
<line class="st2" x1="689.3" y1="342.2" x2="276.4" y2="343.3"/>
<g>
<line class="st2" x1="689.4" y1="253.3" x2="689.4" y2="342.1"/>
<path class="st3" d="M689.4,249.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2l0,0
C686.1,250.7,687.6,249.3,689.4,249.3z"/>
</g>
</g>
<path class="st3" d="M274.2,340.4c1.8,0,3.2,1.4,3.3,3.2s-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2l0,0
C270.9,341.8,272.4,340.4,274.2,340.4z"/>
</g>
<text transform="matrix(1 0 0 1 26.0923 262.5192)" class="st4 st5 st6">struct mg_http_message {</text>
<text transform="matrix(1 0 0 1 45.542 286.2874)" class="st4 st5 st6">struct mg_str method; uri, query, proto; </text>
<text transform="matrix(1 0 0 1 45.542 306.3874)" class="st4 st5 st6">struct mg_http_header headers[MG_MAX_HTTP_HEADERS];</text>
<text transform="matrix(1 0 0 1 45.542 326.4874)" class="st4 st5 st6">struct mg_str body;</text>
<text transform="matrix(1 0 0 1 45.542 346.5874)" class="st4 st5 st6">struct mg_str message; </text>
<g>
<g>
<polyline class="st7" points="621.1,89.6 621.1,78.6 215.4,79.7 215.3,269.4 "/>
<path class="st8" d="M624.3,90.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C622.8,87.4,624.3,88.8,624.3,90.6z"/>
</g>
<path class="st8" d="M212.3,269.4c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C213.7,272.6,212.3,271.2,212.3,269.4z"/>
</g>
<g>
<polyline class="st9" points="597.2,183.6 593.1,183.6 593.1,127.8 597.2,127.8 "/>
<g>
<polyline class="st9" points="582.4,156.2 575.2,156.2 575,302.8 563.4,302.8 "/>
<path class="st10" d="M586.1,156.2c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
C584.7,159.4,586.1,158,586.1,156.2z"/>
<path class="st10" d="M564.2,303c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2s1.4,3.2,3.2,3.3l0,0
C562.7,306.2,564.2,304.7,564.2,303z"/>
</g>
</g>
<text transform="matrix(1 0 0 1 601.1215 118.1291)" class="st4 st5 st6">POST /foo/bar/baz?aa=b&amp;cc=ddd HTTP/1.1</text>
<text transform="matrix(1 0 0 1 601.1215 138.2291)" class="st4 st5 st6">Content-Type: application/json</text>
<text transform="matrix(1 0 0 1 601.1215 158.3291)" class="st4 st5 st6">Content-Length: 19</text>
<text transform="matrix(1 0 0 1 601.1215 178.4291)" class="st4 st5 st6">Host: reqbin.com</text>
<g>
<g>
<g>
<polyline class="st11" points="712.3,90.6 712.4,67.6 277.8,67.6 279.7,269.3 "/>
<path class="st12" d="M715.6,90.8c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C714.1,87.6,715.6,89.1,715.6,90.8z"/>
</g>
<path class="st12" d="M276.5,269.4c0-1.8,1.4-3.2,3.2-3.3s3.2,1.4,3.3,3.2s-1.4,3.2-3.2,3.3l0,0
C278,272.6,276.5,271.2,276.5,269.4z"/>
</g>
<polyline class="st11" points="771.5,104.3 771.5,100.3 652.7,100.3 652.7,104.3 "/>
</g>
<g>
<g>
<g>
<polyline class="st13" points="836.3,90.6 836.3,56.6 342.8,56.6 344.7,268.3 "/>
<path class="st14" d="M839.5,90.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C838,87.4,839.5,88.9,839.5,90.6z"/>
</g>
<path class="st14" d="M341.4,269.3c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C342.9,272.5,341.4,271.1,341.4,269.3z"/>
</g>
<polyline class="st15" points="981.4,104.2 981.4,100.2 902.6,100.2 902.6,104.2 "/>
</g>
<text transform="matrix(1 0 0 1 596.891 232.3658)" class="st4 st5 st6">{&quot;success&quot;: &quot;true&quot;}</text>
<polyline class="st16" points="643.1,104.4 643.1,100.4 599.3,100.4 599.3,104.4 "/>
<text transform="matrix(1 0 0 1 9.5506 207.5157)" class="st17 st18">Source Code</text>
<text transform="matrix(1 0 0 1 797.0799 32.3923)" class="st17 st18">HTTP message</text>
<text transform="matrix(1 0 0 1 26.0924 359.209)" class="st4 st5 st6">};</text>
<polyline class="st13" points="894.2,104.2 894.2,100.2 774.4,100.2 774.4,104.2 "/>
<g>
<g>
<polyline class="st15" points="941.3,90.6 941.3,45.6 412.8,45.6 414.7,268.3 "/>
<path class="st19" d="M944.5,90.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C943,87.4,944.5,88.9,944.5,90.6z"/>
</g>
<path class="st19" d="M411.4,269.3c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C412.9,272.5,411.4,271.1,411.4,269.3z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.0 KiB

-109
View File
@@ -1,109 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1034 663.54" style="enable-background:new 0 0 1034 663.54;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st1{fill:#45CFFF;}
.st2{fill:#576174;}
.st3{fill:#FFFFFF;}
.st4{font-family:'Courier-Bold';}
.st5{font-size:16.7604px;}
.st6{font-family:'Arial-BoldMT';}
.st7{font-size:24px;}
.st8{fill:#67748A;}
.st9{fill:#8B9CBA;}
.st10{fill:none;stroke:#00CF4F;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st11{fill:#00CF4F;}
.st12{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st13{fill:#EA5B0C;}
.st14{fill:#414857;}
</style>
<g>
<g>
<polyline class="st0" points="498.5,624.21 498.5,628.21 447.9,628.21 447.9,624.21 "/>
<g>
<path class="st0" d="M491.8,844.81"/>
<g>
<path class="st1" d="M473.8,636.11c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C477.1,637.61,475.6,636.11,473.8,636.11z"/>
</g>
</g>
<path class="st1" d="M296.7,852.71c-1.8,0-3.2,1.3-3.3,3c0,1.7,1.4,3,3.2,3c1.8,0,3.2-1.3,3.3-3l0,0
C299.9,854.01,298.5,852.71,296.7,852.71z"/>
</g>
<g>
<path class="st2" d="M584.6,199.01H8.5c-4.7,0-8.5-3.8-8.5-8.5V60.71c0-4.7,3.8-8.5,8.5-8.5h576.1c4.7,0,8.5,3.8,8.5,8.5v129.8
C593.1,195.21,589.3,199.01,584.6,199.01z"/>
<g>
<g>
<g>
<text transform="matrix(1 0 0 1 28.7 90.8107)" class="st3 st4 st5">struct mg_http_part part;</text>
<text transform="matrix(1 0 0 1 28.7 110.9108)" class="st3 st4 st5">size_t pos = 0;</text>
<text transform="matrix(1 0 0 1 28.7 151.1107)" class="st3 st4 st5">pos = mg_http_next_multipart(&amp;hm-&gt;body, pos, &amp;part);</text>
<text transform="matrix(1 0 0 1 28.7 171.3107)" class="st3 st4 st5">pos = mg_http_next_multipart(&amp;hm-&gt;body, pos, &amp;part);</text>
</g>
</g>
</g>
<text transform="matrix(1 0 0 1 1.3738 40.559)" class="st6 st7">Source Code</text>
</g>
<g>
<g>
<path class="st8" d="M685.5,646.41H8.5c-4.7,0-8.5-3.8-8.5-8.5v-362.9c0-4.7,3.8-8.5,8.5-8.5h677c4.7,0,8.5,3.8,8.5,8.5v362.9
C694,642.61,690.2,646.41,685.5,646.41z"/>
</g>
<path class="st9" d="M640.2,629.41H26.3c-4.7,0-8.5-3.8-8.5-8.5v-106.5c0-4.7,3.8-8.5,8.5-8.5h613.9c4.7,0,8.5,3.8,8.5,8.5v106.5
C648.7,625.61,644.8,629.41,640.2,629.41z"/>
<path class="st9" d="M644,490.91H30.1c-4.7,0-8.5-3.8-8.5-8.5v-106.5c0-4.7,3.8-8.5,8.5-8.5H644c4.7,0,8.5,3.8,8.5,8.5v106.5
C652.5,487.11,648.7,490.91,644,490.91z"/>
<g>
<text transform="matrix(1 0 0 1 0.0299 253.0343)" class="st6 st7">HTTP message</text>
</g>
<g>
<text transform="matrix(1 0 0 1 28.7 302.8107)" class="st3 st4 st5">POST /upload HTTP/1.1 </text>
<text transform="matrix(1 0 0 1 28.7 322.9107)" class="st3 st4 st5">Content-Type: multipart/form-data; boundary=&quot;--xyz&quot;</text>
<text transform="matrix(1 0 0 1 28.7 363.1107)" class="st3 st4 st5">--xyz</text>
<text transform="matrix(1 0 0 1 28.7 383.3107)" class="st3 st4 st5">Content-Disposition: form-data; name=&quot;foo&quot;; filename=&quot;a.txt&quot;</text>
<text transform="matrix(1 0 0 1 28.7 403.4107)" class="st3 st4 st5">Content-Type: text/plain</text>
<text transform="matrix(1 0 0 1 28.7 443.6107)" class="st3 st4 st5">hello world</text>
<text transform="matrix(1 0 0 1 28.7 483.8107)" class="st3 st4 st5">--xyz---</text>
<text transform="matrix(1 0 0 1 28.7 524.0107)" class="st3 st4 st5">Content-Disposition: form-data; name=&quot;bar&quot;; filename=&quot;b.txt&quot;</text>
<text transform="matrix(1 0 0 1 28.7 544.2108)" class="st3 st4 st5">Content-Type: text/plain</text>
<text transform="matrix(1 0 0 1 28.7 584.4108)" class="st3 st4 st5">hello world again</text>
<text transform="matrix(1 0 0 1 28.7 624.6107)" class="st3 st4 st5">--xyz--</text>
</g>
</g>
<g>
<g>
<polyline class="st10" points="569.5,162.51 574.5,162.51 574.5,176.11 569.5,176.11 "/>
<g>
<path class="st0" d="M726.8,392.91"/>
<g>
<polyline class="st10" points="587.3,169.71 726.7,169.71 726.6,569.31 684.3,569.31 "/>
<path class="st11" d="M585,166.41c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C588.2,167.91,586.8,166.41,585,166.41z"/>
</g>
</g>
<path class="st11" d="M685,566.31c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3l0,0C688,567.61,686.6,566.31,685,566.31z"/>
</g>
<polyline class="st10" points="657.9,501.61 673.9,501.61 673.9,634.21 657.9,634.21 "/>
</g>
<g>
<g>
<polyline class="st12" points="569.5,143.21 574.5,143.21 574.5,156.81 569.5,156.81 "/>
<g>
<path class="st0" d="M726.8,254.61"/>
<g>
<polyline class="st12" points="587.3,150.41 710.7,150.41 710.6,431.01 684.3,431.01 "/>
<path class="st13" d="M585,147.11c-1.8,0-3.2,1.4-3.3,3.2s1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C588.2,148.61,586.8,147.11,585,147.11z"/>
</g>
</g>
<path class="st13" d="M685,428.01c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3l0,0C688,429.31,686.6,428.01,685,428.01z"/>
</g>
<polyline class="st12" points="657.9,363.31 673.9,363.31 673.9,495.91 657.9,495.91 "/>
</g>
<text transform="matrix(1 0 0 1 537.9671 462.1467)" class="st14 st6 st7">Part 1</text>
<text transform="matrix(1 0 0 1 537.9671 600.4373)" class="st14 st6 st7">Part 2</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 5.5 KiB

-94
View File
@@ -1,94 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1034 480.6" style="enable-background:new 0 0 1034 480.6;" xml:space="preserve">
<style type="text/css">
.st0{fill:#67748A;}
.st1{fill:#8B9CBA;}
.st2{fill:#FFFFFF;}
.st3{font-family:'Courier-Bold';}
.st4{font-size:16.7604px;}
.st5{fill:#414857;}
.st6{font-family:'Arial-BoldMT';}
.st7{font-size:30px;}
.st8{font-size:24px;}
.st9{fill:#576174;}
.st10{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st11{fill:#45CFFF;}
.st12{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st13{fill:#EA5B0C;}
.st14{fill:none;stroke:#EA5B0C;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st15{fill:none;stroke:#FFDE00;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st16{fill:#FFDE00;}
</style>
<g>
<g>
<path class="st0" d="M908.4,454.9H272c-4.7,0-8.5-3.8-8.5-8.5V216c0-4.7,3.8-8.5,8.5-8.5h636.4c4.7,0,8.5,3.8,8.5,8.5v230.4
C916.9,451.1,913.1,454.9,908.4,454.9z"/>
<g>
<path class="st1" d="M898.6,430.8H284.7c-4.7,0-8.5-3.8-8.5-8.5V315.9c0-4.7,3.8-8.5,8.5-8.5h613.9c4.7,0,8.5,3.8,8.5,8.5v106.5
C907.1,427,903.3,430.8,898.6,430.8z"/>
<text transform="matrix(1 0 0 1 295.3688 243.086)" class="st2 st3 st4">POST /upload HTTP/1.1 </text>
<text transform="matrix(1 0 0 1 295.3688 263.186)" class="st2 st3 st4">Content-Type: multipart/form-data: boundary=&quot;--xyz&quot;</text>
<text transform="matrix(1 0 0 1 295.3688 303.386)" class="st2 st3 st4">--xyz</text>
<text transform="matrix(1 0 0 1 295.3688 323.586)" class="st2 st3 st4">Content-Disposition: form-data; name=&quot;foo&quot;; filename=&quot;a.txt&quot;</text>
<text transform="matrix(1 0 0 1 295.3688 343.686)" class="st2 st3 st4">Content-Type: text/plain</text>
<text transform="matrix(1 0 0 1 295.3688 383.886)" class="st2 st3 st4">hello world</text>
<text transform="matrix(1 0 0 1 295.3688 424.086)" class="st2 st3 st4">--xyz---</text>
</g>
</g>
<text transform="matrix(1 0 0 1 739.2766 414.2906)" class="st5 st6 st7">HTTP part</text>
<text transform="matrix(1 0 0 1 739.2764 193.4305)" class="st6 st8">HTTP message</text>
<path class="st9" d="M304.9,198H8.5c-4.7,0-8.5-3.8-8.5-8.5V64.8c0-4.7,3.8-8.5,8.5-8.5H305c4.7,0,8.5,3.8,8.5,8.5v124.7
C313.4,194.2,309.6,198,304.9,198z"/>
<g>
<g>
<text transform="matrix(1 0 0 1 25.2409 91.1617)" class="st2 st3 st4">struct mg_http_part {</text>
<text transform="matrix(1 0 0 1 47.0734 113.7079)" class="st2 st3 st4">struct mg_str name;</text>
<text transform="matrix(1 0 0 1 47.0734 133.8079)" class="st2 st3 st4">strucy mg_str filename;</text>
<text transform="matrix(1 0 0 1 47.0734 153.9079)" class="st2 st3 st4">struct mg_str body;</text>
</g>
</g>
<g>
<polyline class="st10" points="237.4,159 237.4,163 185.8,163 185.8,159 "/>
<g>
<polyline class="st10" points="211.7,348.3 349.5,348.4 349.5,355.6 "/>
<g>
<line class="st10" x1="211.6" y1="174.4" x2="211.6" y2="348.1"/>
<path class="st11" d="M211.6,170.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C214.8,171.8,213.4,170.3,211.6,170.3z"/>
</g>
</g>
<path class="st11" d="M349.6,353.6c-1.8,0-3.2,1.4-3.3,3.2s1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C352.8,355.1,351.4,353.6,349.6,353.6z"/>
<polyline class="st10" points="237.4,159 237.4,163 185.8,163 185.8,159 "/>
<polyline class="st10" points="407.3,371.1 407.3,367.1 293.3,367.1 293.3,371.1 "/>
</g>
<g>
<g>
<g>
<polyline class="st12" points="693.7,291.6 693.7,277.7 280.7,278.8 280.5,109.4 248.3,109.4 "/>
<path class="st13" d="M696.9,293.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C695.4,290.4,696.9,291.9,696.9,293.6z"/>
</g>
<path class="st13" d="M243.9,109.5c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C245.3,112.7,243.9,111.3,243.9,109.5z"/>
</g>
<polyline class="st14" points="707.6,309.2 707.6,305.2 679.9,305.2 679.9,309.2 "/>
</g>
<text transform="matrix(1 0 0 1 0.8627 37.8099)" class="st6 st8">Source Code</text>
<text transform="matrix(1 0 0 1 25.2408 177.7241)" class="st2 st3 st4">};</text>
<g>
<g>
<g>
<polyline class="st15" points="863.8,291.5 863.7,218.6 329.7,218.7 329.6,130.3 298.4,130.3 "/>
<path class="st16" d="M867.1,293.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
C865.6,290.3,867.1,291.8,867.1,293.6z"/>
</g>
<path class="st16" d="M293,130.1c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
C294.4,133.3,293,131.9,293,130.1z"/>
</g>
<polyline class="st15" points="888.7,309.1 888.7,305.1 838.9,305.1 838.9,309.1 "/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.9 KiB

-84
View File
@@ -1,84 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1034 331.2" style="enable-background:new 0 0 1034 331.2;" xml:space="preserve">
<style type="text/css">
.st0{fill:#576174;}
.st1{fill:#67748A;}
.st2{fill:#FFFFFF;}
.st3{font-family:'Courier-Bold';}
.st4{font-size:16.7604px;}
.st5{font-family:'Arial-BoldMT';}
.st6{font-size:24px;}
.st7{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st8{fill:#45CFFF;}
.st9{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
.st10{fill:#EA5B0C;}
.st11{fill:none;stroke:#EA5B0C;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st12{fill:none;stroke:#00CF4F;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
.st13{fill:#00CF4F;}
</style>
<g>
<path class="st0" d="M541.43,184.2H8.53c-4.7,0-8.5-3.8-8.5-8.5V54.8c0-4.7,3.8-8.5,8.5-8.5h532.9c4.7,0,8.5,3.8,8.5,8.5v120.9
C549.93,180.4,546.13,184.2,541.43,184.2z"/>
<g>
<path class="st1" d="M829.23,315.5h-370c-4.7,0-8.5-3.8-8.5-8.5V157c0-4.7,3.8-8.5,8.5-8.5h370c4.7,0,8.5,3.8,8.5,8.5v150
C837.83,311.7,833.93,315.5,829.23,315.5z"/>
<g>
<text transform="matrix(1 0 0 1 490.6096 184.0905)" class="st2 st3 st4">HTTP/1.1 200 OK</text>
<text transform="matrix(1 0 0 1 490.6096 204.1905)" class="st2 st3 st4">Content-Length; 13</text>
<text transform="matrix(1 0 0 1 490.6096 224.2905)" class="st2 st3 st4">X-Header-1: additional value 1</text>
<text transform="matrix(1 0 0 1 490.6096 244.3905)" class="st2 st3 st4">X-Header-2: additional value 2</text>
<text transform="matrix(1 0 0 1 490.8657 293.1559)" class="st2 st3 st4">Hello, world!</text>
</g>
</g>
<text transform="matrix(1 0 0 1 660.5036 137.3383)" class="st5 st6">HTTP message</text>
<g>
<g>
<text transform="matrix(1 0 0 1 20.7331 85.1617)" class="st2 st3 st4">mg_http_reply(c, 200</text>
<text transform="matrix(1 0 0 1 159.5657 113.7079)" class="st2 st3 st4">&quot;X-Header-1: additional value 1\r\n&quot;</text>
<text transform="matrix(1 0 0 1 159.5657 133.8079)" class="st2 st3 st4">&quot;X-Header-2: additional value 2\r\n&quot;,</text>
<text transform="matrix(1 0 0 1 159.5657 153.9079)" class="st2 st3 st4">&quot;Hello, %s!&quot;, &quot;world&quot;);</text>
</g>
</g>
<g>
<polyline class="st7" points="362.93,159 362.93,163 167.33,163 167.33,159 "/>
<g>
<polyline class="st7" points="265.93,256.6 552.13,256.7 552.13,264.4 "/>
<g>
<line class="st7" x1="265.83" y1="174.4" x2="265.83" y2="256.6"/>
<path class="st8" d="M265.83,170.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C269.03,171.8,267.53,170.3,265.83,170.3z"/>
</g>
</g>
<path class="st8" d="M552.23,261.6c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
C555.43,263.1,554.03,261.6,552.23,261.6z"/>
</g>
<g>
<g>
<g>
<polyline class="st9" points="206.33,53.6 206.43,37.6 596.43,38.7 596.53,161.3 "/>
<path class="st10" d="M203.23,54.6c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2c0-1.8-1.4-3.2-3.2-3.3l0,0
C204.63,51.4,203.23,52.8,203.23,54.6z"/>
</g>
<path class="st10" d="M599.83,164c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
C598.33,167.2,599.83,165.8,599.83,164z"/>
</g>
<polyline class="st11" points="192.43,69.2 192.43,65.2 220.23,65.2 220.23,69.2 "/>
</g>
<text transform="matrix(1 0 0 1 -1.917133e-04 35.0037)" class="st5 st6">Source Code</text>
<g>
<polyline class="st12" points="160.13,135.9 156.03,135.9 156.03,100.1 160.13,100.1 "/>
<g>
<line class="st12" x1="123.93" y1="231" x2="469.73" y2="231"/>
<polyline class="st12" points="144.73,117.2 123.83,117.2 123.73,230.8 "/>
<path class="st13" d="M147.83,117.2c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
C146.33,120.4,147.83,119,147.83,117.2z"/>
<path class="st13" d="M474.83,230.8c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
C473.43,234,474.83,232.5,474.83,230.8z"/>
</g>
</g>
<polyline class="st7" points="489.03,279.6 489.03,275.6 620.63,275.6 620.63,279.6 "/>
<polyline class="st12" points="487.63,248.3 483.63,248.3 483.63,211.5 487.63,211.5 "/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.4 KiB

-124
View File
@@ -1,124 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 869.6 185.67" style="enable-background:new 0 0 869.6 185.67;" xml:space="preserve">
<style type="text/css">
.st0{font-family:'Arial-BoldMT';}
.st1{font-size:24px;}
.st2{opacity:0.2;fill:#00983A;enable-background:new ;}
.st3{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st4{fill:#00983A;}
.st5{fill:none;stroke:#576174;stroke-miterlimit:10;}
.st6{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st7{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st8{font-family:'Courier-Bold';}
.st9{font-size:16.7604px;}
.st10{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
.st11{fill:#576174;}
.st12{font-family:'Courier';}
.st13{fill:none;}
.st14{fill:#7A8387;}
</style>
<g>
<text transform="matrix(1 0 0 1 1.0956 32.4549)" class="st0 st1">Memory</text>
<polyline class="st2" points="424.58,115.4 219.88,115.4 219.88,90.7 424.58,90.7 "/>
<g>
<g>
<g>
<polyline class="st3" points="458.98,115.4 218.98,115.4 218.98,90.7 458.98,90.7 "/>
<polyline class="st4" points="219.18,115.1 2.98,115.1 2.98,91.3 219.18,91.3 "/>
<line class="st3" x1="2.98" y1="69.2" x2="2.98" y2="130.4"/>
<line class="st5" x1="219.78" y1="69.2" x2="219.78" y2="130.4"/>
<line class="st5" x1="425.28" y1="69.2" x2="425.28" y2="130.4"/>
<path class="st6" d="M458.98,115.4"/>
<path class="st7" d="M33.98,114.6"/>
<path class="st7" d="M33.98,90.9"/>
<path class="st7" d="M2.98,90.7h216.8v24.9l-216.8-0.2C2.98,115.4,3.18,90.7,2.98,90.7z"/>
<line class="st3" x1="425.18" y1="90.8" x2="425.18" y2="115.3"/>
<path class="st6" d="M251.98,115.6"/>
<path class="st6" d="M251.98,91.9"/>
</g>
<g>
<text transform="matrix(1 0 0 1 -2.290726e-04 175.3858)" class="st4 st8 st9">buf</text>
</g>
<g>
<g>
<line class="st10" x1="2.68" y1="158.2" x2="2.68" y2="137.2"/>
<g>
<polygon class="st4" points="0.28,137.6 5.08,137.6 2.68,135.1 "/>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 214.6515 175.3858)" class="st4 st8 st9">len</text>
</g>
</g>
<g>
<g>
<line class="st10" x1="219.78" y1="158.2" x2="219.78" y2="137.2"/>
<g>
<polygon class="st4" points="217.38,137.6 222.18,137.6 219.78,135.1 "/>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 421.6186 175.3858)" class="st4 st8 st9">size</text>
</g>
</g>
<g>
<g>
<line class="st10" x1="425.38" y1="158.2" x2="425.38" y2="137.2"/>
<g>
<polygon class="st4" points="422.98,137.6 427.78,137.6 425.38,135.1 "/>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 93.1143 69.4458)" class="st11 st12 st9">data</text>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 273.8231 69.4458)" class="st11 st12 st9">free space</text>
</g>
</g>
<g>
<g>
<line class="st5" x1="132.98" y1="76.3" x2="13.98" y2="76.3"/>
<g>
<polygon class="st11" points="14.28,78.7 14.28,73.8 11.88,76.3 "/>
</g>
</g>
</g>
<g>
<line class="st13" x1="123.88" y1="76.3" x2="210.88" y2="76.3"/>
<g>
<line class="st5" x1="123.88" y1="76.3" x2="208.78" y2="76.3"/>
<g>
<polygon class="st11" points="208.48,73.8 208.48,78.7 210.88,76.3 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st5" x1="320.38" y1="76.3" x2="414.28" y2="76.3"/>
<g>
<polygon class="st14" points="413.98,73.8 413.98,78.7 416.38,76.3 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st5" x1="322.28" y1="76.3" x2="233.28" y2="76.3"/>
<g>
<polygon class="st14" points="233.68,78.7 233.68,73.8 231.18,76.3 "/>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.1 KiB

-52
View File
@@ -1,52 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 869 124.66" style="enable-background:new 0 0 869 124.66;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st1{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st2{fill:#00983A;}
.st3{font-family:'Courier-Bold';}
.st4{font-size:16.7604px;}
.st5{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
.st6{fill:#7A8387;}
</style>
<g>
<g>
<g>
<polyline class="st0" points="830.92,78.4 5.52,78.4 5.52,53.7 830.92,53.6 "/>
<line class="st1" x1="5.52" y1="32.2" x2="5.52" y2="93.4"/>
<path class="st0" d="M830.92,78.4"/>
<line class="st1" x1="36.52" y1="53.9" x2="36.52" y2="77.6"/>
<line class="st1" x1="68.92" y1="53.9" x2="68.92" y2="77.6"/>
<line class="st1" x1="101.42" y1="53.9" x2="101.42" y2="77.6"/>
<line class="st1" x1="133.72" y1="53.9" x2="133.72" y2="77.6"/>
<line class="st1" x1="166.22" y1="53.9" x2="166.22" y2="77.6"/>
<line class="st1" x1="198.52" y1="54.6" x2="198.52" y2="78.3"/>
<line class="st1" x1="230.92" y1="54.6" x2="230.92" y2="78.3"/>
</g>
<g>
<text transform="matrix(1 0 0 1 59.1908 40.8585)" class="st2 st3 st4">buf=NULL, len=0, size=0 </text>
</g>
<g>
<text transform="matrix(1 0 0 1 -1.811981e-04 109.9024)" class="st2 st3 st4">0</text>
</g>
<g>
<g>
<g>
<line class="st5" x1="46.72" y1="37.7" x2="17.72" y2="37.7"/>
<g>
<polygon class="st2" points="18.12,40.1 18.12,35.2 15.62,37.7 "/>
</g>
</g>
</g>
</g>
<g>
<path class="st6" d="M511.52,66.4c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S511.52,65.5,511.52,66.4z"/>
<path class="st6" d="M525.32,66.4c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S525.32,65.5,525.32,66.4z"/>
<path class="st6" d="M539.02,66.4c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S539.02,65.5,539.02,66.4z"/>
<path class="st6" d="M552.82,66.4c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S552.82,65.5,552.82,66.4z"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

-185
View File
@@ -1,185 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 869.6 127.5" style="enable-background:new 0 0 869.6 127.5;" xml:space="preserve">
<style type="text/css">
.st0{opacity:0.2;fill:#00983A;enable-background:new ;}
.st1{fill:#F2F3F3;}
.st2{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st3{fill:#00983A;}
.st4{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st5{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st6{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:square;stroke-linejoin:round;}
.st7{font-family:'Courier-Bold';}
.st8{font-size:16.7604px;}
.st9{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
.st10{fill:#7A8387;}
.st11{fill:#576174;}
.st12{fill:none;stroke:#576174;stroke-linecap:round;stroke-linejoin:round;}
.st13{fill:none;stroke:#7A8387;stroke-linecap:round;stroke-linejoin:round;}
.st14{fill:#333A45;}
</style>
<g>
<g>
<polyline class="st0" points="577.2,72.8 282.4,72.8 282.4,48 577.2,48 "/>
<g>
<g>
<g>
<polyline class="st1" points="122.6,72.8 5.9,72.8 5.9,48 122.6,48 "/>
<polyline class="st2" points="831.51,72.8 5.5,72.8 5.5,48 831.51,48 "/>
<polyline class="st3" points="282.7,72.5 122.5,72.5 122.5,47.7 282.7,47.7 "/>
<line class="st2" x1="122.5" y1="26.6" x2="122.5" y2="87.8"/>
<line class="st2" x1="283.3" y1="26.6" x2="283.3" y2="87.8"/>
<line class="st2" x1="576.8" y1="26.6" x2="576.8" y2="87.8"/>
<path class="st4" d="M831.51,72.8"/>
<line class="st5" x1="153.5" y1="48.3" x2="153.5" y2="72"/>
<line class="st2" x1="36.5" y1="48.3" x2="36.5" y2="72"/>
<line class="st2" x1="67.6" y1="48.3" x2="67.6" y2="72"/>
<line class="st5" x1="186" y1="48.3" x2="186" y2="72"/>
<line class="st5" x1="218.4" y1="48.3" x2="218.4" y2="72"/>
<line class="st5" x1="250.9" y1="48.3" x2="250.9" y2="72"/>
<line class="st2" x1="315.9" y1="48.3" x2="315.9" y2="72"/>
<line class="st2" x1="348.4" y1="48.3" x2="348.4" y2="72"/>
<line class="st2" x1="381.2" y1="48.3" x2="381.2" y2="72"/>
<line class="st2" x1="413.8" y1="48.3" x2="413.8" y2="72"/>
<line class="st2" x1="446.3" y1="48.3" x2="446.3" y2="72"/>
<line class="st2" x1="478.9" y1="48.3" x2="478.9" y2="72"/>
<line class="st5" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
<line class="st2" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
<line class="st5" x1="544.01" y1="48.3" x2="544.01" y2="72"/>
<line class="st2" x1="544.1" y1="48.3" x2="544.1" y2="72"/>
<line class="st6" x1="283.3" y1="73" x2="122.5" y2="72.8"/>
<line class="st6" x1="122.5" y1="48" x2="283.3" y2="48.1"/>
<path class="st4" d="M385.5,73"/>
<path class="st4" d="M385.5,49.3"/>
</g>
<g>
<text transform="matrix(1 0 0 1 127.5176 105.8013)" class="st3 st7 st8">buf</text>
</g>
<g>
<g>
<line class="st9" x1="122.2" y1="105.6" x2="122.2" y2="94.6"/>
<g>
<polygon class="st3" points="119.8,94.9 124.6,94.9 122.2,92.5 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 286.6495 105.8008)" class="st3 st7 st8">len=5</text>
</g>
<g>
<g>
<line class="st9" x1="283.3" y1="105.6" x2="283.3" y2="94.6"/>
<g>
<polygon class="st3" points="280.9,94.9 285.8,94.9 283.3,92.5 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 581.4624 105.8013)" class="st3 st7 st8">size=16</text>
</g>
<g>
<g>
<line class="st9" x1="576.9" y1="105.6" x2="576.9" y2="94.6"/>
<g>
<polygon class="st3" points="574.51,94.9 579.4,94.9 576.9,92.5 "/>
</g>
</g>
</g>
<g>
<path class="st10" d="M687.51,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S687.51,59.9,687.51,60.7z"/>
<path class="st10" d="M701.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S701.2,59.9,701.2,60.7z"/>
<path class="st10" d="M714.9,60.7c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C714.2,59.1,714.9,59.9,714.9,60.7z"/>
<path class="st10" d="M728.7,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C728.01,59.1,728.7,59.9,728.7,60.7z"/>
</g>
<g>
<path class="st10" d="M82.8,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S82.8,59.9,82.8,60.7z"/>
<path class="st10" d="M96.5,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6C95.8,59.1,96.5,59.9,96.5,60.7
z"/>
<path class="st10" d="M110.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S110.2,59.9,110.2,60.7z"/>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 180.6541 26.8123)" class="st11 st7 st8">data</text>
</g>
<g>
<text transform="matrix(1 0 0 1 387.363 26.8123)" class="st10 st7 st8">free space</text>
</g>
<g>
<g>
<line class="st12" x1="272.2" y1="33.6" x2="133.5" y2="33.6"/>
<g>
<polygon class="st11" points="271.9,36.2 273.5,33.6 271.9,31.1 271.8,31.1 271.8,36.2 "/>
</g>
<g>
<polygon class="st11" points="133.8,36.1 133.8,31.2 131.4,33.6 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st13" x1="563.7" y1="33.6" x2="295.9" y2="33.6"/>
<g>
<polygon class="st10" points="563.4,36.1 563.4,31.2 565.8,33.6 "/>
</g>
<g>
<polygon class="st10" points="296.2,36.1 296.2,31.2 293.7,33.6 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 615.4679 25.1898)" class="st10 st7 st8">non-allocated space</text>
</g>
<g>
<g>
<line class="st13" x1="593.7" y1="33.6" x2="829.7" y2="33.6"/>
<g>
<polygon class="st10" points="829.4,31.2 829.4,36.1 831.8,33.6 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st13" x1="678.7" y1="33.6" x2="589.7" y2="33.6"/>
<g>
<polygon class="st10" points="590.01,36.1 590.01,31.2 587.6,33.6 "/>
</g>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 133.1212 64.9593)" class="st14 st7 st8">h</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 165.1564 64.9593)" class="st14 st7 st8">e</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 196.8744 64.9593)" class="st14 st7 st8">l</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 229.8611 64.9593)" class="st14 st7 st8">l</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 262.2135 64.9593)" class="st14 st7 st8">o</text>
</g>
</g>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 1.811981e-04 105.8011)" class="st3 st7 st8">0</text>
</g>
<line class="st2" x1="5.5" y1="26.4" x2="5.5" y2="87.6"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 7.1 KiB

-347
View File
@@ -1,347 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 869.6 247.73" style="enable-background:new 0 0 869.6 247.73;" xml:space="preserve">
<style type="text/css">
.st0{opacity:0.2;fill:#00983A;enable-background:new ;}
.st1{fill:#00983A;}
.st2{fill:#FF80A4;}
.st3{fill:#F2F3F3;}
.st4{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st5{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st6{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
.st7{fill:none;stroke:#576174;stroke-width:1.2;stroke-linejoin:round;}
.st8{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:square;stroke-linejoin:round;}
.st9{font-family:'Courier-Bold';}
.st10{font-size:16.7604px;}
.st11{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
.st12{fill:#7A8387;}
.st13{fill:#576174;}
.st14{fill:none;stroke:#576174;stroke-linecap:round;stroke-linejoin:round;}
.st15{fill:none;stroke:#7A8387;stroke-linecap:round;stroke-linejoin:round;}
.st16{fill:#333A45;}
</style>
<g>
<g>
<polyline class="st0" points="577.2,72.8 282.4,72.8 282.4,48 577.2,48 "/>
<g>
<g>
<g>
<rect x="250.9" y="47.7" class="st1" width="32.4" height="24.8"/>
<rect x="153.5" y="47.7" class="st2" width="97.3" height="24.8"/>
<polyline class="st3" points="122.6,72.8 5.9,72.8 5.9,48 122.6,48 "/>
<polyline class="st4" points="831.51,72.8 5.5,72.8 5.5,48 831.51,48 "/>
<rect x="122.5" y="47.7" class="st1" width="31" height="24.8"/>
<line class="st4" x1="122.5" y1="26.6" x2="122.5" y2="87.8"/>
<line class="st4" x1="576.8" y1="26.6" x2="576.8" y2="87.8"/>
<path class="st5" d="M831.51,72.8"/>
<line class="st6" x1="153.5" y1="48.3" x2="153.5" y2="72"/>
<line class="st4" x1="36.5" y1="48.3" x2="36.5" y2="72"/>
<line class="st4" x1="67.6" y1="48.3" x2="67.6" y2="72"/>
<line class="st6" x1="186" y1="48.3" x2="186" y2="72"/>
<line class="st6" x1="218.4" y1="48.3" x2="218.4" y2="72"/>
<line class="st7" x1="250.9" y1="73" x2="250.81" y2="47.7"/>
<line class="st4" x1="315.9" y1="48.3" x2="315.9" y2="72"/>
<line class="st4" x1="348.4" y1="48.3" x2="348.4" y2="72"/>
<line class="st4" x1="381.2" y1="48.3" x2="381.2" y2="72"/>
<line class="st4" x1="413.8" y1="48.3" x2="413.8" y2="72"/>
<line class="st4" x1="446.3" y1="48.3" x2="446.3" y2="72"/>
<line class="st4" x1="478.9" y1="48.3" x2="478.9" y2="72"/>
<line class="st6" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
<line class="st4" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
<line class="st6" x1="544.01" y1="48.3" x2="544.01" y2="72"/>
<line class="st4" x1="544.1" y1="48.3" x2="544.1" y2="72"/>
<line class="st8" x1="283.3" y1="73" x2="122.5" y2="72.8"/>
<line class="st8" x1="122.5" y1="48" x2="283.3" y2="48.1"/>
<path class="st5" d="M385.5,73"/>
<path class="st5" d="M385.5,49.3"/>
<line class="st4" x1="283.3" y1="26.6" x2="283.3" y2="87.8"/>
</g>
<g>
<text transform="matrix(1 0 0 1 127.5176 105.8013)" class="st1 st9 st10">buf</text>
</g>
<g>
<g>
<line class="st11" x1="122.2" y1="105.6" x2="122.2" y2="94.6"/>
<g>
<polygon class="st1" points="119.8,94.9 124.6,94.9 122.2,92.5 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 286.6495 105.8008)" class="st1 st9 st10">len=5</text>
</g>
<g>
<g>
<line class="st11" x1="283.3" y1="105.6" x2="283.3" y2="94.6"/>
<g>
<polygon class="st1" points="280.9,94.9 285.8,94.9 283.3,92.5 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 581.4624 105.8013)" class="st1 st9 st10">size=16</text>
</g>
<g>
<g>
<line class="st11" x1="576.9" y1="105.6" x2="576.9" y2="94.6"/>
<g>
<polygon class="st1" points="574.51,94.9 579.4,94.9 576.9,92.5 "/>
</g>
</g>
</g>
<g>
<path class="st12" d="M687.51,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S687.51,59.9,687.51,60.7z"/>
<path class="st12" d="M701.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S701.2,59.9,701.2,60.7z"/>
<path class="st12" d="M714.9,60.7c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C714.2,59.1,714.9,59.9,714.9,60.7z"/>
<path class="st12" d="M728.7,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C728.01,59.1,728.7,59.9,728.7,60.7z"/>
</g>
<g>
<path class="st12" d="M82.8,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S82.8,59.9,82.8,60.7z"/>
<path class="st12" d="M96.5,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6C95.8,59.1,96.5,59.9,96.5,60.7
z"/>
<path class="st12" d="M110.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S110.2,59.9,110.2,60.7z"/>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 180.6541 26.8123)" class="st13 st9 st10">data</text>
</g>
<g>
<text transform="matrix(1 0 0 1 387.363 26.8123)" class="st12 st9 st10">free space</text>
</g>
<g>
<g>
<line class="st14" x1="272.2" y1="33.6" x2="133.5" y2="33.6"/>
<g>
<polygon class="st13" points="271.9,36.2 273.5,33.6 271.9,31.1 271.8,31.1 271.8,36.2 "/>
</g>
<g>
<polygon class="st13" points="133.8,36.1 133.8,31.2 131.4,33.6 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st15" x1="563.7" y1="33.6" x2="295.9" y2="33.6"/>
<g>
<polygon class="st12" points="563.4,36.1 563.4,31.2 565.8,33.6 "/>
</g>
<g>
<polygon class="st12" points="296.2,36.1 296.2,31.2 293.7,33.6 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 615.4679 25.1898)" class="st12 st9 st10">non-allocated space</text>
</g>
<g>
<g>
<line class="st15" x1="593.7" y1="33.6" x2="829.7" y2="33.6"/>
<g>
<polygon class="st12" points="829.4,31.2 829.4,36.1 831.8,33.6 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st15" x1="678.7" y1="33.6" x2="589.7" y2="33.6"/>
<g>
<polygon class="st12" points="590.01,36.1 590.01,31.2 587.6,33.6 "/>
</g>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 133.1212 64.9593)" class="st16 st9 st10">h</text>
</g>
</g>
<g>
<g>
<g>
<text transform="matrix(1 0 0 1 165.1564 64.9593)" class="st16 st9 st10">e</text>
</g>
</g>
</g>
<g>
<g>
<g>
<text transform="matrix(1 0 0 1 196.8744 64.9593)" class="st16 st9 st10">l</text>
</g>
</g>
</g>
<g>
<g>
<g>
<text transform="matrix(1 0 0 1 229.8611 64.9593)" class="st16 st9 st10">l</text>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 262.2135 64.9593)" class="st16 st9 st10">o</text>
</g>
</g>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 1.811981e-04 105.8011)" class="st1 st9 st10">0</text>
</g>
<line class="st4" x1="5.5" y1="26.4" x2="5.5" y2="87.6"/>
</g>
<g>
<g>
<polyline class="st0" points="577.2,207.99 186.3,207.99 186.3,183.19 577.2,183.19 "/>
<g>
<g>
<g>
<polyline class="st3" points="122.6,207.99 5.9,207.99 5.9,183.19 122.6,183.19 "/>
<polyline class="st4" points="831.51,207.99 5.5,207.99 5.5,183.19 831.51,183.19 "/>
<polyline class="st1" points="186.3,207.69 122.5,207.69 122.5,182.89 186.3,182.89 "/>
<line class="st4" x1="122.5" y1="161.79" x2="122.5" y2="222.99"/>
<line class="st4" x1="186" y1="161.79" x2="186" y2="222.99"/>
<line class="st4" x1="576.8" y1="161.79" x2="576.8" y2="222.99"/>
<path class="st5" d="M831.51,207.99"/>
<line class="st6" x1="153.5" y1="183.49" x2="153.5" y2="207.19"/>
<line class="st4" x1="36.5" y1="183.49" x2="36.5" y2="207.19"/>
<line class="st4" x1="67.6" y1="183.49" x2="67.6" y2="207.19"/>
<line class="st6" x1="186" y1="183.49" x2="186" y2="207.99"/>
<line class="st4" x1="218.4" y1="183.49" x2="218.4" y2="207.19"/>
<line class="st4" x1="250.9" y1="183.49" x2="250.9" y2="207.19"/>
<line class="st4" x1="283.3" y1="183.49" x2="283.3" y2="207.19"/>
<line class="st4" x1="315.9" y1="183.49" x2="315.9" y2="207.19"/>
<line class="st4" x1="348.4" y1="183.49" x2="348.4" y2="207.19"/>
<line class="st4" x1="381.2" y1="183.49" x2="381.2" y2="207.19"/>
<line class="st4" x1="413.8" y1="183.49" x2="413.8" y2="207.19"/>
<line class="st4" x1="446.3" y1="183.49" x2="446.3" y2="207.19"/>
<line class="st4" x1="478.9" y1="183.49" x2="478.9" y2="207.19"/>
<line class="st6" x1="511.51" y1="183.49" x2="511.51" y2="207.19"/>
<line class="st4" x1="511.51" y1="183.49" x2="511.51" y2="207.19"/>
<line class="st6" x1="544.01" y1="183.49" x2="544.01" y2="207.19"/>
<line class="st4" x1="544.1" y1="183.49" x2="544.1" y2="207.19"/>
<line class="st8" x1="186" y1="208.19" x2="122.5" y2="207.99"/>
<line class="st8" x1="122.5" y1="183.19" x2="186" y2="183.29"/>
<path class="st5" d="M385.5,208.19"/>
<path class="st5" d="M385.5,184.49"/>
</g>
<g>
<text transform="matrix(1 0 0 1 127.5176 240.9952)" class="st1 st9 st10">buf</text>
</g>
<g>
<g>
<line class="st11" x1="122.2" y1="240.79" x2="122.2" y2="229.79"/>
<g>
<polygon class="st1" points="119.8,230.09 124.6,230.09 122.2,227.69 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 189.2273 240.9947)" class="st1 st9 st10">len=2</text>
</g>
<g>
<g>
<line class="st11" x1="185.88" y1="240.79" x2="185.88" y2="229.79"/>
<g>
<polygon class="st1" points="183.48,230.09 188.38,230.09 185.88,227.69 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 581.4624 240.9952)" class="st1 st9 st10">size=16</text>
</g>
<g>
<g>
<line class="st11" x1="576.9" y1="240.79" x2="576.9" y2="229.79"/>
<g>
<polygon class="st1" points="574.51,230.09 579.4,230.09 576.9,227.69 "/>
</g>
</g>
</g>
<g>
<path class="st12" d="M687.51,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
S687.51,195.09,687.51,195.89z"/>
<path class="st12" d="M701.2,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S701.2,195.09,701.2,195.89z
"/>
<path class="st12" d="M714.9,195.89c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
S714.9,195.09,714.9,195.89z"/>
<path class="st12" d="M728.7,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C728.01,194.29,728.7,195.09,728.7,195.89z"/>
</g>
<g>
<path class="st12" d="M82.8,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S82.8,195.09,82.8,195.89z"/>
<path class="st12" d="M96.5,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
C95.8,194.29,96.5,195.09,96.5,195.89z"/>
<path class="st12" d="M110.2,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S110.2,195.09,110.2,195.89z
"/>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 133.6541 162.0062)" class="st13 st9 st10">data</text>
</g>
<g>
<text transform="matrix(1 0 0 1 327.363 162.0062)" class="st12 st9 st10">free space</text>
</g>
<g>
<g>
<line class="st14" x1="175.2" y1="168.79" x2="133.5" y2="168.79"/>
<g>
<polygon class="st13" points="174.9,171.39 176.5,168.79 174.9,166.29 174.8,166.29 174.8,171.39 "/>
</g>
<g>
<polygon class="st13" points="133.8,171.29 133.8,166.39 131.4,168.79 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st15" x1="563.7" y1="168.79" x2="197.49" y2="168.79"/>
<g>
<polygon class="st12" points="563.4,171.29 563.4,166.39 565.8,168.79 "/>
</g>
<g>
<polygon class="st12" points="197.79,171.29 197.79,166.39 195.29,168.79 "/>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 615.4679 160.3837)" class="st12 st9 st10">non-allocated space</text>
</g>
<g>
<g>
<line class="st15" x1="593.7" y1="168.79" x2="829.7" y2="168.79"/>
<g>
<polygon class="st12" points="829.4,166.39 829.4,171.29 831.8,168.79 "/>
</g>
</g>
</g>
<g>
<g>
<line class="st15" x1="678.7" y1="168.79" x2="589.7" y2="168.79"/>
<g>
<polygon class="st12" points="590.01,171.29 590.01,166.39 587.6,168.79 "/>
</g>
</g>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 133.1212 200.1532)" class="st16 st9 st10">h</text>
</g>
</g>
<g>
<g>
<text transform="matrix(1 0 0 1 165.1565 200.1532)" class="st16 st9 st10">o</text>
</g>
</g>
</g>
</g>
</g>
<g>
<text transform="matrix(1 0 0 1 1.811981e-04 240.995)" class="st1 st9 st10">0</text>
</g>
<line class="st4" x1="5.5" y1="161.59" x2="5.5" y2="222.79"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 13 KiB

-14
View File
@@ -1,14 +0,0 @@
#pragma once
#include "Arduino.h"
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <time.h>
#define MG_ARCH MG_ARCH_CUSTOM
#define MG_ENABLE_SOCKET 0
#define MG_ENABLE_MIP 1
#define mkdir(a, b) (-1)
//#define MG_ENABLE_LOG 0
-49
View File
@@ -1,49 +0,0 @@
#include <SPI.h>
#include "mongoose.h"
#define SS_PIN 3 // Slave select pin
struct mg_mgr mgr; // Mongoose event manager
struct mip_spi spi = {
NULL, // SPI data
[](void *) { digitalWrite(SS_PIN, LOW); }, // begin transation
[](void *) { digitalWrite(SS_PIN, HIGH); }, // end transaction
[](void *, uint8_t c) { return SPI.transfer(c); }, // execute transaction
};
struct mip_if mif = {.mac = {2, 0, 1, 2, 3, 5}}; // MIP network interface
void setup() {
Serial.begin(115200);
pinMode(SS_PIN, OUTPUT);
SPI.begin();
// Set logging function to a serial print
mg_log_set_fn([](char ch, void *) { Serial.print(ch); }, NULL);
mg_mgr_init(&mgr);
delay(3000);
MG_INFO(("Starting TCP/IP stack..."));
mif.driver = &mip_driver_w5500;
mif.driver_data = &spi;
mip_init(&mgr, &mif);
// Start a 5 sec timer, print status message periodically
mg_timer_add(
&mgr, 5000, MG_TIMER_REPEAT,
[](void *) {
MG_INFO(("ethernet: %s", mip_driver_w5500.up(&mif) ? "up" : "down"));
},
NULL);
// Setup HTTP listener. Respond "ok" on any HTTP request
mg_http_listen(
&mgr, "http://0.0.0.0",
[](struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_HTTP_MSG) mg_http_reply(c, 200, "", "ok\n");
},
&mgr);
}
void loop() {
mg_mgr_poll(&mgr, 1);
}
-11
View File
@@ -1,11 +0,0 @@
PROG ?= example
CFLAGS ?= -DMG_IO_SIZE=8192 -DMG_ENABLE_LINES
all: $(PROG)
$(DEBUGGER) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) -o $(PROG) main.c
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
-1
View File
@@ -1 +0,0 @@
See detailed tutorial at https://mongoose.ws/tutorials/captive-dns-portal/
-58
View File
@@ -1,58 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
//
// Example captive DNS server (captive portal).
// 1. Run `make`. This builds and starts a server on port 5533
// 2. Run `dig -t A www.google.com -4 @localhost -p 5533`
#include "mongoose.h"
static const char *s_listen_url = "udp://0.0.0.0:5533";
// DNS answer section. We response with IP 1.2.3.4 - you can change it
// in the last 4 bytes of this array
uint8_t answer[] = {
0xc0, 0x0c, // Point to the name in the DNS question
0, 1, // 2 bytes - record type, A
0, 1, // 2 bytes - address class, INET
0, 0, 0, 120, // 4 bytes - TTL
0, 4, // 2 bytes - address length
1, 2, 3, 4 // 4 bytes - IP address
};
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_OPEN) {
c->is_hexdumping = 1;
} else if (ev == MG_EV_READ) {
struct mg_dns_rr rr; // Parse first question, offset 12 is header size
size_t n = mg_dns_parse_rr(c->recv.buf, c->recv.len, 12, true, &rr);
MG_INFO(("DNS request parsed, result=%d", (int) n));
if (n > 0) {
char buf[512];
struct mg_dns_header *h = (struct mg_dns_header *) buf;
memset(buf, 0, sizeof(buf)); // Clear the whole datagram
h->txnid = ((struct mg_dns_header *) c->recv.buf)->txnid; // Copy tnxid
h->num_questions = mg_htons(1); // We use only the 1st question
h->num_answers = mg_htons(1); // And only one answer
h->flags = mg_htons(0x8400); // Authoritative response
memcpy(buf + sizeof(*h), c->recv.buf + sizeof(*h), n); // Copy question
memcpy(buf + sizeof(*h) + n, answer, sizeof(answer)); // And answer
mg_send(c, buf, 12 + n + sizeof(answer)); // And send it!
}
mg_iobuf_del(&c->recv, 0, c->recv.len);
}
(void) fn_data;
(void) ev_data;
}
int main(void) {
struct mg_mgr mgr;
mg_log_set(MG_LL_DEBUG); // Set log level
mg_mgr_init(&mgr); // Initialise event manager
mg_listen(&mgr, s_listen_url, fn, NULL); // Start DNS server
for (;;) mg_mgr_poll(&mgr, 1000); // Event loop
mg_mgr_free(&mgr);
return 0;
}
-40
View File
@@ -1,40 +0,0 @@
PROG ?= example
SOURCES ?= ../../mongoose.c main.c net.c packed_fs.c
CFLAGS ?= -I../.. -DMG_ENABLE_PACKED_FS=1 -DMG_ENABLE_LINES=1 $(EXTRA)
FILES_TO_EMBED ?= $(wildcard web_root/*)
ROOT ?= $(realpath $(CURDIR)/../../..)
DOCKER ?= docker run --rm -e Tmp=. -e WINEDEBUG=-all -v $(ROOT):$(ROOT) -w $(CURDIR)
VC98 ?= $(DOCKER) mdashnet/vc98 wine
MINGW ?= $(DOCKER) mdashnet/mingw
ifeq "$(SSL)" "MBEDTLS"
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509
endif
ifeq "$(SSL)" "OPENSSL"
CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include -L$(OPENSSL)/lib -lssl -lcrypto
endif
all: $(PROG)
$(RUN) ./$(PROG)
$(PROG): $(SOURCES) $(FILES_TO_EMBED)
$(CC) ../../test/pack.c -o pack
./pack $(FILES_TO_EMBED) > packed_fs.c
$(CC) -W -Wall -Wextra -O0 -g3 $(CFLAGS) -o $(PROG) $(SOURCES)
mingw: $(SOURCES) $(FILES_TO_EMBED)
$(MINGW) i686-w64-mingw32-gcc $(CFLAGS) ../../test/pack.c -o pack.exe
$(MINGW) wine cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c'
$(MINGW) i686-w64-mingw32-gcc $(CFLAGS) $(SOURCES) -lws2_32 -o $(PROG).exe
$(MINGW) wine $(PROG).exe
vc98: $(SOURCES) $(FILES_TO_EMBED)
$(VC98) cl.exe /nologo $(CFLAGS) ../../test/pack.c /Fepack.exe
$(VC98) cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c'
$(VC98) cl.exe /nologo /O2 $(CFLAGS) $(SOURCES) /Fe$(PROG).exe
$(VC98) $(PROG).exe
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt pack
-27
View File
@@ -1,27 +0,0 @@
# A complete device dashboard
This example is a demonstration of how Mongoose Library could be integrated
into an embedded device and provide a complete device dashboard with the
following features:
- Authentication: login-protected dashboard
- Multiple logins with different permissions (admin and user)
- Web UI is fully embedded into the server/firmware binary, and does not
need a filesystem to serve it. UI is resilient to FS problems
- Administrators can change server settings
- All changes are propagates to all connected clients
- A device is connected to the external MQTT server
- Logged in clients can send/receive messages to a device which get
forwarded to MQTT
# Screenshots
This is a login screen that prompts for user/password
![](screenshots/login.png)
# Main dashboard
A main dashboard page shows and interactive MQTT console
![](screenshots/dashboard.png)
-1
View File
@@ -1 +0,0 @@
../../test/data/ca.pem
-18
View File
@@ -1,18 +0,0 @@
// Copyright (c) 2020-2022 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
const char *s_listening_url = "http://0.0.0.0:8000";
void device_dashboard_fn(struct mg_connection *, int, void *, void *);
int main(void) {
struct mg_mgr mgr;
mg_log_set(MG_LL_DEBUG); // Set debug log level
mg_mgr_init(&mgr);
mg_http_listen(&mgr, s_listening_url, device_dashboard_fn, &mgr);
MG_INFO(("Listening on %s", s_listening_url));
while (mgr.conns != NULL) mg_mgr_poll(&mgr, 500);
mg_mgr_free(&mgr);
return 0;
}
-239
View File
@@ -1,239 +0,0 @@
// Copyright (c) 2020-2022 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
#if !defined(MQTT_SERVER)
#define MQTT_SERVER "mqtt://broker.hivemq.com:1883"
#endif
#define MQTT_PUBLISH_TOPIC "mg/my_device"
#define MQTT_SUBSCRIBE_TOPIC "mg/#"
static time_t s_boot_timestamp = 0; // Updated by SNTP
#ifndef DISABLE_ROUTING
static struct mg_connection *s_sntp_conn = NULL; // SNTP connection
#endif
// Define a system time alternative
time_t ourtime(time_t *tp) {
time_t t = s_boot_timestamp + (time_t) (mg_millis() / 1000);
if (tp != NULL) *tp = t;
return t;
}
// Authenticated user.
// A user can be authenticated by:
// - a name:pass pair
// - a token
// When a user is shown a login screen, she enters a user:pass. If successful,
// a server returns user info which includes token. From that point on,
// client can use token for authentication. Tokens could be refreshed/changed
// on a server side, forcing clients to re-login.
struct user {
const char *name, *pass, *token;
};
// This is a configuration structure we're going to show on a dashboard
static struct config {
char *url, *pub, *sub; // MQTT settings
} s_config;
static struct mg_connection *s_mqtt = NULL; // MQTT connection
static bool s_connected = false; // MQTT connection established
// Try to update a single configuration value
static void update_config(struct mg_str *body, const char *name, char **value) {
char buf[256];
if (mg_http_get_var(body, name, buf, sizeof(buf)) > 0) {
free(*value);
*value = strdup(buf);
}
}
// Parse HTTP requests, return authenticated user or NULL
static struct user *getuser(struct mg_http_message *hm) {
// In production, make passwords strong and tokens randomly generated
// In this example, user list is kept in RAM. In production, it can
// be backed by file, database, or some other method.
static struct user users[] = {
{"admin", "pass0", "admin_token"},
{"user1", "pass1", "user1_token"},
{"user2", "pass2", "user2_token"},
{NULL, NULL, NULL},
};
char user[256], pass[256];
struct user *u;
mg_http_creds(hm, user, sizeof(user), pass, sizeof(pass));
if (user[0] != '\0' && pass[0] != '\0') {
// Both user and password is set, search by user/password
for (u = users; u->name != NULL; u++)
if (strcmp(user, u->name) == 0 && strcmp(pass, u->pass) == 0) return u;
} else if (user[0] == '\0') {
// Only password is set, search by token
for (u = users; u->name != NULL; u++)
if (strcmp(pass, u->token) == 0) return u;
}
return NULL;
}
// Notify all config watchers about the config change
static void send_notification(struct mg_mgr *mgr, const char *fmt, ...) {
struct mg_connection *c;
for (c = mgr->conns; c != NULL; c = c->next) {
if (c->data[0] == 'W') {
va_list ap;
va_start(ap, fmt);
mg_ws_vprintf(c, WEBSOCKET_OP_TEXT, fmt, &ap);
va_end(ap);
}
}
}
// Send simulated metrics data to the dashboard, for chart rendering
static void timer_metrics_fn(void *param) {
send_notification(param, "{%Q:%Q,%Q:[%lu, %d]}", "name", "metrics", "data",
(unsigned long) ourtime(NULL),
10 + (int) ((double) rand() * 10 / RAND_MAX));
}
#ifndef DISABLE_ROUTING
// MQTT event handler function
static void mqtt_fn(struct mg_connection *c, int ev, void *ev_data, void *fnd) {
if (ev == MG_EV_CONNECT && mg_url_is_ssl(s_config.url)) {
struct mg_tls_opts opts = {.ca = "ca.pem",
.srvname = mg_url_host(s_config.url)};
mg_tls_init(c, &opts);
} else if (ev == MG_EV_MQTT_OPEN) {
s_connected = true;
c->is_hexdumping = 1;
mg_mqtt_sub(s_mqtt, mg_str(s_config.sub), 2);
send_notification(c->mgr, "{%Q:%Q,%Q:null}", "name", "config", "data");
MG_INFO(("MQTT connected, server %s", MQTT_SERVER));
} else if (ev == MG_EV_MQTT_MSG) {
struct mg_mqtt_message *mm = ev_data;
send_notification(c->mgr, "{%Q:%Q,%Q:{%Q: %.*Q, %Q: %.*Q, %Q: %d}}", "name",
"message", "data", "topic", (int) mm->topic.len,
mm->topic.ptr, "data", (int) mm->data.len, mm->data.ptr,
"qos", (int) mm->qos);
} else if (ev == MG_EV_MQTT_CMD) {
struct mg_mqtt_message *mm = (struct mg_mqtt_message *) ev_data;
MG_DEBUG(("%lu cmd %d qos %d", c->id, mm->cmd, mm->qos));
} else if (ev == MG_EV_CLOSE) {
s_mqtt = NULL;
if (s_connected) {
s_connected = false;
send_notification(c->mgr, "{%Q:%Q,%Q:null}", "name", "config", "data");
}
}
(void) fnd;
}
// Keep MQTT connection open - reconnect if closed
static void timer_mqtt_fn(void *param) {
struct mg_mgr *mgr = (struct mg_mgr *) param;
if (s_mqtt == NULL) {
struct mg_mqtt_opts opts;
memset(&opts, 0, sizeof(opts));
s_mqtt = mg_mqtt_connect(mgr, s_config.url, &opts, mqtt_fn, NULL);
}
}
// SNTP connection event handler. When we get a response from an SNTP server,
// adjust s_boot_timestamp. We'll get a valid time from that point on
static void sfn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_SNTP_TIME) {
uint64_t t = *(uint64_t *) ev_data;
s_boot_timestamp = (time_t) ((t - mg_millis()) / 1000);
c->is_closing = 1;
} else if (ev == MG_EV_CLOSE) {
s_sntp_conn = NULL;
}
(void) fn_data;
}
static void timer_sntp_fn(void *param) { // SNTP timer function. Sync up time
struct mg_mgr *mgr = (struct mg_mgr *) param;
if (s_sntp_conn == NULL && s_boot_timestamp == 0) {
s_sntp_conn = mg_sntp_connect(mgr, NULL, sfn, NULL);
}
}
#endif
// HTTP request handler function
void device_dashboard_fn(struct mg_connection *c, int ev, void *ev_data,
void *fn_data) {
if (ev == MG_EV_OPEN && c->is_listening) {
mg_timer_add(c->mgr, 1000, MG_TIMER_REPEAT, timer_metrics_fn, c->mgr);
#ifndef DISABLE_ROUTING
mg_timer_add(c->mgr, 1000, MG_TIMER_REPEAT, timer_mqtt_fn, c->mgr);
mg_timer_add(c->mgr, 1000, MG_TIMER_REPEAT, timer_sntp_fn, c->mgr);
#endif
s_config.url = strdup(MQTT_SERVER);
s_config.pub = strdup(MQTT_PUBLISH_TOPIC);
s_config.sub = strdup(MQTT_SUBSCRIBE_TOPIC);
} else if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
struct user *u = getuser(hm);
// MG_INFO(("%p [%.*s] auth %s", c->fd, (int) hm->uri.len, hm->uri.ptr,
// u ? u->name : "NULL"));
if (mg_http_match_uri(hm, "/api/hi")) {
mg_http_reply(c, 200, "", "hi\n"); // Testing endpoint
} else if (mg_http_match_uri(hm, "/api/debug")) {
int level = mg_json_get_long(hm->body, "$.level", MG_LL_DEBUG);
mg_log_set(level);
mg_http_reply(c, 200, "", "Debug level set to %d\n", level);
} else if (u == NULL && mg_http_match_uri(hm, "/api/#")) {
// All URIs starting with /api/ must be authenticated
mg_http_reply(c, 403, "", "Denied\n");
} else if (mg_http_match_uri(hm, "/api/config/get")) {
#ifdef DISABLE_ROUTING
mg_http_reply(c, 200, NULL, "{%Q:%Q,%Q:%Q,%Q:%Q}\n", "url", s_config.url,
"pub", s_config.pub, "sub", s_config.sub);
#else
mg_http_reply(c, 200, NULL, "{%Q:%Q,%Q:%Q,%Q:%Q,%Q:%s}\n", "url",
s_config.url, "pub", s_config.pub, "sub", s_config.sub,
"connected", s_connected ? "true" : "false");
#endif
} else if (mg_http_match_uri(hm, "/api/config/set")) {
// Admins only
if (strcmp(u->name, "admin") == 0) {
update_config(&hm->body, "url", &s_config.url);
update_config(&hm->body, "pub", &s_config.pub);
update_config(&hm->body, "sub", &s_config.sub);
if (s_mqtt) s_mqtt->is_closing = 1; // Ask to disconnect from MQTT
send_notification(fn_data, "{%Q:%Q,%Q:null}", "name", "config", "data");
mg_http_reply(c, 200, "", "ok\n");
} else {
mg_http_reply(c, 403, "", "Denied\n");
}
} else if (mg_http_match_uri(hm, "/api/message/send")) {
char buf[256];
if (s_connected &&
mg_http_get_var(&hm->body, "message", buf, sizeof(buf)) > 0) {
mg_mqtt_pub(s_mqtt, mg_str(s_config.pub), mg_str(buf), 1, false);
}
mg_http_reply(c, 200, "", "ok\n");
} else if (mg_http_match_uri(hm, "/api/watch")) {
c->data[0] = 'W'; // Mark ourselves as a event listener
mg_ws_upgrade(c, hm, NULL);
} else if (mg_http_match_uri(hm, "/api/login")) {
mg_http_reply(c, 200, NULL, "{%Q:%Q,%Q:%Q}\n", "user", u->name, "token",
u->token);
} else {
struct mg_http_serve_opts opts;
memset(&opts, 0, sizeof(opts));
#if 1
opts.root_dir = "/web_root";
opts.fs = &mg_fs_packed;
#else
opts.root_dir = "web_root";
#endif
mg_http_serve_dir(c, ev_data, &opts);
}
MG_DEBUG(("%lu %.*s %.*s -> %.*s", c->id, (int) hm->method.len,
hm->method.ptr, (int) hm->uri.len, hm->uri.ptr, (int) 3,
&c->send.buf[9]));
}
}
File diff suppressed because it is too large. Load diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

-385
View File
@@ -1,385 +0,0 @@
'use strict';
import {Component, h, html, render, useEffect, useState, useRef} from './preact.min.js';
var devaddr = "address:port";
const MaxMetricsDataPoints = 50;
// This simple publish/subscribe is used to pass notifications that were
// received from the server, to all child components of the app.
var PubSub = (function() {
var handlers = {}, id = 0;
return {
subscribe: function(fn) {
handlers[id++] = fn;
},
unsubscribe: function(id) {
delete handlers[id];
},
publish: function(data) {
for (var k in handlers) handlers[k](data);
}
};
})();
const Nav = props => html`
<div style="background: #333; padding: 0.5em; color: #fff;">
<div class="container d-flex">
<div style="flex: 1 1 auto; display: flex; align-items: center;">
<b>Your Product</b>
</div>
<div style="display: flex; align-items: center; flex: 0 0 auto; ">
<span>Logged in as:</span>
<span style="padding: 0 0.5em;"><img src="user.png" height="22" /></span>
<span>${props.user}</span>
<a class="btn" onclick=${props.logout}
style="margin-left: 1em; font-size: 0.8em; background: #8aa;">logout</a>
</div>
</div>
</div>`;
const Hero = props => html`
<div class="section">
<div style="margin-top: 1em; background: #eee; padding: 1em; border-radius: 0.5em; color: #777; ">
<h1 style="margin: 0.2em 0;">Interactive Device Dashboard</h1>
<p>
This device dashboard is developed using the modern and compact Preact framework,
in order to fit on very small devices. This is
a <a href="https://mongoose.ws/tutorials/http-server/">hybrid server</a> which
provides both static and dynamic content. Static files, like CSS/JS/HTML
or images, are compiled into the server binary.
This UI uses the REST API implemented by the device, which you can examine
using <code>curl</code> command-line utility:
</p>
<div><code>curl -u admin:pass0 ${devaddr}/api/config/get</code> </div>
<div><code>curl -u admin:pass0 ${devaddr}/api/config/set -d 'pub=mg/topic'</code> </div>
<div><code>curl -u admin:pass0 ${devaddr}/api/message/send -d 'message=hello'</code> </div>
<p>
The device can send notifications to this dashboard at anytime. Notifications
are sent over WebSocket at URI <code>/api/watch</code> as JSON strings: <code>{"name": "..", "data": ...}</code>
<div>Try <code>wscat --auth user1:pass1 --connect ws://${devaddr}/api/watch</code></div>
</p>
</div>
</div>`;
const Login = function(props) {
const [user, setUser] = useState('');
const [pass, setPass] = useState('');
const login = ev =>
fetch(
'/api/login',
{headers: {Authorization: 'Basic ' + btoa(user + ':' + pass)}})
.then(r => r.json())
.then(r => r && props.login(r))
.catch(err => err);
return html`
<div class="rounded border" style="max-width: 480px; margin: 0 auto; margin-top: 5em; background: #eee; ">
<div style="padding: 2em; ">
<h1 style="color: #666;">Device Dashboard Login </h1>
<div style="margin: 0.5em 0;">
<input type='text' placeholder='Name' style="width: 100%;"
oninput=${ev => setUser(ev.target.value)} value=${user} />
</div>
<div style="margin: 0.5em 0;">
<input type="password" placeholder="Password" style="width: 100%;"
oninput=${ev => setPass(ev.target.value)} value=${pass}
onchange=${login} />
</div>
<div style="margin: 1em 0;">
<button class="btn" style="width: 100%; background: #8aa;"
disabled=${!user || !pass} onclick=${login}> Login </button>
</div>
<div style="color: #777; margin-top: 2em;">
Valid logins: admin:pass0, user1:pass1, user2:pass2
</div>
</div>
</div>`;
};
const Configuration = function(props) {
const [url, setUrl] = useState(props.config.url || '');
const [pub, setPub] = useState(props.config.pub || '');
const [sub, setSub] = useState(props.config.sub || '');
useEffect(() => {
setUrl(props.config.url);
setPub(props.config.pub);
setSub(props.config.sub);
}, [props.config]);
const update = (name, val) => fetch('/api/config/set', {
method: 'post',
body: `${name}=${encodeURIComponent(val)}`
}).catch(err => err);
const updateurl = ev => update('url', url);
const updatepub = ev => update('pub', pub);
const updatesub = ev => update('sub', sub);
// console.log(props, [url, pub, sub]);
return html`
<div class="section">
<h3 style="background: #c03434; color: #fff; padding: 0.4em;">
Device Configuration</h3>
<div style="margin: 0.5em 0; display: flex;">
<span class="addon nowrap">MQTT server:</span>
<input type="text" style="flex: 1 100%;"
value=${url} onchange=${updateurl}
oninput=${ev => setUrl(ev.target.value)} />
<button class="btn" disabled=${!url} onclick=${updateurl}
style="margin-left: 1em; background: #8aa;">Update</button>
</div>
<div style="margin: 0.5em 0; display: flex; ">
<span class="addon nowrap">Subscribe topic:</span>
<input type="text" style="flex: 1 100%;"
value=${sub} onchange=${updatesub}
oninput=${ev => setSub(ev.target.value)} />
<button class="btn" disabled=${!sub} onclick=${updatesub}
style="margin-left: 1em; background: #8aa;">Update</button>
</div>
<div style="margin: 0.5em 0; display: flex;">
<span class="addon nowrap">Publish topic:</span>
<input type="text" style="flex: 1 100%;"
value=${pub} onchange=${updatepub}
oninput=${ev => setPub(ev.target.value)} />
<button class="btn" disabled=${!pub} onclick=${updatepub}
style="margin-left: 1em; background: #8aa;">Update</button>
</div>
<div>
You can use <a href="http://www.hivemq.com/demos/websocket-client/">
HiveMQ Websocket web client</a> to send messages to this console.
</div>
<div class="msg">
The device keeps a persistent connection to the configured MQTT server.
Changes to this configuration are propagated to all dashboards: try
changing them in this dashboard and observe changes in other opened
dashboards.
</div><div class="msg">
Note: administrators can see this section and can change device
configuration, whilst users cannot.
</div>
</div>`;
};
const Message = m => html`<div style="margin: 0.5em 0;">
<span class="qos">qos: ${m.message.qos} </span>
<span class="topic">topic: ${m.message.topic} </span>
<span class="data">data: ${m.message.data}</span>
</div>`;
const Messages = function(props) {
const [messages, setMessages] = useState([]);
const [txt, setTxt] = useState('');
useEffect(() => {
const id = PubSub.subscribe(function(msg) {
if (msg.name == 'message') setMessages(x => x.concat([msg.data]));
});
return PubSub.unsubscribe(id);
}, []);
const sendmessage = ev => fetch('/api/message/send', {
method: 'post',
body: `message=${encodeURIComponent(txt)}`
}).then(r => setTxt(''));
const routing = "connected" in props.config;
const connstatus = !routing ? 'This device has no MQTT functionality' : props.config.connected ? 'connected' : 'disconnected';
return html`
<div class="section">
<h3 style="background: #30c040; color: #fff; padding: 0.4em;">MQTT messages</h3>
<div>
MQTT server status: <b>${connstatus}</b>
</div>
<div style="height: 10em; overflow: auto; padding: 0.5em; " class="border">
${messages.map(message => h(Message, {message}))}
</div>
<div style="margin: 0.5em 0; display: flex">
<span class="addon nowrap">Publish message:</span>
<input placeholder="type and press enter..." style="flex: 1 100%;"
value=${txt} onchange=${sendmessage} disabled=${!routing}
oninput=${ev => setTxt(ev.target.value)} />
</div>
<div class="msg">
The message gets passed to the device via REST. Then the device sends it to
the MQTT server over MQTT. All MQTT messages on a subscribed topic
received by the device, are propagated to this dashboard via /api/watch.
</div>
</div>`;
};
// Expected arguments:
// data: timeseries, e.g. [ [1654361352, 19], [1654361353, 18], ... ]
// width, height, yticks, xticks, ymin, ymax, xmin, xmax
const SVG = function(props) {
// w
// +---------------------+
// | h1 |
// | +-----------+ |
// | | | | h
// | w1 | | w2 |
// | +-----------+ |
// | h2 |
// +---------------------+
//
let w = props.width, h = props.height, w1 = 30, w2 = 0, h1 = 8, h2 = 18;
let yticks = props.yticks || 4, xticks = props.xticks || 5;
let data = props.data || [];
let ymin = props.ymin || 0;
let ymax = props.ymax || Math.max.apply(null, data.map(p => p[1]));
let xmin = props.xmin || Math.min.apply(null, data.map(p => p[0]));
let xmax = props.xmax || Math.max.apply(null, data.map(p => p[0]));
// Y-axis tick lines and labels
let yta = (new Array(yticks + 1)).fill(0).map((_, i) => i); // indices
let yti = i => h - h2 - (h - h1 - h2) * i / yticks; // index's Y
let ytv = i => (ymax - ymin) * i / yticks;
let ytl = y => html`<line x1=${w1} y1=${y} x2=${w} y2=${y} class="tick"/>`;
let ytt = (y, v) => html`<text x=0 y=${y + 5} class="label">${v}</text>`;
// X-axis tick lines and labels
let datefmt = unix => (new Date(unix * 1000)).toISOString().substr(14, 5);
let xta = (new Array(xticks + 1)).fill(0).map((_, i) => i); // indices
let xti = i => w1 + (w - w1 - w2) * i / xticks; // index's X
let xtv = i => datefmt(xmin + (xmax - xmin) * i / xticks);
let xtl = x => html`<path d="M ${x},${h1} L ${x},${h - h2}" class="tick"/>`;
let xtt = (x, v) =>
html`<text x=${x - 15} y=${h - 2} class="label">${v}</text>`;
// Transform data points array into coordinate
let dx = v => w1 + (v - xmin) / ((xmax - xmin) || 1) * (w - w1 - w2);
let dy = v => h - h2 - (v - ymin) / ((ymax - ymin) || 1) * (h - h1 - h2);
let dd = data.map(p => [Math.round(dx(p[0])), Math.round(dy(p[1]))]);
let ddl = dd.length;
// And plot the data as <path> element
let begin0 = ddl ? `M ${dd[0][0]},${dd[0][1]}` : `M 0,0`;
let begin = `M ${w1},${h - h2}`; // Initial point
let end = ddl ? `L ${dd[ddl - 1][0]},${h - h2}` : `L ${w1},${h - h2}`;
let series = ddl ? dd.map(p => `L ${p[0]} ${p[1]}`) : [];
return html`
<svg viewBox="0 0 ${w} ${h}">
<style>
.axis { stroke: #aaa; fill: none; }
.label { stroke: #aaa; font-size: 13px; }
.tick { stroke: #ccc; fill: none; stroke-dasharray: 5; }
.seriesbg { stroke: none; fill: rgba(200,225,255, 0.25)}
.series { stroke: #25a; fill: none; }
</style>
${yta.map(i => ytl(yti(i)))}
${yta.map(i => ytt(yti(i), ytv(i)))}
${xta.map(i => xtl(xti(i)))}
${data.length ? xta.map(i => xtt(xti(i), xtv(i))) : ''}
<path d="${begin} ${series.join(' ')} ${end}" class="seriesbg" />
<path d="${begin0} ${series.join(' ')}" class="series" />
</svg>`;
};
const Chart = function(props) {
const [data, setData] = useState([]);
useEffect(() => {
const id = PubSub.subscribe(function(msg) {
if (msg.name != 'metrics') return;
setData(x => x.concat([msg.data]).splice(-MaxMetricsDataPoints));
});
return PubSub.unsubscribe(id);
}, []);
let xmax = 0, missing = MaxMetricsDataPoints - data.length;
if (missing > 0) xmax = Math.round(Date.now() / 1000) + missing;
return html`
<div class="section">
<h3 style="background: #ec3; color: #fff; padding: 0.4em;">Data Chart</h3>
<div style="overflow: auto; padding: 0.5em;" class="">
<${SVG} height=240 width=600 ymin=0 ymax=20 xmax=${xmax} data=${data} />
</div>
<div class="msg">
This chart plots live sensor data, sent by the device via /api/watch.
</div>
</div>`;
};
const App = function(props) {
const [user, setUser] = useState('');
const [config, setConfig] = useState({});
const getconfig = () =>
fetch('/api/config/get', {headers: {Authorization: ''}})
.then(r => r.json())
.then(r => setConfig(r))
.catch(err => console.log(err));
// Watch for notifications. As soon as a notification arrives, pass it on
// to all subscribed components
const watch = function() {
var l = window.location, proto = l.protocol.replace('http', 'ws');
var tid, wsURI = proto + '//' + l.host + '/api/watch'
var reconnect = function() {
var ws = new WebSocket(wsURI);
// ws.onopen = () => console.log('ws connected');
ws.onmessage = function(ev) {
try {
var msg = JSON.parse(ev.data);
PubSub.publish(msg);
// if (msg.name != 'metrics') console.log('ws->', msg);
} catch (e) {
console.log('Invalid ws frame:', ev.data); // eslint-disable-line
}
};
ws.onclose = function() {
clearTimeout(tid);
tid = setTimeout(reconnect, 1000);
console.log('ws disconnected');
};
};
reconnect();
};
const login = function(u) {
document.cookie = `access_token=${u.token}; Secure, HttpOnly; SameSite=Lax; path=/; max-age=3600`;
setUser(u.user);
if (location.search.substring(1) == 'nows') {
// If query string is ?nows, then do not connect to websocket. For debug.
} else {
watch(); // Connect to websocket, receive constant graph updates
}
return getconfig();
};
const logout = ev => {
document.cookie = `access_token=; Secure, HttpOnly; SameSite=Lax; path=/; max-age=0`;
setUser('');
};
useEffect(() => {
// Called once at init time
PubSub.subscribe(msg => msg.name == 'config' && getconfig());
fetch('/api/login', {headers: {Authorization: ''}})
.then(r => r.json())
.then(r => login(r))
.catch(err => setUser(''));
}, []);
if (!user) return html`<${Login} login=${login} />`;
return html`
<${Nav} user=${user} logout=${logout} />
<div class="container">
<div class="row">
<div class="col col-6"><${Hero} /></div>
<div class="col col-6"><${Chart} /></div>
<div class="col col-6">
${user == 'admin' && h(Configuration, {config})}
</div>
<div class="col col-6"><${Messages} config=${config} /></div>
</div>
</div>`;
};
window.onload = () => render(h(App), document.body);
-51
View File
@@ -1,51 +0,0 @@
PROG ?= example
SOURCES ?= ../../mongoose.c main.c packed_fs.c
CFLAGS ?= -I../.. -DMG_ENABLE_PACKED_FS=1 -DMG_ENABLE_LINES=1 $(EXTRA)
FILES_TO_EMBED ?= $(wildcard web_root/*)
ROOT ?= $(realpath $(CURDIR)/../../..)
DOCKER ?= docker run --rm -e Tmp=. -e WINEDEBUG=-all -v $(ROOT):$(ROOT) -w $(CURDIR)
VC98 ?= $(DOCKER) mdashnet/vc98 wine
MINGW ?= $(DOCKER) mdashnet/mingw
all: $(PROG)
$(RUN) ./$(PROG)
$(PROG): $(SOURCES) $(FILES_TO_EMBED)
$(CC) ../../test/pack.c -o pack
./pack $(FILES_TO_EMBED) > packed_fs.c
$(CC) -W -Wall -Wextra -O0 -g3 $(CFLAGS) -o $(PROG) $(SOURCES)
mingw: $(SOURCES) $(FILES_TO_EMBED)
$(MINGW) i686-w64-mingw32-gcc $(CFLAGS) ../../test/pack.c -o pack.exe
$(MINGW) wine cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c'
$(MINGW) i686-w64-mingw32-gcc $(CFLAGS) $(SOURCES) -lws2_32 -o $(PROG).exe
$(MINGW) wine $(PROG).exe
vc98: $(SOURCES) $(FILES_TO_EMBED)
$(VC98) cl.exe /nologo $(CFLAGS) ../../test/pack.c /Fepack.exe
$(VC98) cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c'
$(VC98) cl.exe /nologo /O2 $(CFLAGS) $(SOURCES) /Fe$(PROG).exe
$(VC98) $(PROG).exe
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt pack
.PHONY: compress expand gzipped plain all
gzipped: compress
$(MAKE) all
plain: expand
$(MAKE) all
compress:
for file in $(FILES_TO_EMBED) ; do \
gzip -q $$file ; \
done
expand:
for file in $(FILES_TO_EMBED) ; do \
gunzip -q $$file ; \
done
-28
View File
@@ -1,28 +0,0 @@
// Copyright (c) 2022 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
const char *s_listening_url = "http://0.0.0.0:8000";
// HTTP request handler function
void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_serve_opts opts = {
.root_dir = "/web_root",
.fs = &mg_fs_packed
};
mg_http_serve_dir(c, ev_data, &opts);
}
(void) fn_data;
}
int main(void) {
struct mg_mgr mgr;
mg_log_set(MG_LL_INFO);
mg_mgr_init(&mgr);
mg_http_listen(&mgr, s_listening_url, fn, NULL);
while (true) mg_mgr_poll(&mgr, 500);
mg_mgr_free(&mgr);
return 0;
}
File diff suppressed because it is too large. Load diff
-38
View File
@@ -1,38 +0,0 @@
THISDIR = $(realpath $(CURDIR))
ROOTDIR = $(realpath $(CURDIR)/../../..)
DOCKER ?= docker run --rm $(DA) -v $(ROOTDIR):$(ROOTDIR) -w $(THISDIR) espressif/idf
CMD ?= idf.py build
PORT ?= /dev/ttyUSB0
all: example
example:
true
build: Makefile $(wildcard main/*)
$(DOCKER) $(CMD)
flash:
flash: CMD = idf.py flash
flash: DA = --device $(PORT)
flash: build
.PHONY: build
dashboard.hex: build
esputil mkhex \
0x8000 build/partition_table/partition-table.bin \
0x1000 build/bootloader/bootloader.bin \
0x100000 build/mongoose-esp32-example.bin > $@
flash2: dashboard.hex
esputil -p $(PORT) -b 921600 -fp 0x220 flash dashboard.hex
esputil -p $(PORT) monitor
ESPTOOL ?= esptool.py
flash3:
cd build && $(ESPTOOL) --chip esp32 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x100000 mongoose-esp32-example.bin
clean:
test -d build && $(DOCKER) rm -rf build sdkconfig || true
@@ -1,7 +0,0 @@
idf_component_register(SRCS "main.c"
"wifi.c"
"net.c"
"packed_fs.c"
"mongoose.c")
component_compile_options(-DMG_ENABLE_LINES)
component_compile_options(-DMG_ENABLE_PACKED_FS)
@@ -1,35 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
#include "esp_spiffs.h"
//#include "freertos/FreeRTOS.h"
#include "mongoose.h"
const char *s_listening_url = "http://0.0.0.0:80";
void device_dashboard_fn(struct mg_connection *, int, void *, void *);
#define WIFI_SSID "YOUR_WIFI_NETWORK_NAME" // SET THIS!
#define WIFI_PASS "YOUR_WIFI_PASSWORD" // SET THIS!
#define FS_ROOT "/spiffs"
void app_main(void) {
// Mount filesystem
esp_vfs_spiffs_conf_t conf = {
.base_path = FS_ROOT, .max_files = 20, .format_if_mount_failed = true};
int res = esp_vfs_spiffs_register(&conf);
MG_INFO(("FS %s, %d", conf.base_path, res));
mg_file_printf(&mg_fs_posix, FS_ROOT "/hello.txt", "%s", "hello from ESP");
// Setup wifi. This function is implemented in wifi.c
// It blocks until connected to the configured WiFi network
void wifi_init(const char *ssid, const char *pass);
wifi_init(WIFI_SSID, WIFI_PASS);
// Connected to WiFi, now start HTTP server
struct mg_mgr mgr;
mg_log_set(MG_LL_DEBUG); // Set log level
mg_mgr_init(&mgr);
MG_INFO(("Mongoose v%s on %s", MG_VERSION, s_listening_url));
mg_http_listen(&mgr, s_listening_url, device_dashboard_fn, &mgr);
for (;;) mg_mgr_poll(&mgr, 1000); // Infinite event loop
}
-104
View File
@@ -1,104 +0,0 @@
// Code taken from the ESP32 IDF WiFi station Example
#include <string.h>
#include "esp_event.h"
#include "esp_log.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
#include "freertos/task.h"
#include "nvs_flash.h"
#include "lwip/err.h"
#include "lwip/sys.h"
#include "mongoose.h"
static EventGroupHandle_t s_wifi_event_group;
/* The event group allows multiple bits for each event, but we only care about
* two events:
* - we are connected to the AP with an IP
* - we failed to connect after the maximum amount of retries */
#define WIFI_CONNECTED_BIT BIT0
#define WIFI_FAIL_BIT BIT1
static int s_retry_num = 0;
static void event_handler(void *arg, esp_event_base_t event_base,
int32_t event_id, void *event_data) {
if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
esp_wifi_connect();
} else if (event_base == WIFI_EVENT &&
event_id == WIFI_EVENT_STA_DISCONNECTED) {
if (s_retry_num < 3) {
esp_wifi_connect();
s_retry_num++;
MG_INFO(("retry to connect to the AP"));
} else {
xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT);
}
MG_ERROR(("connect to the AP fail"));
} else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
ip_event_got_ip_t *event = (ip_event_got_ip_t *) event_data;
MG_INFO(("IP ADDRESS:" IPSTR, IP2STR(&event->ip_info.ip)));
s_retry_num = 0;
xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT);
}
}
void wifi_init(const char *ssid, const char *pass) {
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES ||
ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
s_wifi_event_group = xEventGroupCreate();
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
esp_netif_create_default_wifi_sta();
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
esp_event_handler_instance_t instance_any_id;
esp_event_handler_instance_t instance_got_ip;
ESP_ERROR_CHECK(esp_event_handler_instance_register(
WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL, &instance_any_id));
ESP_ERROR_CHECK(esp_event_handler_instance_register(
IP_EVENT, IP_EVENT_STA_GOT_IP, &event_handler, NULL, &instance_got_ip));
wifi_config_t c = {.sta = {.threshold = {.authmode = WIFI_AUTH_WPA2_PSK},
.pmf_cfg = {.capable = true, .required = false}}};
snprintf((char *) c.sta.ssid, sizeof(c.sta.ssid), "%s", ssid);
snprintf((char *) c.sta.password, sizeof(c.sta.password), "%s", pass);
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &c));
ESP_ERROR_CHECK(esp_wifi_start());
MG_DEBUG(("wifi_init_sta finished."));
EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group,
WIFI_CONNECTED_BIT | WIFI_FAIL_BIT,
pdFALSE, pdFALSE, portMAX_DELAY);
if (bits & WIFI_CONNECTED_BIT) {
MG_INFO(("connected to ap SSID:%s password:%s", ssid, pass));
} else if (bits & WIFI_FAIL_BIT) {
MG_ERROR(("Failed to connect to SSID:%s, password:%s", ssid, pass));
} else {
MG_ERROR(("UNEXPECTED EVENT"));
}
/* The event will not be processed after unregister */
ESP_ERROR_CHECK(esp_event_handler_instance_unregister(
IP_EVENT, IP_EVENT_STA_GOT_IP, instance_got_ip));
ESP_ERROR_CHECK(esp_event_handler_instance_unregister(
WIFI_EVENT, ESP_EVENT_ANY_ID, instance_any_id));
vEventGroupDelete(s_wifi_event_group);
}
-32
View File
@@ -1,32 +0,0 @@
CWD = $(realpath $(CURDIR))
MNT = $(realpath $(CURDIR)/../../..)
PORT ?= /dev/ttyUSB0
CMD ?= build
all: example
example:
true
build: Makefile $(wildcard main/*)
docker run --rm $(DA) -v $(MNT):$(MNT) -w $(CWD) espressif/idf idf.py $(CMD)
flash:
flash: CMD = flash
flash: DA = --device $(PORT)
flash: build
.PHONY: build
bridge.hex: build
esputil mkhex \
0x8000 build/partition_table/partition-table.bin \
0x1000 build/bootloader/bootloader.bin \
0x100000 build/mongoose-esp32-example.bin > $@
flash2: bridge.hex
esputil -p $(PORT) -b 921600 -fp 0x220 flash bridge.hex
esputil -p $(PORT) monitor
clean:
rm -rf build
-61
View File
@@ -1,61 +0,0 @@
# A UART to network bridge for ESP32
This example is a demonstration of how Mongoose Library could be integrated
into an embedded device and provide a UART-to-Network bridge capability:
- A device opens listening TCP port and Websocket port and waits for connections
- When a client connects, data is exchanged with the device's UART
- Everything that client send, is sent to the UART
- Everything that is read from the UART, gets sent to the client
- Multiple clients are allowed
- Live UART console allows to talk to the UART from the web page
- Web UI is hardcoded into the binary and does not need a filesystem
# Screenshots
![](../../uart-bridge/screenshots/dashboard.png)
# Build and flash
Build requires Docker installed, and uses Espressif's ESP-IDF docker image:
```sh
make build
make flash PORT=/dev/YOURSERIAL
```
# Flash pre-built firmware
You can flash a pre-built firmware to the ESP32 device using the following
instructions:
1. Connect your ESP32 device to the workstation. It should be accessible
via a serial port
2. Download and unzip ESP32 flashing tool from https://mongoose.ws/downloads/esputil.zip
3. Download a prebuilt firmware https://mongoose.ws/downloads/uart-bridge.hex into the unzipped directory
4. Start command prompt (or terminal on Mac/Linux). Run `cd
PATH/TO/esputil` to go into the unzipped `esputil/` directory. After that, run
the following command (change `COMPORT` to the board's serial port):
| OS | Command |
| ------- | ------- |
| Windows | <pre><code class="language-bash">.\windows\esputil -p COMPORT flash uart-bridge.hex</code></pre>|
| Linux | <pre><code class="language-bash">./linux/esputil -p COMPORT flash uart-bridge.hex</pre> |
| MacOS | <pre><code class="language-bash">./macos/esputil -p COMPORT flash uart-bridge.hex</code></pre> |
Next step is to monitor and follow the instructions.
```sh
esputil -p COMPORT monitor
```
Note: if monitor command shows constant restarts, the flash parameters
settings can be wrong. Reflash your device with `-fp ...` flash parameters
settings. For example, WROOM-32 based boards use `-fp 0x220`:
```sh
esputil -p COMPORT -fp 0x220 flash uart-bridge.hex
```
For more on possible options for flash parameters, see
https://github.com/cpq/esputil#flash-parameters
@@ -1,10 +0,0 @@
idf_component_register(SRCS "main.c"
"wifi.c"
"uart.c"
"cli.c"
"net.c"
"packed_fs.c"
"mongoose.c")
component_compile_options(-DMG_ENABLE_LINES=1)
component_compile_options(-DMG_ENABLE_PACKED_FS=1)
component_compile_options(-DUART_API_IMPLEMENTED=1)
-50
View File
@@ -1,50 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
#include "main.h"
const char *s_listening_url = "http://0.0.0.0:80";
char *config_read(void) {
return mg_file_read(&mg_fs_posix, FS_ROOT "/config.json", NULL);
}
void config_write(struct mg_str config) {
mg_file_write(&mg_fs_posix, FS_ROOT "/config.json", config.ptr, config.len);
}
void app_main(void) {
// Mount filesystem
esp_vfs_spiffs_conf_t conf = {
.base_path = FS_ROOT, .max_files = 20, .format_if_mount_failed = true};
int res = esp_vfs_spiffs_register(&conf);
MG_INFO(("FS at %s initialised, status: %d", conf.base_path, res));
// Try to connect to wifi by using saved WiFi credentials
char *json = mg_file_read(&mg_fs_posix, WIFI_FILE, NULL);
if (json != NULL) {
char *ssid = mg_json_get_str(mg_str(json), "$.ssid");
char *pass = mg_json_get_str(mg_str(json), "$.pass");
while (!wifi_init(ssid, pass)) (void) 0;
free(ssid);
free(pass);
free(json);
} else {
// If WiFi is not configured, run CLI until configured
MG_INFO(("WiFi is not configured, running CLI. Press enter"));
cli_init();
for (;;) {
uint8_t ch = getchar();
cli(ch);
usleep(10000);
}
}
// Connected to WiFi, now start HTTP server
struct mg_mgr mgr;
mg_mgr_init(&mgr);
mg_log_set(MG_LL_DEBUG); // Set log level
MG_INFO(("Mongoose v%s on %s", MG_VERSION, s_listening_url));
mg_http_listen(&mgr, s_listening_url, uart_bridge_fn, &mgr);
for (;;) mg_mgr_poll(&mgr, 10); // Infinite event loop
}
-18
View File
@@ -1,18 +0,0 @@
#pragma once
#include "mongoose.h"
#include "driver/gpio.h"
#include "driver/uart.h"
#include "esp_spiffs.h"
#include "freertos/FreeRTOS.h"
#define FS_ROOT "/spiffs"
#define WIFI_FILE FS_ROOT "/wifi.json"
#define UART_NO 1
void uart_bridge_fn(struct mg_connection *, int, void *, void *);
int uart_read(void *buf, size_t len);
bool wifi_init(const char *ssid, const char *pass);
void cli(uint8_t ch);
void cli_init(void);
-1
View File
@@ -1 +0,0 @@
../../../uart-bridge/net.c
@@ -1 +0,0 @@
../../../uart-bridge/packed_fs.c
@@ -1,5 +0,0 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
storage, data, spiffs, 0x10000, 0x10000,
factory, app, factory, 0x100000, 1M,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x6000
3 phy_init data phy 0xf000 0x1000
4 storage data spiffs 0x10000 0x10000
5 factory app factory 0x100000 1M
@@ -1,45 +0,0 @@
THISDIR = $(realpath $(CURDIR))
ROOTDIR = $(realpath $(CURDIR)/../../..)
DOCKER ?= docker run --rm $(DA) -v $(ROOTDIR):$(ROOTDIR) -w $(THISDIR) docker.io/mdashnet/8266
CMD ?= make -C src defconfig app
PORT ?= /dev/ttyUSB0
all: example
example:
true
build: Makefile $(wildcard src/main/*)
$(DOCKER) $(CMD)
flash:
flash: CMD = python /esp/components/esptool_py/esptool/esptool.py \
--chip esp8266 --port $(PORT) --baud 115200 --before default_reset \
--after hard_reset write_flash -z --flash_mode dio --flash_freq 40m \
--flash_size 2MB 0x10000 $(THISDIR)/src/build/mongoose-example.bin
flash: DA = --device $(PORT)
flash: build
buildall:
buildall: CMD = make -C src all
buildall: build
flashall:
flashall: CMD = python /esp/components/esptool_py/esptool/esptool.py \
--chip esp8266 --port $(PORT) --baud 115200 --before default_reset \
--after hard_reset write_flash -z --flash_mode dio --flash_freq 40m \
--flash_size 2MB 0x0 $(THISDIR)/src/build/bootloader/bootloader.bin \
0x10000 $(THISDIR)/src/build/mongoose-example.bin \
0x8000 $(THISDIR)/src/build/partitions_singleapp.bin
flashall: DA = --device $(PORT)
flashall: build
monitor:
monitor: CMD = /esp/tools/idf_monitor.py --port $(PORT) $(THISDIR)/src/build/mongoose-example.elf
monitor: build
.PHONY: build
clean:
test -d src/build && $(DOCKER) rm -rf src/build || true
@@ -1,22 +0,0 @@
# An example ESP8266 application
To build this application, follow these steps:
1. Make sure you have Docker installed
2. Clone whole mongoose repository on your machine:
```sh
git clone https://github.com/cesanta/mongoose.git
```
3. Start command line or terminal, and go into the example's directory:
```sh
cd mongoose/examples/esp8266
```
4. Run `make`. This invokes a Docker-based build. A firmware will be built
in the `src/build/` directory:
```sh
make build
```
5. Flash your ESP8266. If you have esptool.py installed, the build process will end telling you the command to flash your device. You can just run `make` again to use Docker:
```sh
make flash PORT=/your/serial
```
@@ -1,54 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
#define WIFI_SSID "WIFI_NETWORK" // SET THIS!
#define WIFI_PASS "WIFI_PASSWORD" // SET THIS!
#define SERVER_URL "http://0.0.0.0:80"
#define CLIENT_URL "http://info.cern.ch"
// Event handler for an server (accepted) connection
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_HTTP_MSG) {
mg_http_reply(c, 200, "", "Hello from ESP!\n");
}
}
// Event handler for a client connection - fetch the first web page in history
// To enable TLS for HTTP,
// 1. Copy "ca.pem" file to the ESP8266 flash FS
// 2. Add TLS init snippet for the connection, see examples/http-client
static void cb2(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_CONNECT) {
struct mg_str s = mg_url_host(CLIENT_URL);
mg_printf(c, "GET / HTTP/1.0\r\nHost: %.*s\r\n\r\n", (int) s.len, s.ptr);
} else if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = ev_data; // Print HTTP response
MG_INFO(("Fetched:\n%.*s", (int) hm->message.len, hm->message.ptr));
c->is_closing = 1;
}
}
// Called after we're connected to WiFi network
static void run_mongoose(void) {
struct mg_mgr mgr;
mg_log_set(MG_LL_DEBUG); // Set log level
mg_mgr_init(&mgr);
mg_http_listen(&mgr, SERVER_URL, cb, &mgr); // Listening server
mg_http_connect(&mgr, CLIENT_URL, cb2, &mgr); // Example client
MG_INFO(("Starting Mongoose web server v%s", MG_VERSION));
for (;;) mg_mgr_poll(&mgr, 1000);
mg_mgr_free(&mgr);
}
void app_main(void) {
// Setup wifi. This function is implemented in wifi.c
// It blocks until connected to the configured WiFi network
void wifi_init(const char *ssid, const char *pass);
wifi_init(WIFI_SSID, WIFI_PASS);
// Done connecting to WiFi, now start HTTP server
run_mongoose();
}
-10
View File
@@ -1,10 +0,0 @@
PROG ?= example
all: $(PROG)
$(DEBUGGER) ./$(PROG)
$(PROG):
$(CC) ../../mongoose.c -I../.. $(CFLAGS) $(EXTRA) -o $(PROG) main.c
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt
-1
View File
@@ -1 +0,0 @@
See detailed tutorial at https://mongoose.ws/tutorials/file-uploads/
-51
View File
@@ -1,51 +0,0 @@
// Copyright (c) 2021 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
// HTTP request handler function. It implements the following endpoints:
// /upload - prints all submitted form elements
// all other URI - serves web_root/ directory
//
// ///////////////// IMPORTANT //////////////////////////
//
// Mongoose has a limit on input buffer, which also limits maximum upload size.
// It is controlled by the MG_MAX_RECV_SIZE constant, which is set by
// default to (3 * 1024 * 1024), i.e. 3 megabytes.
// Use -DMG_MAX_BUF_SIZE=NEW_LIMIT to override it.
//
// Also, consider changing -DMG_IO_SIZE=SOME_BIG_VALUE to increase IO buffer
// increment when reading data.
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
MG_INFO(("New request to: [%.*s], body size: %lu", (int) hm->uri.len,
hm->uri.ptr, (unsigned long) hm->body.len));
if (mg_http_match_uri(hm, "/upload")) {
struct mg_http_part part;
size_t ofs = 0;
while ((ofs = mg_http_next_multipart(hm->body, ofs, &part)) > 0) {
MG_INFO(("Chunk name: [%.*s] filename: [%.*s] length: %lu bytes",
(int) part.name.len, part.name.ptr, (int) part.filename.len,
part.filename.ptr, (unsigned long) part.body.len));
}
mg_http_reply(c, 200, "", "Thank you!");
} else {
struct mg_http_serve_opts opts = {.root_dir = "web_root"};
mg_http_serve_dir(c, ev_data, &opts);
}
}
}
int main(void) {
struct mg_mgr mgr;
mg_mgr_init(&mgr);
mg_log_set(MG_LL_DEBUG); // Set log level
mg_http_listen(&mgr, "http://localhost:8000", cb, NULL);
for (;;) mg_mgr_poll(&mgr, 50);
mg_mgr_free(&mgr);
return 0;
}
@@ -1,10 +0,0 @@
PROG ?= example
all: $(PROG)
$(DEBUGGER) ./$(PROG)
$(PROG):
$(CC) ../../mongoose.c -I../.. $(CFLAGS) $(EXTRA) -o $(PROG) main.c
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt
@@ -1 +0,0 @@
See detailed tutorial at https://mongoose.ws/tutorials/file-uploads/
@@ -1,40 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
// HTTP request handler function. It implements the following endpoints:
// /upload - Saves the next file chunk
// all other URI - serves web_root/ directory
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
if (mg_http_match_uri(hm, "/upload")) {
char path[80], name[64];
mg_http_get_var(&hm->query, "name", name, sizeof(name));
if (name[0] == '\0') {
mg_http_reply(c, 400, "", "%s", "name required");
} else {
mg_snprintf(path, sizeof(path), "/tmp/%s", name);
mg_http_upload(c, hm, &mg_fs_posix, mg_remove_double_dots(path), 99999);
}
} else {
struct mg_http_serve_opts opts = {.root_dir = "web_root"};
mg_http_serve_dir(c, ev_data, &opts);
}
}
}
int main(void) {
struct mg_mgr mgr;
struct mg_timer t1;
mg_mgr_init(&mgr);
mg_log_set(MG_LL_DEBUG); // Set log level
mg_http_listen(&mgr, "http://localhost:8000", cb, NULL);
for (;;) mg_mgr_poll(&mgr, 50);
mg_mgr_free(&mgr);
return 0;
}
-10
View File
@@ -1,10 +0,0 @@
PROG ?= example
all: $(PROG)
$(DEBUGGER) ./$(PROG)
$(PROG):
$(CC) ../../mongoose.c -I../.. $(CFLAGS) $(EXTRA) -o $(PROG) main.c
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt
@@ -1 +0,0 @@
See detailed tutorial at https://mongoose.ws/tutorials/file-uploads/
-42
View File
@@ -1,42 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
//
// Streaming upload example. Demonstrates how to use chunked encoding
// to send large payload in smaller chunks. To test, use curl utility:
//
// curl http://localhost:8000/upload?name=a.txt --data-binary @large_file.txt
#include "mongoose.h"
// HTTP request handler function. It implements the following endpoints:
// /upload - Saves the next file chunk
// all other URI - serves web_root/ directory
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
if (ev == MG_EV_HTTP_CHUNK && mg_http_match_uri(hm, "/upload")) {
MG_INFO(("Got chunk len %lu", (unsigned long) hm->chunk.len));
MG_INFO(("Query string: [%.*s]", (int) hm->query.len, hm->query.ptr));
// MG_INFO(("Chunk data:\n%.*s", (int) hm->chunk.len, hm->chunk.ptr));
mg_http_delete_chunk(c, hm);
if (hm->chunk.len == 0) {
MG_INFO(("Last chunk received, sending response"));
mg_http_reply(c, 200, "", "ok (chunked)\n");
}
} else if (ev == MG_EV_HTTP_MSG) {
struct mg_http_serve_opts opts = {.root_dir = "web_root"};
mg_http_serve_dir(c, hm, &opts);
}
}
int main(void) {
struct mg_mgr mgr;
mg_mgr_init(&mgr);
mg_log_set(MG_LL_DEBUG); // Set debug log level
mg_http_listen(&mgr, "http://localhost:8000", cb, NULL);
for (;;) mg_mgr_poll(&mgr, 50);
mg_mgr_free(&mgr);
return 0;
}
@@ -1,64 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>example</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
#container { margin-right: auto; margin-left: auto; max-width: 480px; }
#info { background: #e0f0f0; border-radius: .5em; padding: 2em; }
#wrapper { margin-top: 1em; }
</style>
</head>
<body>
<div id="container">
<div id="info">
Mongoose always buffers a full HTTP message before invoking
MG_EV_HTTP_MSG event. Big POST request require of lot
of RAM to buffer everything.
<br><br>
In order to upload large files to a memory-constrained system, use
<code>MG_EV_HTTP_CHUNK</code> on a server side. It fires when
a partial HTTP message has been received (or a chunk-encoded chunk).
Use <code>mg_http_delete_chunk()</code> to release chunk memory.
When 0-sized chunk is received, that's the end of the message.
Use <code>MG_MAX_RECV_SIZE</code> build constant to limit
maximum chunk size on a server side.
<br><br>
In this example, JavaScript code uses "fetch()" browser API.
Uploaded file is not saved, but rather printed by server side.
</div>
<div id="wrapper">
<input type="file" id="el1" style="display: none"/>
<button id="el2">choose file...</button>
<div id="el3" style="margin-top: 1em;"></div>
</div>
</div>
</body>
<script>
// When user clicks on a button, trigger file selection dialog
document.getElementById('el2').onclick = function(ev) {
document.getElementById('el1').click();
};
// If user selected a file, read it into memory and trigger sendFileData()
document.getElementById('el1').onchange = function(ev) {
if (!ev.target.files[0]) return;
var f = ev.target.files[0], r = new FileReader();
r.readAsArrayBuffer(f);
r.onload = function() {
ev.target.value = '';
document.getElementById('el3').innerText = 'Uploading...';
fetch('/upload?name=' + encodeURIComponent(f.name), {
method: 'POST',
body: r.result,
}).then(function(res) {
document.getElementById('el3').innerText = 'Uploaded ' + r.result.byteLength + ' bytes';
});
};
};
</script>
</html>
-41
View File
@@ -1,41 +0,0 @@
PROG ?= example
ROOT ?= $(realpath $(CURDIR)/../..)
CFLAGS ?= -DMG_ENABLE_LINES $(EXTRA_CFLAGS)
LIN = docker run -it --rm -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/cc2
SSL = ?
ifeq "$(SSL)" "MBEDTLS"
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -lmbedtls -lmbedcrypto -lmbedx509
endif
ifeq "$(SSL)" "OPENSSL"
CFLAGS += -DMG_ENABLE_OPENSSL=1 -lssl -lcrypto
endif
all: $(PROG)
$(RUN) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) -o $(PROG) main.c
linux: all
linux: CFLAGS += -O2 -g -fsanitize=address,undefined,shift,null,return,bounds,alignment,object-size,bool,enum -static-libasan
linux: CC = $(LIN) cc
linux: RUN = $(LIN)
ROOT ?= $(realpath $(CURDIR)/../..)
DOCKER = docker run -it --rm -e Tmp=. -e WINEDEBUG=-all -v $(ROOT):$(ROOT) -w $(CURDIR)
WDEFS = -DMG_ENABLE_MBEDTLS -DMG_ENABLE_LINES -Imbedtls/include -Imbedtls/library $(EXTRA)
WFLAGS = /nologo -O2 -I. -I../.. ws2_32.lib advapi32.lib /link /out:$(PROG).exe
WSRCS = ../../mongoose.c main.c mbedtls/library/*.c
$(PROG).exe: main.c mbedtls
$(DOCKER) mdashnet/vc2017 wine cl $(WSRCS) $(WDEFS) $(WFLAGS)
vc2017: ARGS = https://cesanta.com
vc2017: $(PROG).exe
$(DOCKER) mdashnet/vc2017 wine $(PROG).exe $(ARGS)
mbedtls:
git clone --depth 1 -b v3.1.0 https://github.com/ARMmbed/mbedtls
clean:
rm -rf $(PROG) _CL* *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb mbedtls
-1
View File
@@ -1 +0,0 @@
See detailed tutorial at https://mongoose.ws/tutorials/http-client/
-1
View File
@@ -1 +0,0 @@
../../test/data/ca.pem
-72
View File
@@ -1,72 +0,0 @@
// Copyright (c) 2021 Cesanta Software Limited
// All rights reserved
//
// Example HTTP client. Connect to `s_url`, send request, wait for a response,
// print the response and exit.
// You can change `s_url` from the command line by executing: ./example YOUR_URL
//
// To enable SSL/TLS, make SSL=OPENSSL or make SSL=MBEDTLS
#include "mongoose.h"
// The very first web page in history. You can replace it from command line
static const char *s_url = "http://info.cern.ch/";
static const char *s_post_data = NULL; // POST data
static const uint64_t s_timeout_ms = 1500; // Connect timeout in milliseconds
// Print HTTP response and signal that we're done
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_OPEN) {
// Connection created. Store connect expiration time in c->data
*(uint64_t *) c->data = mg_millis() + s_timeout_ms;
} else if (ev == MG_EV_POLL) {
if (mg_millis() > *(uint64_t *) c->data &&
(c->is_connecting || c->is_resolving)) {
mg_error(c, "Connect timeout");
}
} else if (ev == MG_EV_CONNECT) {
// Connected to server. Extract host name from URL
struct mg_str host = mg_url_host(s_url);
// If s_url is https://, tell client connection to use TLS
if (mg_url_is_ssl(s_url)) {
struct mg_tls_opts opts = {.ca = "ca.pem", .srvname = host};
mg_tls_init(c, &opts);
}
// Send request
int content_length = s_post_data ? strlen(s_post_data) : 0;
mg_printf(c,
"%s %s HTTP/1.0\r\n"
"Host: %.*s\r\n"
"Content-Type: octet-stream\r\n"
"Content-Length: %d\r\n"
"\r\n",
s_post_data ? "POST" : "GET", mg_url_uri(s_url), (int) host.len,
host.ptr, content_length);
mg_send(c, s_post_data, content_length);
} else if (ev == MG_EV_HTTP_MSG) {
// Response is received. Print it
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
printf("%.*s", (int) hm->message.len, hm->message.ptr);
c->is_closing = 1; // Tell mongoose to close this connection
*(bool *) fn_data = true; // Tell event loop to stop
} else if (ev == MG_EV_ERROR) {
*(bool *) fn_data = true; // Error, tell event loop to stop
}
}
int main(int argc, char *argv[]) {
const char *log_level = getenv("LOG_LEVEL"); // Allow user to set log level
if (log_level == NULL) log_level = "4"; // Default is verbose
struct mg_mgr mgr; // Event manager
bool done = false; // Event handler flips it to true
if (argc > 1) s_url = argv[1]; // Use URL provided in the command line
mg_log_set(atoi(log_level)); // Set to 0 to disable debug
mg_mgr_init(&mgr); // Initialise event manager
mg_http_connect(&mgr, s_url, fn, &done); // Create client connection
while (!done) mg_mgr_poll(&mgr, 50); // Event manager loops until 'done'
mg_mgr_free(&mgr); // Free resources
return 0;
}
-21
View File
@@ -1,21 +0,0 @@
PROG ?= example
ARGS ?= 167.235.63.238:3128 http://info.cern.ch/
SSL = ?
ifeq "$(SSL)" "MBEDTLS"
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -lmbedtls -lmbedcrypto -lmbedx509
endif
ifeq "$(SSL)" "OPENSSL"
CFLAGS += -DMG_ENABLE_OPENSSL=1 -lssl -lcrypto
endif
all: $(PROG)
$(DEBUGGER) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) $(EXTRA_CFLAGS) -o $(PROG) main.c
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
-1
View File
@@ -1 +0,0 @@
../../test/data/ca.pem
-65
View File
@@ -1,65 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
//
// Example HTTP client that uses a proxy server. Usage:
// make
// ./example PROXY:PORT http://www.ladyada.net
//
// To enable SSL/TLS, make SSL=OPENSSL or make SSL=MBEDTLS
//
#include "mongoose.h"
// Print HTTP response and signal that we're done
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
const char *url = fn_data;
static bool connected;
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
printf("%.*s", (int) hm->message.len, hm->message.ptr);
exit(EXIT_SUCCESS);
} else if (ev == MG_EV_CONNECT) {
// Proxy TCP connection established. Send CONNECT request
struct mg_str host = mg_url_host(url);
// c->is_hexdumping = 1;
mg_printf(c, "CONNECT %.*s:%hu HTTP/1.1\r\nHost: %.*s:%hu\r\n\r\n",
(int) host.len, host.ptr, mg_url_port(url), (int) host.len,
host.ptr, mg_url_port(url));
// If target URL is SSL/TLS, command client connection to use TLS
if (mg_url_is_ssl(url)) {
struct mg_tls_opts opts = {.ca = "ca.pem"};
mg_tls_init(c, &opts);
}
} else if (!connected && ev == MG_EV_READ) {
struct mg_http_message hm;
int n = mg_http_parse((char *) c->recv.buf, c->recv.len, &hm);
if (n > 0) {
struct mg_str host = mg_url_host(url);
// CONNECT response - tunnel is established
connected = true;
MG_DEBUG(
("Connected to proxy, status: %.*s", (int) hm.uri.len, hm.uri.ptr));
mg_iobuf_del(&c->recv, 0, n);
// Send request to the target server
mg_printf(c, "GET %s HTTP/1.0\r\n"
"Host: %.*s\r\n"
"\r\n",
mg_url_uri(url), (int) host.len, host.ptr);
}
}
}
int main(int argc, char *argv[]) {
struct mg_mgr mgr;
if (argc != 3) {
fprintf(stderr, "Usage: %s PROXY_URL URL\n", argv[0]);
return EXIT_FAILURE;
}
mg_mgr_init(&mgr); // Initialise event manager
mg_http_connect(&mgr, argv[1], fn, argv[2]); // Connect to the proxy
for (;;) mg_mgr_poll(&mgr, 1000); // Event loop
mg_mgr_free(&mgr);
return 0;
}
-20
View File
@@ -1,20 +0,0 @@
PROG ?= example
CFLAGS ?= -W -Wall -DMG_ENABLE_LINES=1
SSL = ?
ifeq "$(SSL)" "MBEDTLS"
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -lmbedtls -lmbedcrypto -lmbedx509
endif
ifeq "$(SSL)" "OPENSSL"
CFLAGS += -DMG_ENABLE_OPENSSL=1 -lssl -lcrypto
endif
all: $(PROG)
$(DEBUGGER) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) ../../mongoose.c -I../.. $(CFLAGS) $(EFLAGS) -o $(PROG) main.c
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
-1
View File
@@ -1 +0,0 @@
../../test/data/ca.pem
-66
View File
@@ -1,66 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
//
// HTTP server example. This server serves both static and dynamic content.
// It opens two ports: plain HTTP on port 8000 and HTTP on port 8443.
// It implements the following endpoints:
// /api/stats - respond with free-formatted stats on current connections
// /api/f2/:id - wildcard example, respond with JSON string {"result": "URI"}
// any other URI serves static files from s_root_dir
//
// To enable SSL/TLS (using self-signed certificates in PEM files),
// 1. make SSL=OPENSSL or make SSL=MBEDTLS
// 2. curl -k https://127.0.0.1:8443
#include "mongoose.h"
static const char *s_http_addr = "http://0.0.0.0:8000"; // HTTP port
static const char *s_https_addr = "https://0.0.0.0:8443"; // HTTPS port
static const char *s_root_dir = ".";
// We use the same event handler function for HTTP and HTTPS connections
// fn_data is NULL for plain HTTP, and non-NULL for HTTPS
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_ACCEPT && fn_data != NULL) {
struct mg_tls_opts opts = {
//.ca = "ca.pem", // Uncomment to enable two-way SSL
.cert = "server.pem", // Certificate PEM file
.certkey = "server.pem", // This pem contains both cert and key
};
mg_tls_init(c, &opts);
} else if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
if (mg_http_match_uri(hm, "/api/stats")) {
// Print some statistics about currently established connections
mg_printf(c, "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n");
mg_http_printf_chunk(c, "ID PROTO TYPE LOCAL REMOTE\n");
for (struct mg_connection *t = c->mgr->conns; t != NULL; t = t->next) {
mg_http_printf_chunk(c, "%-3lu %4s %s %I %I\n", t->id,
t->is_udp ? "UDP" : "TCP",
t->is_listening ? "LISTENING"
: t->is_accepted ? "ACCEPTED "
: "CONNECTED",
4, &t->loc.ip, 4, &t->rem.ip);
}
mg_http_printf_chunk(c, ""); // Don't forget the last empty chunk
} else if (mg_http_match_uri(hm, "/api/f2/*")) {
mg_http_reply(c, 200, "", "{\"result\": \"%.*s\"}\n", (int) hm->uri.len,
hm->uri.ptr);
} else {
struct mg_http_serve_opts opts = {.root_dir = s_root_dir};
mg_http_serve_dir(c, ev_data, &opts);
}
}
(void) fn_data;
}
int main(void) {
struct mg_mgr mgr; // Event manager
mg_log_set(MG_LL_DEBUG); // Set log level
mg_mgr_init(&mgr); // Initialise event manager
mg_http_listen(&mgr, s_http_addr, fn, NULL); // Create HTTP listener
mg_http_listen(&mgr, s_https_addr, fn, (void *) 1); // HTTPS listener
for (;;) mg_mgr_poll(&mgr, 1000); // Infinite event loop
mg_mgr_free(&mgr);
return 0;
}
-21
View File
@@ -1,21 +0,0 @@
PROG ?= example
CFLAGS ?= -DMG_IO_SIZE=128
SSL = ?
ifeq "$(SSL)" "MBEDTLS"
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -lmbedtls -lmbedcrypto -lmbedx509
endif
ifeq "$(SSL)" "OPENSSL"
CFLAGS += -DMG_ENABLE_OPENSSL=1 -lssl -lcrypto
endif
all: $(PROG)
$(DEBUGGER) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) $(EXTRA_CFLAGS) -o $(PROG) main.c
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
-1
View File
@@ -1 +0,0 @@
../../test/data/ca.pem
-85
View File
@@ -1,85 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
//
// Example HTTP reverse proxy
// 1. Run `make`. This builds and starts a proxy on port 8000
// 2. Start your browser, go to https://localhost:8000
//
// To enable SSL/TLS, add SSL=OPENSSL or SSL=MBEDTLS
static const char *s_backend_url =
#if defined(MG_ENABLE_MBEDTLS) || defined(MG_ENABLE_OPENSSL)
"https://cesanta.com";
#else
"http://info.cern.ch";
#endif
static const char *s_listen_url = "http://localhost:8000";
#include "mongoose.h"
// Forward client request to the backend connection, rewriting the Host header
static void forward_request(struct mg_http_message *hm,
struct mg_connection *c) {
size_t i, max = sizeof(hm->headers) / sizeof(hm->headers[0]);
struct mg_str host = mg_url_host(s_backend_url);
mg_printf(c, "%.*s\r\n",
(int) (hm->proto.ptr + hm->proto.len - hm->message.ptr),
hm->message.ptr);
for (i = 0; i < max && hm->headers[i].name.len > 0; i++) {
struct mg_str *k = &hm->headers[i].name, *v = &hm->headers[i].value;
if (mg_strcmp(*k, mg_str("Host")) == 0) v = &host;
mg_printf(c, "%.*s: %.*s\r\n", (int) k->len, k->ptr, (int) v->len, v->ptr);
}
mg_send(c, "\r\n", 2);
mg_send(c, hm->body.ptr, hm->body.len);
MG_DEBUG(("FORWARDING: %.*s %.*s", (int) hm->method.len, hm->method.ptr,
(int) hm->uri.len, hm->uri.ptr));
}
static void fn2(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
struct mg_connection *c2 = fn_data;
if (ev == MG_EV_READ) {
// All incoming data from the backend, forward to the client
if (c2 != NULL) mg_send(c2, c->recv.buf, c->recv.len);
mg_iobuf_del(&c->recv, 0, c->recv.len);
} else if (ev == MG_EV_CLOSE) {
if (c2 != NULL) c2->fn_data = NULL;
}
(void) ev_data;
}
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
struct mg_connection *c2 = fn_data;
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
// Client request, create backend connection Note that we're passing
// client connection `c` as fn_data for the created backend connection.
c2 = mg_connect(c->mgr, s_backend_url, fn2, c);
if (c2 == NULL) {
mg_error(c, "Cannot create backend connection");
} else {
if (mg_url_is_ssl(s_backend_url)) {
struct mg_tls_opts opts = {.ca = "ca.pem"};
mg_tls_init(c2, &opts);
}
c->fn_data = c2;
forward_request(hm, c2);
c2->is_hexdumping = 1;
}
} else if (ev == MG_EV_CLOSE) {
if (c2 != NULL) c2->is_closing = 1;
if (c2 != NULL) c2->fn_data = NULL;
}
}
int main(void) {
struct mg_mgr mgr;
mg_log_set(MG_LL_DEBUG); // Set log level
mg_mgr_init(&mgr); // Initialise event manager
mg_http_listen(&mgr, s_listen_url, fn, NULL); // Start proxy
for (;;) mg_mgr_poll(&mgr, 1000); // Event loop
mg_mgr_free(&mgr);
return 0;
}
-21
View File
@@ -1,21 +0,0 @@
PROG ?= example
ROOT ?= $(realpath $(CURDIR)/../..)
DEFS ?= -DMG_ENABLE_LINES=1 -DMG_ENABLE_IPV6=1 -DMG_ENABLE_SSI=1 -DMG_HTTP_DIRLIST_TIME=1
CFLAGS ?= -I../.. -W -Wall $(DEFS) $(EXTRA)
VCFLAGS = /nologo /W3 /O2 /I../.. $(DEFS) $(EXTRA) /link /incremental:no /machine:IX86
VC98 = docker run -it --rm -e Tmp=. -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/vc98
all: $(PROG)
$(RUN) ./$(PROG) $(ARGS)
$(PROG): main.c Makefile
$(CC) ../../mongoose.c main.c -I../.. $(CFLAGS) -o $@
mongoose.exe: main.c
$(VC98) wine cl ../../mongoose.c main.c $(VCFLAGS) ws2_32.lib /out:$@
mingw:
gcc ../../mongoose.c main.c -I../.. -W -Wall $(DEFS) -D_POSIX_C_SOURCE=200000L -lws2_32 -o mongoose.exe
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb mongoose mongoose_* mongoose.*
-1
View File
@@ -1 +0,0 @@
See detailed tutorial at https://mongoose.ws/tutorials/http-server/
-103
View File
@@ -1,103 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
#include <signal.h>
#include "mongoose.h"
static int s_debug_level = MG_LL_INFO;
static const char *s_root_dir = ".";
static const char *s_listening_address = "http://0.0.0.0:8000";
static const char *s_enable_hexdump = "no";
static const char *s_ssi_pattern = "#.html";
// Handle interrupts, like Ctrl-C
static int s_signo;
static void signal_handler(int signo) {
s_signo = signo;
}
// Event handler for the listening connection.
// Simply serve static files from `s_root_dir`
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = ev_data, tmp = {0};
struct mg_str unknown = mg_str_n("?", 1), *cl;
struct mg_http_serve_opts opts = {0};
opts.root_dir = s_root_dir;
opts.ssi_pattern = s_ssi_pattern;
mg_http_serve_dir(c, hm, &opts);
mg_http_parse((char *) c->send.buf, c->send.len, &tmp);
cl = mg_http_get_header(&tmp, "Content-Length");
if (cl == NULL) cl = &unknown;
MG_INFO(("%.*s %.*s %.*s %.*s", (int) hm->method.len, hm->method.ptr,
(int) hm->uri.len, hm->uri.ptr, (int) tmp.uri.len, tmp.uri.ptr,
(int) cl->len, cl->ptr));
}
(void) fn_data;
}
static void usage(const char *prog) {
fprintf(stderr,
"Mongoose v.%s\n"
"Usage: %s OPTIONS\n"
" -H yes|no - enable traffic hexdump, default: '%s'\n"
" -S PAT - SSI filename pattern, default: '%s'\n"
" -d DIR - directory to serve, default: '%s'\n"
" -l ADDR - listening address, default: '%s'\n"
" -v LEVEL - debug level, from 0 to 4, default: %d\n",
MG_VERSION, prog, s_enable_hexdump, s_ssi_pattern, s_root_dir,
s_listening_address, s_debug_level);
exit(EXIT_FAILURE);
}
int main(int argc, char *argv[]) {
char path[MG_PATH_MAX] = ".";
struct mg_mgr mgr;
struct mg_connection *c;
int i;
// Parse command-line flags
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-d") == 0) {
s_root_dir = argv[++i];
} else if (strcmp(argv[i], "-H") == 0) {
s_enable_hexdump = argv[++i];
} else if (strcmp(argv[i], "-S") == 0) {
s_ssi_pattern = argv[++i];
} else if (strcmp(argv[i], "-l") == 0) {
s_listening_address = argv[++i];
} else if (strcmp(argv[i], "-v") == 0) {
s_debug_level = atoi(argv[++i]);
} else {
usage(argv[0]);
}
}
// Root directory must not contain double dots. Make it absolute
// Do the conversion only if the root dir spec does not contain overrides
if (strchr(s_root_dir, ',') == NULL) {
realpath(s_root_dir, path);
s_root_dir = path;
}
// Initialise stuff
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
mg_log_set(s_debug_level);
mg_mgr_init(&mgr);
if ((c = mg_http_listen(&mgr, s_listening_address, cb, &mgr)) == NULL) {
MG_ERROR(("Cannot listen on %s. Use http://ADDR:PORT or :PORT",
s_listening_address));
exit(EXIT_FAILURE);
}
if (mg_casecmp(s_enable_hexdump, "yes") == 0) c->is_hexdumping = 1;
// Start infinite event loop
MG_INFO(("Mongoose version : v%s", MG_VERSION));
MG_INFO(("Listening on : %s", s_listening_address));
MG_INFO(("Web root : [%s]", s_root_dir));
while (s_signo == 0) mg_mgr_poll(&mgr, 1000);
mg_mgr_free(&mgr);
MG_INFO(("Exiting on signal %d", s_signo));
return 0;
}
-22
View File
@@ -1,22 +0,0 @@
PROG ?= example
CFLAGS ?= -DMG_ENABLE_LINES $(EXTRA)
ifneq ($(MBEDTLS),)
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -I/usr/include
CFLAGS += -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509
endif
ifneq ($(OPENSSL),)
CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include
CFLAGS += -L$(OPENSSL)/lib -lssl -lcrypto
endif
all: $(PROG)
$(DEBUGGER) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) -o $(PROG) main.c
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
-1
View File
@@ -1 +0,0 @@
../../test/data/ca.pem
-70
View File
@@ -1,70 +0,0 @@
// Copyright (c) 2021 Cesanta Software Limited
// All rights reserved
//
// Example HTTP client.
// Instead of buffering the whole HTTP response in memory and wait for the
// MG_EV_HTTP_MSG event, this client catches MG_EV_HTTP_CHUNK events and
// prints them. This is useful to download large content without spooling
// everything to memory, or catch chunked content.
//
// You can change `s_url` from the command line by executing: ./example YOUR_URL
//
// To enable SSL/TLS for this client, build it like this:
// make MBEDTLS=/path/to/your/mbedtls/installation
// make OPENSSL=/path/to/your/openssl/installation
#include "mongoose.h"
// The very first web page in history. You can replace it from command line
static const char *s_url = "http://info.cern.ch";
// Print HTTP response and signal that we're done
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_CONNECT) {
// Connected to server. Extract host name from URL
struct mg_str host = mg_url_host(s_url);
// If s_url is https://, tell client connection to use TLS
if (mg_url_is_ssl(s_url)) {
struct mg_tls_opts opts = {.ca = "ca.pem", .srvname = host};
mg_tls_init(c, &opts);
}
// Send request
mg_printf(c,
"GET %s HTTP/1.1\r\n"
"Connection: keep-alive\r\n"
"Keep-Alive: timeout=60\r\n"
"Host: %.*s\r\n"
"\r\n",
mg_url_uri(s_url), (int) host.len, host.ptr);
} else if (ev == MG_EV_HTTP_CHUNK) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
fwrite(hm->chunk.ptr, 1, hm->chunk.len, stdout);
// fprintf(stderr, "c %u\n", (unsigned) hm->chunk.len);
mg_http_delete_chunk(c, hm);
if (hm->chunk.len == 0) *(bool *) fn_data = true; // Last chunk
} else if (ev == MG_EV_HTTP_MSG) {
// Response is received. Print it
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
fwrite(hm->body.ptr, 1, hm->body.len, stdout);
c->is_closing = 1; // Tell mongoose to close this connection
*(bool *) fn_data = true; // Tell event loop to stop
} else if (ev == MG_EV_ERROR) {
*(bool *) fn_data = true; // Error, tell event loop to stop
}
}
int main(int argc, char *argv[]) {
struct mg_mgr mgr; // Event manager
bool done = false; // Event handler flips it to true
const char *log_level = getenv("V"); // Log level
if (log_level == NULL) log_level = "3"; // If not set, set to DEBUG
mg_log_set(atoi(log_level)); // Set to 0 to disable debug log
if (argc > 1) s_url = argv[1]; // Use URL from command line
mg_mgr_init(&mgr); // Initialise event manager
mg_http_connect(&mgr, s_url, fn, &done); // Create client connection
while (!done) mg_mgr_poll(&mgr, 1000); // Infinite event loop
mg_mgr_free(&mgr); // Free resources
return 0;
}
-11
View File
@@ -1,11 +0,0 @@
PROG ?= example
CFLAGS ?= -W -Wall -Wextra -O0 -g
all: $(PROG)
$(RUN) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) ../../mongoose.c -I../.. -W -Wall -DMG_ENABLE_LINES=1 $(CFLAGS) -o $(PROG) main.c
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
-89
View File
@@ -1,89 +0,0 @@
// Copyright (c) 2021 Cesanta Software Limited
// All rights reserved
//
// Example that demonstrates how to send a large responses with limited memory.
// We're going to send a JSON array of many integer values, s_data.
// The idea is to send a response in small chunks, and let the client request
// the next chunk.
// Periodically, s_data changes, which is tracked by s_version.
// Client requests a range and a version, to ensure data integrity.
//
// 1. Start this server, type `make`
// 2. Open http://localhost:8000 in your browser
#include "mongoose.h"
static const char *s_listen_on = "http://localhost:8000";
static const char *s_root_dir = "web_root";
#define DATA_SIZE 10000 // Total number of elements
#define CHUNK_SIZE 100 // Max number returned in one API call
static int s_data[DATA_SIZE]; // Simulate some complex big data
static long s_version = 0; // Data "version"
static long getparam(struct mg_http_message *hm, const char *json_path) {
double dv = 0;
mg_json_get_num(hm->body, json_path, &dv);
return dv;
}
static size_t printdata(mg_pfn_t out, void *ptr, va_list *ap) {
unsigned start = va_arg(*ap, unsigned);
unsigned max = start + CHUNK_SIZE;
const char *comma = "";
size_t n = 0;
if (max > DATA_SIZE) max = DATA_SIZE;
while (start < max) {
n += mg_xprintf(out, ptr, "%s%d", comma, s_data[start]);
comma = ",";
start++;
}
return n;
}
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = ev_data;
if (mg_http_match_uri(hm, "/api/data")) {
const char *headers = "content-type: text/json\r\n";
long start = getparam(hm, "$.start");
long version = getparam(hm, "$.version");
MG_DEBUG(("%.*s", (int) hm->body.len, hm->body.ptr));
if (version > 0 && version != s_version) {
// Version mismatch: s_data has changed while client fetches it
// Tell client to restart
mg_http_reply(c, 200, headers, "{%Q:%Q, %Q:%ld}", "error",
"wrong version", "version", version);
} else {
// Return data, up to CHUNK_SIZE elements
mg_http_reply(c, 200, headers, "{%Q:%ld,%Q:%ld,%Q:[%M]}", "version",
s_version, "start", start, "data", printdata, start);
}
} else {
struct mg_http_serve_opts opts = {0};
opts.root_dir = s_root_dir;
mg_http_serve_dir(c, hm, &opts);
}
}
(void) fn_data;
}
static void timer_fn(void *arg) {
for (int i = 0; i < DATA_SIZE; i++) {
s_data[i] = rand();
}
s_version++;
(void) arg;
}
int main(void) {
struct mg_mgr mgr;
mg_mgr_init(&mgr);
srand(time(NULL));
mg_timer_add(&mgr, 5000, MG_TIMER_REPEAT | MG_TIMER_RUN_NOW, timer_fn, NULL);
mg_http_listen(&mgr, s_listen_on, fn, NULL);
MG_INFO(("Listening on %s", s_listen_on));
for (;;) mg_mgr_poll(&mgr, 1000);
mg_mgr_free(&mgr);
return 0;
}
@@ -1,9 +0,0 @@
NAME ?= $(notdir $(CURDIR))
build:
git clone --depth 1 https://github.com/mongoose-examples/$(NAME)
cp ./../../../mongoose.[ch] $(NAME)
make -C $(NAME) build
clean:
rm -rf $(NAME)
-10
View File
@@ -1,10 +0,0 @@
PROG ?= example
all: $(PROG)
$(DEBUGGER) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) main.c ../../mongoose.c -I../.. -W -Wall -DMG_ENABLE_LINES=1 $(CFLAGS) -o $(PROG)
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
@@ -1 +0,0 @@
See detailed tutorial at https://mongoose.ws/tutorials/json-rpc-over-websocket/
-84
View File
@@ -1,84 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
//
// See https://mongoose.ws/tutorials/json-rpc-over-websocket/
#include "mongoose.h"
static const char *s_listen_on = "ws://localhost:8000";
static const char *s_web_root = "web_root";
static struct mg_rpc *s_rpc_head = NULL;
static void rpc_sum(struct mg_rpc_req *r) {
double a = 0.0, b = 0.0;
mg_json_get_num(r->frame, "$.params[0]", &a);
mg_json_get_num(r->frame, "$.params[1]", &b);
mg_rpc_ok(r, "%g", a + b);
}
static void rpc_mul(struct mg_rpc_req *r) {
double a = 0.0, b = 0.0;
mg_json_get_num(r->frame, "$.params[0]", &a);
mg_json_get_num(r->frame, "$.params[1]", &b);
mg_rpc_ok(r, "%g", a * b);
}
// This RESTful server implements the following endpoints:
// /websocket - upgrade to Websocket, and implement websocket echo server
// any other URI serves static files from s_web_root
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_OPEN) {
// c->is_hexdumping = 1;
} else if (ev == MG_EV_WS_OPEN) {
c->data[0] = 'W'; // Mark this connection as an established WS client
} else if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
if (mg_http_match_uri(hm, "/websocket")) {
// Upgrade to websocket. From now on, a connection is a full-duplex
// Websocket connection, which will receive MG_EV_WS_MSG events.
mg_ws_upgrade(c, hm, NULL);
} else {
// Serve static files
struct mg_http_serve_opts opts = {.root_dir = s_web_root};
mg_http_serve_dir(c, ev_data, &opts);
}
} else if (ev == MG_EV_WS_MSG) {
// Got websocket frame. Received data is wm->data
struct mg_ws_message *wm = (struct mg_ws_message *) ev_data;
struct mg_iobuf io = {0, 0, 0, 512};
struct mg_rpc_req r = {&s_rpc_head, 0, mg_pfn_iobuf, &io, 0, wm->data};
mg_rpc_process(&r);
if (io.buf) mg_ws_send(c, (char *) io.buf, io.len, WEBSOCKET_OP_TEXT);
mg_iobuf_free(&io);
}
(void) fn_data;
}
static void timer_fn(void *arg) {
struct mg_mgr *mgr = (struct mg_mgr *) arg;
// Broadcast message to all connected websocket clients.
for (struct mg_connection *c = mgr->conns; c != NULL; c = c->next) {
if (c->data[0] != 'W') continue;
mg_ws_printf(c, WEBSOCKET_OP_TEXT, "{%Q:%Q,%Q:[%d,%d,%d]}", "method",
"notification1", "params", 1, 2, 3);
}
}
int main(void) {
struct mg_mgr mgr; // Event manager
mg_mgr_init(&mgr); // Init event manager
mg_log_set(MG_LL_DEBUG); // Set log level
mg_timer_add(&mgr, 5000, MG_TIMER_REPEAT, timer_fn, &mgr); // Init timer
// Configure JSON-RPC functions we're going to handle
mg_rpc_add(&s_rpc_head, mg_str("sum"), rpc_sum, NULL);
mg_rpc_add(&s_rpc_head, mg_str("mul"), rpc_mul, NULL);
mg_rpc_add(&s_rpc_head, mg_str("rpc.list"), mg_rpc_list, &s_rpc_head);
printf("Starting WS listener on %s/websocket\n", s_listen_on);
mg_http_listen(&mgr, s_listen_on, fn, NULL); // Create HTTP listener
for (;;) mg_mgr_poll(&mgr, 1000); // Infinite event loop
mg_mgr_free(&mgr); // Deallocate event manager
mg_rpc_del(&s_rpc_head, NULL); // Deallocate RPC handlers
return 0;
}
-10
View File
@@ -1,10 +0,0 @@
PROG ?= example
all: $(PROG)
$(DEBUGGER) ./$(PROG)
$(PROG):
$(CC) ../../mongoose.c -I../.. $(CFLAGS) $(EXTRA) -o $(PROG) main.c
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt
-61
View File
@@ -1,61 +0,0 @@
// Copyright (c) 2020 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
// HTTP request handler function. It implements the following endpoints:
// /api/log/static - returns contents of log.txt file
// /api/log/live - hangs forever, and returns live log messages
// all other URI - serves web_root/ directory
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
if (mg_http_match_uri(hm, "/api/log/static")) {
struct mg_http_serve_opts opts = {.root_dir = NULL};
mg_http_serve_file(c, hm, "log.txt", &opts);
} else if (mg_http_match_uri(hm, "/api/log/live")) {
c->data[0] = 'L'; // Mark that connection as live log listener
mg_printf(c, "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n");
} else {
struct mg_http_serve_opts opts = {.root_dir = "web_root"};
mg_http_serve_dir(c, ev_data, &opts);
}
}
}
static void log_message(const char *filename, const char *message) {
FILE *fp = fopen(filename, "a");
if (fp != NULL) {
fprintf(fp, "%s", message);
fclose(fp);
}
}
static void broadcast_message(struct mg_mgr *mgr, const char *message) {
struct mg_connection *c;
for (c = mgr->conns; c != NULL; c = c->next) {
if (c->data[0] == 'L') mg_http_printf_chunk(c, "%s", message);
}
}
// Timer function - called periodically.
// Prepare log message. Save it to a file, and broadcast.
static void timer_fn(void *arg) {
char buf[64];
snprintf(buf, sizeof(buf), "Time is: %lu\n", (unsigned long) time(NULL));
log_message("log.txt", buf);
broadcast_message(arg, buf);
}
int main(void) {
struct mg_mgr mgr;
mg_mgr_init(&mgr);
mg_http_listen(&mgr, "http://localhost:8000", cb, NULL);
mg_timer_add(&mgr, 1000, MG_TIMER_REPEAT, timer_fn, &mgr);
for (;;) mg_mgr_poll(&mgr, 50);
mg_mgr_free(&mgr);
return 0;
}
-22
View File
@@ -1,22 +0,0 @@
PROG ?= example
DEFS ?= -DMG_ENABLE_LINES=1 -DMG_ENABLE_MIP=1 -DMG_ENABLE_SOCKET=0 -DMG_ENABLE_PACKED_FS=1 -I../..
CFLAGS ?= -W -Wall $(EXTRA_CFLAGS)
LIBS ?= -lpcap
SOURCES = main.c ../../mongoose.c ../device-dashboard/net.c ../device-dashboard/packed_fs.c
ifeq "$(SSL)" "MBEDTLS"
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -lmbedtls -lmbedcrypto -lmbedx509 -I$(MBEDTLS)/include -L$(MBEDTLS)/lib
endif
ifeq "$(SSL)" "OPENSSL"
CFLAGS += -DMG_ENABLE_OPENSSL=1 -lssl -lcrypto -I$(OPENSSL)/include -L$(OPENSSL)/lib
endif
all: $(PROG)
$(RUN) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) $(SOURCES) $(CFLAGS) $(DEFS) -o $(PROG) $(LIBS)
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
-246
View File
@@ -1,246 +0,0 @@
# MIP TCP / IP stack over pcap
This example allows to use Mongoose's MIP built-in TCP/IP stack on systems
that support pcap API, i.e. have libpcap library installed. The application
opens an interface and uses `pcap_next_ex()` for reading packets from the
interface, and `pcap_inject()` to write packets to the interface.
NOTE: depending on the libcap implementation, the injected packets may
or may not be looped back to the interface's TCP/IP stack. If they are
not looped back, then it is necessary to create a separate interface that
is bridged to the target interface - see MacOS example below.
## MacOS setup
MacOS has support for `feth` (fake ethernet) interfaces. One can create a pair
of `feth` interfaces and interlink them. Once a `feth` interface is assigned
a peer and an IP address, anything that gets injected to it, appears on a
peer interface and vice versa.
```sh
$ sudo ifconfig feth0 create
$ sudo ifconfig feth1 create
$ sudo ifconfig feth1 peer feth0 # Link two fake ethernet ifaces together
$ sudo ifconfig feth1 10.10 # Assign 10.0.0.10 to feth1
$ sudo ifconfig feth0 up
$ sudo ifconfig feth1 up
```
Now we have two Ethernet interfaces, `feth0` and `feth1`, interlinked and
active. On your Mac, go to "System Preferences" / Sharing, enable "Internet
Sharing" and choose "Thunderbolt bridge". This enables DHCP on the `bridge0`
interface, which is bridge for all Thunderbolt devices, and adds necessary
routes to the WiFi interface. On my system it gets `192.168.2.1` IP address,
and serves `192.168.2/24` net. We should add one of our fake interfaces to
this bridge:
```sh
$ sudo ifconfig bridge0 addm feth1
```
We can start an example using the `feth0`:
```sh
$ make -C examples/mip-pcap/ clean all ARGS="-i feth0"
...
2386718 3 mip.c:279:arp_cache_add ARP cache: added 0xc0a80201 @ 36:77:4d:be:e0:80
2386718 2 mip.c:300:onstatechange READY, IP: 192.168.2.17
```
The diagram of the setup is below:
```
┌──────────► 192.168.2.1 bridge0
│ routing DHCP │
│ ┌──────────────────┴──────────────────┐
▼ │ │ 192.168.2.17
│ ┌─────────┐ fake ethernet pair ┌─────────┐
192.168.0.10 │ │ feth1 ├────────────┬───────┤ feth0 │
┌─────────┐ │ └─────────┘ │ └────┬────┘
│ en0 │ │ │ │
└────┬────┘ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │
│ │ │ en1 │ │ en2 │ │ en3 │ │ mip-pcap
│ └────┬────┘ └────┬────┘ └────┬────┘ │
WiFi │ │ │ │ │
└──────┼───────────┼───────────┼──────┘
│ │ │ │
▼
Internet Thunderbolt Ethernet
```
## Linux setup
The quick and simple options are:
- Open your loopback device (probably `lo`), in which case MIP is only reachable from your machine, and MIP also sees echoes of its own traffic.
- Open your Ethernet/WiFi device (probably `eth0` or `enpXsY` for Ethernet), in which case MIP can access the network and the Internet but is not reachable from within your machine
- If you happen to have a virtual bridge interface (for linking several virtual machines together, for example) (probably `br0` or `virbr0`), you can open it, but it will behave as opening the underlying physical interface.
For best results, you should create a virtual interface, which you can use as is, attach to a virtual bridge, or forward/masquerade its traffic.
```sh
$ sudo ip link add my0 type veth peer [name] my1
$ sudo ip link set my0 up
$ sudo ip link set my1 up
```
In some systems, like for example RHEL7, _name_ is mandatory; in others you might need not to add it, that is why we represented it here using square brackets.
### Use a virtual interface
This is similar to using the loopback device, MIP is only reachable from the hosting machine, but you can add forwarding and masquerading later. Once you have your virtual interface up and running with an IP address, you can configure any services on one end, let's say `my1`, while you open the other end, `my0` with MIP.
- Add an IP address to one end of the pipe
```sh
$ sudo ip addr add 192.168.0.1/24 dev my1
```
- Start your DHCP server at that interface serving that subnet, or otherwise configure MIP to use a fixed address within that subnet.
- Now start the example opening the other end of the virtual interface:
```sh
$ make -C examples/mip-pcap/ clean all ARGS="-i my0"
```
- In some systems, you will probably need superuser privileges to open the device:
```sh
$ sudo examples/mip-pcap/example -i my0
```
```
[DHCP server for 192.168.0.x]
192.168.0.1 192.168.0.x
┌─────────┐ virtual eth pair ┌─────────┐
│ my1 ├────────────────────┤ my0 │
└─────────┘ └────┬────┘
│
│
mip-pcap
```
As you can't access any other host than your workstation, you need to add any required services (as DNS) there, and configure Mongoose appropriately. This is a foundation, you can expand it by choosing one of the solutions that follow.
### Bridge to your network
We will attach one end of the virtual interface to a bridge, which will also be attached to your network interface. In this case, MIP will have access to your network (and through it, to the Internet) and will also be reachable from your own workstation and other hosts in your network. You don't need to add IP addresses as in the example above, unless you don't have a DHCP server in your network, in which case you will configure MIP for a fixed address in your subnet.
- If you don't already have a virtual bridge interface, as mentioned above, you'll have to create it and attach your network interface (NIC) to it. Your IP address has to be assigned to the bridge, instead of the NIC. If you are using DHCP, the client must run on the bridge interface instead of the NIC.
```sh
$ ip link add virbr0 type bridge
$ sudo ip link set virbr0 up
$ sudo ip addr del 10.1.0.10/24 dev enp9s0
$ sudo ip link set enp9s0 master virbr0
$ sudo ip addr add 10.1.0.10/24 dev virbr0
```
Check using `ifconfig`, and try to ping some host in your network
- Attach one end of the virtual interface to the bridge:
```sh
$ sudo ip link set my1 master virbr0
```
- If everything is fine, you'll see your interface pair state is UP:
```sh
$ ip link show master virbr0
2: enp9s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master virbr0 state UP mode DEFAULT group default qlen 1000
link/ether 30:5a:3a:08:db:90 brd ff:ff:ff:ff:ff:ff
396: my1@my0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master virbr0 state UP mode DEFAULT group default qlen 1000
link/ether b6:ee:bc:53:f2:6e brd ff:ff:ff:ff:ff:ff
```
- Now start the example opening the other end of the virtual interface:
```sh
$ make -C examples/mip-pcap/ clean all ARGS="-i my0"
```
- In some systems, you will probably need superuser privileges to open the device:
```sh
$ sudo examples/mip-pcap/example -i my0
```
```
10.1.0.10
virbr0
│
┌──────────────────┴──────────────────┐
│ │ 10.1.0.x
│ ┌─────────┐ virtual eth pair ┌─────────┐
│ │ my1 ├────────────┬───────┤ my0 │
│ └─────────┘ │ └────┬────┘
│ │ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │
│ │ vnet1 │ │ enp9s0 │ │ vnet2 │ │ mip-pcap
│ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │
└──────┼───────────┼───────────┼──────┘
│ │ │
│
Ethernet [WiFi]
│ Local LAN 10.1.0.x
│ DHCP server, router
▼
Internet
```
If you have _Docker_ running, it may introduce firewall rules that will disrupt your bridging.
### Forward/Masquerade
Once you have your virtual interface up and running with an IP address, you can use your Linux to NAT and forward MIP traffic to another interface, for example the one that connects you to the Internet. In this case, MIP will have access to the Internet and will also be reachable from your own workstation; but not from any other hosts in your local network (if there is one). You can use this setup with a direct connection to the Internet or being part of a network, when you want to isolate MIP from the rest of your network.
- We assume you already have a firewall in place (you should); to configure masquerading and forwarding do:
```sh
$ sudo iptables -t nat -A POSTROUTING -o enp9s0 -j MASQUERADE
$ echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
```
Remember to use the proper network interface name
- Now start the example opening the other end of the virtual interface:
```sh
$ make -C examples/mip-pcap/ clean all ARGS="-i my0"
```
- In some systems, you will probably need superuser privileges to open the device:
```sh
$ sudo examples/mip-pcap/example -i my0
```
```
[DHCP server for 192.168.0.x]
┌────────────► 192.168.0.1 192.168.0.x
│ forwarding ┌─────────┐ virtual eth pair ┌─────────┐
│ masquerading │ my1 ├────────────────────┤ my0 │
│ └─────────┘ └────┬────┘
▼ │
Your IP (LAN / Public) │
┌─────────┐ mip-pcap
│ enp9s0 │
└────┬────┘
│
│
Ethernet
│
▼
Internet
```
You can also use this setup if your NIC is part of a bridge (for example: you have virtual machines); in that case:
- use the bridge interface for masquerading, instead of the Ethernet (your IP now belongs to the virtual bridge, not the NIC):
```sh
$ sudo iptables -t nat -A POSTROUTING -o virbr0 -j MASQUERADE
$ echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
```
Remember to use the proper bridge interface name
```
[DHCP server for 192.168.0.x]
10.1.0.10 ◀──────────────► 192.168.0.1 192.168.0.x
virbr0 forwarding ┌─────────┐ virtual eth pair ┌─────────┐
│ masquerading │ my1 ├────────────────────┤ my0 │
│ └─────────┘ └────┬────┘
┌──────────────────┴──────────────────┐ │
│ │ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ mip-pcap
│ │ vnet1 │ │ enp9s0 │ │ vnet2 │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │
└──────┼───────────┼───────────┼──────┘
│ │ │
│
Ethernet [WiFi]
│ Local LAN 10.1.0.x
│ DHCP server, router
▼
Internet
```
-1
View File
@@ -1 +0,0 @@
../../test/data/ca.pem
-153
View File
@@ -1,153 +0,0 @@
// Copyright (c) 2022 Cesanta Software Limited
// All rights reserved
//
// SNTP example using MIP and pcap driver
#include <pcap.h>
#include "mongoose.h"
#define MQTT_URL "mqtt://broker.hivemq.com:1883" // MQTT broker to connect to
#define MQTT_TOPIC "t/123" // Topic to subscribe to
#if MG_ARCH == MG_ARCH_WIN32
#define usleep(x) Sleep((x) / 1000)
#endif
static int s_signo;
void signal_handler(int signo) {
s_signo = signo;
}
static size_t pcap_tx(const void *buf, size_t len, struct mip_if *ifp) {
int res = pcap_inject((pcap_t *) ifp->driver_data, buf, len);
if (res == PCAP_ERROR) {
MG_ERROR(("pcap_inject: %d", res));
}
return res == PCAP_ERROR ? 0 : len;
}
static bool pcap_up(struct mip_if *ifp) {
return ifp->driver_data ? true : false;
}
static size_t pcap_rx(void *buf, size_t len, struct mip_if *ifp) {
size_t received = 0;
struct pcap_pkthdr *hdr = NULL;
const unsigned char *pkt = NULL;
usleep(1000); // Sleep 1 millisecond. This is to avoid 100% CPU
if (pcap_next_ex((pcap_t *) ifp->driver_data, &hdr, &pkt) == 1) {
received = hdr->len < len ? hdr->len : len;
memcpy(buf, pkt, received);
}
return received;
}
static void fn2(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
MG_DEBUG(("Got response (%d) %.*s...", (int) hm->message.len, 12,
hm->message.ptr));
c->is_closing = 1;
} else if (ev == MG_EV_CONNECT) {
mg_printf(c, "GET %s HTTP/1.1\r\n\r\n", mg_url_uri((char *) fn_data));
} else if (ev == MG_EV_CLOSE) {
free(fn_data);
}
}
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
if (mg_http_match_uri(hm, "/api/debug")) {
int level = mg_json_get_long(hm->body, "$.level", MG_LL_DEBUG);
mg_log_set(level);
mg_http_reply(c, 200, "", "Debug level set to %d\n", level);
} else if (mg_http_match_uri(hm, "/api/url")) {
char *url = mg_json_get_str(hm->body, "$.url");
if (url == NULL) {
mg_http_reply(c, 200, NULL, "no url, rl %d\r\n", (int) c->recv.len);
} else {
mg_http_connect(c->mgr, url, fn2, url);
mg_http_reply(c, 200, NULL, "ok\r\n");
}
} else {
mg_http_reply(c, 200, NULL, "%.*s\r\n", (int) hm->message.len,
hm->message.ptr);
}
}
(void) ev_data, (void) fn_data;
}
int main(int argc, char *argv[]) {
const char *iface = "lo0"; // Network iface
const char *mac = "02:00:01:02:03:77"; // MAC address
const char *bpf = NULL; // "host x.x.x.x or ether host ff:ff:ff:ff:ff:ff";
char errbuf[PCAP_ERRBUF_SIZE] = "";
// Parse options
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "-i") == 0 && i + 1 < argc) {
iface = argv[++i];
} else if (strcmp(argv[i], "-mac") == 0 && i + 1 < argc) {
mac = argv[++i];
} else if (strcmp(argv[i], "-bpf") == 0 && i + 1 < argc) {
bpf = argv[++i];
} else if (strcmp(argv[i], "-v") == 0 && i + 1 < argc) {
mg_log_set(atoi(argv[++i]));
} else {
MG_ERROR(("unknown option %s", argv[i]));
return EXIT_FAILURE;
}
}
// Open network interface
pcap_t *ph = pcap_open_live(iface, 0xffff, 1, 1, errbuf);
if (ph == NULL) {
pcap_if_t *devs, *d;
MG_ERROR(("Failed to open interface %s. Available interfaces:", iface));
if (pcap_findalldevs(&devs, errbuf) == 0) {
for (d = devs; d != NULL; d = d->next) {
MG_ERROR(("%s (%s)", d->name, d->description ? d->description : ""));
}
pcap_freealldevs(devs);
}
return EXIT_FAILURE;
}
pcap_setnonblock(ph, 1, errbuf);
pcap_setdirection(ph, PCAP_D_IN);
// Apply BPF to reduce noise. Let in only broadcasts and our own traffic
if (bpf != NULL) {
struct bpf_program bpfp;
if (pcap_compile(ph, &bpfp, bpf, 1, 0)) MG_ERROR(("BPF compile failed\n"));
pcap_setfilter(ph, &bpfp);
pcap_freecode(&bpfp);
}
MG_INFO(("Opened interface %s", iface));
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
struct mg_mgr mgr; // Event manager
mg_mgr_init(&mgr); // Initialise event manager
mg_log_set(MG_LL_DEBUG); // Set log level
struct mip_driver driver = {.tx = pcap_tx, .up = pcap_up, .rx = pcap_rx};
struct mip_if mif = {.driver = &driver, .driver_data = ph};
sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &mif.mac[0], &mif.mac[1],
&mif.mac[2], &mif.mac[3], &mif.mac[4], &mif.mac[5]);
mip_init(&mgr, &mif);
MG_INFO(("Init done, starting main loop"));
// extern void device_dashboard_fn(struct mg_connection *, int, void *, void
// *);
mg_http_listen(&mgr, "http://0.0.0.0:8000", fn, &mgr);
while (s_signo == 0) mg_mgr_poll(&mgr, 100); // Infinite event loop
mg_mgr_free(&mgr);
pcap_close(ph);
printf("Exiting on signal %d\n", s_signo);
return 0;
}
-22
View File
@@ -1,22 +0,0 @@
PROG ?= example
DEFS ?= -DMG_ENABLE_LINES=1 -DMG_ENABLE_MIP=1 -DMG_ENABLE_SOCKET=0 -DMG_ENABLE_PACKED_FS=1 -I../..
CFLAGS ?= -W -Wall $(EXTRA_CFLAGS)
LIBS ?=
SOURCES = main.c ../../mongoose.c ../device-dashboard/net.c ../device-dashboard/packed_fs.c
ifeq "$(SSL)" "MBEDTLS"
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -lmbedtls -lmbedcrypto -lmbedx509 -I$(MBEDTLS)/include -L$(MBEDTLS)/lib
endif
ifeq "$(SSL)" "OPENSSL"
CFLAGS += -DMG_ENABLE_OPENSSL=1 -lssl -lcrypto -I$(OPENSSL)/include -L$(OPENSSL)/lib
endif
all: $(PROG)
$(RUN) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) $(SOURCES) $(CFLAGS) $(DEFS) -o $(PROG) $(LIBS)
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
Loaded 100 of 4275 files, more files were not shown because too many files have changed in this diff. Show more