Compare commits

...
3268 Commits
Author SHA1 Message Date
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
Sergio R. Caprile 4236405b90 Ready to release 2023-01-24 13:30:45 -03:00
Sergio R. Caprile 292c66e25c Merge pull request #1992 from cesanta/revert-1920-patch-1
Revert "Update comment for the path of rest API"
2023-01-24 11:42:18 -03:00
Sergio R. Caprile 5aa6c15c76 Revert "Update comment for the path of rest API" 2023-01-24 11:41:51 -03:00
Sergio R. Caprile 1f89dc47cb Merge pull request #1991 from cesanta/revert-1797-fix-typo
Revert "Fix typo in documentation"
2023-01-24 11:36:51 -03:00
Sergio R. Caprile 31393128c8 Revert "Fix typo in documentation" 2023-01-24 11:35:26 -03:00
Sergio R. Caprile 232a18425a Merge pull request #1990 from cesanta/revert-1705-master
Revert "fix the doc error: htts to https"
2023-01-24 11:33:02 -03:00
Sergio R. Caprile 88e2eb2a49 Revert "fix the doc error: htts to https" 2023-01-24 11:31:25 -03:00
Sergey Lyubka e635d5f748 Merge pull request #1986 from cesanta/w5
Add examples/rp2040/pico-w5500 to hwtest
2023-01-23 12:32:14 +00:00
Sergey Lyubka 08a23cdb2f Merge pull request #1988 from cesanta/h743
Add nucleo-h743zi-baremetal boilerplate, with HW test
2023-01-23 12:31:55 +00:00
cpq 1ead940623 Add nucleo-h743zi-baremetal boilerplate, with HW test 2023-01-22 11:48:56 +00:00
Hakaba Hitoyo 382362668e bugfix openssl tls sni 2023-01-22 14:27:44 +09:00
cpq 987f8bc949 Prep for msc 2023-01-21 13:42:25 +00:00
cpq 6f096333d3 make clean: invoke docker only when there is something to clean 2023-01-21 07:44:50 +00:00
cpq 5a25111b20 Add examples/rp2040/pico-w5500 to hwtest 2023-01-21 02:21:20 +00:00
Sergio R. Caprile c7cb16cafa Merge pull request #1984 from cesanta/ti-nodocker
Get rid of Docker (TI), part 2: FreeRTOS
2023-01-20 18:47:55 -03:00
Sergio R. Caprile a746a698b6 Merge pull request #1983 from cesanta/stm32-nodocker
Get rid of Docker, part 2: FreeRTOS
2023-01-20 18:47:27 -03:00
Sergio R. Caprile 9a7f7255ff Get rid of Docker, part 2: FreeRTOS 2023-01-20 18:20:19 -03:00
Sergio R. Caprile d3df6b8f4f Get rid of Docker (TI), part 2: FreeRTOS 2023-01-20 18:19:29 -03:00
Sergio R. Caprile fcffd17b11 Merge pull request #1982 from cesanta/freertos
Fix FreeRTOS arch includes on newlib platforms
2023-01-20 18:16:55 -03:00
Sergio R. Caprile 7fc6be9f39 Fix FreeRTOS arch includes on newlib platforms 2023-01-20 18:09:21 -03:00
Sergio R. Caprile 7362744ff8 Merge pull request #1981 from cesanta/stm32uarts
Fix UART1,2 clocking in all other examples
2023-01-20 18:00:46 -03:00
Sergio R. Caprile f4d058155a Fix UART1,2 clocking in all other examples 2023-01-20 17:49:57 -03:00
Sergio R. Caprile b04612e80d Merge pull request #1975 from cesanta/hwtest
Cleanup, adopt for HW test
2023-01-20 16:26:05 -03:00
Sergio R. Caprile 5f00e4d34d Merge pull request #1980 from cesanta/ti-nodocker
Get rid of Docker (TI), part 1
2023-01-20 16:21:45 -03:00
cpq e967feb091 Cleanup, adopt for HW test 2023-01-20 18:46:19 +00:00
Sergio R. Caprile 0445b18bb9 Merge pull request #1977 from cesanta/reallyclean
Apply a deeper cleanser
2023-01-20 15:36:51 -03:00
Sergio R. Caprile 99f1f749cf Apply a deeper cleanser 2023-01-20 15:27:37 -03:00
Sergio R. Caprile f4d16f1c47 Get rid of Docker (TI), part 1 2023-01-20 15:06:03 -03:00
Sergio R. Caprile 68071d6caf Merge pull request #1976 from cesanta/stm32-nodocker
Get rid of Docker, part 1
2023-01-20 14:14:07 -03:00
Sergio R. Caprile 44975da7db Get rid of Docker, part 1 2023-01-20 12:42:38 -03:00
Sergio R. Caprile e4566518b2 Merge pull request #1978 from cesanta/test-nosprintf
Make MacOS happy by getting rid of sprintf()
2023-01-20 12:41:09 -03:00
novlean c038cb5b96 Merge pull request #1979 from cesanta/novlean-patch-1
2023
2023-01-20 15:31:07 +00:00
novlean d7eb3db60b 2023 2023-01-20 15:28:16 +00:00
Sergio R. Caprile 44e781d7da Make MacOS happy be getting rid of sprintf() 2023-01-20 11:54:56 -03:00
Sergio R. Caprile 0951d58c8f Merge pull request #1974 from cesanta/stm32uarts
Fix AF in UART1,2
2023-01-19 16:31:55 -03:00
Sergio R. Caprile 37c0ed0b49 Fix AF in UART1,2 2023-01-19 15:28:51 -03:00
cpq 556bf7b888 Fix uart_init(), use correct AF for UART1/UART2 2023-01-19 10:31:26 +00:00
Sergey Lyubka 280be2eaea Merge pull request #1968 from cesanta/ackstream
Don't retrigger ACK timer
2023-01-18 08:52:12 +00:00
Sergio R. Caprile 13f9357f8e Merge pull request #1970 from cesanta/test-pico-rndis
Update test.yml
2023-01-17 15:19:45 -03:00
Sergio R. Caprile 56e015db0e Enable test for pico-rndis-dashboard 2023-01-17 14:58:05 -03:00
Sergio R. Caprile 1068fbf079 Merge pull request #1969 from cesanta/pico-dash
Simplify build
2023-01-17 13:59:54 -03:00
Sergio R. Caprile 45f7afb3e1 Simplify build 2023-01-17 13:54:22 -03:00
Sergio R. Caprile 0d3fc2b656 Don't retrigger ACK timer 2023-01-16 20:16:59 -03:00
Sergio R. Caprile 2dc66b2e3b Merge pull request #1966 from cesanta/test-pico-rmii
Update test.yml
2023-01-16 16:48:10 -03:00
Sergio R. Caprile 0b9129d8f5 Update test.yml 2023-01-16 15:36:50 -03:00
cpq 82d702fedc mg_url_encode() 0-terminate the destination 2023-01-16 15:05:04 +00:00
Sergey Lyubka 197be75677 Merge pull request #1960 from cesanta/keepalive
TCP keepalives
2023-01-16 10:40:28 +00:00
cpq 3f9aff1b10 Update uart logs with Ethernet status 2023-01-15 12:03:40 +00:00
Sergey Lyubka f5ed50fa88 Merge pull request #1959 from cesanta/handle-rst
Handle TCP RST
2023-01-14 00:16:40 +00:00
Sergio R. Caprile 645b52602f Update main.c 2023-01-13 15:08:00 -03:00
Sergio R. Caprile 27a8e60e9a TCP keepalives 2023-01-12 15:58:25 -03:00
Sergio R. Caprile 201ffa108b Handle TCP RST 2023-01-11 17:33:37 -03:00
Sergey Lyubka 1661bd6691 Merge pull request #1955 from cesanta/picormii
Add RMII example for RP2040
2023-01-11 10:40:10 +00:00
Sergio R. Caprile d431f4bbc5 Merge pull request #1957 from cesanta/pico-w5500
updated to ARCH_RP2040
2023-01-10 11:21:23 -03:00
Sergio R. Caprile 2b8e92a70d updated to ARCH_RP2040 2023-01-10 10:54:27 -03:00
Sergey Lyubka d70ab3cfa8 Merge pull request #1944 from cesanta/devdash
Add reduced functionality version
2023-01-10 12:31:03 +00:00
Sergey Lyubka 9402c6ad28 Merge pull request #1956 from cesanta/lbl
Rename struct mg_connection::label -> data. Make its size configurable
2023-01-10 08:34:22 +00:00
cpq da5e8e9778 Rename struct mg_connection::label -> data. Make its size configurable 2023-01-10 08:19:49 +00:00
Sergio R. Caprile feedfdf810 Update main.c 2023-01-09 14:31:04 -03:00
Sergio R. Caprile 6db0a502bf Add RMII example 2023-01-09 11:16:01 -03:00
Sergey Lyubka f07957d45e Merge pull request #1952 from cesanta/mipqueue
Rename mip_rxcb to mip_qwrite, add mip_qread and enforce rx() for drivers
2023-01-08 06:47:38 +00:00
cpq 3d75d71767 Do not show response handler in the rpc.list result 2023-01-08 06:38:08 +00:00
Sergio R. Caprile b259bdeddd Rename mip_rxcb to mip_qwrite, add mip_qread and enforce rx() for drivers 2023-01-03 19:33:26 -03:00
Sergey Lyubka 042465387f Merge pull request #1950 from cesanta/picodash
Add Pico dashboard
2023-01-02 20:14:34 +00:00
Sergio R. Caprile d09e4d648c Add Pico dashboard 2023-01-02 16:49:15 -03:00
Sergio R. Caprile 754910ad5f Merge pull request #1947 from cesanta/pico
Moved pico-w example
2023-01-02 15:48:24 -03:00
Sergio R. Caprile 977e080215 Update test.yml 2023-01-02 15:29:21 -03:00
Sergio R. Caprile a9ac947c96 Merge pull request #1949 from cesanta/scaprile-patch-1
Update test.yml
2023-01-02 15:23:15 -03:00
Sergio R. Caprile 28e6ef1d63 Update test.yml 2023-01-02 15:22:24 -03:00
Sergio R. Caprile b0f273157d Fix Makefile 2023-01-02 15:16:50 -03:00
Sergio R. Caprile 49add531c4 Moved pico-w example 2023-01-02 15:12:07 -03:00
cpq 8a1d2a5dca Install gcc-arm-none-eabi for examples 2023-01-02 17:53:55 +00:00
Sergey Lyubka 31c5883f5f Merge pull request #1946 from cesanta/rp2040-w5500
Add pico-w5500 example
2023-01-02 16:48:43 +00:00
Sergey Lyubka c625fbb43d Merge branch 'master' into rp2040-w5500 2023-01-02 16:48:34 +00:00
cpq 0f474e8d2a Add pico-w5500 example 2023-01-02 16:36:55 +00:00
Sergey Lyubka 73813a8383 Merge pull request #1943 from cesanta/add-test-for-RNDIS-examples
Update tests
2022-12-28 02:47:56 +00:00
Sergio R. Caprile d8fb110b56 Update test.yml 2022-12-27 20:34:10 -03:00
Sergio R. Caprile 77e62626a9 Add RNDIS examples to tests, remove "stm32/nucleo*" examples from "examples" test group 2022-12-27 20:27:08 -03:00
Sergio R. Caprile 24ee83f13d Update test.yml 2022-12-27 18:31:39 -03:00
Sergio R. Caprile 6791a36d85 Add reduced functionality version 2022-12-27 18:12:55 -03:00
Sergio R. Caprile c6a5a64e64 Update test.yml 2022-12-26 10:51:44 -03:00
Sergey Lyubka 311062dc41 Merge pull request #1938 from cesanta/F746rndis
Add RNDIS example for F7
2022-12-24 15:10:00 +00:00
Sergio R. Caprile 391ce1f009 Merge pull request #1939 from cesanta/tireadme
Added link to tutorial
2022-12-23 19:47:14 -03:00
Sergio R. Caprile 9f6d99352a Added link to tutorial 2022-12-23 19:45:57 -03:00
Sergio R. Caprile 02b1d6260a Add RNDIS example for F7 2022-12-23 19:28:33 -03:00
Sergio R. Caprile e8ade14259 Merge pull request #1937 from cesanta/tm4cdriverdata
Rename driver data structure
2022-12-23 16:27:42 -03:00
Sergio R. Caprile f0804dfed4 Merge pull request #1936 from cesanta/stm32driverdata
Rename driver data structure
2022-12-23 15:57:19 -03:00
Sergio R. Caprile f506344ada Rename driver data structure 2022-12-23 15:56:46 -03:00
Sergio R. Caprile ddca518cca Rename driver data structure 2022-12-23 15:45:30 -03:00
cpq 21d3678fa7 Add more on logging 2022-12-21 11:31:14 +00:00
cpq 3dd8d7d8e5 Add diagrams 2022-12-21 11:18:50 +00:00
Sergio R. Caprile 92aa538a84 Merge pull request #1934 from cesanta/myheart
Unbreak
2022-12-20 19:39:22 -03:00
Sergio R. Caprile 557a5583e8 Unbreak 2022-12-20 19:38:20 -03:00
Sergio R. Caprile b00ddff7dd Merge pull request #1933 from cesanta/fixmqttserver
Fix MQTT server example
2022-12-20 16:08:56 -03:00
Sergio R. Caprile cc3b311ab0 Fix MQTT server example 2022-12-20 16:06:46 -03:00
cpq 6cedca5d76 Remove DS_Store 2022-12-19 14:40:17 +00:00
Sergey Lyubka d82452e00f Merge pull request #1929 from cesanta/usb
Add TinyUSB example
2022-12-19 14:33:11 +00:00
cpq 57a5c0ba38 Add TinyUSB example 2022-12-19 14:31:54 +00:00
Sergio R. Caprile 28c8519e5b Merge pull request #1924 from cesanta/scaprile-patch-1
Update README.md
2022-12-15 10:31:37 -03:00
Sergio R. Caprile cfcb7191ea Update README.md 2022-12-15 09:52:19 -03:00
Sergey Lyubka 6921227ec8 Merge pull request #1915 from jfsimon1981/miptap
Mip tests and tuntap example to compile on OpenBSD natively.
2022-12-13 16:42:09 +00:00
Sergey Lyubka 1c9991ee83 Merge pull request #1916 from cesanta/stm32
Minor tweaks in STM32 examples
2022-12-13 16:40:38 +00:00
Sergey Lyubka fd475fcfff Merge pull request #1917 from cesanta/tm4c
Correct stack initialization
2022-12-13 16:40:10 +00:00
Sergio R. Caprile f47f995e90 Merge pull request #1921 from cesanta/scaprile-patch-1
Update test.yml
2022-12-13 13:02:11 -03:00
Sergio R. Caprile d93e943326 Update test.yml 2022-12-13 12:51:43 -03:00
Sergio R. Caprile 7ca9f2d5cd Merge pull request #1920 from jojo2massol/patch-1
Update comment for the path of rest API
2022-12-13 12:39:28 -03:00
jojo2massol ff1d45a008 Update comment for the path of rest API
rest api is available at `/rest` and not `/api/rest`
2022-12-13 15:33:51 +01:00
Sergio R. Caprile 53f0a72362 Merge pull request #1919 from cesanta/doc1918
Update README.md
2022-12-10 20:14:30 -03:00
Sergio R. Caprile 3a47242219 Update README.md
Closes #1918
2022-12-10 20:12:58 -03:00
Jean-Francois Simon 5556568feb Mip tests and tuntap example to compile on OpenBSD natively.
(updated for c++ build)

Fix typo
2022-12-09 18:48:05 +00:00
Sergio R. Caprile 6011a15cd4 Correct stack initialization 2022-12-09 15:47:23 -03:00
Sergio R. Caprile 2c014778d9 Minor tweaks in STM32 examples
Fix comments in newer mip initialization (main.c)
Correct stack initialization (boot.c)
Remove SCC clock enable when not needed (mcu.h)
2022-12-09 15:20:51 -03:00
Sergey Lyubka 0b2712f52f Merge pull request #1911 from cesanta/gwarp
Ask for gw mac when needed and not known
2022-12-09 11:51:40 +00:00
Sergey Lyubka 69f1acd823 Merge pull request #1912 from cesanta/nodupack
Avoid duplicated ACKs
2022-12-09 11:50:30 +00:00
cpq c0f15d50d6 Squash cppcheck warn 2022-12-09 09:29:34 +00:00
Sergio R. Caprile 1d3fe51e8b Avoid duplicated ACKs 2022-12-08 18:59:18 -03:00
Sergio R. Caprile d364d50c05 Improve MIP resiliency 2022-12-08 17:17:05 -03:00
Sergey Lyubka 615d324b11 Merge pull request #1906 from jfsimon1981/armfix
Fix arm and armhf test builds and unit_test runtime.
2022-12-07 18:31:29 +00:00
Jean-Francois Simon eb36b6755f Fix arm and armhf test builds and unit_test runtime.
Generalized with the correct define (comment from SC).
2022-12-07 17:09:13 +00:00
Sergey Lyubka 40c28d3b21 Merge pull request #1905 from cesanta/percentA
Use %I in mip.c
2022-12-07 07:22:10 +00:00
Sergio R. Caprile e726282023 Merge pull request #1908 from cesanta/tm4creadme
Add README
2022-12-06 17:10:19 -03:00
Sergio R. Caprile 327f734e4f Add README 2022-12-06 17:09:15 -03:00
Sergio R. Caprile b361f64d4f Merge pull request #1907 from cesanta/tests
Update test.yml
2022-12-06 16:25:47 -03:00
Sergio R. Caprile b38d215b3d Update test.yml 2022-12-06 15:53:18 -03:00
Sergio R. Caprile 99aa498bc4 Use %I in mip.c
Add %A to print hw address and use it in mip.c
Fix some debug data
2022-12-06 13:44:31 -03:00
Sergio R. Caprile f14798dec9 Merge pull request #1904 from cesanta/tm4cdriver
Improve TM4C driver
2022-12-06 11:08:44 -03:00
Sergio R. Caprile 65873f3dee Improve TM4C driver
- Fix clock guessing
- Frames are now read in order, and only host owned descriptors are checked
- Read as many frames as possible (but don't loop forever)
- Discard bad frames
- Fixed incorrect handling of RU bit and exit out of suspended condition
- If a frame arrives while processing, it will now generate a new interrupt (formerly it would wait for another frame to arrive as we reset the flag on exit)
2022-12-06 10:45:41 -03:00
Sergio R. Caprile fc98c88358 Merge pull request #1903 from cesanta/freemgstrdupdoc
Update README.md
2022-12-05 16:30:24 -03:00
Sergio R. Caprile 7c0440c148 Update README.md 2022-12-05 16:24:28 -03:00
Sergio R. Caprile ad051269ed Merge pull request #1899 from cesanta/castREADME
Update README.md
2022-12-04 19:17:23 -03:00
Sergio R. Caprile 497d8f25a1 Update README.md 2022-12-04 19:16:34 -03:00
Sergey Lyubka eb142f26f2 Merge pull request #1897 from cesanta/i
Fix #1888: add %I *printf specifier for IP address. Remove mg_ntoa, m…
2022-12-03 14:39:47 +00:00
cpq b01989f041 Fix #1888: add %I *printf specifier for IP address. Remove mg_ntoa, mg_straddr 2022-12-03 14:27:07 +00:00
Sergey Lyubka 84d89e80cd Merge pull request #1896 from cesanta/stm32driver
Improve STM32 driver
2022-12-03 09:40:38 +00:00
Sergio R. Caprile d059d2cda4 Improve STM32 driver 2022-12-02 19:47:29 -03:00
jfsimon1981 751413f050 MIP tuntap with dhcp added, enabled gitactions (#1890)
Enable DHCP with MIP tests.
Separate sources for high and low level stack tests.
Fixed assertion.
Added dhcpd.conf file.
2022-12-02 17:40:46 +01:00
Sergey Lyubka ce5e28554f Merge pull request #1891 from cesanta/baremetalREADMEs
Add links to tool installation in MIP hw examples
2022-12-02 07:12:46 +00:00
Sergio R. Caprile 860be3f96c Add links to tool installation in MIP hw examples 2022-12-01 17:23:16 -03:00
Sergey Lyubka 89fb3a3d6e Merge pull request #1889 from cesanta/mippoll
MG_EV_POLL generation on MIP
2022-12-01 07:25:19 +00:00
Sergio R. Caprile 474a07564c Make test NOT fail 2022-11-30 18:16:13 -03:00
Sergio R. Caprile 59b69a3b3b Add test for MG_EV_POLL generation 2022-11-30 12:13:45 -03:00
Sergey Lyubka 2553392e42 Merge pull request #1885 from cesanta/tm4c-freertos-mip
Add FreeRTOS + MIP example on TM4C
2022-11-29 15:17:48 +00:00
cpq fcd6901558 Fix broken mip_test 2022-11-29 14:55:36 +00:00
Sergio R. Caprile 716ffbb945 Add FreeRTOS + MIP tutorial on TM4C 2022-11-29 11:16:43 -03:00
Sergey Lyubka cd4b9aeafe Merge pull request #1884 from cesanta/macfilter
Fix MAC address filtering on STM32 and TM4C
2022-11-29 14:05:11 +00:00
Sergey Lyubka 5d712b6f54 Merge pull request #1886 from jfsimon1981/master
Release MIP tests using tuntap
2022-11-29 11:24:52 +00:00
Jean-Francois Simon 754c68fccc Release MIP tests using tuntap 2022-11-29 11:20:22 +01:00
Sergio R. Caprile 858f4da0d1 Fix MAC address filtering on STM32 and TM4C 2022-11-28 10:16:10 -03:00
Sergey Lyubka 90910a7a4f Merge pull request #1883 from cesanta/arpbcast
Fix sending ARP request for IP broadcasts
2022-11-26 11:58:16 +00:00
Sergey Lyubka cd218b59f9 Merge pull request #1882 from cesanta/f746zg-frertos-mip
Add FreeRTOS + MIP example on F746
2022-11-26 11:57:43 +00:00
Sergio R. Caprile 9625c49c95 Fix sending ARP request for IP broadcasts 2022-11-25 17:42:35 -03:00
Sergio R. Caprile 2dfed10d2e Add FreeRTOS + MIP example on F746 2022-11-25 16:57:35 -03:00
cpq a74d3737dc Fix mip-pcap 2022-11-25 14:23:59 +00:00
cpq 6c82a34aa0 Remove unused code 2022-11-25 10:00:04 +00:00
cpq 320d5656ac Remove unused code 2022-11-25 10:00:04 +00:00
Sergio R. Caprile a4a5778001 Merge pull request #1879 from cesanta/freestdlib
Add stdlib.h to includes in FreeRTOS arch
2022-11-24 10:34:24 -03:00
Sergio R. Caprile a80a003865 Add stdlib.h to includes in FreeRTOS arch 2022-11-24 10:15:03 -03:00
cpq 4607e46c6f Disable mip_test on macos 2022-11-24 07:21:55 +00:00
cpq 0aa3e2e49c Enable macos test 2022-11-24 07:02:17 +00:00
Sergio R. Caprile 595bb36956 Merge pull request #1878 from cesanta/Makefile
be able to flash target
2022-11-23 17:09:05 -03:00
Sergio R. Caprile afdf7e6df3 actually be able to flash target 2022-11-23 16:13:37 -03:00
Sergey Lyubka 3e1c7d7ef2 Merge pull request #1874 from cesanta/makefix
Fix wildcard in Makefile
2022-11-23 10:16:11 +00:00
cpq 7ce7c3deb7 Fix mingw build 2022-11-22 09:50:35 +00:00
Sergio R. Caprile c9b390ec60 Fix wildcard in Makefile 2022-11-21 16:57:15 -03:00
Sergey Lyubka cc2b826356 Merge pull request #1865 from jfsimon1981/master
Implemented MIP stack http_fetch()
2022-11-21 18:35:14 +00:00
Jean-Francois Simon 0b2c493731 Merge branch 'master' of https://github.com/jfsimon1981/mongoose 2022-11-21 15:33:42 +01:00
Jean-Francois Simon 0d7bbc51e7 Implemented MIP stack http_fetch()
This approach used tuntap driver for Linux/Unices
2022-11-21 15:32:45 +01:00
Sergey Lyubka db81c30d24 Merge pull request #1871 from cesanta/straddr
Fix mg_straddr() stack overwrite
2022-11-21 07:00:23 +00:00
cpq 41ea8de0d6 Mark request close for HTTP redirects 2022-11-20 12:18:15 +00:00
Sergio R. Caprile c4b5b37568 Fix mg_straddr() stack overwrite 2022-11-19 19:44:52 -03:00
Sergio R. Caprile 76e6b23a4f Update README.md 2022-11-18 18:06:48 -03:00
Sergio R. Caprile 283e295a98 Merge pull request #1869 from cesanta/miptap
Add missing include
2022-11-18 12:28:59 -03:00
Sergio R. Caprile 606009afb0 Add missing include
linux/if uses struct sockaddr that is defined in sys/socket.h. This breaks building on some systems. It went unnoticed as it was hidden by mongoose.h being included first
2022-11-18 10:51:58 -03:00
Sergey Lyubka da303b8b4f Merge pull request #1858 from cesanta/LAA
change MIP MAC to LAA
2022-11-18 10:41:12 +00:00
Sergey Lyubka d4048661ae Merge pull request #1857 from cesanta/scaprile-patch-1
Update issue_template.md
2022-11-18 10:39:34 +00:00
Sergey Lyubka 47853547ca Merge pull request #1856 from cesanta/zephyr-tests
Zephyr tests
2022-11-18 10:39:13 +00:00
Jean-Francois Simon 6ae9188af4 Implemented MIP stack http_fetch()
This approach used tuntap driver for Linux/Unices
2022-11-16 18:26:49 +01:00
jfsimon1981 d958ec2ac8 Revert "mip_test.c http fetch (#1851)" (#1864)
This reverts commit 07aac8e6e9.
2022-11-16 18:02:23 +01:00
jfsimon1981andJean-Francois Simon 07aac8e6e9 mip_test.c http fetch (#1851)
* Update mip_test.c

* Adding mip_free() function.

* Adding mip_free() function.

* Added MIP free.

* Fixed C++ builds.

* Proper C/C++ struct initialization.

* Squashed commit of the following:

commit 7ba68dd20d
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Wed Nov 16 16:19:50 2022 +0100

    Proper C/C++ struct initialization.

commit aeab3ef7ac
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 17:09:29 2022 +0100

    Fixed C++ builds.

commit 2afd529107
Merge: 14710b81 f8445a4c
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Tue Nov 15 11:33:56 2022 +0100

    Merge branch 'cesanta:master' into master

commit 14710b81e4
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:07:15 2022 +0100

    Added MIP free.

commit 6393cd149d
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:06:44 2022 +0100

    Adding mip_free() function.

commit feee81b733
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:05:55 2022 +0100

    Adding mip_free() function.

commit f8445a4c85
Merge: a39b7ddb 71f5be01
Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
Date:   Fri Nov 11 20:42:38 2022 -0300

    Merge pull request #1853 from cesanta/tibaremetaltest

    Update test.yml

commit 71f5be011b
Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
Date:   Fri Nov 11 20:15:01 2022 -0300

    Update test.yml

commit b53d3cf032
Merge: 7a71038a a39b7ddb
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Fri Nov 11 16:10:53 2022 +0100

    Merge branch 'cesanta:master' into master

commit 7a71038a27
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Fri Nov 11 16:09:22 2022 +0100

    Update mip_test.c

commit a39b7ddbac
Author: cpq <valenok@gmail.com>
Date:   Fri Nov 11 15:03:48 2022 +0000

    Fix fuzzer use-after-poison READ 1

* Squashed commit of the following:

commit 192ae56ece
Merge: 7b0509c8 7ba68dd2
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Wed Nov 16 17:44:03 2022 +0100

    Merge branch 'master' of https://github.com/jfsimon1981/mongoose

commit 7b0509c878
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Wed Nov 16 17:43:33 2022 +0100

    Squashed commit of the following:

    commit 7ba68dd20d
    Author: Jean-Francois Simon <jfsimon@startmail.com>
    Date:   Wed Nov 16 16:19:50 2022 +0100

        Proper C/C++ struct initialization.

    commit aeab3ef7ac
    Author: Jean-Francois Simon <jfsimon@startmail.com>
    Date:   Tue Nov 15 17:09:29 2022 +0100

        Fixed C++ builds.

    commit 2afd529107
    Merge: 14710b81 f8445a4c
    Author: jfsimon1981 <jfsimon1981@gmail.com>
    Date:   Tue Nov 15 11:33:56 2022 +0100

        Merge branch 'cesanta:master' into master

    commit 14710b81e4
    Author: Jean-Francois Simon <jfsimon@startmail.com>
    Date:   Tue Nov 15 11:07:15 2022 +0100

        Added MIP free.

    commit 6393cd149d
    Author: Jean-Francois Simon <jfsimon@startmail.com>
    Date:   Tue Nov 15 11:06:44 2022 +0100

        Adding mip_free() function.

    commit feee81b733
    Author: Jean-Francois Simon <jfsimon@startmail.com>
    Date:   Tue Nov 15 11:05:55 2022 +0100

        Adding mip_free() function.

    commit f8445a4c85
    Merge: a39b7ddb 71f5be01
    Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
    Date:   Fri Nov 11 20:42:38 2022 -0300

        Merge pull request #1853 from cesanta/tibaremetaltest

        Update test.yml

    commit 71f5be011b
    Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
    Date:   Fri Nov 11 20:15:01 2022 -0300

        Update test.yml

    commit b53d3cf032
    Merge: 7a71038a a39b7ddb
    Author: jfsimon1981 <jfsimon1981@gmail.com>
    Date:   Fri Nov 11 16:10:53 2022 +0100

        Merge branch 'cesanta:master' into master

    commit 7a71038a27
    Author: jfsimon1981 <jfsimon1981@gmail.com>
    Date:   Fri Nov 11 16:09:22 2022 +0100

        Update mip_test.c

    commit a39b7ddbac
    Author: cpq <valenok@gmail.com>
    Date:   Fri Nov 11 15:03:48 2022 +0000

        Fix fuzzer use-after-poison READ 1

commit 7ba68dd20d
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Wed Nov 16 16:19:50 2022 +0100

    Proper C/C++ struct initialization.

commit aeab3ef7ac
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 17:09:29 2022 +0100

    Fixed C++ builds.

commit 2afd529107
Merge: 14710b81 f8445a4c
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Tue Nov 15 11:33:56 2022 +0100

    Merge branch 'cesanta:master' into master

commit 14710b81e4
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:07:15 2022 +0100

    Added MIP free.

commit 6393cd149d
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:06:44 2022 +0100

    Adding mip_free() function.

commit feee81b733
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:05:55 2022 +0100

    Adding mip_free() function.

commit f8445a4c85
Merge: a39b7ddb 71f5be01
Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
Date:   Fri Nov 11 20:42:38 2022 -0300

    Merge pull request #1853 from cesanta/tibaremetaltest

    Update test.yml

commit 71f5be011b
Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
Date:   Fri Nov 11 20:15:01 2022 -0300

    Update test.yml

commit b53d3cf032
Merge: 7a71038a a39b7ddb
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Fri Nov 11 16:10:53 2022 +0100

    Merge branch 'cesanta:master' into master

commit a39b7ddbac
Author: cpq <valenok@gmail.com>
Date:   Fri Nov 11 15:03:48 2022 +0000

    Fix fuzzer use-after-poison READ 1

Co-authored-by: Jean-Francois Simon <jfsimon@startmail.com>
2022-11-16 17:55:27 +01:00
Sergio R. Caprile 9a341c9032 change MIP MAC to LAA 2022-11-15 14:56:51 -03:00
Sergio R. Caprile 21e8b08ed9 Reduce Zephyr test time 2022-11-14 18:06:00 -03:00
Sergio R. Caprile c41d477adc Update issue_template.md 2022-11-14 14:58:36 -03:00
Sergio R. Caprile f8445a4c85 Merge pull request #1853 from cesanta/tibaremetaltest
Update test.yml
2022-11-11 20:42:38 -03:00
Sergio R. Caprile 71f5be011b Update test.yml 2022-11-11 20:15:01 -03:00
cpq a39b7ddbac Fix fuzzer use-after-poison READ 1 2022-11-11 15:03:48 +00:00
Sergio R. Caprile cab5c822c5 Merge pull request #1850 from cesanta/miplocal
Fix incorrect local network address detection
2022-11-11 11:58:29 -03:00
Sergey Lyubka 4056bd3c2d Merge pull request #1847 from cesanta/xiao
Fix arduino-xiao build and add GA test
2022-11-11 14:53:40 +00:00
Sergio R. Caprile a985ae9c0a Fix incorrect local network address detection 2022-11-11 11:18:47 -03:00
cpq 804a3bf380 Fix #1801 - report ipv4 accepted address for ipv4 listeners 2022-11-11 14:01:17 +00:00
Sergey Lyubka a8bef96463 Merge pull request #1844 from cesanta/tm4c129x
Add TM4C129x driver
2022-11-11 13:15:35 +00:00
Sergey Lyubka 5e43a3f695 Merge pull request #1846 from cesanta/ektm4c129x
Add EK-TM4C1294XL example
2022-11-11 13:15:20 +00:00
cpq 8e46e05e1b Fix arduino-xiao build and add GA test 2022-11-11 10:04:47 +00:00
Sergio R. Caprile ec0e27dbb4 Add EK-TM4C1294XL example 2022-11-10 21:14:30 -03:00
Sergio R. Caprile 3f55d93b41 Merge pull request #1845 from cesanta/mip-tap
Unbreak
2022-11-10 15:01:10 -03:00
Sergio R. Caprile 5418a8c28a Unbreak
userdata was changed to a pointer to a socket, but tx() was not updated

My Linux system does not like mongoose.h at the end...
2022-11-10 15:00:43 -03:00
Sergio R. Caprile e180192379 Add TM4C129x driver 2022-11-10 14:41:41 -03:00
cpq f498d69b7d Fix examples/stm32/nucleo-f429zi-freertos-mip 2022-11-10 03:01:10 +00:00
Sergio R. Caprile dfae1b3f70 Merge pull request #1843 from cesanta/mip
Expose mip guts
2022-11-09 17:40:46 -03:00
Sergio R. Caprile a9ebb55f95 Merge pull request #1842 from cesanta/ft
Add nucleo-f429zi-freertos-mip example
2022-11-09 16:28:33 -03:00
cpq abfac8aa40 Expose mip guts 2022-11-09 19:25:40 +00:00
cpq 78956ccf83 Add nucleo-f429zi-freertos-mip example 2022-11-09 18:25:11 +00:00
Sergey Lyubka eed25f23f6 Merge pull request #1839 from cesanta/stm32uart
Fix wrong reference to prescaler
2022-11-09 09:24:24 +00:00
Sergey Lyubka 134ce56f80 Merge pull request #1841 from cesanta/small
Endianness test
2022-11-09 09:23:04 +00:00
cpq 28a4778187 Endianness test 2022-11-09 09:20:15 +00:00
Sergio R. Caprile c654c2e5e8 Fix wrong reference to prescaler 2022-11-08 11:23:10 -03:00
Sergey Lyubka e580d4e637 Merge pull request #1837 from cesanta/arch
Create MG_ARCH_FREERTOS, MG_ENABLE_LWIP, MG_ENABLE_FREERTOS_TCP. Remo…
2022-11-08 00:13:28 +00:00
cpq 2192914cbb Create MG_ARCH_FREERTOS, MG_ENABLE_LWIP, MG_ENABLE_FREERTOS_TCP. Remove MG_ARCH_FREERTOS_TCP, MG_ARCH_RTX_LWIP 2022-11-07 23:58:58 +00:00
Sergio R. Caprile ca6dee1777 Merge pull request #1836 from cesanta/dewarning
Remove some warnings
2022-11-07 15:29:33 -03:00
Sergio R. Caprile 6f3bdc5dca Remove some warnings 2022-11-07 15:23:47 -03:00
Sergey Lyubka 095cdcd69e Merge pull request #1834 from cesanta/sock
Generalize socket constants
2022-11-05 13:11:57 +00:00
cpq f022633f29 Generalize socket constants 2022-11-05 12:33:49 +00:00
Sergey Lyubka 1f85fcc9b0 Merge pull request #1831 from cesanta/mqtt
Accept zero-length payload messages
2022-11-03 16:46:56 +00:00
Sergio R. Caprile a3ede75842 Accept zero-length payload messages 2022-11-03 11:26:08 -03:00
cpq 0defce37f0 Pull mongoose_custom.h 2022-11-03 12:59:55 +00:00
Sergey Lyubka 4355b39b1e Merge pull request #1830 from cesanta/mip
ARP lookup hosts in the same net. Use up-to-date code in zephyr dash …
2022-11-03 12:35:17 +00:00
cpq efec738c89 ARP lookup hosts in the same net. Use up-to-date code in zephyr dash example 2022-11-03 08:06:17 +00:00
Sergey Lyubka 10c09a361b Merge pull request #1829 from cesanta/cr
CR incorrectly set in STM32 driver
2022-11-02 23:18:20 +00:00
Sergio R. Caprile e3d1a69223 CR incorrectly set in STM32 driver 2022-11-02 19:25:05 -03:00
Sergey Lyubka 4b82253ae9 Merge pull request #1826 from cesanta/custom
mongoose_custom.h not pulled in when MG_ARCH=MG_ARCH_CUSTOM
2022-11-02 12:05:59 +00:00
Sergio R. Caprile 47a12c30ca mongoose_custom.h not pulled in when MG_ARCH=MG_ARCH_CUSTOM 2022-11-01 21:01:33 -03:00
cpq 613655767b Housekeeping at the end of c->label 2022-11-01 21:01:03 +00:00
Sergey Lyubka 1182027f1c Merge pull request #1823 from cesanta/ti-rtos
Fix TI-RTOS port
2022-10-30 09:41:48 +00:00
Sergio R. Caprile e9421d557a Fix TI-RTOS port
Sockets were not being put in non-blocking mode as the setsockopt() call wasn't using SOL_SOCKET
Do not include errno.h but serrno.h, otherwise error codes are mangled... NDK functions use serrno, errno belongs to the compiler
UDP sockets require binding to receive responses
select() does not return write-ready on connect if the amount of bytes to write is below the "low-water mark". This parameter defaults to 2048, there was some code apparently setting this otherwise, with no success. Reworked the code to set this water mark at half the buffer size by just using plain getsockopt/setsockopt calls.

For the record:
	TI typedef's void * SOCKET for internal use, INVALID_SOCKET is cast to (void *). Their BSD compatible socket interface expects and returns int; while Mongoose uses SOCKET... this generates lots of warnings 169 and 515, disabled in the examples
2022-10-28 18:55:10 -03:00
cpq bbc0c0df94 Unbreak test 2022-10-28 15:35:40 +01:00
Sergio R. Caprile 610e32714c Merge pull request #1822 from cesanta/hello
Add mg_hello()
2022-10-28 09:48:43 -03:00
cpq 7ab81d3805 Add mg_hello() 2022-10-28 10:57:06 +01:00
Sergey Lyubka 9a1e41e1fa Merge pull request #1821 from cesanta/docs
Augment WS documentation
2022-10-27 23:09:47 +01:00
Sergio R. Caprile ae71d12f06 Augment WS documentation 2022-10-27 12:03:16 -03:00
cpq c25234df83 Better MIP description 2022-10-27 08:12:22 +01:00
Sergey Lyubka 03284ba046 Merge pull request #1810 from cesanta/zephyresp
Support Zephyr on ESP32
2022-10-25 17:22:47 +01:00
Sergey Lyubka 5fa433ecca Merge pull request #1814 from cesanta/ti-rtos
Improve TI-RTOS timing support
2022-10-25 17:07:33 +01:00
Sergio R. Caprile ac2a4c700a Merge pull request #1818 from cesanta/ti
Allow flash and cloning without build
2022-10-25 10:55:46 -03:00
Sergio R. Caprile eeb7b00f60 Allow flash and cloning without build 2022-10-25 10:41:53 -03:00
Sergio R. Caprile c8c540b453 Improve TI-RTOS timing support 2022-10-24 11:48:54 -03:00
Sergio R. Caprile a0585f75f7 Support Zephyr on ESP32 2022-10-21 11:44:09 -03:00
Sergey Lyubka 637af1d392 Merge pull request #1809 from cesanta/picow
Make pico-w device-dashboard example fully functional
2022-10-20 18:24:38 +01:00
Sergio R. Caprile fe6c31acc1 Make pico-w device-dashboard example fully functional 2022-10-20 11:57:00 -03:00
Sergio R. Caprile 04cfcf751e Merge pull request #1805 from cesanta/invsock
Fix unintended socket close on systems with valid fd=0 descriptor numbering
2022-10-20 11:04:03 -03:00
Sergio R. Caprile 51c51d49ad Fix unintended socket close on systems with valid fd=0 descriptor numbering 2022-10-20 10:34:26 -03:00
cpq 4271aa5b1f Update matrix example name 2022-10-19 09:24:19 +01:00
cpq 17ada1c894 Fix #1803 - conditional for SSL_set1_host(). In unit test, disable time.windows.com, use google and apple SNTP servers 2022-10-19 09:06:47 +01:00
cpq 2e14d125ba Fuzzer nits 2022-10-18 15:21:59 +01:00
cpq ce8fa4c24b Echo WS CLOSE payload back 2022-10-18 14:31:47 +01:00
Sergey Lyubka cfe2e83e6b Merge pull request #1798 from Yeicor/patch-1
Remove mg_hexdump from deliver_chunked_chunks
2022-10-17 07:14:24 +01:00
Yeicor b17c62618d Remove mg_hexdump from deliver_chunked_chunks 2022-10-16 21:11:00 +02:00
Sergey Lyubka 6b162a1193 Merge pull request #1796 from cesanta/rpicow
Dettach git clone and fix clean
2022-10-16 16:59:19 +01:00
Sergey Lyubka 6653530b63 Merge pull request #1797 from strager/fix-typo
Fix typo in documentation
2022-10-16 16:58:20 +01:00
cpq aacae6444e Fix stack overflow in fuzzer - too big on-stack array 2022-10-15 17:18:31 +01:00
Matthew "strager" Glazar b91fe12258 Fix typo in documentation 2022-10-14 18:27:06 -07:00
Sergio R. Caprile ae7ca00e69 Dettach git clone and fix clean
The user has to clone the repo, then edit the Makefile to change WiFi credentials. Running make build does both and the tests go flawlessly
The user can run make to clone the repo, then change credentials and run make build, it will skip cloning if the repo is already there

In some systems the compiled files are not owned by the user as Docker runs as root, so we first invoke clean in the cloned repo (which erases the compiled files), and then remove the cloned repo that the user owns and can rm.
2022-10-14 12:09:39 -03:00
Sergio R. Caprile 0103f1f080 Merge pull request #1795 from cesanta/z
Use board nucleo_f429zi
2022-10-14 08:54:20 -03:00
cpq e8d29d54d6 Use board nucleo_f429zi 2022-10-14 11:39:00 +01:00
Sergey Lyubka 092f2ce0b3 Merge pull request #1794 from cesanta/addMissingTests
Update test.yml
2022-10-11 07:37:53 +01:00
Sergio R. Caprile d89233276b Update test.yml 2022-10-10 17:16:42 -03:00
Sergio R. Caprile 7d797187e8 Merge pull request #1793 from cesanta/device-dashboard
fix paths in Makefile (like other examples)
2022-10-10 17:01:43 -03:00
Sergio R. Caprile 6edcc72364 fix paths in Makefile 2022-10-10 16:51:07 -03:00
Sergey Lyubka 250dfc1377 Merge pull request #1790 from cesanta/zephyr-device-dashboard
Add device-dashboard example on Zephyr
2022-10-10 15:59:08 +01:00
Sergey Lyubka 45489c1c87 Merge pull request #1789 from zudwalex/picow
Add Pico-W example
2022-10-10 15:58:53 +01:00
Sergey Lyubka 09b250f189 Merge pull request #1787 from cesanta/zephyr
Update Zephyr examples
2022-10-10 15:58:39 +01:00
cpq a84465ddba Use MG_SOCK_LISTEN_BACKLOG_SIZE -> 128 for FreeRTOS-TCP 2022-10-10 13:41:07 +01:00
Sergey Lyubka 3b95671442 Merge pull request #1791 from zahar517/fix-json-rpc-example
Fix json-rpc-over-ws example
2022-10-10 10:35:29 +01:00
zahar517 52e66077a7 Fix json-rpc-over-ws example 2022-10-08 14:39:01 +03:00
Sergio R. Caprile 84bf4d21a3 Add device-dashboard example on Zephyr 2022-10-07 11:52:31 -03:00
Alex Alashkin 04cfc510d0 Add Pico-W example 2022-10-07 09:11:35 +03:00
Sergio R. Caprile d846e67ec1 Update Zephyr examples 2022-10-06 17:30:27 -03:00
Sergio R. Caprile 9c60a1bc10 Merge pull request #1788 from cesanta/mod-tests4zephyr
Update test.yml
2022-10-06 17:11:30 -03:00
Sergio R. Caprile f06ac52a43 Update test.yml 2022-10-06 16:55:13 -03:00
Sergio R. Caprile 9e5fd43a2d Update test.yml 2022-10-06 16:46:26 -03:00
Sergio R. Caprile 8d50e7dc82 Update test.yml 2022-10-06 16:32:33 -03:00
cpq 1e6b7bd2a6 Fix broken link 2022-10-05 11:49:06 +01:00
Sergey Lyubka 8346be7a81 Merge pull request #1783 from cesanta/zephyr
Update to latest Zephyr and their Docker repo
2022-10-05 11:41:55 +01:00
Sergey Lyubka 9dc5683fc2 Merge pull request #1785 from cesanta/device-dashboard
rename time() to ourtime()
2022-10-05 11:40:08 +01:00
Sergio R. Caprile e7cb82175a rename time() to ourtime() 2022-10-04 19:27:38 -03:00
Sergio R. Caprile 1ef0aa14c0 Update to latest Zephyr and their Docker repo 2022-10-04 17:24:13 -03:00
cpq 0b3f6d6aab Use CC for fuzzer, not CXX 2022-09-30 11:44:50 +01:00
Sergey Lyubka 0beef1d770 Merge pull request #1781 from jameshilliard/update-spdx
Update GPL license identifier
2022-09-29 20:29:07 +01:00
James Hilliard b944db30fd Update GPL license identifier
GPL-2.0 was deprecated in favor of GPL-2.0-only.

GPL-2.0+ was deprecated in favor of GPL-2.0-or-later.

See: https://spdx.org/licenses/
2022-09-29 15:18:10 -04:00
cpq 6cf3a3feaf Fix fuzzer 2022-09-29 19:31:52 +01:00
cpq 9680b8ccb3 Fix overflow in rx_icmp 2022-09-29 16:53:11 +01:00
cpq a88a11c243 Fix TX overflow in rx_icmp() 2022-09-29 11:13:40 +01:00
Sergey Lyubka 7ff76f69a1 Merge pull request #1777 from jameshilliard/disable-big-endian
Disable broken 32 bit tests and enable 32 bit little endian tests.
2022-09-29 07:33:15 +01:00
James Hilliard c2e4e6d221 Disable broken 32 bit tests and enable 32 bit little endian tests.
It appears there's a bunch of endian specific failing 32 bit tests.
2022-09-28 22:18:08 -06:00
Sergey Lyubka 60edc456a9 Merge pull request #1774 from cesanta/smtp-client
Fix wrong ca.pem path +
2022-09-28 21:58:20 +01:00
Sergey Lyubka 625f804130 Merge pull request #1776 from jameshilliard/32-bit-bigendian
Also test on 32 bit big endian ppc
2022-09-28 21:56:37 +01:00
Sergey Lyubka 7100aaedec Merge pull request #1775 from cesanta/endian
Fix endianness issues in unit test
2022-09-28 21:55:46 +01:00
James Hilliard c867dbc7b2 Also test on 32 bit big endian ppc 2022-09-28 16:02:32 -04:00
cpq 88097f1829 Fix endianness issues in unit test 2022-09-28 20:22:09 +01:00
Sergio R. Caprile 7cf4834336 Fix wrong ca.pem path
Remove extra EHLO before AUTH (there were two)
2022-09-28 16:05:29 -03:00
Sergey Lyubka b5355307a3 Merge pull request #1767 from jameshilliard/bigendian-tests
Test on big endian CPU architectures
2022-09-28 08:08:38 +01:00
James Hilliard 76f693e5d7 Test on big endian CPU architectures 2022-09-26 05:16:49 -04:00
Sergey Lyubka fb3b0ca6e3 Merge pull request #1765 from jameshilliard/rpc-add-calloc-null
Fix null pointer dereference in mg_rpc_add()
2022-09-25 23:22:57 +01:00
James Hilliard 3c71977e2e Fix null pointer dereference in mg_rpc_add()
Fixes #1736
2022-09-25 14:08:58 -04:00
cpq 5574a2663a Close connection on 3 keep-alive misses 2022-09-25 17:35:14 +01:00
cpq 41960b4212 Optimize fuzzer 2022-09-25 11:58:28 +01:00
Sergey Lyubka 6a500b8d40 Merge pull request #1764 from cesanta/fuzz
Optimize fuzzer
2022-09-25 10:31:21 +01:00
Sergey Lyubka dcede59379 Merge pull request #1743 from cesanta/stm32-nucleo-f746z
Stm32 nucleo f746z
2022-09-25 10:22:52 +01:00
Sergey Lyubka 695153c527 Merge pull request #1762 from gdawg/ssdp-example-fix-dupe-responses
Fix SSDP example for second and subsequent responses
2022-09-25 10:20:55 +01:00
cpq c409cca20e Optimize fuzzer 2022-09-25 10:19:17 +01:00
Sergey Lyubka a5a9204f83 Merge pull request #1754 from cesanta/iobuf_init
issue #1734, avoid passing null ptr to memmove
2022-09-24 07:18:42 +01:00
Andrew Griffiths 25d42ad345 Fix SSDP example for second and subsequent responses 2022-09-24 14:14:26 +10:00
Sergio R. Caprile f70a407611 issue #1734, avoid passing null ptr to memmove 2022-09-23 19:34:36 -03:00
Sergio R. Caprile 89f2e66c80 Merge pull request #1752 from cesanta/asan
Activate asan for mip_test
2022-09-23 09:45:18 -03:00
Sergio R. Caprile 4562be52d4 Merge pull request #1753 from cesanta/mg_vprintf
Get rid of va_copy
2022-09-23 09:30:09 -03:00
cpq ebd931f7af Get rid of va_copy 2022-09-23 08:59:02 +01:00
cpq 6a47ff6422 Activate asan for mip_test 2022-09-23 08:35:59 +01:00
cpq 1237185bb4 MIP: atomic -> volatile. Add lease time 2022-09-22 17:16:52 +01:00
Sergio R. Caprile d7fe819699 Merge pull request #1751 from cesanta/stm32-nucleo-f746zg
Add new example as per the tutorial
2022-09-22 12:00:15 -03:00
Sergio R. Caprile 770ffd1483 Add new example as per the tutorial 2022-09-22 11:32:52 -03:00
Sergio R. Caprile 9373e77636 Update Makefile as per the tutorial, enhance it 2022-09-22 11:01:40 -03:00
cpq cb5034548d Fix oob read in rx_dhcp() 2022-09-22 13:42:17 +01:00
Sergey Lyubka f9ad870ff0 Merge pull request #1750 from cesanta/make
Optimize makefile
2022-09-22 13:26:57 +01:00
cpq b538bc3871 Optimize makefile 2022-09-22 12:55:45 +01:00
Sergey Lyubka e5b0528aca Merge pull request #1742 from cesanta/mip-fuzz
Fuzzing MIP
2022-09-21 21:15:50 +01:00
cpq a12bd2271e Fuzzing MIP 2022-09-21 20:29:49 +01:00
Sergey Lyubka 15c5858732 Merge pull request #1746 from cesanta/dtoa
Fix issue #1733
2022-09-21 17:48:06 +01:00
Sergio R. Caprile dd4227f444 Fix issue #1733 2022-09-21 11:38:39 -03:00
Sergey Lyubka fe8a7d8db9 Merge pull request #1748 from cesanta/va_end
Fix issue #1735
2022-09-21 09:43:47 +01:00
Sergey Lyubka ec79ca71b2 Merge pull request #1747 from cesanta/timer_add
Fix issue #1737
2022-09-21 07:16:27 +01:00
Sergio R. Caprile 7a1544e76a Fix issue #1735 2022-09-20 14:26:06 -03:00
Sergio R. Caprile 27ffc23664 Fix issue #1737 2022-09-20 13:54:17 -03:00
Sergio R. Caprile 8ef8ee91e9 Merge pull request #1745 from cesanta/tls-hs
Update README.md with TLS_HS event
2022-09-20 10:53:27 -03:00
Sergio R. Caprile 571625f0c3 Update README.md 2022-09-20 10:52:45 -03:00
Sergio R. Caprile fc2d6eb6bb Merge pull request #1744 from cesanta/smtp
Add smtp client example
2022-09-20 10:38:16 -03:00
cpq 48800504be Add smtp client example 2022-09-20 11:34:22 +01:00
Sergey Lyubka f94a019733 Merge pull request #1741 from cesanta/tls
Fix mbedtls MG_IO_WAIT case
2022-09-19 14:06:31 +01:00
cpq 535d8b9e02 Fix mbedtls MG_IO_WAIT case 2022-09-19 13:38:59 +01:00
Sergey Lyubka 161d44ee04 Merge pull request #1730 from cesanta/stm32-nucleo-f429z
Update Makefile as per the tutorial
2022-09-13 21:46:41 +01:00
Sergey Lyubka 7ea155b943 Merge pull request #1729 from cesanta/mip-tap
Add example to use TAP interface on Linux
2022-09-13 21:46:06 +01:00
Sergio R. Caprile 30acef2452 Merge pull request #1727 from cesanta/mdc
Pass MDC clock divider explicitly rather than guess
2022-09-12 20:43:00 -03:00
cpq 82b50fd3a5 Pass MDC clock divider explicitly rather than guess 2022-09-12 23:57:04 +01:00
Sergio R. Caprile 9e5503dd04 Update Makefile as per the tutorial 2022-09-12 17:29:47 -03:00
Sergio R. Caprile 2ec2ed62c8 Add example to use TAP interface on Linux 2022-09-12 10:52:23 -03:00
cpq 274c11c3ec Update README 2022-09-11 13:42:59 +01:00
cpq 76c4bb556f Update README 2022-09-11 11:23:58 +01:00
cpq 40f484cc54 Update README 2022-09-11 11:20:53 +01:00
cpq 85b701b8c2 Formatting 2022-09-10 21:49:20 +01:00
Sergey Lyubka 7e875ba89d Merge pull request #1726 from cesanta/qp
Add MAC addr filtering to stm32 driver. Record free space in q profiler
2022-09-10 18:19:36 +01:00
cpq c718d7999f Add MAC addr filtering to stm32 driver. Record free space in q profiler 2022-09-10 16:38:03 +01:00
Sergey Lyubka d1472992da Merge pull request #1725 from cesanta/qprofile
Add irq and drop counters to qprofiler
2022-09-09 20:19:19 +01:00
Sergio R. Caprile 995f90aa49 Add irq and drop counters to qprofiler 2022-09-09 14:47:46 -03:00
Sergio R. Caprile a4c27618b4 Update README.md 2022-09-09 14:10:48 -03:00
Sergio R. Caprile 05019529f1 Merge pull request #1724 from cesanta/mgread
Pass long *bytes_read to MG_EV_READ
2022-09-09 14:09:50 -03:00
Sergio R. Caprile 1b5ab3261c Merge pull request #1722 from cesanta/mip-tls
Add mbedtls support to MIP
2022-09-09 14:09:19 -03:00
Sergey Lyubka 6033555ac0 Merge pull request #1723 from cesanta/pcap
Added Linux howto
2022-09-09 17:43:53 +01:00
cpq fd4e1975a3 Pass long *bytes_read to MG_EV_READ 2022-09-09 17:09:18 +01:00
cpq 124ac12150 Add mbedtls support to MIP 2022-09-09 15:53:42 +01:00
Sergio R. Caprile 8c1ffa3f5d Added Linux howto 2022-09-09 10:42:46 -03:00
cpq f76a7e36e8 Corrected MacOS setup diagram 2022-09-08 12:11:01 +01:00
cpq 6484c4bc8b Updated description 2022-09-08 12:09:30 +01:00
cpq bba2421ba9 Corrected MacOS setup diagram 2022-09-08 11:36:01 +01:00
cpq 3c69c7feaf Add MacOS setup diagram 2022-09-08 11:28:16 +01:00
cpq 45b2ffe1af Use DMG_HTTP_DIRLIST_TIME 2022-09-08 11:02:32 +01:00
cpq a57c0f4700 Fix #1712 - JSON parsing for keys with arrays 2022-09-08 10:59:23 +01:00
Sergey Lyubka c33116166f Merge pull request #1720 from cesanta/qprofile
Add rudimentary queue profiler
2022-09-08 10:37:01 +01:00
Sergey Lyubka 50a2063e45 Merge pull request #1713 from behnejad/master
display file modify date in "%Y/%m/%d %H:%M:%S".
2022-09-08 08:55:22 +01:00
cpq cd30cf2d6c Fix #1710 - free MIP in mg_mgr_free() 2022-09-08 08:53:54 +01:00
cpq 419126652e Merge branch 'master' of github.com:cesanta/mongoose 2022-09-08 08:50:51 +01:00
cpq 06ab83dca6 Implement keep-alive, 45 sec interval. Correct ACK piggyback 2022-09-08 08:50:42 +01:00
Sergio R. Caprile 313fddf722 Add rudimentary queue profiler
ETH IRQ and mip_poll() can both write to the queue, so if a memcpy() is interrupted we might see some weird records.
2022-09-07 17:14:03 -03:00
Sergey Lyubka f4def36ccb Merge pull request #1717 from cesanta/fixmipq
Fix MIP Q
2022-09-07 20:59:12 +01:00
Sergey Lyubka 4be8f2ba93 Merge pull request #1719 from cesanta/testq
Make mip_test fail with current queue algo
2022-09-07 20:58:29 +01:00
cpq 881b282604 Implement ack timer 2022-09-07 20:48:23 +01:00
Sergio R. Caprile 9675bfe07d Fix MIP Q 2022-09-07 14:59:58 -03:00
Sergio R. Caprile 443351e95a Make mip_test fail with current queue algo 2022-09-07 14:46:36 -03:00
Behnejad d4cd1c61ee fixing defines. 2022-09-07 22:08:50 +04:30
cpq 75892cb523 Add %f to src/fmt.c 2022-09-07 15:09:52 +01:00
Sergey Lyubka 63e0041644 Merge pull request #1715 from davidhozic/feature/1714
Bug Fix #1714
2022-09-07 15:03:51 +01:00
Sergey Lyubka 70e2d8dd4e Merge pull request #1716 from cesanta/pcap
Make mip-pcap work on Mac
2022-09-07 13:36:14 +01:00
cpq b2624f6055 Make mip-pcap work on Mac 2022-09-07 13:36:00 +01:00
David Hozic 0bb8144677 Bug Fix #1714 2022-09-07 13:35:32 +02:00
Behnejad ad50447ec6 display file modify date in "%Y/%m/%d %H:%M:%S".
adding compile time option to display file modification date as "%Y/%m/%d %H:%M:%S" in http directory indexing.
2022-09-07 09:04:15 +04:30
Sergey Lyubka 84de7437c6 Merge pull request #1711 from cesanta/ethrxsz
Fix Ethernet buffer size
2022-09-06 22:29:23 +01:00
Sergio R. Caprile 419dd50255 Fix Ethernet buffer size
1500 bytes is payload size, which is OK for tx. On the rx side, a full 802.1Q-tagged frame size is 1522 bytes, without the 4-byte CRC = 1518 bytes (1514 for non-VLAN-tagged frames).
2022-09-06 16:53:26 -03:00
Sergio R. Caprile 9dea02e578 Merge pull request #1708 from cesanta/ack
Add mip test
2022-09-05 12:11:24 -03:00
cpq 1c181e091e Add mip test 2022-09-05 15:56:03 +01:00
Sergio R. Caprile 32782bab0e Merge pull request #1706 from cesanta/mg_timer_expired
Introduce mg_timer_expired(). Adopt DHCP and link status to use it
2022-09-05 11:45:53 -03:00
cpq 330783cb5a Corrected clean and examples targets 2022-09-05 14:14:50 +01:00
Sergio R. Caprile 504b004e01 Merge pull request #1707 from cesanta/comments
Use single-line comments
2022-09-05 09:05:28 -03:00
cpq edb861da70 docs 2022-09-05 12:29:06 +01:00
cpq 64ad15895f Small nit in minimal HTTP server example 2022-09-05 12:26:43 +01:00
cpq 44b4944334 Use single-line comments 2022-09-03 09:49:41 +01:00
cpq f9272d0959 Introduce mg_timer_expired(). Adopt DHCP and link status to use it 2022-09-03 09:45:19 +01:00
Sergey Lyubka a113e344a1 Merge pull request #1704 from cesanta/acknow
Re-enable sending ACKs until proper mechanism is in place
2022-09-03 07:46:43 +01:00
Sergey Lyubka 2d80f03f01 Merge pull request #1705 from lionsoul2014/master
fix the doc error: htts to https
2022-09-03 07:44:01 +01:00
lion 542fe9f029 fix the doc error: htts to https 2022-09-03 10:51:09 +08:00
Sergio R. Caprile a1992f5910 Re-enable sending ACKs until proper mechanism is in place 2022-09-02 20:48:30 -03:00
Sergey Lyubka 45a057b0c6 Merge pull request #1703 from cesanta/stm32driver
Extend explanation for MDC clock
2022-09-02 20:02:05 +01:00
Sergio R. Caprile 4a1a26e8b7 Extend explanation for MDC clock 2022-09-02 15:03:46 -03:00
Sergey Lyubka db35e6a427 Merge pull request #1702 from cesanta/stm32driver
Add CR setup, set MDC based on HCLK
2022-09-02 18:46:31 +01:00
Sergio R. Caprile 7358ed25a5 Add CR setup, set MDC based on HCLK 2022-09-02 14:02:02 -03:00
cpq 0d385c29a3 More JSON tests 2022-09-02 16:23:39 +01:00
Sergey Lyubka 51076e68c8 Merge pull request #1701 from cesanta/enableFPU
Enable FPU
2022-09-02 15:46:00 +01:00
Sergio R. Caprile 3270f1252b Enable FPU 2022-09-02 11:18:11 -03:00
Sergey Lyubka d8ee105e1e Merge pull request #1699 from cesanta/scb
Fix SCB address for scb struct
2022-09-02 14:09:08 +01:00
cpq 567fccd7ee Refactor W5500 driver, add arduino w5500 example 2022-09-02 12:58:54 +01:00
cpq f7f7319698 Refactor W5500 driver, add arduino w5500 example 2022-09-02 12:58:54 +01:00
Sergio R. Caprile 62a6b61fc9 Fix SCB address for scb struct 2022-09-01 17:14:31 -03:00
Sergey Lyubka 1a87d9fa77 Merge pull request #1698 from oakfire/master
Fix mg_json_get for the array element result not as expected.
2022-09-01 09:14:10 +01:00
oakfire 8131e30002 Fix mg_json_get for the array element result not as expected. 2022-09-01 15:02:17 +08:00
cpq 83c76bdafc Make mongoose_custom.h a local include, for Arduino builds 2022-08-31 18:20:34 +01:00
cpq cf1566e116 Add more comments in json code 2022-08-31 17:59:04 +01:00
Sergey Lyubka 5d2c977029 Merge pull request #1697 from oakfire/master
fix: #1696  mg_json_get() bugs.
2022-08-31 17:55:12 +01:00
cpq 823c0ef5fb Add enc28j60 driver skeleton 2022-08-31 08:54:33 +01:00
cpq aefc588e6e Unbreak win98 build 2022-08-31 08:53:22 +01:00
cpq 1949439d69 Adopt mip changes 2022-08-31 08:44:05 +01:00
cpq c131b8daf1 struct mip_ipcfg -> struct mip_cfg 2022-08-31 08:41:16 +01:00
cpq 8a61969c8f Add struct mip_spi for SPI drivers, and skeleton for enc28j60 driver 2022-08-31 08:35:06 +01:00
Sergey Lyubka 3cf85770c7 Merge pull request #1694 from cesanta/nucleo-f746zg-baremetal
Group clock setup dependencies
2022-08-30 12:25:41 +01:00
Sergey Lyubka 310b339f0d Merge pull request #1691 from cesanta/docs
Moved packed filesystem section out of the docs
2022-08-30 12:24:30 +01:00
Sergey Lyubka 229b7810df Merge pull request #1695 from cesanta/nucleo-f429zi-baremetal
Add baremetal example on Nucleo-F429ZI
2022-08-30 12:24:15 +01:00
oakfire a686beb9a7 fix: #1696 mg_json_get() bugs. 2022-08-30 14:22:58 +08:00
Sergio R. Caprile 42c1bee8ea Add baremetal example on Nucleo-F429ZI 2022-08-29 19:20:20 -03:00
Sergio R. Caprile c289556775 Group clock setup dependencies 2022-08-29 14:36:40 -03:00
Sergio R. Caprile 941d2f2a3e Moved packed filesystem section out of the docs (relevant parts into the tutorial) 2022-08-29 10:43:29 -03:00
cpq 0a265e79a6 Remove debug log and add a comment 2022-08-29 13:10:11 +01:00
cpq 7f30c01c58 Correct condition check sequence for the prev fix 2022-08-29 13:01:56 +01:00
cpq 0661f5921a Fix #1690 - mg_json_get for keys with the same prefix 2022-08-29 12:40:50 +01:00
cpq 1c16e95b3a Fix driver link 2022-08-29 08:55:53 +01:00
cpq 44efa45d75 7.8 2022-08-28 14:11:08 +01:00
cpq ef89776517 Add reponse end to the http dir list 2022-08-28 13:58:41 +01:00
cpq 2f3f1357c8 Unbreak after mip init API change 2022-08-27 17:15:11 +01:00
cpq dcdeffff9a MIP refactor: use mg_hton*, move driver_data to ifp, parametrise f746 PLL setup 2022-08-27 16:45:31 +01:00
cpq 229b492ccc Minor refactorings, reduced MG_HTTP_MAX_HEADERS 40 -> 30 to reduce stack usage 2022-08-27 12:31:43 +01:00
cpq 2d45ba1981 Merge branch 'master' of github.com:cesanta/mongoose 2022-08-26 17:41:22 +01:00
cpq b73022096d Let RPC handle responses too 2022-08-26 17:41:13 +01:00
Sergio R. Caprile d1124703b7 Merge pull request #1687 from cesanta/webui-login
Fix SameSite cookie value
2022-08-26 10:24:00 -03:00
Sergio R. Caprile 4a8dd81c93 Fix SameSite cookie value 2022-08-26 10:22:31 -03:00
cpq f474a31484 Rebuild packed_fs.c 2022-08-26 14:21:33 +01:00
cpq e9ec2c5304 Add TLS support to MQTT 2022-08-26 14:20:54 +01:00
cpq c7b9ca68c2 Move mg_mqtt_next-* to the example, and some nits 2022-08-26 14:20:54 +01:00
Sergio R. Caprile ffa033cca9 Merge pull request #1686 from cesanta/device-dashboard
Fix SameSite cookie value
2022-08-26 10:19:08 -03:00
Sergio R. Caprile 3d3f6e09b6 Fix SameSite cookie value 2022-08-26 10:17:49 -03:00
Sergey Lyubka 7252f5385b Merge pull request #1683 from cesanta/multi-threaded
Show how to send data to a worker thread
2022-08-25 23:53:29 +01:00
Sergio R. Caprile ad641880a6 Show how to send data to a worker thread 2022-08-25 17:00:47 -03:00
Sergey Lyubka 1f6d62a635 Merge pull request #1684 from cesanta/nucleo-f746zg-baremetal
Workaround for aliased weak symbol override issue
2022-08-25 05:10:06 +01:00
Sergio R. Caprile 3cd4fd2d61 Workaround for aliased weak symbol override issue
Changed README to use picocom as cu is apparently not able to add carriage return after line feed
2022-08-24 19:02:11 -03:00
cpq d565faa75d Make non-initialised MIP poll work 2022-08-21 23:35:24 +01:00
cpq 786e118f06 Include mongoose_custom.h early to allow overrides 2022-08-20 18:26:29 +01:00
cpq eca612d514 Document all supported MG_ARCH choices 2022-08-20 03:44:29 +01:00
Sergey Lyubka 060f43839d Merge pull request #1680 from cesanta/esp8266
Expanded Makefile
2022-08-20 00:27:09 +01:00
cpq 9c3c4a6f4b MIP client 2022-08-20 00:03:15 +01:00
cpq 101cc1a672 Add define for strdup 2022-08-20 00:02:36 +01:00
Sergio R. Caprile e47f71344d Expanded Makefile 2022-08-19 18:17:52 -03:00
cpq fee6de6a7f Allow NULL head in struct mg_rpc 2022-08-19 15:08:01 +01:00
Sergey Lyubka 2bf25a1406 Merge pull request #1678 from cesanta/esp8266
Improved Makefile to be able to flash
2022-08-18 22:30:20 +01:00
Sergio R. Caprile dd59296be9 Improved Makefile to be able to flash
subtle mod in main.c comment
2022-08-18 17:41:05 -03:00
cpq b382726ed0 Build dashboard by default, fix FPU flag 2022-08-18 21:36:36 +01:00
Sergey Lyubka 01390fe540 Merge pull request #1675 from cesanta/stm32h743
Change README to point to new tutorial location
2022-08-17 08:30:41 +01:00
cpq 8596e1bef7 Enable FPU 2022-08-16 16:45:05 +01:00
Sergey Lyubka 13fffbc5b6 Merge pull request #1674 from cesanta/webui-preact
back to symbolic link
2022-08-16 11:56:08 +01:00
Sergey Lyubka 5f4857ddae Merge pull request #1673 from cesanta/docs
Change argument of %M handler to mg_pfn_t plus some cosmetic changes
2022-08-16 11:55:51 +01:00
Sergey Lyubka 5f36b41785 Merge pull request #1672 from cesanta/webui-push-rest
Change argument of %M handler to mg_pfn_t as in huge_response
2022-08-16 11:55:33 +01:00
Sergio R. Caprile bd8f0c90e1 back to symbolic link 2022-08-15 18:42:20 -03:00
Sergio R. Caprile f49683353d Change argument of %M handler to mg_pfn_t plus some cosmetic changes 2022-08-15 16:07:18 -03:00
Sergio R. Caprile 4f012d6bc6 Change argument of %M handler to mg_pfn_t as in huge_response 2022-08-15 16:04:17 -03:00
cpq e48e353066 Restore mg_file_write() to use tmp file 2022-08-15 16:08:34 +01:00
cpq 6ad7af54dc Fix docs, nits to freertos includes 2022-08-14 23:46:33 +01:00
cpq 6b69bef2ef mg_dtoa, mg_atod, mg_lld made static 2022-08-14 01:25:38 +01:00
cpq d2a27d3d91 mg_*rprintf -> mg_*xprintf 2022-08-13 20:34:20 +01:00
cpq 189aa80743 Update examples to NOT use mg_*mprintf 2022-08-13 20:09:51 +01:00
cpq f122bd5797 Update mg_log_set_fn() 2022-08-13 15:43:27 +01:00
cpq d76f86f7db Get rid of mg_*asprintf 2022-08-13 15:37:55 +01:00
cpq ccf5364187 Squash C++ warn 2022-08-13 14:57:15 +01:00
cpq a3bfe3e61a Use hand-crafted packet for large WS frame test 2022-08-13 14:52:43 +01:00
cpq de10e340b6 Update examples to use mg_http_reply 2022-08-13 14:52:10 +01:00
cpq 40ca26f23b Refactor mg_ws_connect() 2022-08-13 14:44:08 +01:00
cpq da28213613 Squash warning 2022-08-13 11:36:24 +01:00
cpq 6615a821f1 Test WS frames that are larger than 64k 2022-08-13 11:16:13 +01:00
Sergio R. Caprile d627d669bc Change README to point to new tutorial location 2022-08-12 17:08:18 -03:00
cpq ef6fbad0cb Better CFLAGS for SSL when building examples 2022-08-11 12:12:00 +01:00
cpq ef9f7d4c16 Change mg_ws_send: const char * -> const void * 2022-08-11 12:12:00 +01:00
Sergey Lyubka 44a0fa0986 Merge pull request #1670 from cesanta/index.gx-test
Add unit test for gzipped index when / is requested
2022-08-10 23:46:08 +01:00
Sergio R. Caprile 4d9338323a Add unit test for gzipped index when / is requested 2022-08-10 19:06:04 -03:00
Sergey Lyubka 1a6bfb65e6 Merge pull request #1669 from cesanta/embedded-filesystem
Add Embedded Filesystem example
2022-08-10 21:45:23 +01:00
Sergey Lyubka 3b112cc8c8 Merge pull request #1668 from cesanta/index.gz
check for gzipped index file when / is requested
2022-08-10 21:45:09 +01:00
Sergio R. Caprile 014a008c3a Add Embedded Filesystem example 2022-08-10 16:05:34 -03:00
Sergio R. Caprile 374be7b065 check for gzipped index file when / is requested 2022-08-10 15:54:24 -03:00
cpq 2ba3630de9 Remove dangerous mg_pfn_realloc(). Add %q printf specifier 2022-08-10 18:27:58 +01:00
cpq 24cb9467c0 Update docs for mg_rpc_process() 2022-08-10 15:35:07 +01:00
cpq 79c49e64e8 vc2017 -> vc17 2022-08-09 19:22:47 +01:00
cpq c8c0b8fb91 Squash vc98 warn 3 2022-08-09 19:17:40 +01:00
cpq e5585cb0e7 Squash vc98 warn 2 2022-08-09 18:58:58 +01:00
cpq bd32f6e2ef Squash warn on vc98 2022-08-09 15:49:54 +01:00
cpq 08f8ea0cd9 vc2017 -> vc17 2022-08-09 15:38:25 +01:00
cpq 2d48b28b0a Set dockerrun 2022-08-09 13:10:21 +01:00
cpq 9cfaee9b21 Multi-platform docker build 2022-08-09 13:02:50 +01:00
cpq 9393e271de Set dockercmd 2022-08-09 12:47:27 +01:00
cpq 948595fb3b Do not assert on SNTP and local clock diff, since local clock could be off 2022-08-09 12:45:10 +01:00
cpq 6149b619e7 Squash warnings 2022-08-09 12:39:40 +01:00
cpq b7406357c5 Fix #1600 - more precise SNTP time calculation 2022-08-09 12:13:23 +01:00
Sergey Lyubka 2279a51d52 Merge pull request #1666 from cesanta/tcp
Added TLS support
2022-08-08 20:57:11 +01:00
cpq 4d3d0995c9 Use only time.windows.com in SNTP test 2022-08-08 20:56:10 +01:00
Sergio R. Caprile 0ca752662d Added TLS support 2022-08-08 15:42:35 -03:00
cpq 4246f5d206 PATH_MAX -> MG_PATH_MAX 2022-08-06 22:26:07 +01:00
cpq e8289ec17d Fix #1648 - set MG_PATH_MAX to FILENAME_MAX on windows and unix 2022-08-06 22:19:55 +01:00
cpq cde441bca6 Remove tcpdump on port 123 2022-08-06 20:30:12 +01:00
cpq 740b609e1e Fix for deliver_normal_chunks() and a test case 2022-08-06 09:01:34 +01:00
cpq c459c17fab Update docs 2022-08-05 19:55:15 +01:00
cpq 11bbda9bb3 Update images 2022-08-05 19:44:55 +01:00
cpq 6a5c523948 Merge branch 'master' of github.com:cesanta/mongoose 2022-08-05 19:28:04 +01:00
cpq 99c23606c5 Add c->is_resp note 2022-08-05 19:27:56 +01:00
Sergey Lyubka 608b1ee156 Merge pull request #1665 from cesanta/esp32-device-dashboard
Changed README to point to new tutorial location
2022-08-05 19:20:35 +01:00
Sergey Lyubka 12ab5c9964 Merge pull request #1664 from gvanem/patch-1
Fix empty initializer
2022-08-05 19:19:55 +01:00
cpq 779c825e92 Fixes to chunked support when pipelining 2022-08-05 19:18:06 +01:00
Gisle Vanem 96df718304 Fix empty initializer
MSVC does not like such empty initializer:
  xamples/device-dashboard/net.c(116): error C2059: syntax error: '}'
2022-08-05 13:50:55 +02:00
Sergey Lyubka 4bee440a56 Merge pull request #1663 from cesanta/doc-rpc
Add pfn functions and RPC docs
2022-08-04 21:56:24 +01:00
Sergio R. Caprile bb4e4c7cda Add pfn functions docs
Add RPC docs
2022-08-04 17:20:00 -03:00
cpq 582ab220b3 Update mqtt docs 2022-08-04 18:50:20 +01:00
cpq 3e2ad83b2c Fix #1647 - add note in the doc that opts->root_dir is ignored by the mg_http_serve_file() 2022-08-04 17:47:48 +01:00
Sergey Lyubka ae29a1734c Merge pull request #1660 from cesanta/device-dashboard
device-dashboard: default to using packed fs, otherwise hw examples won't work
2022-08-04 17:13:03 +01:00
cpq 457ce5e563 Refactor chunking support. Fix #1656 2022-08-04 17:10:53 +01:00
Sergey Lyubka 154bdb08a9 Merge pull request #1659 from cesanta/scaprile-patch-1
Update README.md
2022-08-04 11:26:33 +01:00
Sergio R. Caprile 22b2dc9ea8 Update README.md 2022-08-03 14:38:12 -03:00
Sergey Lyubka 3ede1a4a5a Merge pull request #1658 from cesanta/ut-pause
Add unit test to check on server pausing between headers and data fir…
2022-08-03 16:20:14 +01:00
Sergio R. Caprile 9e3138b892 Add unit test to check on server pausing between headers and data firing a zero length MG_EV_HTTP_CHUNK 2022-08-03 12:09:24 -03:00
Sergey Lyubka 51cb40acd2 Enable epoll on linux 2022-08-03 15:07:26 +01:00
Sergey Lyubka 4702073458 Merge pull request #1655 from cesanta/esp32-uart-bridge
Fix for new mg_iobuf API
2022-08-03 08:40:04 +01:00
Sergio R. Caprile e01cffff46 Changed README to point to new tutorial location
Expanded Makefile to be able to flash with Docker and esputil
2022-08-02 16:10:34 -03:00
Sergio R. Caprile d88e438679 default to using packed fs, otherwise hw examples won't work 2022-08-02 16:06:19 -03:00
Sergio R. Caprile 70683fc8e7 Fix for new mg_iobuf API 2022-08-02 14:46:27 -03:00
Sergey Lyubka bd7ee0d1e8 Refactor mg_http_reply and mg_http_printf_chunk to use less allocs and mem copies 2022-08-01 21:07:42 +01:00
Sergey Lyubka 17e2fdd4cb Add align to struct mg_iobuf 2022-08-01 12:53:25 +01:00
Sergey Lyubka a468f58128 Use int debug level 2022-08-01 11:19:32 +01:00
Sergey Lyubka 581a0698af Expose rpc guts 2022-07-31 22:51:59 +01:00
Sergey Lyubka f02f88f336 mg_rpc_free -> mg_rpc_del 2022-07-30 21:13:30 +01:00
Sergey Lyubka 43d53b0616 Merge pull request #1650 from cesanta/esp32-uart
Fix Makefile
2022-07-30 07:57:37 +01:00
Sergey Lyubka 54d6bad5e5 Refactor JSON and RPC API 2022-07-30 07:55:26 +01:00
Sergio R. Caprile c37d4f768b Fix Makefile 2022-07-29 18:27:20 -03:00
Sergey Lyubka a4b003b7ac Merge pull request #1644 from cesanta/esp32_uart-bridge
Fix Makefile
2022-07-28 21:04:27 +01:00
Sergey Lyubka 433120ab22 Merge pull request #1637 from cesanta/webui-push-rest
Add data push using REST example
2022-07-28 20:54:20 +01:00
Sergio R. Caprile 109da5f515 Add data push using REST example 2022-07-28 10:20:22 -03:00
Sergey Lyubka 56e6cf406a Fix unamalgamated build 2022-07-28 10:47:12 +01:00
Sergey Lyubka a2289a0625 Fix unamalgamated build 2022-07-28 10:33:44 +01:00
Sergey Lyubka 02943a1082 Merge pull request #1649 from cesanta/tcp
Added plain TCP server and client example
2022-07-28 10:27:10 +01:00
Sergey Lyubka 64a36496e3 Merge pull request #1643 from cesanta/uart-bridge
Fixes to uart-bridge example
2022-07-28 10:26:51 +01:00
Sergey Lyubka f2009ebd62 Move mg_*printf* decls in fmt.h 2022-07-28 10:18:17 +01:00
Sergio R. Caprile 638892ca70 Fix incorrect oninput function call
Check a new config element is present before acting on the previous one

Correctly update config local copy

Fix TCP buffering for ever
2022-07-27 17:19:34 -03:00
Sergio R. Caprile 90fdbd36ec Added plain TCP server and client example 2022-07-27 13:40:02 -03:00
Sergey Lyubka 0dabc45780 Add RPC API 2022-07-27 00:46:05 +01:00
Sergio R. Caprile 0ffec91984 Fix Makefile 2022-07-25 11:27:19 -03:00
Sergey Lyubka 9cacf443e1 Merge pull request #1636 from cesanta/webui-push-ws
Added data push over WS example
2022-07-25 11:03:06 +01:00
Sergey Lyubka 3f21be4fb0 Merge pull request #1639 from cesanta/docs
Add mg_ws_printf()/vprintf() doc
2022-07-25 10:54:06 +01:00
Sergey Lyubka 7587f8212e Merge pull request #1642 from cesanta/fix-json
Fix json's MG_EOO in nested objects
2022-07-25 10:53:30 +01:00
Sergio R. Caprile 1eed80375d Fix MG_EOO 2022-07-22 11:50:23 -03:00
Sergio R. Caprile 806eed6040 Add mg_ws_printf()/vprintf() doc 2022-07-21 11:46:50 -03:00
Sergey Lyubka d1828ecdb4 Merge pull request #1634 from cesanta/webui-plain
Fix former config value not being freed
2022-07-18 21:24:07 +01:00
Sergey Lyubka 5cddb8ecda Merge pull request #1633 from cesanta/webui-login
Added web UI login example
2022-07-18 21:23:41 +01:00
Sergio R. Caprile 1651d9d6d9 Fix former config value not being freed 2022-07-18 16:21:02 -03:00
Sergio R. Caprile 40fc049cdc Added web UI login example 2022-07-18 14:12:42 -03:00
Sergey Lyubka 89afe62121 Merge pull request #1627 from cesanta/webui-rest
added webUI REST basics example
2022-07-17 18:09:02 +01:00
Sergey Lyubka e5b40ee29e Merge pull request #1630 from cesanta/webui-plain
added webUI plain JS example
2022-07-17 18:08:45 +01:00
Sergey Lyubka 4a3d760c06 Add timer ID attribute, for safe cleanup in the scripted environment 2022-07-17 12:52:30 +01:00
Sergio R. Caprile aa326f975d Added data push over WS example 2022-07-15 21:32:41 -03:00
Sergey Lyubka 1fbf534f9a Merge pull request #1631 from cesanta/webui-preact-example
added webUI Preact-based example
2022-07-15 09:15:43 +01:00
Sergey Lyubka 86aa38bfd5 Merge pull request #1629 from jbrzusto/fix-mg_ntp_parse
NTP reponse gives fractional (not micro-) seconds, per RFC5905
2022-07-15 00:43:31 +01:00
Sergio R. Caprile ca929031ee added webUI Preact-based example 2022-07-13 14:41:38 -03:00
Sergio R. Caprile f80477a093 added webUI plain JS example 2022-07-13 11:07:01 -03:00
Sergio R. Caprile abd7698d6d added webUI REST basics example 2022-07-13 10:45:49 -03:00
John Brzustowski d5fe3261f4 NTP reponse gives fractional (not micro-) seconds, per RFC5905 2022-07-13 04:08:54 -03:00
Sergey Lyubka 3f46ae7beb Make generated packed_fs.c independent 2022-07-12 15:09:33 +01:00
Sergey Lyubka 46af09f776 Change ff_open to explicit memcpy() 2022-07-11 18:13:46 +01:00
Sergey Lyubka f40b272eeb Fix #1626 - ignore @ in query string 2022-07-10 15:41:43 +01:00
Sergey Lyubka 9876e3afd7 Merge pull request #1622 from cesanta/percentM
added mg_rprintf(), updated doc to new %M API
2022-07-10 11:15:52 +01:00
Sergio R. Caprile 41df6a6c0b added mg_rprintf(), updated doc to new %M API 2022-07-07 14:15:55 -03:00
Sergey Lyubka dbd25daff8 Merge pull request #1621 from cesanta/percentM
Update (fix) to new %M API
2022-07-07 14:44:54 +01:00
Sergio R. Caprile 71eefb6272 Update to new %M API
Doc still references the old API and mg_rprintf() is not yet documented
2022-07-06 19:01:18 -03:00
Sergey Lyubka a4a340dbd4 Merge branch 'master' of github.com:cesanta/mongoose 2022-07-04 19:18:27 +01:00
Sergey Lyubka 2c01893bb1 Give more time for unit test to detect conn refused on windows 2022-07-04 19:18:20 +01:00
Sergey Lyubka c4e496b001 Merge pull request #1618 from cesanta/mqtt
updated docs and example to recently exported MQTT result codes
2022-07-04 19:07:28 +01:00
Sergio R. Caprile 16e90c3082 updated docs and example to recently exported MQTT result codes 2022-07-04 14:32:12 -03:00
Sergey Lyubka 543b4a132b Fix POLLERR usage 2022-07-04 18:25:13 +01:00
Sergey Lyubka e4a5296fbf Introduce c->is_mqtt5 for keeping mqtt version. Make mqtt over ws work again 2022-07-04 17:47:17 +01:00
Sergey Lyubka 6c796b8552 Fix memset in mg_iotest, add mg_random_str test 2022-07-04 16:13:38 +01:00
Sergey Lyubka e30ad43d36 Merge pull request #1612 from cesanta/mqtt
Exported MQTT result codes
2022-07-04 15:15:19 +01:00
Sergey Lyubka f841b85d7d Merge pull request #1614 from cesanta/udp-ssdp-search
Added parsing of remote responses
2022-07-04 15:14:39 +01:00
Sergey Lyubka 735b7bece6 Squash more warns 2022-07-04 11:43:52 +01:00
Sergey Lyubka 4c9fdaf8b0 Merge pull request #1617 from jameshilliard/osx-clock
util: use correct clock on OSX
2022-07-04 11:12:58 +01:00
Sergey Lyubka 2ccc4acf34 Squash warns for rp2040 builds 2022-07-04 11:10:08 +01:00
James Hilliard c24343f107 util: use correct clock on OSX
CLOCK_MONOTONIC_RAW on OSX is not the same as CLOCK_MONOTONIC_RAW on linux
2022-07-04 04:04:43 -06:00
Sergey Lyubka 81ffcd8ee9 Fix #1616 - randomize mqtt will and client id for parallel test 2022-07-04 11:00:06 +01:00
Sergey Lyubka 432452ea9a Fix #1615 - prefer monotonic clock. Add clock for rp2040 2022-07-04 10:08:21 +01:00
Sergey Lyubka 6c14c7d623 Unbreak mac build 2022-07-04 00:06:01 +01:00
Sergey Lyubka 30126072dc Add MG_ARCH_RP2040 2022-07-03 23:00:15 +01:00
Sergio R. Caprile f7812c9b0a Added parsing of remote responses 2022-07-02 13:16:49 -03:00
Sergey Lyubka dca43f430b Fix poll support for win32 2022-07-02 12:45:44 +01:00
Sergey Lyubka 0947ce9234 Merge branch 'master' of github.com:cesanta/mongoose 2022-07-02 11:57:09 +01:00
Sergey Lyubka 91fa2ad23b Enable poll support on windows 2022-07-02 11:52:16 +01:00
Sergey Lyubka 1b57c56fdc Merge pull request #1613 from cesanta/typo
fix typo
2022-07-02 11:15:43 +01:00
Sergio R. Caprile d13509e302 Update app.js 2022-07-01 15:58:03 -03:00
Sergio R. Caprile 85d300ce71 Exported MQTT result codes 2022-07-01 15:32:24 -03:00
Sergey Lyubka d6e1a3ab4c Unbreak my heart ^W the build 2022-07-01 18:10:40 +01:00
Sergey Lyubka f1da8542ce Nits 2022-07-01 17:28:06 +01:00
Sergey Lyubka a183621268 Fix ff_write() call 2022-07-01 13:22:36 +01:00
Sergey Lyubka 035de980e3 Fix ff_read() call 2022-07-01 13:18:49 +01:00
Sergey Lyubka 99f0688377 Change mg_http_upload API 2022-06-30 21:54:50 +01:00
Sergey Lyubka 56412193e7 Add mg_remove_double_dots(), hide mg_http_upload() 2022-06-30 20:27:43 +01:00
Sergey Lyubka c5751b0bd3 Add mg_json_get_long 2022-06-30 20:03:29 +01:00
Sergey Lyubka 86e57d243d Enhance esp32 makefile 2022-06-30 19:59:23 +01:00
Sergey Lyubka 7fc57a3be7 Merge pull request #1610 from cesanta/http-restful-server
updated SSL build options
2022-06-30 12:27:25 +01:00
Sergio R. Caprile 75069a44c7 updated SSL build options 2022-06-29 17:31:31 -03:00
Sergey Lyubka 2536865c4d Fix freertos-tcp build 2022-06-29 19:39:36 +01:00
Sergey Lyubka d266f822ca Merge branch 'master' of github.com:cesanta/mongoose 2022-06-29 19:19:28 +01:00
Sergey Lyubka 5b8979a0f1 Better connect() result test 2022-06-29 19:19:19 +01:00
Sergey Lyubka 3bc79b9dfd Merge pull request #1609 from cesanta/mqtt-over-ws-client
Added openSSL support
2022-06-29 19:18:25 +01:00
Sergio R. Caprile 0ae75e6db6 Added openSSL support 2022-06-29 14:57:11 -03:00
Sergey Lyubka 89e2a15eb7 Fix build 2022-06-29 18:03:04 +01:00
Sergey Lyubka b1896d9944 Fix typo 2022-06-29 17:57:59 +01:00
Sergey Lyubka d0dedcfd2e Fix build 2022-06-29 17:54:33 +01:00
Sergey Lyubka 73297c8e65 Use mg_putchar_iobuf in mg_vprintf 2022-06-29 17:42:55 +01:00
Sergey Lyubka 017c7290d6 Better error handling - report from iotest 2022-06-29 17:02:37 +01:00
Sergey Lyubka 6a8b5b06d0 Merge pull request #1608 from cesanta/fix_mqtt-over-ws-client
fix incorrect WS packet payload
2022-06-29 14:51:39 +01:00
Sergey Lyubka 93a6bc501e Refactor guess_mime_type() 2022-06-29 10:28:37 +01:00
Sergey Lyubka e8f050c194 Dont use realloc 2022-06-29 00:00:16 +01:00
Sergio R. Caprile 712517b6fa fix incorrect WS packet payload 2022-06-28 16:27:49 -03:00
Sergey Lyubka 434378eda5 Merge pull request #1602 from cesanta/device-dashboard
fixed watch() not being called after login
2022-06-28 20:24:36 +01:00
Sergey Lyubka cf38fdb720 Merge pull request #1606 from cesanta/mqtt-client
fixed TLS build comment
2022-06-28 20:23:45 +01:00
Sergey Lyubka 95d30cf482 Merge pull request #1607 from cesanta/http-client
fixed TLS build comment
2022-06-28 20:20:35 +01:00
Sergio R. Caprile 6542c02b7f fixed TLS build comment 2022-06-28 10:56:56 -03:00
Sergio R. Caprile a13144932a fixed TLS build comment 2022-06-28 10:49:45 -03:00
Sergio R. Caprile 6597830631 fixed watch() not being called after login 2022-06-28 10:26:32 -03:00
Sergey Lyubka ba08140197 Initial mqtt5 support 2022-06-28 11:31:13 +01:00
Sergey Lyubka d65ce3b596 Add mg_rprintf, mg_vrprintf 2022-06-28 00:45:52 +01:00
Sergey Lyubka 4864a6e618 Use SSL_set1_host() 2022-06-28 00:45:47 +01:00
Sergey Lyubka 2bbb2bb1db Merge branch 'master' of github.com:cesanta/mongoose 2022-06-24 14:27:29 +01:00
Sergey Lyubka 47ce004f61 docs nits 2022-06-24 14:24:14 +01:00
Sergey Lyubka 507e392509 Merge pull request #1601 from cesanta/device-dashboard
updated and cleaned up texts
2022-06-24 14:09:36 +01:00
Sergio R. Caprile dcfb014d1f updated and cleaned up texts 2022-06-23 15:33:31 -03:00
Sergey Lyubka 4e880fb6e0 Nit - fix openssl error message 2022-06-23 13:11:04 +01:00
Sergey Lyubka 898e2b1e30 Add mg_json_get_hex(), mg_json_get_b64() 2022-06-22 16:28:22 +01:00
Sergey Lyubka a68f3dc4eb Add %V and %H specifiers for mg_snrpintf() 2022-06-22 13:15:52 +01:00
Sergey Lyubka c446fe0c6d Make stm32 eth declared as volatile 2022-06-21 12:11:59 +01:00
Sergey Lyubka 4246e6c768 Fix #1599 2022-06-21 12:07:00 +01:00
Sergey Lyubka 4f9cfdf65d Merge pull request #1598 from cesanta/http-reverse-proxy
Added openSSL support
2022-06-20 22:00:14 +01:00
Sergey Lyubka b1cd233dda Merge pull request #1597 from cesanta/http-proxy-client
Added openSSL support
2022-06-20 21:59:48 +01:00
Sergey Lyubka 4f63b6093f Merge pull request #1595 from cesanta/http-client
fixed comment, updated TLS section in makefile
2022-06-20 21:59:24 +01:00
Sergio R. Caprile 380a50e39b Added openSSL support
Fixed missing parameter in makefile
Added URI handling
2022-06-20 15:27:46 -03:00
Sergio R. Caprile 3bd3a4ff7b fixed comment, updated TLS section in makefile 2022-06-20 14:50:45 -03:00
Sergey Lyubka 46bf79455c Add examples/esp32/uart-bridge 2022-06-19 18:27:37 +01:00
Sergey Lyubka 2d5c26d44f Rename mg_log_set_fn properly 2022-06-19 09:08:37 +01:00
Sergey Lyubka 9760b7c9d6 Add mg_log_set_fn(), MG_ENABLE_LOG 2022-06-19 09:04:22 +01:00
Sergey Lyubka 0b5a00c99a Change uart_read signature 2022-06-18 20:41:04 +01:00
Sergey Lyubka ba8482c707 Update uart bridge 2022-06-18 11:32:31 +01:00
Sergey Lyubka 1b34360b05 Update uart bridge 2022-06-18 11:30:44 +01:00
Sergey Lyubka c84dab21e4 Refactor UART example 2022-06-18 04:25:11 +01:00
Sergey Lyubka 1640287897 Add mg_http_var 2022-06-18 04:25:11 +01:00
Sergey Lyubka adcf5bab0e Merge pull request #1589 from cesanta/mqtt-client
Add support for openSSL
2022-06-17 22:04:38 +01:00
Sergey Lyubka e024700851 Merge pull request #1593 from cesanta/file-uploads
update file upload example set
2022-06-17 22:03:58 +01:00
Sergio R. Caprile f4fc33d111 brought back 7.5 file-upload as file-upload-multiple-posts; updated to latest API
renamed form-upload to file-upload-html-form
renamed file-upload to file-upload-single-post
2022-06-17 16:35:02 -03:00
Sergio R. Caprile fb446022e2 Added openSSL support
Backend host is https only if TLS is enabled
2022-06-16 11:59:06 -03:00
Sergio R. Caprile e021d7cd9d Add support for openSSL 2022-06-15 10:42:32 -03:00
Sergey Lyubka 3331ed2f49 Merge pull request #1591 from cesanta/jsondoc
fix JSON docs
2022-06-15 06:56:08 +01:00
Sergio R. Caprile 939a8ddc26 fix JSON docs 2022-06-14 14:19:25 -03:00
Sergey Lyubka 3774f676cf Less verbose unit test 2022-06-13 21:12:11 +01:00
Sergey Lyubka 7923509d1e More json docs 2022-06-13 15:04:52 +01:00
Sergey Lyubka 30d6a44b0d Fix mg_http_upload() 2022-06-13 14:48:52 +01:00
Sergey Lyubka 6d46ecaa6c Add mip-pcap example 2022-06-13 02:03:52 +01:00
Sergey Lyubka 5a448ab4f5 Compile driver_stm32.c only for __arm__ 2022-06-13 01:04:09 +01:00
Sergey Lyubka a71262437d Use mip for arm and riscv targets 2022-06-12 12:43:01 +01:00
Sergey Lyubka 52ab963845 Update images 2022-06-11 22:59:20 +01:00
Sergey Lyubka 67280724ba Remove pragma 2022-06-11 19:05:07 +01:00
Sergey Lyubka d8a4b5aa34 Make mip MSVC friendly 2022-06-11 18:54:32 +01:00
Sergey Lyubka fe0b2d0646 Fix typo 2022-06-11 17:40:48 +01:00
Sergey Lyubka d3368e4aad Move mip into mip/ 2022-06-11 17:29:45 +01:00
Sergey Lyubka 903b510411 Merge pull request #1587 from cesanta/timers
fixed poll timeout being larger than timer period
2022-06-10 22:57:44 +01:00
Sergio R. Caprile 0dbc99d9ee fixed poll timeout being larger than timer period 2022-06-10 16:59:14 -03:00
Sergio R. Caprile 505ca96547 fixed typo 2022-06-10 16:25:56 -03:00
Sergey Lyubka 89623d00f9 Update readme 2022-06-10 18:48:32 +01:00
Sergey Lyubka e47bcb3fb6 Merge pull request #1583 from cesanta/multi-threaded
Remove outdated comments
2022-06-10 15:21:32 +01:00
Sergey Lyubka 50d0d68f45 Docs nitpick 2022-06-10 15:00:34 +01:00
Sergio R. Caprile 2f75418c70 Remove outdated comments 2022-06-10 10:37:12 -03:00
Sergey Lyubka 013bc58371 Add json docs 2022-06-10 13:01:52 +01:00
Sergey Lyubka 55948cd431 Allow to set log level 2022-06-10 12:33:30 +01:00
Sergey Lyubka dfca896a64 Update huge response. More tests 2022-06-10 12:14:42 +01:00
Sergey Lyubka 8fc6f3f744 Remove mjson dependency 2022-06-10 09:40:22 +01:00
Sergey Lyubka f65058fa03 Remove mjson dependency
Signed-off-by: Sergey Lyubka <valenok@gmail.com>
2022-06-10 09:39:53 +01:00
Sergey Lyubka 33567bab41 Add %g support to mg_snprintf() 2022-06-10 09:38:36 +01:00
Sergey Lyubka 106662b1d7 Add JSON API 2022-06-09 17:17:33 +01:00
Sergey Lyubka b73115c002 Unbreak build 2022-06-08 22:09:11 +01:00
Sergey Lyubka cff208c5a9 Introduce %Q format specifier, rework device dashboard 2022-06-08 21:44:01 +01:00
Sergey Lyubka a83dd9569d Unbreak esp32 example 2022-06-08 20:04:35 +01:00
Sergey Lyubka 807cd4df9e Make sock.c less verbose 2022-06-08 19:55:24 +01:00
Sergey Lyubka ac3151f871 Make dashboard more robust 2022-06-08 19:53:29 +01:00
Sergey Lyubka d4106b5cbd Send puback for qos > 0 2022-06-08 19:51:03 +01:00
Sergey Lyubka bcb6c2675f Unbreak esp32 device dashboard build 2022-06-08 13:54:20 +01:00
Sergey Lyubka 6b51666248 Move esp32 example 2022-06-08 13:24:41 +01:00
Sergey Lyubka 628a007112 Refresh packed filesystems 2022-06-08 13:22:09 +01:00
Sergey Lyubka ee65342545 docs 2022-06-08 11:30:54 +01:00
Sergey Lyubka 94ea973fb5 Update docs 2022-06-08 11:01:30 +01:00
Sergey Lyubka 9f8424e93f Update readme 2022-06-08 09:06:14 +01:00
Sergey Lyubka 2e750236be Add uart-bridge example 2022-06-08 08:58:32 +01:00
Sergey Lyubka c701315ab5 Merge pull request #1581 from behnejad/patch-1
fixing offset of Content-Length value.
2022-06-07 08:35:24 +01:00
Sergey Lyubka a53dc5c0a0 Fix #1580 - uri_to_path2 for / corner case 2022-06-07 04:33:46 +01:00
Behnejad 895ca80b2b fixing offset of Content-Length value.
in very large HTTP response, this offset might cause a problem with HTTP header format.
2022-06-07 08:00:12 +04:30
Sergey Lyubka 1dcb7dd13d Update mingw target 2022-06-07 00:25:15 +01:00
Sergey Lyubka e75afcba42 Update dash UI 2022-06-05 17:17:19 +01:00
Sergey Lyubka 0f0cf7a5db Integrate #1579 - properly clear c->is_readable and c->is_writable flags in mg_iotest() 2022-06-05 15:27:16 +01:00
Sergey Lyubka 31c7d66245 Rework dashboard 2022-06-05 14:59:59 +01:00
Sergey Lyubka cac7f653c9 Add mg_ws_printf() 2022-06-05 14:59:50 +01:00
Sergey Lyubka 219428c249 Change device dashboard to use MQTT 2022-06-04 22:21:59 +01:00
Sergey Lyubka f4fa1e097d docs 2022-06-04 08:45:34 +01:00
Sergey Lyubka 35b517b434 docs 2022-06-04 08:29:03 +01:00
Sergey Lyubka b3f956ba63 docs 2022-06-04 08:23:25 +01:00
Sergio R. Caprile 3ae8b3f8a7 Merge pull request #1577 from cesanta/sntp
Add sntp-time-sync example
2022-06-03 10:38:25 -03:00
Sergey Lyubka c48349ba56 Add sntp-time-sync example 2022-06-03 13:57:57 +01:00
Sergey Lyubka 0763146254 Fix #1476 - introduce c->is_full to cap the recv buf len for streaming connections 2022-06-03 11:37:35 +01:00
Sergio R. Caprile 7da5d42009 Merge pull request #1573 from cesanta/timers
Minor cosmetic changes
2022-06-02 10:06:41 -03:00
Sergey Lyubka 5ac847076a Change long read_conn -> void read_conn 2022-06-02 14:02:09 +01:00
Sergey Lyubka a88ea776a9 Change MG_MAX_RECV_BUF_SIZE -> MG_MAX_RECV_SIZE 2022-06-02 13:50:44 +01:00
Sergey Lyubka 73a5ff1fb6 Use only TFLAGS, get rid of EXTRA 2022-06-02 12:02:41 +01:00
Sergey Lyubka 7e8901c99f Docs - amend images 2022-06-02 12:02:26 +01:00
Sergey Lyubka 45816ef5db Add missing test file 2022-06-02 06:18:43 +01:00
Sergey Lyubka fe682f8399 Fix #1560 - implement precompressed .gz file serving 2022-06-02 06:13:37 +01:00
Sergey Lyubka 9ffb6fb26a Merge pull request #1570 from behnejad/patch-2
Update README.md
2022-06-01 21:17:52 +01:00
Sergey Lyubka 063244e4ca Minor cosmetic changes 2022-06-01 21:15:31 +01:00
Sergey Lyubka d7b7a0a577 Merge pull request #1572 from cesanta/timers
Modify times example
2022-06-01 17:22:24 +01:00
Sergey Lyubka f735585239 Update timers example 2022-06-01 17:09:15 +01:00
Sergey Lyubka 30349ec217 Update timers example 2022-06-01 17:09:13 +01:00
Sergey Lyubka 55517d48ed Change linux target 2022-06-01 16:25:04 +01:00
Behnejad 0f93ab84e9 Update README.md
after sending buffer to socket, MG_EV_WRITE will generated.
2022-06-01 14:36:17 +04:30
Sergey Lyubka 4dd1891594 Add mg_http_serve_opts.page404 2022-05-31 23:44:03 +01:00
Sergey Lyubka 27e1472d88 Merge pull request #1568 from behnejad/master
adding new api to enable separation of query string with '&'.
2022-05-31 18:25:12 +01:00
Sergey Lyubka a3d63c095a Handle #1562 - add udp/tcp extra param to mg_mkpipe() 2022-05-31 18:23:32 +01:00
Sergey Lyubka dc486a2aa3 Add pics 2022-05-31 12:01:06 +01:00
Sergey Lyubka 9963bdee09 Docs images 2022-05-31 11:38:03 +01:00
Hooman Behnejad 499401d457 adding mg_split function 2022-05-31 14:11:14 +04:30
Sergey Lyubka e2fcf5f92c Fix #1565 - mg_snprintf %.*s with zero len printing 2022-05-30 18:40:44 +01:00
Sergey Lyubka b8bba7513a Fix #1566 - proper error cleanup in mg_listen 2022-05-30 17:56:50 +01:00
Sergey Lyubka 65957527cb Fix #1558 - add opts.extra_headers in 304 responses 2022-05-30 17:44:26 +01:00
Sergey Lyubka e2ce68e3ef Fix build: delete -> del 2022-05-30 16:20:14 +01:00
Sergey Lyubka 44cf02e5ba Fix #1545 - do not send MG_EV_HTTP_MSG if chunks were deleted 2022-05-30 16:02:59 +01:00
Sergey Lyubka a4a70270ee Merge pull request #1564 from behnejad/patch-1
Update README.md
2022-05-30 14:32:17 +01:00
Behnejad 82e1cac1c7 Update README.md
added missing parameter in sample code of `mg_match`.
2022-05-29 18:22:56 +04:30
Sergey Lyubka 21ffe8e3f3 docs 2022-05-29 12:59:33 +01:00
Sergey Lyubka 45f20d5089 Update http_message diagram 2022-05-29 12:03:54 +01:00
Sergey Lyubka cea12a35b7 Merge pull request #1563 from vkoskiv/fix-docs
Small fix to mg_timer_add() documentation
2022-05-28 18:28:27 +01:00
Sergey Lyubka 686320a805 Remove verbose log in mg_iotest() 2022-05-27 23:18:23 +01:00
Sergey Lyubka 14ad51d2d2 More SNtp debug 12 2022-05-27 22:47:12 +01:00
Sergey Lyubka 28c15b3ff4 More SNtp debug 11 2022-05-27 22:36:34 +01:00
Sergey Lyubka f5af28c886 More SNtp debug 10 2022-05-27 22:26:17 +01:00
Sergey Lyubka 6b50039863 More SNtp debug 9 2022-05-27 22:24:45 +01:00
Sergey Lyubka 34c5f63c00 More SNtp debug 8 2022-05-27 22:18:14 +01:00
Sergey Lyubka 53bca4efab More SNtp debug 7 2022-05-27 22:08:05 +01:00
Sergey Lyubka 9029593691 More SNtp debug 6 2022-05-27 21:59:13 +01:00
Sergey Lyubka 4aad859e20 More SNtp debug 5 2022-05-27 21:44:03 +01:00
Sergey Lyubka b9d1d4a94f More SNtp debug 4 2022-05-27 20:48:19 +01:00
Sergey Lyubka be8b01e289 More SNtp debug 4 2022-05-27 20:43:30 +01:00
Sergey Lyubka 360dedd9b2 More SNtp debug 3 2022-05-27 20:39:37 +01:00
Sergey Lyubka e5d3d02307 More SNtp debug 2022-05-27 20:16:08 +01:00
Sergey Lyubka d3e14ca7e5 More SNTP debug 3 2022-05-27 20:05:14 +01:00
Sergey Lyubka 5998208449 More SNTP debug 2022-05-27 19:57:15 +01:00
Sergey Lyubka 4fc84621ae More SNTP debug 2022-05-27 19:55:39 +01:00
Valtteri Koskivuori 8253a84689 Small fix to mg_timer_add() documentation
The return value was not documented.
2022-05-26 23:43:56 +03:00
Sergey Lyubka 6b7f14c69d docs 2022-05-26 20:25:20 +01:00
Sergey Lyubka cfaca604f5 Debug SNTP issue 2 2022-05-26 17:50:56 +01:00
Sergey Lyubka 0226b9db31 Debug SNTP issue 2022-05-26 17:45:52 +01:00
Sergey Lyubka 7f8d12b9f7 Use time.windows.com too 2022-05-26 16:22:44 +01:00
Sergey Lyubka 2ae341cf5e Add nucleo-f746zg-baremetal 2022-05-26 13:53:36 +01:00
Sergey Lyubka 7850b550d8 Unbreak test 2022-05-26 11:18:36 +01:00
Sergey Lyubka 10596a8bdc Proper TLS handling for poll(). Make poll() default on linux 2022-05-26 08:55:28 +01:00
Sergey Lyubka 252e4715d4 Merge pull request #1561 from vkoskiv/add-poll
Add optional poll() implementation under MG_ENABLE_POLL define
2022-05-26 07:53:02 +01:00
Valtteri Koskivuori 420b989adb Add optional poll() implementation under MG_ENABLE_POLL
This adds the ability to substitute select() with poll() on supported
unix environments when MG_ENABLE_POLL is defined. A make flag called
USE_POLL is provided as well.
Using poll() removes the limitation of FD_SETSIZE concurrent sockets,
generally 1024 on Linux environments.
2022-05-26 06:00:27 +03:00
Sergey Lyubka bdb388c79d Fix pedantic warnings 2022-05-26 03:08:08 +01:00
Sergey Lyubka 87148f95f2 Clean up pedantic warnings 2022-05-26 02:50:15 +01:00
Sergey Lyubka fe124354cd Update custom build instructions 2022-05-26 02:10:28 +01:00
Sergey Lyubka 9a28fa71f0 Add -pedantic to gcc/clang CFLAGS 2022-05-26 02:10:07 +01:00
Sergey Lyubka 4139cdaf35 Remove poll() support 2022-05-26 02:07:37 +01:00
Sergey Lyubka ebe04620e1 Better custom build reference 2022-05-25 13:36:39 +01:00
Sergey Lyubka 7e053cd632 Typo fs docs 2022-05-25 13:29:49 +01:00
Sergey Lyubka 1fd65c77fe Enhance fs docs 2022-05-25 13:28:25 +01:00
Sergey Lyubka 2bfc838614 Fix build 2022-05-25 11:18:54 +01:00
Sergey Lyubka 69082db381 Regenerated packed fs 2022-05-25 11:15:00 +01:00
Sergey Lyubka 5ce2130f05 Minor formatting fix 2022-05-25 11:14:42 +01:00
Sergey Lyubka 5b448ec7a6 Integrate #1561 with some minor tweaks - add MG_ENABLE_POLL for poll() support 2022-05-25 11:14:12 +01:00
Sergey Lyubka f72b27d1c1 docs 2022-05-24 20:36:21 +01:00
Sergey Lyubka 9973c5f2b7 docs 2022-05-24 19:20:20 +01:00
Sergey Lyubka 88ee415dd1 docs 2022-05-24 19:19:42 +01:00
Sergey Lyubka 4f168cf346 docs 2022-05-24 19:18:42 +01:00
Sergey Lyubka ad7b5d2cd8 Change packed image 2022-05-24 19:14:20 +01:00
Sergey Lyubka 1e522de4a7 Change mg_iobuf image 2022-05-24 18:57:22 +01:00
Sergey Lyubka c2d2d085cd Add chart example 2022-05-23 15:27:19 +01:00
Sergey Lyubka b3a4c12d67 Handle #1559 - set no flags in send() call 2022-05-22 23:49:38 +01:00
Sergey Lyubka d5993ba27e Fix #1550 - excladdrinuse 2022-05-21 16:18:34 +01:00
Sergey Lyubka ef563603a9 Merge pull request #1557 from cesanta/pc
Remove mg_log_set_callback. Use MG_PUTCHAR macro instead
2022-05-20 10:16:57 +01:00
Sergey Lyubka 7e2ca72310 Remove mg_log_set_callback. Use MG_PUTCHAR macro instead 2022-05-20 09:45:17 +01:00
Sergey Lyubka 7c17c806ad 7.6 -> 7.7 2022-05-19 11:44:32 +01:00
Sergey Lyubka 8e0f529a00 Add MIP - an experimental TCP/IP stack 2022-05-18 21:19:21 +01:00
Sergey Lyubka 47e15a3d47 RTX nits 2022-05-17 19:29:53 +01:00
Sergey Lyubka cac7007069 Merge pull request #1554 from zudwalex/zephyr_ci
Use docker for Zephyr CI
2022-05-16 13:39:25 +01:00
Alex Alashkin ac55c900e7 Use docker for Zephyr CI 2022-05-16 15:30:25 +03:00
Sergey Lyubka 25806e48dc Fix ESP32 build 2022-05-16 11:54:26 +01:00
Sergey Lyubka 3871f4b6ab Fix #1546 - dont send excess for range requests 2022-05-16 11:45:08 +01:00
Sergey Lyubka 27c892806b Fix #1540 - case sensitive match in mg_is_chunked() 2022-05-16 11:19:45 +01:00
Sergey Lyubka 2b9f0480a1 Fix #1549 - fix typo in log format specifier 2022-05-15 21:02:41 +01:00
Sergey Lyubka 72cc433265 Make SNTP test more resilient 2022-05-15 19:41:37 +01:00
Sergey Lyubka 7721b074e6 Log ms in test_sntp() 2022-05-15 19:31:29 +01:00
Sergey Lyubka f5fd176b35 Increate SNTP timeout 3s->5s. Change mg_sntp_send() to mg_sntp_request(), remove one unnecessary parameter 2022-05-15 18:41:01 +01:00
Sergey Lyubka 6db1d7925e Merge pull request #1552 from zudwalex/ti_merged
Add TI support
2022-05-15 17:40:46 +01:00
Alex Alashkin 0ed7545947 Add TI support 2022-05-15 19:25:50 +03:00
Sergey Lyubka 95e22e8d4f Exporting only dashboard func 2022-05-15 14:40:58 +01:00
Sergey Lyubka cf7d1d8041 Address #1551 - better timers handling 2022-05-15 14:29:34 +01:00
Sergey Lyubka 443d0f0c6c Rename complete -> device-dashboard, remove multiple-logins and dashboard 2022-05-14 09:08:23 +01:00
Sergey Lyubka c20e48179f Un-break the test and untie serving code in dash example 2022-05-13 22:15:33 +01:00
Sergey Lyubka 3fbb7de712 Refactor dashboard example 2022-05-13 20:08:08 +01:00
Sergey Lyubka 0294603dfc MG_ARCH_RTX nits 2022-05-12 15:07:02 +01:00
Sergey Lyubka 5458252e4a Add missing src/arch_rtx.h 2022-05-12 08:23:17 +01:00
Sergey Lyubka 31ce219544 Add MG_ARCH_RTX 2022-05-12 08:07:51 +01:00
Sergey Lyubka 86cd567968 Nit - use quotes, not brackets for custom arch 2022-05-11 21:14:44 +01:00
Sergey Lyubka 5c66d32bc0 Refactor mg_open_listener() 2022-05-10 13:43:47 +01:00
Sergey Lyubka 5ac5c93c90 Refactor mg_open_listener() 2022-05-10 13:41:45 +01:00
Sergey Lyubka 84480f4072 Fix #1539 - proper timer cleanup 2022-05-10 07:38:03 +01:00
Sergey Lyubka b82953405d Fix valgrind test 2022-05-09 19:11:27 +01:00
Sergey Lyubka 5271626947 Disable SSI by default 2022-05-08 21:54:15 +01:00
Sergey Lyubka bc16854ccb Get rid of MG_ENABLE_LOG, change mg_hexdump() 2022-05-06 21:09:13 +01:00
Sergey Lyubka 6db0485c7b Set c->loc for accepted and UDP connections 2022-05-06 20:19:40 +01:00
Sergey Lyubka b5fc0d30a8 Add extraconnsize 2022-05-04 17:18:35 +01:00
Sergey Lyubka 38557aac7f Add MG_ARCH_NEWLIB 2022-05-01 13:47:33 +01:00
Sergey Lyubka d621fbfab1 Remove unused macros 2022-05-01 08:18:18 +01:00
Sergey Lyubka f19eec7fae Refactor multithreading API 2022-04-25 14:56:15 +01:00
Sergey Lyubka 8174842b05 docs 2022-04-24 11:39:54 +01:00
Sergey Lyubka ff07d261b2 docs 2022-04-24 11:37:23 +01:00
Sergey Lyubka c55db8a895 docs 2022-04-24 11:33:47 +01:00
Sergey Lyubka 70a9554b72 docs 2022-04-24 11:26:25 +01:00
Sergey Lyubka bdd7d92108 Fix #1533 - fix iotest error on windows 2022-04-22 20:53:54 +01:00
Sergey Lyubka a7cbc19755 Fix #1532 - improve ipv6 DNS lookup 2022-04-22 20:44:53 +01:00
Sergey Lyubka 93ff3e4d1f Add message sequence test 2022-04-21 03:13:31 +01:00
Sergey Lyubka 1dfc748e87 Add message sequence test 2022-04-21 02:50:50 +01:00
Sergey Lyubka e1f17a7ff1 Merge pull request #1531 from zudwalex/fix_tests
Fix zephyr tests
2022-04-20 11:38:00 +01:00
Alex Alashkin 56c40ff0fd Fix zephyr tests 2022-04-20 09:28:36 +03:00
Sergey Lyubka 9dd3b75165 Handle #1529 - do not mark normal conn termination as an error 2022-04-19 20:28:10 +01:00
Sergey Lyubka 20fc8f0279 Handle #1529: add automatic linkage against ws2_32.lib on _WIN32 targets 2022-04-19 18:51:28 +01:00
Sergey Lyubka 944704a12d Fix #1528: pack.c build on Win32 2022-04-19 18:46:29 +01:00
Sergey Lyubka fba9f14b2c Merge pull request #1526 from zudwalex/zephyr3
Add Zephyr build to Github actions
2022-04-19 09:03:30 +01:00
Alex Alaskin a7c24aeeee Add Zephyr build to Github actions 2022-04-13 19:54:08 +03:00
Sergey Lyubka 186eb998ba Adjust to timer API change, add root makefile 2022-04-13 14:03:00 +01:00
Sergey Lyubka d630ba743d Merge pull request #1524 from zudwalex/zephyr2
Add Zephyr examples
2022-04-13 11:17:22 +01:00
Sergey Lyubka e9fabdcc96 Handle #1523 - multiple WS messages 2022-04-13 11:14:57 +01:00
Sergey Lyubka 31698678fb Squash warning 2022-04-13 10:52:06 +01:00
Sergey Lyubka ebd2e89faa Handle #1522 - Fix TLS buffering 2022-04-13 10:48:17 +01:00
Alex Alashkin 17e0fb1c15 Add Zephyr examples 2022-04-13 11:10:22 +03:00
Sergey Lyubka 6e3e77a1a0 Enhance http-streaming-client 2022-04-12 19:06:37 +01:00
Sergey Lyubka ef44f90491 Fix #1520 - move state to struct mg_mgr 2022-04-12 14:14:55 +01:00
Sergey Lyubka 66376885e9 Fix #1521 - add mg_tou64() 2022-04-12 10:20:43 +01:00
Sergey Lyubka db941e2627 Fix #1519 - make opts structs in API calls const 2022-04-12 10:04:55 +01:00
Sergey Lyubka 5f78d34f4d Fix #1513 - fix mg_strdup() documentation 2022-04-12 09:57:25 +01:00
Sergey Lyubka 85281ae128 Fix #1514 - explicitely initialize io in mg_iobuf_init() 2022-04-12 09:54:05 +01:00
Sergey Lyubka e5d1b213c9 Merge pull request #1518 from jameshilliard/mqtt-suback
Ensure MQTT_CMD_SUBACK is received before calling mg_mqtt_pub in tests
2022-04-11 10:45:07 +01:00
James Hilliard e4ab9a4130 Ensure MQTT_CMD_SUBACK is received before calling mg_mqtt_pub in tests 2022-04-07 19:11:51 -06:00
Sergey Lyubka a1ec179229 Use uint64_t for uptime in millis, not int64_t 2022-04-07 13:50:25 +01:00
Sergey Lyubka 2f77855ec1 Handle #1502 - send CLOSE when CLOSE is received 2022-04-05 14:45:39 +01:00
Sergey Lyubka d11173fe90 Fix #1510 - wrap X509_VERIFY_PARAM_set1_host() usage inside a conditional 2022-04-05 13:09:17 +01:00
Sergey Lyubka fde8b82b78 Merge pull request #1507 from jameshilliard/mbedtls-reset
Handle MBEDTLS_ERR_NET_CONN_RESET errors
2022-04-05 13:06:06 +01:00
Sergey Lyubka b20eded30e Fix ESP32 example 2022-04-05 12:54:20 +01:00
James Hilliard 3ec17c41be Handle MBEDTLS_ERR_NET_CONN_RESET errors 2022-04-04 17:17:17 -06:00
Sergey Lyubka 0ed64707f3 Introduce MG_ENABLE_CUSTOM_MILLIS 2022-04-04 18:14:59 +01:00
Sergey Lyubka 417533e90c Merge pull request #1509 from jameshilliard/wakeup-conflict
Fix mg_mgr_wakeup conflicting types error
2022-04-04 09:16:34 +01:00
James Hilliard e268affb5a Fix mg_mgr_wakeup conflicting types error 2022-04-02 22:10:17 -06:00
Sergey Lyubka 4474ada291 Fix #1505: let mg_wakeup() return status 2022-04-03 00:17:31 +01:00
Sergey Lyubka a65c3288d8 Merge pull request #1508 from jameshilliard/mqtt-debug
Print mqtt buffer on error in tests
2022-04-03 00:11:25 +01:00
Sergey Lyubka affcef7e37 Fix clean targets 2022-04-03 00:04:58 +01:00
James Hilliard 173c2ba338 Print mqtt buffer on error in tests
This test seems to fail randomly a lot, print the buffer on error to
make it easier to isolate issues.
2022-04-02 15:26:15 -06:00
Sergey Lyubka b5fcf95b88 Enable mbedTLS 2022-04-01 21:33:09 +01:00
Sergey Lyubka d954851d43 Drop CRL from mbedTLS integration - let customer do a custom init if required 2022-04-01 16:42:41 +01:00
Sergey Lyubka df602c27d5 Disable SSI on Zephyr by default 2022-04-01 16:38:37 +01:00
Sergey Lyubka 3d9fa10485 Increase sock limit, fix multiple connections issue 2022-04-01 15:42:15 +01:00
Sergey Lyubka 6990040626 Set DNS error on UDP send error 2022-04-01 15:41:23 +01:00
Sergey Lyubka b42ea6cd3c Better logging 2022-04-01 15:41:03 +01:00
Sergey Lyubka 8c7fd8b330 Set default socket in mg_connect() to -1 2022-04-01 15:40:53 +01:00
Sergey Lyubka 4e0039625e Remove cruft 2022-03-31 18:07:15 +01:00
Sergey Lyubka 6c909f8935 Disable SNTP 2022-03-31 18:02:29 +01:00
Sergey Lyubka 4f5d385e52 Enable SNTP in zephyr example 2022-03-31 17:42:09 +01:00
Sergey Lyubka 84fe1d87b3 Enable DHCP 2022-03-31 17:26:58 +01:00
Sergey Lyubka bb0bc41f99 Add zephyr example skeleton 2022-03-31 16:58:27 +01:00
Sergey Lyubka 1c2d67ded7 Add missing arch_zephyr.h, add musl target 2022-03-30 09:06:00 +01:00
Sergey Lyubka 7372a05ce5 Add initial Zephyr support 2022-03-30 07:56:44 +01:00
Sergey Lyubka 642befa8d5 Remove unused mg_hmac_sha1() 2022-03-22 13:30:25 +00:00
Sergey Lyubka 3b5a9e2d4b Add tests for mg_ws_wrap() and messages > 128 bytes 2022-03-22 12:46:55 +00:00
Sergey Lyubka 6b3d9d9baf Add failed TLS host validation 2022-03-22 10:51:37 +00:00
Sergey Lyubka 436852d077 Enable TLS host validation in test_http_client() 2022-03-22 10:48:50 +00:00
Sergey Lyubka b78ced4fa9 Honor hostname validation for openssl 2022-03-22 08:50:37 +00:00
Sergey Lyubka 1bc81df00e Fix mg_dns_parse_name_depth() 2022-03-21 16:29:27 +00:00
Sergey Lyubka bf025537b6 Merge pull request #1495 from jameshilliard/optimize-valgrind
Run valgrind tests with appropriate compiler optimizations.
2022-03-21 15:18:58 +00:00
Sergey Lyubka ad4812218d Handle #1497 - handshake format 2022-03-21 15:17:09 +00:00
Sergey Lyubka 0fbc4b8ff4 Reuse sock.c logic in mbedtls integration 2022-03-21 14:39:27 +00:00
Sergey Lyubka 7ef82f5caf Add vc2017 target 2022-03-21 14:38:42 +00:00
Sergey Lyubka 1141ea7933 Add connection timeout 2022-03-20 18:50:01 +00:00
James Hilliard 1e9344161b Run valgrind tests with appropriate compiler optimizations. 2022-03-18 13:51:05 -06:00
Sergey Lyubka 6c021765bb Merge pull request #1479 from zudwalex/infineon_rtx_support
Add RTX-RTOS support
2022-03-18 09:18:49 +00:00
Sergey Lyubka bc151af51d Set IPv6=0 for valgrind test 2022-03-18 09:10:24 +00:00
Sergey Lyubka 8bd09e0e80 Add valgrind test 2022-03-18 09:03:18 +00:00
Sergey Lyubka 5978cb9703 Add valgrind test 2022-03-18 08:56:12 +00:00
Sergey Lyubka 8c447a95dd Fix #1483 - add valgrind target, do not use stdlib strcasecmp() 2022-03-18 08:52:54 +00:00
Sergey Lyubka 870431dc1a Enhance HTTP client example 2022-03-15 14:14:36 +00:00
Sergey Lyubka 1125b1f545 Fix #1490 - add winerror.h to fix old mingw build 2022-03-15 10:10:08 +00:00
Sergey Lyubka d255fc737a Fix mongoose.exe target 2022-03-15 10:03:00 +00:00
Sergey Lyubka 37cb51ee94 Fix #1488 - properly set non-blocking flags on accepted connections 2022-03-14 13:26:00 +00:00
Sergey Lyubka 02cabcc0ec Fix busy loop in TLS case 2022-03-14 11:16:41 +00:00
Sergey Lyubka 3ffb6c046e Merge branch 'master' of github.com:cesanta/mongoose 2022-03-11 15:40:22 +00:00
Sergey Lyubka 7bf8b81995 Fix mg_http_delete_chunk() 2022-03-11 15:38:59 +00:00
Sergey Lyubka 0ddda4a267 Merge pull request #1487 from jameshilliard/update-actions
Update actions/checkout@v2 to actions/checkout@v3
2022-03-08 12:06:08 +00:00
James Hilliard c46ad970cb Update actions/checkout@v2 to actions/checkout@v3 2022-03-06 21:59:25 -07:00
Sergey Lyubka 733abcffbc Merge pull request #1485 from jameshilliard/fix-pack-rebuild
Regenerate pack file when dependencies are changed.
2022-03-06 16:50:03 +00:00
Sergey Lyubka 139f928731 Fix #1481 - use stricter compilation flags 2022-03-06 14:31:42 +00:00
James Hilliard 3da9986232 Regenerate pack file when dependencies are changed.
Should help prevent some spurious test failures due to stale
test/packed_fs.c file.
2022-03-02 10:12:48 -07:00
Sergey Lyubka a284df01d1 Fix #1480 - use memmove instead of memcpy in mg_iobuf_resize() 2022-02-28 16:51:46 +00:00
Alex Alashkin 412f5cf3e0 Add RTX-RTOS support 2022-02-23 19:56:37 +02:00
Sergey Lyubka 42ba1e4aed Fix #1473 - calm static analyzer 2022-02-23 13:34:20 +00:00
Sergey Lyubka 1893b06c13 Fix #1472 - calm static analyzer 2022-02-23 13:31:00 +00:00
Sergey Lyubka b0cbb70e53 Fix #1471 - calm static analyzer 2022-02-23 13:30:14 +00:00
Sergey Lyubka 78e81fef27 Fix #1471 - calm static analyzer 2022-02-23 13:28:56 +00:00
Sergey Lyubka dd08231a34 Fix #1470 - calm static analyzer 2022-02-23 13:25:25 +00:00
Sergey Lyubka 8c78b7ef53 Refactor mg_alloc_conn() 2022-02-23 10:51:01 +00:00
Sergey Lyubka c650fdcdfc Move mg_listen() to net.c 2022-02-23 03:06:02 +00:00
Sergey Lyubka e99973d4b7 Introduce local address 2022-02-22 22:00:55 +00:00
Sergey Lyubka 4012a86bd8 Remove gitter chat link 2022-02-22 21:46:07 +00:00
Sergey Lyubka 048fee5c88 Fix build after mg_connect() move 2022-02-22 21:35:03 +00:00
Sergey Lyubka a287fd97e4 Factor mg_connect() to net.c 2022-02-22 21:27:08 +00:00
Sergey Lyubka 3a249183f8 Factor out mg_alloc_conn() 2022-02-22 21:14:29 +00:00
Sergey Lyubka 393dad97e0 Get rid of ctype dependencies 2022-02-22 20:20:56 +00:00
Sergey Lyubka 113abc71d4 Add SPDX identifier. Fix #1387 2022-02-22 18:13:06 +00:00
Sergey Lyubka 63261ec0d5 Use mg_http_status() 2022-02-19 16:19:51 +00:00
Sergey Lyubka 507935d067 Tiny refactoring - move clearance of the c->is_resolving flag to the mg_connect_resolved() 2022-02-19 16:17:03 +00:00
Sergey Lyubka c579b73f75 Update docs 2022-02-19 15:31:22 +00:00
Sergey Lyubka e69ec148cc Better mbedtls debug 2022-02-19 13:46:07 +00:00
Sergey Lyubka a76ade9bb2 Update packed fs 2022-02-14 17:44:43 +00:00
Sergey Lyubka 4fec149345 Disable dirlist by default 2022-02-14 11:32:01 +00:00
Sergey Lyubka 5bc164de76 Remove MG_ENABLE_DIRLIST 2022-02-14 11:19:24 +00:00
Sergey Lyubka 969b84043c Fix #1465 - rename LL_* constants, introduce MG_* log macros 2022-02-12 18:17:25 +00:00
Sergey Lyubka da72dafbfb Fix #1462 - add helper function for getting HTTP response status code. 2022-02-12 16:51:37 +00:00
Sergey Lyubka 1adf7f6b2b Handle #1463 - add missing includes for windows 2022-02-12 16:43:08 +00:00
Sergey Lyubka 3e085ccbaa Eliminate explicit _WIN32 checks 2022-02-12 14:33:43 +00:00
Sergey Lyubka 3e8e2ab513 Add optional zip cmd to pack.c 2022-02-12 14:28:02 +00:00
Sergey Lyubka 4f802ece52 Enhance mg_snrpintf tests 2022-02-11 18:15:34 +00:00
Sergey Lyubka 313ac34e59 Handle minus in the fmt spec 2022-02-11 11:02:06 +00:00
Sergey Lyubka 54f75889fa Using mg_snprintf() everywhere 2022-02-10 17:11:03 +00:00
Sergey Lyubka f64c86d23f Use mg_snprintf() 2022-02-10 11:56:55 +00:00
Sergey Lyubka 9e634310b4 Use MG_EV_HTTP_CHUNK for streaming upload 2022-02-09 12:24:06 +00:00
Sergey Lyubka 33666e7d6b Fix ESP32 example 2022-02-08 14:13:47 +00:00
Sergey Lyubka 40d4c7e410 Fix ESP32 example 2022-02-08 13:43:34 +00:00
Sergey Lyubka 8cd4699dbc Rename FS API functions to avoid conflicts 2022-02-08 13:36:04 +00:00
Sergey Lyubka 49d5aff8f9 Call realpath() against root_dir only when there are no overrides 2022-02-01 11:10:01 +00:00
Sergey Lyubka b2ee9cb363 Update docs 2022-01-29 11:12:31 +00:00
Sergey Lyubka e9c20ad992 Update docs 2022-01-29 11:11:22 +00:00
Sergey Lyubka 63b880e624 Handle #1459 - deprecate mg_globmatch, introduce mg_match() 2022-01-29 11:03:54 +00:00
Sergey Lyubka 768f67ae0a Fix #1458 - fail on example build error, and fix examples/mqtt-server 2022-01-27 12:10:03 +00:00
Sergey Lyubka fbf5fa53c6 Refactor ff_open() 2022-01-25 10:50:08 +00:00
Sergey Lyubka 4a5824e7a7 Silence error in clean target 2022-01-24 13:07:56 +00:00
Sergey Lyubka 32f3c48b65 Fix FreeBSD build 2022-01-24 02:20:45 +00:00
Sergey Lyubka f7fbcd2451 Disable leaks detection on macos 2022-01-23 06:58:06 +00:00
Sergey Lyubka c6253854ba Disable leaks detection on macos 2022-01-23 06:12:36 +00:00
Sergey Lyubka 544644e94b Refactor - always enable LOG macro. Enhance iolog 2022-01-23 06:10:14 +00:00
Sergey Lyubka f6cebf6956 Listen on INADDR_ANY by default 2022-01-22 17:03:27 +00:00
Sergey Lyubka 1b82aa02aa 7.5 -> 7.6 2022-01-21 12:41:52 +00:00
Sergey Lyubka e565a7e73d Fix #1453 - do not allow empty wakeup buffer 2022-01-21 12:35:28 +00:00
Sergey Lyubka 59c4dfa33b Fix 1452 - byte order issue in mg_check_ip_acl 2022-01-21 12:24:58 +00:00
Sergey Lyubka 1a8e3c2e31 Decrese debug verbosity 2022-01-19 18:15:47 +00:00
Sergey Lyubka 226917e1cd Use mg_str, not pointers, in mg_mqtt_{sub,pub} 2022-01-19 09:57:27 +00:00
Sergey Lyubka fe813ee247 Add buf,len params to mg_mgr_wakeup() 2022-01-19 09:25:01 +00:00
Sergey Lyubka 4cd830a0bf Improve ff_write - save large blocks in chunks 2022-01-19 08:43:34 +00:00
Sergey Lyubka 1259ca9ac9 Add missing mkdir() on ARM targets 2022-01-18 19:31:10 +00:00
Sergey Lyubka d0857fe36c Add mkdir to the FS API 2022-01-18 19:19:34 +00:00
Sergey Lyubka 56a7438114 Add fs arg to mg_file* and mg_http_upload API 2022-01-18 17:11:02 +00:00
Sergey Lyubka 09df542db8 Fix unamalgamated build 2022-01-18 08:02:41 +00:00
Sergey Lyubka 1df102ab93 Add Fat FS support 2022-01-18 07:44:30 +00:00
Sergey Lyubka 02b3b780bb Add missing fs.c 2022-01-17 14:44:59 +00:00
Sergey Lyubka f84f3da012 Change in FS API for fs->open() and fs->close() 2022-01-17 14:42:41 +00:00
Sergey Lyubka c65c8fdaaa Protect against the directory traversal in mg_upload() 2022-01-17 12:08:23 +00:00
Sergey Lyubka b484123f1b gcc and clang 2022-01-15 01:45:31 +00:00
Sergey Lyubka b60119790e Fix wrong memcmp usage in mg_url_port() 2022-01-14 12:45:55 +00:00
Sergey Lyubka 216427cea0 Cleanup suseconds_t usage 2022-01-14 12:33:06 +00:00
Sergey Lyubka c53e2fcc14 Fix #1444 - clang warns on undefined behavior with null pointers 2022-01-14 09:55:15 +00:00
Sergey Lyubka 9fd80fd136 Fix #1445 - send error to a resolving connection when DNS error happens 2022-01-14 08:50:01 +00:00
Sergey Lyubka 5fc284722f Fix #1448 - fix MG_ENABLE_FILE build 2022-01-14 08:21:12 +00:00
Sergey Lyubka ad6e395da0 Fix #1447 - typo in mg_random() 2022-01-14 08:18:28 +00:00
Sergey Lyubka 6c79a406cd Fix localtime_r and gmtmime_r signatures 2022-01-11 19:15:38 +00:00
Sergey Lyubka 456e8bd249 Use 3 params for fcntl() 2022-01-10 18:21:13 +00:00
Sergey Lyubka de95f28598 Make stat and struct stat changeable 2022-01-10 18:07:45 +00:00
Sergey Lyubka 43405afdb2 Dont use ctype.h from str.h 2022-01-10 17:30:51 +00:00
Sergey Lyubka 97f95e17db Better strategy for restoring multicast address 2022-01-07 18:40:48 +00:00
Sergey Lyubka 6725d61b3f Re-init SSDP peer address before every search 2022-01-07 18:28:51 +00:00
Sergey Lyubka ebda2cb100 Use sendto on Mac too 2022-01-07 16:31:29 +00:00
Sergey Lyubka bb72b2494d Fix unamalgamated target 2022-01-07 15:48:09 +00:00
Sergey Lyubka 3b0a509cae Change mg_resolve() 2022-01-07 15:00:10 +00:00
Sergey Lyubka 2f981f9383 Skip connect() on UDP connection 2022-01-06 15:42:55 +00:00
Sergey Lyubka fc3c08e411 Change mg_straddr() API 2022-01-05 19:09:11 +00:00
Sergey Lyubka ff811f287a Squash warnings 2022-01-05 13:57:30 +00:00
Sergey Lyubka 8ebb3bc37b More detailed debug log - show ip/port for sender and receiver 2022-01-05 13:47:11 +00:00
Sergey Lyubka f7ff571c5f Added SSDP search example 2022-01-05 13:22:00 +00:00
Sergey Lyubka 6a82cbee71 Send MG_EV_WRITE for UDP messages 2022-01-05 13:03:56 +00:00
Sergey Lyubka b0585bd0a9 Do not set c->label for DNS connections - let labels be user-only-settable 2022-01-05 11:46:26 +00:00
Sergey Lyubka 6ad4d242c2 Better cleanup 2022-01-05 11:45:22 +00:00
Sergey Lyubka 030b1d9826 Remove wrong comment 2021-12-27 03:31:33 +00:00
Sergey Lyubka f6ffa7b3b9 Add huge-response example 2021-12-27 03:25:28 +00:00
Sergey Lyubka 137efe2233 Show requests in flight 2021-12-24 20:46:31 +00:00
Sergey Lyubka 62411d039e Increase mqtt timeouts 2021-12-24 12:14:06 +00:00
novlean 54b1716e77 Merge pull request #1436 from cesanta/novlean-patch-1
Update README.md
2021-12-23 17:18:55 +00:00
novlean 9f7aba8039 Update README.md 2021-12-23 17:18:45 +00:00
Sergey Lyubka a176b8d566 Upate docs w.r.t. mg_mqtt_opts 2021-12-23 11:12:10 +00:00
Sergey Lyubka 26a97ec36c Fix #1434 - set will QoS in CONNECT message correctly, and rename qos -> will_qos in struct mg_mqtt_opts 2021-12-23 11:00:18 +00:00
Sergey Lyubka f29807aad8 Resolve root path before serving to avoid double dots 2021-12-22 18:05:03 +00:00
Sergey Lyubka 92d3c7a4cd Add realpath() for Win32 2021-12-22 18:04:36 +00:00
Sergey Lyubka af3a0f6af0 Add realpath() for Win32 2021-12-22 18:04:27 +00:00
Sergey Lyubka ce6164ca20 Fail stat() if S_ISDIR is not defined 2021-12-22 18:04:16 +00:00
Sergey Lyubka e9fc3fcecf Update event enum 2021-12-21 22:20:42 +00:00
Sergey Lyubka 25a1a24890 Fallback to time(0) in mg_millis() 2021-12-21 22:04:03 +00:00
Sergey Lyubka bf7fc1d5a9 Amalgamate 2021-12-21 21:58:03 +00:00
Sergey Lyubka 2126b49ab3 Merge pull request #1433 from ryuukk/patch-2
Remove debugging left over
2021-12-21 21:56:41 +00:00
Sergey Lyubka ae6767b1d2 Use int64_t for timers and mg_millis() 2021-12-21 21:50:18 +00:00
ryuukk 133629dbee Remove debugging left over 2021-12-21 21:28:22 +01:00
Sergey Lyubka fb0a9bc7e3 Fix build 2021-12-21 18:16:12 +00:00
Sergey Lyubka 2a3492766f Remove mg_time() and mg_usleep() 2021-12-21 17:44:34 +00:00
Sergey Lyubka 2ec7e5653e Merge branch 'master' of github.com:cesanta/mongoose 2021-12-21 17:40:04 +00:00
Sergey Lyubka 30bfb245f5 Make mongoose more bare-metal Keil friendly. Declare settings after arch. Introduce MG_ENABLE_FILE 2021-12-21 17:39:55 +00:00
Sergey Lyubka 84d89bc4f5 Merge pull request #1431 from ryuukk/patch-1
Closed WS connection is not an error for the logger
2021-12-21 08:47:21 +00:00
ryuukk 7f55fabfec Closed WS connection is not an error for the logger 2021-12-21 01:34:48 +01:00
Sergey Lyubka 9e0f04dc8b Add -S option 2021-12-20 16:35:16 +00:00
Sergey Lyubka 574c2954b3 Docs nitpick 2021-12-19 10:53:17 +00:00
Sergey Lyubka 9d38e26b81 Add MG_HTTP_INDEX build var 2021-12-17 13:54:01 +00:00
Sergey Lyubka 4e75a0c81e 7.4 -> 7.5 2021-12-17 13:34:32 +00:00
Sergey Lyubka d311e967fa Add mingw target 2021-12-16 09:22:28 +00:00
Sergey Lyubka d0a6c111cb Call MG_EV_ERROR with c->is_closing set 2021-12-15 11:31:42 +00:00
Sergey Lyubka aa6d8b4662 Remove TLS custom_init() API 2021-12-15 11:04:43 +00:00
Sergey Lyubka 3f5fd89fd7 Pass more args to custom TLS init 2021-12-14 13:21:59 +00:00
Sergey Lyubka f43a5a005c Introduce custom TLS init function 2021-12-14 13:04:11 +00:00
Sergey Lyubka 755bf3c412 Split TLS files and introduce MG_ENABLE_CUSTOM_TLS 2021-12-14 12:42:41 +00:00
Sergey Lyubka 84f3fb0ba5 Move EXTERN_C to util.h 2021-12-14 12:11:05 +00:00
Sergey Lyubka f2df6c114d Example for mg_http_bauth 2021-12-13 15:14:29 +00:00
Sergey Lyubka f93659e303 Merge branch 'master' of github.com:cesanta/mongoose 2021-12-13 15:08:14 +00:00
Sergey Lyubka 226404d39c Example for mg_http_bauth 2021-12-13 15:08:05 +00:00
Sergey Lyubka c1bcc143b9 Merge pull request #1417 from DavidKorczynski/cifuzz-integration
Add CIFuzz integration
2021-12-13 11:35:31 +00:00
Sergey Lyubka 5ca9062d45 Less verbose serve_dir 2021-12-07 15:23:02 +00:00
Sergey Lyubka 0b209eaabb Add mg_http_get_header_var() 2021-12-03 09:54:03 +00:00
David Korczynski 47ef191ea2 Add CIFuzz integration 2021-11-30 22:48:20 +00:00
Sergey Lyubka 25e76d761e Fix usage message 2021-11-29 14:00:03 +00:00
Sergey Lyubka 9731a51dae Recognise :PORT as a valid URL 2021-11-29 13:57:33 +00:00
Sergey Lyubka 81220fa590 Remove noisy debug 2021-11-26 16:23:06 +00:00
Sergey Lyubka 24e8c4d81a Increase SNMP test timeout 2021-11-25 17:31:41 +00:00
Sergey Lyubka 013520b0c0 Add note for mg_http_serve_dir() 2021-11-25 12:29:45 +00:00
Sergey Lyubka f012bcb027 Update issue template 2021-11-25 11:47:26 +00:00
Sergey Lyubka 922e1ce529 Make captive portal work on Linux 2021-11-23 17:52:54 +00:00
Sergey Lyubka 7a707cc64b Add README 2021-11-23 15:08:34 +00:00
Sergey Lyubka 1967acfef2 Make it build on vc98 2021-11-23 13:24:21 +00:00
Sergey Lyubka e24cb04003 Update URL 2021-11-23 09:37:03 +00:00
Sergey Lyubka 67974746ff Add json-rpc-over-ws example 2021-11-22 16:45:14 +00:00
Sergey Lyubka 8d916d41d7 Fix #1409 - remove VLA which confuses MSVC 2021-11-22 12:24:58 +00:00
Sergey Lyubka 08444e3942 Fix links and typos 2021-11-16 12:30:40 +00:00
Sergey Lyubka 9c41a0cd26 Fix links 2021-11-16 09:54:36 +00:00
Sergey Lyubka 2c50069d98 Do not clean the recv buffer 2021-11-14 16:47:40 +00:00
Sergey Lyubka 31059f6728 Add test.html 2021-11-14 14:31:51 +00:00
Sergey Lyubka 2000752b2c Remove dead code 2021-11-11 15:15:47 +00:00
Sergey Lyubka dd34830443 Update README 2021-11-11 15:11:57 +00:00
Sergey Lyubka c58f4ee51b Add symlinks 2021-11-11 14:21:52 +00:00
Sergey Lyubka 00f7e8cb2a Support wildcards 2021-11-11 12:08:17 +00:00
Sergey Lyubka 439904e27f Add signal handler 2021-11-11 10:35:41 +00:00
Sergey Lyubka 4d6590ece2 Add readme 2021-11-11 10:29:16 +00:00
Sergey Lyubka 9b0c4b970d Add README.md 2021-11-11 08:26:31 +00:00
Sergey Lyubka a80ce1b12a Add signal handler 2021-11-11 07:36:25 +00:00
Sergey Lyubka 57dd74c180 Add reconnection logic 2021-11-10 12:57:02 +00:00
Sergey Lyubka 90c67e4226 Reformatting for better readability 2021-11-06 11:29:56 +00:00
Sergey Lyubka 093cd6a6a3 Fix FD_CLOEXEC setting 2021-11-05 13:30:12 +00:00
Sergey Lyubka 975db86306 Add READMEs 2021-11-05 13:02:36 +00:00
Sergey Lyubka eba688e11b Update docs 2021-11-04 23:07:47 +00:00
Sergey Lyubka 05b44204d5 Set FD_CLOEXEC properly 2021-11-04 18:28:32 +00:00
Sergey Lyubka 0bb017c1d5 Add examples/mqtt-client-aws-iot 2021-11-03 20:58:57 +00:00
Sergey Lyubka a6efd0b335 Merge branch 'master' into dec 2021-11-02 22:43:59 +00:00
Sergey Lyubka c3d237e9c6 More verbose log 2021-11-02 22:43:23 +00:00
Sergey Lyubka 09d28f5570 Print a clarifying message at start 2021-11-02 16:53:57 +00:00
Sergey Lyubka ba02937ec6 Squash warnings 2021-11-02 16:40:25 +00:00
Sergey Lyubka 3d78b14deb Fix #1396 - JS sorting code for dir listing 2021-11-02 16:01:06 +00:00
Sergey Lyubka f558551d1d Fix #1395 - show decoded URI in dir listing 2021-11-02 15:11:56 +00:00
Sergey Lyubka 12fe66370f Fix #1393 - cleanup mime types 2021-11-01 20:31:45 +00:00
Sergey Lyubka 423aaa492c Fix #1394 - mg_mqtt_sub(). Add MG_EV_OPEN, too. 2021-11-01 16:20:00 +00:00
Sergey Lyubka 2016586475 Clearer client init 2021-11-01 13:29:44 +00:00
Sergey Lyubka bf88167152 Add missing test files 2021-10-31 12:50:06 +00:00
Sergey Lyubka 52be84f04e Add user and pass to struct mg_mqtt_opts 2021-10-31 12:48:32 +00:00
Sergey Lyubka 03d187b147 Fix #1375 - change event processing order 2021-10-31 12:40:56 +00:00
Sergey Lyubka 3329047579 More explicit check on hm->uri.len 2021-10-31 12:37:40 +00:00
Sergey Lyubka 86c70e5abb Fix #1391 - make remove_double_dots less aggressive 2021-10-31 12:36:34 +00:00
Sergey Lyubka b17f4108ea Change MG_PATH_MAX for ESP8266 2021-10-30 19:34:53 +01:00
Sergey Lyubka 4e523cc455 Remove binary section 2021-10-27 20:13:05 +01:00
Sergey Lyubka 49c9be9159 Set MG_IO_SIZE -> 128 2021-10-27 19:20:52 +01:00
Sergey Lyubka f1bfe0760f Optimise TLS read 2021-10-27 19:18:44 +01:00
Sergey Lyubka 35f02fdaad Use small IO buffer 2021-10-27 19:18:19 +01:00
Sergey Lyubka 6ac09966ba Fix #1374 - fix ESP32 build 2021-10-22 22:06:10 +01:00
Sergey Lyubka af9a7617f5 Merge pull request #1381 from ptsolakos/master
Certificate revocation checking when using mbedtls
2021-10-22 20:30:47 +01:00
Sergey Lyubka 42c89732c8 Remove private.h 2021-10-22 19:41:26 +01:00
Sergey Lyubka 054475ddbf Fix #1376 - handle comma for unquoted header vars 2021-10-22 14:33:51 +01:00
Sergey Lyubka 126d556d6a Merge pull request #1380 from jameshilliard/fix-time
util: Actually return uptime on OSX/Linux for mg_millis
2021-10-22 14:06:44 +01:00
Sergey Lyubka 529a302e77 Merge pull request #1379 from jameshilliard/fix-sntp
sntp: Don't set Leap Indicator in client messages.
2021-10-22 14:04:54 +01:00
Sergey Lyubka acbf978452 Merge pull request #1378 from jameshilliard/undef
Fix some undefined macro warnings.
2021-10-22 14:03:42 +01:00
Sergey Lyubka 90b22716ea Merge branch 'master' into undef 2021-10-22 14:03:25 +01:00
Sergey Lyubka fb90c504a6 Remove private.h 2021-10-22 14:00:31 +01:00
Sergey Lyubka 65fd834654 Increate mqtt test timeout 2021-10-22 13:58:51 +01:00
Sergey Lyubka a84acf5b8b Merge pull request #1385 from zudwalex/move_stm32_examples
Move STM32 examples to stm32 folder
2021-10-22 13:39:13 +01:00
Sergey Lyubka e9505db146 Merge pull request #1384 from zudwalex/master
Add more NXP examples and move them to nxp folder
2021-10-22 13:39:02 +01:00
Sergey Lyubka 4fb49b011e Merge pull request #1377 from jameshilliard/missing-prototypes
Make private functions static and add missing prototypes.
2021-10-22 13:16:06 +01:00
Alex Alashkin 6742991469 Move STM32 examples to stm32 folder 2021-10-22 14:19:50 +03:00
Alex Alashkin 2430cc5aac Add more NXP examples and move them to nxp folder 2021-10-22 14:04:15 +03:00
Sergey Lyubka 54590aaf26 Use UDP sendto() on win32 only 2021-10-22 09:14:18 +01:00
Sergey Lyubka 7c5e67b272 Fix #1382 - use sendto for UDP send 2021-10-22 08:56:45 +01:00
Sergey Lyubka c62c8ea4dd Correct licensing URL 2021-10-20 10:04:49 +01:00
Panagiotis Tsolakos 383653d608 mbedtls CRL support
Certificate revocation checking when using mbedtls
2021-10-14 17:56:31 +02:00
James Hilliard 001dc3f33d util: Actually return uptime on OSX/Linux for mg_millis
The documentation for mg_millis indicates it will:
Return current uptime in milliseconds.

So we should use API's that actually return uptime.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2021-10-13 17:06:18 -06:00
James Hilliard 37d45b3fbb sntp: Don't set Leap Indicator in client messages.
Per RFC4330:
This field is significant only in server messages

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2021-10-13 16:48:33 -06:00
James Hilliard f72b8c6034 Fix some undefined macro warnings.
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2021-10-13 13:06:00 -06:00
James Hilliard c11e5a9383 Make private functions static and add missing prototypes.
Fixes:
mongoose/mongoose.c:180:8: warning: no previous prototype for ‘mg_dns_parse_name’ [-Wmissing-prototypes]
  180 | size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs, char *dst,
      |        ^~~~~~~~~~~~~~~~~
mongoose/mongoose.c:306:6: warning: no previous prototype for ‘mg_dns_send’ [-Wmissing-prototypes]
  306 | void mg_dns_send(struct mg_connection *c, const struct mg_str *name,
      |      ^~~~~~~~~~~
mongoose/mongoose.c:925:6: warning: no previous prototype for ‘mg_http_parse_headers’ [-Wmissing-prototypes]
  925 | void mg_http_parse_headers(const char *s, const char *end,
      |      ^~~~~~~~~~~~~~~~~~~~~
mongoose/mongoose.c:1125:7: warning: no previous prototype for ‘mg_http_etag’ [-Wmissing-prototypes]
 1125 | char *mg_http_etag(char *buf, size_t len, size_t size, time_t mtime) {
      |       ^~~~~~~~~~~~
mongoose/mongoose.c:2578:6: warning: no previous prototype for ‘mg_sha1_transform’ [-Wmissing-prototypes]
 2578 | void mg_sha1_transform(uint32_t state[5], const unsigned char buffer[64]) {
      |      ^~~~~~~~~~~~~~~~~
mongoose/mongoose.c:2976:8: warning: no previous prototype for ‘mg_open_listener’ [-Wmissing-prototypes]
 2976 | SOCKET mg_open_listener(const char *url, struct mg_addr *addr) {
      |        ^~~~~~~~~~~~~~~~

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2021-10-12 20:18:11 -06:00
Sergey Lyubka b5147a149e Merge pull request #1373 from zudwalex/fix_board_ci
Use mongoose.[ch] from main repo
2021-10-06 12:31:27 +01:00
Alex Alashkin 655529f30b Use mongoose.[ch] from parent repo 2021-10-06 13:15:12 +03:00
novlean fd5319e0ce Merge pull request #1372 from cesanta/novlean-patch-1
license
2021-10-05 17:09:43 +01:00
novlean f8c84ca672 license 2021-10-05 17:09:35 +01:00
novlean 1b81ac8916 Merge pull request #1371 from cesanta/novlean-patch-1
mongoose.ws
2021-10-05 16:54:43 +01:00
novlean c64e2ebb16 mongoose.ws 2021-10-05 16:54:34 +01:00
Sergey Lyubka 3771f2c088 Merge branch 'master' of github.com:cesanta/mongoose 2021-10-04 19:47:34 +01:00
Sergey Lyubka 6d398bd5c7 Fix mg_random() for ESP32 2021-10-04 19:47:24 +01:00
Sergey Lyubka 5c355a5ff3 Merge pull request #1368 from zudwalex/nxp_examples
Add NXP examples
2021-10-04 12:04:00 +01:00
Alex Alashkin d2f8b346e6 Add nxp to actions 2021-10-04 13:15:32 +03:00
Alex Alashkin 5cdaa931f9 Add NXP examples 2021-10-04 12:54:15 +03:00
Sergey Lyubka 693863a51e Merge pull request #1366 from zudwalex/fix_rtos_lwip
Add missed include for FreeRTOS/LwIP arch
2021-10-02 22:45:08 +01:00
Sergey Lyubka a204c80308 Update ca.pem links 2021-10-01 09:25:34 +01:00
Sergey Lyubka 7d620965e2 Update ca.pem: DST root CA has expired 2021-10-01 09:22:49 +01:00
Sergey Lyubka 0149654791 Update README 2021-10-01 08:26:34 +01:00
Sergey Lyubka f08d280429 Version 7.4 2021-09-30 13:35:44 +01:00
Sergey Lyubka 6fbb749431 7.4 -> 7.5 2021-09-30 13:34:55 +01:00
Alex Alashkin bc7178e5f7 Add missed include 2021-09-29 12:25:25 +03:00
Sergey Lyubka 61070d136d Add nxp-mimxrt1020-azurertos to Actions 2021-09-27 13:55:19 +01:00
Sergey Lyubka ea85f93e37 Merge branch 'master' of github.com:cesanta/mongoose 2021-09-27 13:52:59 +01:00
Sergey Lyubka 46029c501a Fix #1359 - add conditional for MSVC, _DEBUG and strdup 2021-09-27 13:52:39 +01:00
Sergey Lyubka 78e1fdd1c9 Merge pull request #1365 from zudwalex/mimxrt1020_example
Add NXP MIMXRT1020 AzureRTOS example
2021-09-27 11:50:48 +01:00
Alex Alashkin 9ef5c7c667 Add NXP MIMXRT1020 AzureRTOS example 2021-09-27 11:12:15 +03:00
Sergey Lyubka cdf279e438 Merge pull request #1358 from yermin/master
makes it more readable
2021-09-27 09:00:11 +01:00
Sergey Lyubka cdd192abe4 Merge pull request #1363 from tophatgeeks/patch-1
Update README - Jordan Ramsey Edits.md
2021-09-27 08:44:42 +01:00
Sergey Lyubka 9af6f4b02e Merge pull request #1360 from zudwalex/azure_basics
Add AzureRTOS basic support
2021-09-27 08:39:15 +01:00
Alex Alashkin d86ceecd8c Add AzureRTOS basic support 2021-09-26 10:25:44 +03:00
yermin 8f693b92a7 makes it more readable
Signed-off-by: yermin <yermin@buaa.edu.cn>
2021-09-24 11:30:21 +08:00
tophatgeeks 6b1ff37cf3 Update README.md
I have gone through and edited for consistency, punctuation, wording, and grammar. If you have questions feel free to reach out.  I fixed some spelling errors "if" instead of "is" "update" instead of "updatw", etc. 

-Jordan Ramsey
2021-09-23 12:07:00 -04:00
Sergey Lyubka c490ff8ae7 Fix typo 2021-09-22 20:38:28 +01:00
Sergey Lyubka f73ebbf689 Fix #1354 - report correct errno in mg_open_listener() 2021-09-22 18:52:42 +01:00
Sergey Lyubka 1928ba9c1f Merge branch 'master' of github.com:cesanta/mongoose 2021-09-22 11:51:26 +01:00
Sergey Lyubka ad3655fb92 Docs spelling 2021-09-22 11:51:16 +01:00
novlean 29e0158689 Merge pull request #1355 from cesanta/novlean-patch-1
2021
2021-09-21 18:07:33 +01:00
novlean aaf55b6da0 2021 2021-09-21 18:02:11 +01:00
Sergey Lyubka 90a131bd29 Include ipv6 wrapping brackets [] in the result of mg_url_host() 2021-09-21 08:10:27 +01:00
Sergey Lyubka 8652006aea Remove dead code 2021-09-20 12:26:09 +01:00
Sergey Lyubka 2139fbc4b7 Support multiple web roots 2021-09-20 12:24:44 +01:00
Sergey Lyubka 2b48e8b03a Send suback 2021-09-18 20:56:56 +01:00
Sergey Lyubka a7afea0963 Handle ipv4-mapped addresses 2021-09-18 19:38:59 +01:00
Sergey Lyubka 9d1e61de93 Update docs 2021-09-17 15:59:15 +01:00
Sergey Lyubka 9b6b1a68f4 Add MQTT version check 2021-09-17 14:02:29 +01:00
Sergey Lyubka c7bd63ef53 Fix #1351 - squash warning 2021-09-17 11:07:20 +01:00
Sergey Lyubka 40b3382023 Enable WS data size check 2021-09-17 10:56:58 +01:00
Sergey Lyubka a70c5e726d Merge branch 'master' of github.com:cesanta/mongoose 2021-09-16 11:17:02 +01:00
Sergey Lyubka 409fdaec59 Rename posix_* -> p_* to avoid build conflict on linux 2021-09-16 11:16:10 +01:00
Sergey Lyubka 372aa369c4 Merge pull request #1350 from zudwalex/mg_parameters_retval
Add parameters descriptions to documentation
2021-09-15 20:51:18 +01:00
Alex Alashkin eb94704d8d Add params and retvals 2021-09-15 22:18:44 +03:00
Sergey Lyubka 894a168833 Get rid of fs->realpath 2021-09-15 07:43:48 +01:00
Sergey Lyubka f3eb466af3 Update docs 2021-09-15 07:43:24 +01:00
Sergey Lyubka df848973dc Fix unamalgamated target 2021-09-14 12:27:02 +01:00
Sergey Lyubka f37e5ecc38 WS frame len sanity check 2021-09-14 10:26:03 +01:00
Sergey Lyubka 6316609a5f Show log level 2021-09-13 13:48:02 +01:00
Sergey Lyubka dca08d32bd Fix URL 2021-09-13 13:47:49 +01:00
Sergey Lyubka 2b287f50f1 Add gitter badge 2021-09-02 10:28:16 +01:00
Sergey Lyubka acf58972f7 Fix posix_open() 2021-09-02 10:20:55 +01:00
Sergey Lyubka 5bf5516b29 struct iobuf doc 2021-08-30 13:06:45 +01:00
Sergey Lyubka 40b99e3751 Print openssl error on TLS error 2021-08-30 11:45:30 +01:00
Sergey Lyubka 28a56370d4 Fix zeromem() call in mg_iobuf_del() 2021-08-30 11:39:19 +01:00
Sergey Lyubka e3589577ed Update OpenSSL handshake error codepath 2021-08-29 16:54:24 +01:00
Sergey Lyubka 38beb4cbc0 Update readme 2021-08-28 22:00:46 +01:00
Sergey Lyubka 167af7f160 docs update 2021-08-28 20:27:55 +01:00
Sergey Lyubka 7d91885413 Update docs 2021-08-28 11:16:45 +01:00
Sergey Lyubka 0de83157dc Update docs 2021-08-28 08:52:41 +01:00
Sergey Lyubka cc9639b3cb Update docs 2021-08-28 08:48:47 +01:00
Sergey Lyubka cb0ac1868f Update docs 2021-08-28 08:46:01 +01:00
Sergey Lyubka e653147119 Merge pull request #1344 from timgates42/bugfix_typo_priority
docs: fix simple typo, priorty -> priority
2021-08-28 08:37:26 +01:00
Sergey Lyubka f3d15a0440 Update docs 2021-08-28 08:25:31 +01:00
Sergey Lyubka 0bc736d384 Update docs 2021-08-28 08:23:33 +01:00
Sergey Lyubka 3bf7b817f6 Update docs 2021-08-28 08:21:29 +01:00
Sergey Lyubka 477e48bf54 mg_iobuf_append -> mg_iobuf_add 2021-08-28 08:08:54 +01:00
Sergey Lyubka 913e730ec2 mg_iobuf_delete -> mg_iobuf_del 2021-08-28 07:16:38 +01:00
Sergey Lyubka bd64043377 mg_comma -> mg_commalist 2021-08-28 06:54:56 +01:00
Tim Gates 9f827feeaa docs: fix simple typo, priorty -> priority
There is a small typo in examples/stm32-freertos-tcp/stm32f7/core_cm7.h.

Should read `priority` rather than `priorty`.
2021-08-28 07:46:08 +10:00
Sergey Lyubka 714b7a8145 Handle WS fragmentation 2021-08-27 10:25:24 +01:00
Sergey Lyubka 7ba6fda236 Add stm32-nucleo-h743z and stm32-nucleo-f429z 2021-08-26 11:40:47 +01:00
Sergey Lyubka fc9c454518 Add mg_check_ip_acl() 2021-08-25 07:59:31 +01:00
Sergey Lyubka 1c456fc2df mg_next_comma_entry -> mg_comma 2021-08-23 16:54:58 +01:00
Sergey Lyubka 9b37ac384f Merge pull request #1341 from lnksz/bugfix-1340-http_chunked
Fix #1340: Long HTTP Chunks
2021-08-23 14:50:39 +01:00
Sergey Lyubka 99b279d5e5 Add examples/stm32-nucleo-f746z 2021-08-23 10:38:11 +01:00
Kristof Havasi 4d07a99ee2 Fix bug in long HTTP chunk handling
Due to a copy/paste error, the start of the payload in the latest parsed
chunk was compared to chunk-length of the terminating chunk (5 chars).
So only chunks were parsed as expected, which also had a single hex
digit length.
2021-08-23 08:50:58 +02:00
Kristof Havasi f6f0e49de4 Add failing test for HTTP chunk
This test would have caught #1340: handling chunks longer than 15 chars
2021-08-23 08:19:46 +02:00
Sergey Lyubka 07568a8f06 Docs nits 2021-08-22 10:51:40 +01:00
Sergey Lyubka 71e9019211 Docs nitpicks 2021-08-20 20:31:32 +01:00
Sergey Lyubka 0937213f4b Merge pull request #1336 from zudwalex/freertos_lwip_support
Update FREERTOS + LWIP support
2021-08-12 12:57:06 +01:00
Sergey Lyubka 6c42350fcf docs 2021-08-12 12:24:28 +01:00
Alex Alashkin 453d4be4d0 Update FREERTOS + LWIP support 2021-08-12 13:54:43 +03:00
Sergey Lyubka 104c4fab19 More docs 2021-08-11 19:24:33 +01:00
Sergey Lyubka fd5eb2d3f9 Refactor mg_mkpipe() 2021-08-11 19:17:04 +01:00
Sergey Lyubka 8b770d2a0d Fix #1334 - typo in mg_call(..MG_EV_WS_OPEN) call 2021-08-11 04:52:39 +01:00
Sergey Lyubka b739aa89f1 Update readme 2021-08-09 09:43:21 +01:00
Sergey Lyubka 11c07470bb Refactor UDP handling 2021-08-07 22:55:13 +01:00
Sergey Lyubka 76865cbe14 Fix STM32 build 2021-08-07 17:52:51 +01:00
Sergey Lyubka b7ce8213d7 Better multithreading support: remove mg_socketpair, add mg_mkpipe() and mg_rmpipe() 2021-08-07 17:22:47 +01:00
Sergey Lyubka 86f43cd8d6 Refactor mg_socketpair and document MG_ENABLE_NATIVE_SOCKETPAIR 2021-08-06 10:23:08 +01:00
Sergey Lyubka 2407509ce0 More detailed environment questions 2021-08-05 10:49:24 +01:00
Sergey Lyubka 47ce072af7 Fix #1331 - add comment about order of operations in conn_close() 2021-08-05 10:39:24 +01:00
Sergey Lyubka c2c6ff11ed Fix #1329 - send MG_EV_WS_OPEN for server connections 2021-08-04 11:38:32 +01:00
Sergey Lyubka 9b18a6350a Make ws_upgrade() respond with error if request is not and upgrade 2021-08-03 23:37:50 +01:00
Sergey Lyubka a36050ab4b Fix #1326 - spelling errors 2021-08-02 00:23:01 +01:00
Sergey Lyubka 568484f079 Fix #920 - add MQTT over Websocket client example 2021-08-01 14:10:21 +01:00
Sergey Lyubka 3ea4f1fda8 Merge pull request #1324 from ignacionr/fix/issue-1323
allow for in-url colon, when port is not specified
2021-07-31 22:30:04 +01:00
Sergey Lyubka 5366844581 Fix #1325 - squash gcc 10 warning, and optimise casts 2021-07-31 22:26:43 +01:00
Ignacio Rodriguez e52a6184c4 test and fix 2021-07-30 12:34:55 -05:00
Sergey Lyubka b40b1232cc Enhance packed fs serving 2021-07-30 17:41:23 +01:00
Sergey Lyubka 3a46055e52 Better packed test 2021-07-30 13:19:20 +01:00
Sergey Lyubka 2af5d07467 Fix stm32 GA 2021-07-29 14:28:20 +01:00
Sergey Lyubka c2176f969b Implement FS virtualization 2021-07-29 14:21:20 +01:00
Sergey Lyubka 9346122c29 Add FS API layer 2021-07-28 21:11:07 +01:00
Sergey Lyubka b98556a4dc Enable mg_fopen_packed on ARM 2021-07-27 09:54:45 +01:00
Sergey Lyubka 55d102e450 Enable mg_fopen_packed in newlib 2021-07-27 09:50:11 +01:00
Sergey Lyubka dfc22af10f Run docker non-interactive 2021-07-26 18:18:29 +01:00
Sergey Lyubka 2d585474c1 Add riscv target, enhance arm target 2021-07-26 11:00:37 +01:00
Sergey Lyubka 53ee984eb7 Fix mg_prefix test 2021-07-26 09:26:52 +01:00
Sergey Lyubka bdb747f9de Fix mg_prefix test 2021-07-26 09:15:17 +01:00
Sergey Lyubka 299075c930 Add test for fopen_packed() 2021-07-26 09:05:34 +01:00
Sergey Lyubka b0e0247b21 Add ascii to the packed data 2021-07-25 21:08:02 +01:00
Sergey Lyubka 35abd695cd Add packed FS 2021-07-25 10:22:56 +01:00
Sergey Lyubka df2ffd1187 Refactor serve dir even more 2021-07-24 22:00:37 +01:00
Sergey Lyubka b378082ec4 Refactor mg_http_serve_dir() 2021-07-24 21:48:19 +01:00
Sergey Lyubka fb4fae9174 Optimise file serving path 2021-07-24 21:23:52 +01:00
Sergey Lyubka cddff2b1b8 Cleanup on riscv baremetal build 2021-07-24 11:40:52 +01:00
Sergey Lyubka d6dbf831f7 Remove mg_stat 2021-07-24 10:35:48 +01:00
Sergey Lyubka 7e1d4325ec Fail examples target if any example fails 2021-07-24 08:45:51 +01:00
Sergey Lyubka 2a2c17a232 Remove MG_ENABLE_STDIO and cleanup 2021-07-24 03:44:00 +01:00
Sergey Lyubka d130c6f42d Remove leftovers 2021-07-24 02:44:25 +01:00
Sergey Lyubka a09238debd Place config.h before arch*.h 2021-07-23 20:48:48 +01:00
Sergey Lyubka 328a87b02a Remove mg_file_size() 2021-07-23 20:18:34 +01:00
Sergey Lyubka 529faa1172 MG_ENABLE_FS -> MG_ENABLE_STDIO 2021-07-23 19:47:26 +01:00
Sergey Lyubka 8e5efd4804 7.3 -> 7.4 2021-07-23 12:17:05 +01:00
Sergey Lyubka 32406b678b Increase sntp test timeout 2021-07-22 23:03:20 +01:00
Sergey Lyubka 55e2077a46 Use mg_fopen only on win32 2021-07-22 22:46:33 +01:00
Sergey Lyubka a771d6a19d Add unicode filename 2021-07-22 20:16:50 +01:00
Sergey Lyubka 0d5d7bb26f Keep directory listing compile-time option 2021-07-21 11:05:27 +01:00
Sergey Lyubka 3808dd3222 Update issue template 2021-07-21 10:31:48 +01:00
Sergey Lyubka 8fc94e12af Add enable_dirlist to mg_http_serve_opts 2021-07-20 17:22:41 +01:00
Sergey Lyubka 824e33ef8a Merge pull request #1319 from ignacionr/patch-1
The sanitiser pointed out this problem
2021-07-20 16:46:30 +01:00
Sergey Lyubka 655f9a9f79 Add Content-Type header to the SSI files 2021-07-20 11:33:38 +01:00
Ignacio Rodríguez 6ac6aa521c The sanitiser pointed out this problem
And I believe it's right. Other-side-close should be done only for the 'A' (proxy-client-side) connection.
2021-07-20 00:04:05 -05:00
Sergey Lyubka 3982e065c8 Fix #1315, fix #1317 - use #ifndef instead of #pragma once for compilers that do not support #pragma once 2021-07-19 09:04:18 +01:00
Sergey Lyubka 497b8027f5 Fix #1314 - expose local port for listeners 2021-07-19 08:47:38 +01:00
Sergey Lyubka 89757388c7 Disable SSL v1.1 2021-07-16 12:10:48 +01:00
Sergey Lyubka 77fae5c562 Fix #1298 - shadowing struct mg_str constructor 2021-07-15 02:18:32 +01:00
Sergey Lyubka 80fcba91c8 Fix #1297 - %p warning 2021-07-14 04:00:27 +01:00
Sergey Lyubka 39d64be581 Fix FD_CLOEXEC setting 2021-07-13 22:49:36 +01:00
Sergey Lyubka 2bfd30ab4b Fix mac test 2021-07-13 20:49:19 +01:00
Sergey Lyubka 60004eb209 Fix mac test 2021-07-13 20:01:46 +01:00
Sergey Lyubka db11897d71 Fix #1302 - set FD_CLOEXEC on sockets 2021-07-13 19:32:31 +01:00
Sergey Lyubka 5e466f9037 Fix #1294 - add more common mime types 2021-07-13 19:24:46 +01:00
Sergey Lyubka 6b2698a503 Squash warning in mg_random() 2021-07-13 18:07:38 +01:00
Sergey Lyubka 4788db7e00 Fix #1301 - use correct openssl version conditional for SSL_use_certificate_chain_file() 2021-07-13 18:05:57 +01:00
Sergey Lyubka d9680df510 Support mbedtls 3.x.x 2021-07-13 17:28:07 +01:00
Sergey Lyubka f20ee1f305 Open HTTP and HTTPS ports 2021-07-13 14:40:52 +01:00
cpq 302bf865f9 Fix #1310 - wrap _CRT_SECURE_NO_WARNINGS into #ifndef 2021-07-13 07:13:06 +01:00
Sergey Lyubka 03929dcdaa Merge pull request #1306 from SimonNitzsche/patch-1
Fixed typo on README
2021-07-13 07:06:30 +01:00
cpq 89af2e9638 Merge branch 'master' of github.com:cesanta/mongoose 2021-07-13 06:58:52 +01:00
cpq 015586950f Fix #1305 - add #ifdef __cplusplus for C++ linkage 2021-07-13 06:58:34 +01:00
Simon Nitzsche 9df261a0eb Fixed typo on README
Added a dot to "etc" on the README
2021-07-04 17:40:18 +02:00
Sergey Lyubka a2a3c84450 Merge pull request #1303 from Jasper-Ben/master
Makefile: change curly brackets to round brackets
2021-07-02 18:28:53 +01:00
novlean 6611348ebf added customers references 2021-07-01 15:02:51 +01:00
Jasper Orschulko e69ee90acf Makefile: change curly brackets to round brackets
Esthetic change which replaces the curly brackets introduced by me in
commit b6ee9e637b with round brackets.
2021-06-30 21:46:58 +02:00
Sergey Lyubka 8f3554d08a Merge pull request #1295 from Jasper-Ben/add_linux_lib_targets
Add static and dynamic lib targets to Makefile
2021-06-21 11:35:43 +01:00
Jasper Orschulko b6ee9e637b Makefile: add static and dynamic lib targets 2021-06-21 11:51:42 +02:00
cpq f46453f80f Squash warnings 2021-06-10 19:37:03 +01:00
cpq 3deafaea7f Extend mg_mqtt_{pub,sub} by adding qos and retain 2021-06-10 19:27:19 +01:00
cpq a15d518571 Add mg_mqtt_pubex 2021-06-10 19:15:50 +01:00
cpq 886a29d659 Fix #1292 - allow requests with missing protocol version, responses with no reason fields 2021-05-29 10:07:05 +01:00
cpq e69de57def Optimise mg_iobuf_append() 2021-05-29 09:46:50 +01:00
cpq 9d68e20dcc Fix #1288 - better mg_iobuf_append allocation strategy 2021-05-29 09:44:07 +01:00
cpq c0a8546330 Add MG_ARCH_FREERTOS_LWIP 2021-05-28 23:49:26 +01:00
cpq 4c0002e28a Separate examples job 2021-05-28 19:05:10 +01:00
cpq 7c37d75bf4 Squash even more warnings 2021-05-28 18:57:47 +01:00
cpq 879261981f Squash more warnings 2021-05-28 18:54:39 +01:00
cpq 838b0bcd27 Squash more warnings 2021-05-28 18:45:35 +01:00
cpq 736b8ad7b7 Fix #1285 - __builtin___snprintf_chk warning. Tighten test flags and refactor the code to squash all warnings 2021-05-28 18:30:42 +01:00
cpq db27fae40e Update issue template 2021-05-24 10:18:44 +01:00
cpq 594111a255 Update issue template 2021-05-24 10:16:33 +01:00
cpq 53a46a2739 Change issue template 2021-05-24 09:53:39 +01:00
Sergey Lyubka eef7a55904 Merge pull request #1290 from lnksz/patch-1
Propose an issue template
2021-05-24 09:49:35 +01:00
Kristóf Havasi a68fa5e6e0 Propose an issue template
As it is in the discussion of raised issues to have some extra iteration because of architecture, library version, and other meta information, an issue template could save these extra rounds and possibly reduce the number of duplicates by highlighting where one can check for answers.

This is just a sketch based on what notifications I got from mongoose in the past months. Feel free to change it.
2021-05-23 22:44:16 +02:00
cpq 7c0d126edc Build with -DMG_ENABLE_FS=1 2021-05-19 08:10:38 +01:00
cpq 1a5e3d3151 Fix #1286 2021-05-19 00:19:21 +01:00
cpq 95ff6c56af Update readme 2021-05-19 00:15:45 +01:00
cpq e2ef392633 Update readme 2021-05-19 00:14:27 +01:00
cpq dbc2356768 FreeRTOS-Plus-TCP fixes 2021-05-19 00:00:32 +01:00
cpq 47e5e984df stm32f7 example starts on real h/w, with plus-TCP driver 2021-05-17 17:36:57 +01:00
cpq 0f32f50c50 Add missing files 2021-05-13 22:05:00 +01:00
cpq 606cc1f538 Build w/semihosting support 2021-05-13 22:04:29 +01:00
cpq 2bb11888d5 Build w/semihosting support 2021-05-13 22:03:46 +01:00
cpq 09b1d6aa72 Running two blinkers 2021-05-13 15:05:09 +01:00
cpq 72f0489ec2 Using nucleo-f746zg. Moved 3party libs to test/. Using headers from ST 2021-05-13 14:56:14 +01:00
cpq 7b39973065 docs 2021-05-12 11:44:15 +01:00
cpq 30b64483fd docs 2021-05-12 11:39:46 +01:00
cpq 5369fb0376 Remove low-level lwip stubs 2021-05-12 11:06:19 +01:00
cpq 5fe34fd6c3 Remove MG_ENABLE_MGOS 2021-05-12 11:05:05 +01:00
Sergey Lyubka 0fbdda4d2e Merge pull request #1284 from cesanta/stm32
Stm32
2021-05-12 10:28:43 +01:00
cpq a98e980c8f Nits to have tests pass 2021-05-12 09:25:21 +01:00
cpq 2b836504ab rename 2021-05-12 08:44:16 +01:00
cpq 0de3f0d985 f1 build works 2021-05-12 08:43:34 +01:00
cpq 151e375091 FreeRTOS w/blink works 2021-05-11 20:44:14 +01:00
cpq c44549bfa5 Blinky works 2021-05-11 18:05:03 +01:00
cpq d6852f5e74 First stab 2021-05-11 09:12:06 +01:00
novlean 9173034b96 Update README.md 2021-05-04 17:03:53 +01:00
novlean 2888ab1f52 Merge pull request #1277 from cesanta/novlean-patch-1
more typos + some fixes
2021-05-04 17:02:55 +01:00
novlean 26b5416641 more typos + some fixes 2021-05-04 17:02:46 +01:00
novlean 8bcac7e955 Merge pull request #1276 from cesanta/novlean-patch-1
fixed typo + added few things
2021-05-04 16:54:28 +01:00
novlean ea25e8129c fixed typo + added few things 2021-05-04 16:54:16 +01:00
cpq 26cb44f9d9 Typo in readme 2021-05-04 13:55:45 +01:00
cpq 7a37a44433 Update README 2021-05-04 13:53:17 +01:00
cpq a752f3f8c7 Update README 2021-05-04 13:46:44 +01:00
Sergey Lyubka 946e07644c Merge pull request #1275 from panosto/master
Corrected small typo in docs
2021-04-29 19:26:46 +01:00
Panagiotis 497b26a249 Corrected small typo in docs 2021-04-29 18:16:33 +02:00
cpq 79aad7fabf Put Range support back 2021-04-29 11:00:57 +01:00
cpq 7851930ac3 Fix #1256 2021-04-29 09:50:33 +01:00
cpq 758572872d Fix #1255 2021-04-29 09:26:37 +01:00
cpq 111551477a Integrate #1266 2021-04-29 09:17:24 +01:00
cpq 31c9e3fb7e Make mg_random() weak, see #1269 2021-04-29 09:09:21 +01:00
cpq 7061b7202f Integrate 1265 2021-04-29 08:49:23 +01:00
novlean d88b6a3c95 Update README.md 2021-04-28 17:07:39 +01:00
novlean cea2a62ee0 Added Schneider Electric case study & testimonial 2021-04-28 17:06:27 +01:00
cpq 35a8b8e8e8 TLS nits, more DNS logging 2021-04-22 15:21:16 +01:00
cpq 1b8624f135 Better log trace 2021-04-13 21:02:05 +01:00
cpq e217066bf6 Squash warning 2021-04-13 19:42:47 +01:00
cpq 5430408218 Merge branch 'master' of github.com:cesanta/mongoose 2021-04-09 16:55:16 +01:00
cpq d2744063a0 Remove unused MG_SWAPxx macros 2021-04-09 16:55:12 +01:00
Sergey Lyubka 03356616ef Merge pull request #1259 from mcottrell1/fix-msvc-compile-errors
fixed msvc errors around VLAs when using TLS
2021-04-09 16:54:23 +01:00
Mark Cottrell 6ce2e48dd3 fixed msvc errors around VLAs 2021-04-09 08:11:16 -07:00
novlean 16a7ba6bf0 Added 4 new sections
Why Mongoose
Used to implement
Case Studies
Testimonials
2021-03-25 17:50:56 +00:00
cpq e9d122f231 Stricter checks for mg_url_*() 2021-03-24 15:49:35 +00:00
cpq 0ae5c61759 More comments 2021-03-23 14:02:24 +00:00
cpq 691460c5fc Add linux target to http-server example 2021-03-22 11:30:48 +00:00
cpq ab1c924388 Better check in mg_iobuf_resize() 2021-03-22 11:30:29 +00:00
cpq 05050eba38 Squash warning in mg_random 2021-03-22 11:29:59 +00:00
cpq 912dd518bf Tests for mg_to64() 2021-03-21 16:18:44 +00:00
cpq e0395a9907 Merge branch 'master' of github.com:cesanta/mongoose 2021-03-21 16:14:56 +00:00
cpq 0051f23e12 Even stricted check in mg_to64() 2021-03-21 16:14:44 +00:00
novlean a9bb8fa9fc Update README.md 2021-03-19 14:02:23 +00:00
novlean 09f5d2fdae Merge pull request #1247 from cesanta/novlean-patch-1
added video call offer
2021-03-19 14:01:45 +00:00
novlean 006a9d914c added video call offer 2021-03-19 14:01:30 +00:00
cpq 9009cbc528 Adjust recv.len after stripping chunked body 2021-03-19 13:13:24 +00:00
cpq a1862986b8 Better docstring for file upload example 2021-03-18 12:23:03 +00:00
cpq cc2989a848 Merge branch 'master' of github.com:cesanta/mongoose 2021-03-18 12:01:32 +00:00
cpq 4deb95776f Remove multipart example code 2021-03-18 11:59:23 +00:00
Sergey Lyubka f195b27884 Merge pull request #1245 from panosto/mbedtls_parse_crt_and_key_from_buffer
mbedtls parse cert and key from buffer
2021-03-18 08:51:04 +00:00
panosto 5036a71334 mbedtls parse cert and key from buffer 2021-03-17 15:23:45 +01:00
cpq 531c47b47c mg_to64 overflow protection 2021-03-17 13:46:50 +00:00
cpq 4dbb2da78f Add form-upload example 2021-03-17 13:28:36 +00:00
cpq 41c1e0f08d Squash truncation warning 2021-03-17 12:22:19 +00:00
cpq e7b1905e49 Add -Wno-error=format-truncation for test++ build 2021-03-17 12:15:46 +00:00
cpq e00265f855 Add -Wno-error=format-truncation for linux++ build 2021-03-17 12:11:05 +00:00
cpq cd36708b6d Fix tests 2021-03-17 07:46:39 +00:00
cpq 5bd22cb5e4 Add mg_http_next_multipart() 2021-03-17 07:43:29 +00:00
cpq bc00d5159a Add mg_http_next_part 2021-03-15 13:20:53 +00:00
cpq bcb0874477 Add file upload code example 2021-03-15 09:36:27 +00:00
cpq 5326e8d212 Update docs 2021-03-15 09:18:02 +00:00
cpq 4528cc28ef Add sizep param to mg_file_read() 2021-03-15 09:16:34 +00:00
cpq 381d7cce54 Do not call setsockopts() on a listening connection 2021-03-13 12:36:00 +00:00
cpq 2594e7b37a Stricter MG_ARCH_CUSTOM and type conversions in sock.c 2021-03-13 12:34:26 +00:00
Sergey Lyubka 4356b953ca Merge pull request #1238 from cesanta/novlean-patch-1
Fixed typos
2021-03-11 13:16:06 +00:00
cpq e788853156 Fix typos 2021-03-11 13:15:53 +00:00
novlean 91ed6de166 Fixed typos 2021-03-11 13:01:45 +00:00
novlean cf3aafc32e added . 2021-03-11 10:16:17 +00:00
cpq c2d7ff8179 Update readme 2021-03-10 13:44:32 +00:00
cpq e5eaa1c633 Update readme 2021-03-10 13:42:46 +00:00
cpq 6366c832b0 Add struct mg_http_serve_opts::extra_headers 2021-03-10 07:56:14 +00:00
cpq f326cbedbe Fix doc example 2021-03-09 17:44:15 +00:00
cpq 5b272c2b5c Bump HEAD to 7.3 2021-03-09 11:38:37 +00:00
cpq 452bcc68a4 Add mg_mqtt_next_unsub() signature 2021-03-09 11:29:53 +00:00
cpq 829827d46f Add mg_mqtt_next_unsub 2021-03-09 09:54:02 +00:00
cpq ff9d0e462e Tiny refactor in walkchunks() 2021-03-09 08:22:52 +00:00
cpq e84ea91a4a Process chunked body before sending MG_EV_HTTP_MSG 2021-03-09 08:21:29 +00:00
cpq 2dcb10ef36 Less verbose test 2021-03-08 15:45:09 +00:00
cpq 99fa7f0851 2020 -> 2021 2021-03-08 15:44:57 +00:00
cpq 1b5cc341a5 Add streaming client support, MG_EV_HTTP_CHUNK 2021-03-08 15:41:16 +00:00
cpq d50dc288cd Add mg_crc32 2021-03-08 15:40:39 +00:00
cpq 060bb29cdc Restore mg_mqtt_{ping,pong,disconnect} 2021-03-07 12:21:59 +00:00
cpq 366426e8bb Avoid extra allocation for static HTTP handling 2021-03-07 11:56:20 +00:00
cpq e710df4c80 Define WEAK to nothing on Cygwin 2021-03-04 14:25:50 +00:00
cpq 79e5841483 Fix QNX build 2021-03-04 11:09:57 +00:00
cpq 374ab4ecf0 Add struct mg_mgr::userdata 2021-02-28 16:40:27 +00:00
cpq 56980be48c Do not reveal full root dir path 2021-02-17 16:07:18 +00:00
cpq 602c5c0866 Refactor mg_url_encode 2021-02-15 14:42:55 +00:00
cpq 7ce5009de1 Remove reduntant code 2021-02-15 14:42:22 +00:00
cpq 51e3a1304b Fix TLS build 2021-02-13 10:45:27 +00:00
cpq d5a1d5a5e8 Stricter realpath checks 2021-02-11 15:03:22 +00:00
cpq ae5f6c0920 Increase conn label size 32 -> 50 2021-02-10 11:09:13 +00:00
cpq 0a9303bb07 Stricter mg_http_parse() 2021-02-09 21:16:33 +00:00
cpq 42bc7b1f47 Add "struct mg_http_message::head" attr 2021-02-09 13:27:17 +00:00
cpq 4844ed60bd Remove fflush in logging 2021-02-09 00:16:13 +00:00
cpq 41f5daeb47 Fix mg_random 2021-02-08 19:43:01 +00:00
cpq a3f8f33d50 Allow mbedtls CA being inline PEM 2021-02-08 17:50:00 +00:00
cpq fd8db5c53a Better unicode handling on win32 2021-02-07 22:43:49 +00:00
cpq a2f027e798 Change mws binary link 2021-02-07 14:51:37 +00:00
novlean dad5c8fe87 Update README.md 2021-02-05 16:56:06 +00:00
novlean 98783a41ba Update README.md 2021-02-05 16:55:26 +00:00
cpq 1517d2985a Update README 2021-02-04 10:40:33 +00:00
Sergey Lyubka acc0564957 Merge pull request #1213 from csimons/drainig
README.md: fix typo: is_drainig -> is_draining
2021-02-03 08:30:55 +00:00
Christopher Simons 421bc126b5 README.md: fix typo: is_drainig -> is_draining 2021-02-02 22:17:15 -05:00
cpq ed1a98c381 Remove debug logs 2021-02-03 02:19:17 +00:00
cpq 457d76b049 Fix #1211 - adjust ESP32 example to serve FS 2021-02-03 02:13:05 +00:00
cpq 6827972f71 Fix #1210 - on win32, open upload file in binary mode 2021-02-02 08:43:56 +00:00
cpq 7eb998891e Show served dir in the start message 2021-02-01 00:02:33 +00:00
cpq 582fde5c6e Fix #1209 2021-01-31 19:54:42 +00:00
cpq d327ee9834 Improve SNI 2021-01-30 13:03:11 +00:00
cpq 31cf6f8969 https://localhost -> http://0.0.0.0 2021-01-29 13:18:34 +00:00
cpq 86b1053678 Add error check for iobuf allocation 2021-01-29 12:32:34 +00:00
cpq 6678e36278 Use openssl/ssl.h 2021-01-28 08:45:24 +00:00
cpq 5118355732 Use 64bit file ops even on 32bit systems 2021-01-26 17:43:31 +00:00
cpq 5b4b7f7dc5 Fix test 2021-01-26 17:01:43 +00:00
cpq 7614a8101f Wrap util funcs that use FILE into MG_ENABLE_FS 2021-01-26 16:34:42 +00:00
cpq 3c851bcfc3 mg_file_write -> mg_file_printf 2021-01-26 16:30:44 +00:00
cpq 01691dafa0 Released 7.1, move HEAD to 7.2 2021-01-26 13:07:42 +00:00
cpq 8e52075636 Handle calloc failures 2021-01-26 12:16:58 +00:00
cpq 7200f079bf Remove dead code 2021-01-25 14:43:56 +00:00
cpq d155db81de Add socks5 server example 2021-01-25 14:43:08 +00:00
Sergey Lyubka 25e3bbf039 Merge pull request #1200 from Davonter/master
Fix README.md mg_mgr_free
2021-01-25 10:37:35 +00:00
cpq eecf3d854b Show accepted IPv6 peer corrently 2021-01-25 10:35:45 +00:00
cpq 7c2499fc06 -D -> -v 2021-01-25 10:35:14 +00:00
cpq 1aa605c620 desktop-server -> http-server 2021-01-25 10:09:48 +00:00
cpq 66287ad6c1 TLS nits 2 2021-01-25 10:08:15 +00:00
cpq 9a19485454 TLS nits 2021-01-24 13:57:40 +00:00
cpq 7d67d578fd TLS krypton compat 2021-01-23 17:47:51 +00:00
wangtun 960d3c7880 Fix README.md mg_mgr_free 2021-01-23 15:49:55 +08:00
cpq 9eabf3fa81 URL decoding URI 2021-01-21 17:14:08 +00:00
cpq 89beadd2ce Squash warning in unit test 2021-01-21 10:24:49 +00:00
cpq 6ecb6c1500 Fix DNS timeout, add unit test 2021-01-21 10:00:18 +00:00
cpq 51bc5f70c5 Disable native socketpair by default, fix multithreaded win32 example 2021-01-21 09:12:49 +00:00
cpq be62ac9c14 Add more docs 2021-01-20 11:28:47 +00:00
cpq 161c34384d Enable SO_EXCLUSIVEADDRUSE on Win32. Better listdir response. 2021-01-20 11:10:02 +00:00
cpq 89784ab90a Restore to a simple version 2021-01-19 14:21:50 +00:00
cpq d83e547fa9 Make mg_url_port() return 80 for ws:// 2021-01-18 18:39:22 +00:00
Sergey Lyubka 30d86928d5 Merge pull request #1191 from RiccardoDalFiume/master
FIX README mg_http_serve*
2021-01-17 11:18:32 +00:00
cpq 12c32d09fb Pass mg_http_message to MG_EV_WS_OPEN 2021-01-17 11:16:19 +00:00
cpq ae6fd6aa35 Add extra headers param to mg_ws_upgrade() 2021-01-16 22:48:43 +00:00
cpq 72d3a49352 Restore SO_EXCLUSIVEADDRUSE 2021-01-13 03:47:11 +00:00
cpq 87b62390b7 No static for linux 2021-01-13 03:10:42 +00:00
cpq 6c93446a1f Better reuseaddr handling on Win32 2021-01-13 03:08:11 +00:00
cpq 83c106a857 UI for Win32 2021-01-13 03:07:51 +00:00
cpq facb2846fd Bump version 2021-01-13 03:07:38 +00:00
cpq 596c70d3dc Add config file processing 2021-01-12 15:18:19 +00:00
Riccardo Dal Fiume 7beff0201d FIX README mg_http_serve* 2021-01-12 11:28:41 +01:00
cpq a4c9d1ecb7 Update mg_http_serve_file() doc 2021-01-07 16:21:01 +00:00
cpq b7a79a556a Add extra headers param to mg_http_serve_file 2021-01-07 12:48:20 +00:00
cpq 03ab9e4e0d Update axios 2021-01-06 17:11:53 +00:00
cpq 7e855f5c8f Add oss-fuzz badge 2021-01-05 18:10:01 +00:00
Sergey Lyubka 9e510d5831 Merge pull request #1185 from hakabahitoyo/master
Suppress error: cast from ‘void*’ to ‘int’ loses precision [-fpermissive] in MG_ENABLE_OPENSSL build.
2021-01-05 11:46:49 +00:00
Hakaba Hitoyo 1689a0d56b Update mongoose.c. 2021-01-05 12:35:28 +09:00
cpq 9ff774e7df Trigger test on pull requests 2021-01-04 12:02:55 +00:00
Hakaba Hitoyo c78ad0b574 Supress error: cast from ‘void*’ to ‘int’ loses precision [-fpermissive] 2021-01-04 16:25:06 +09:00
cpq 117aeaa15d Fix fd leak for cached static files 2021-01-03 09:39:46 +00:00
cpq e135743efa Fix example build 2021-01-03 08:55:00 +00:00
cpq 2c1324dc0a Remove -r option 2021-01-03 08:43:56 +00:00
cpq c7e09bd7b4 Add SSI include file=, include virtual= 2021-01-02 17:57:51 +00:00
cpq 86824795a0 Pass opts structure to mg_http_serve_dir() 2021-01-02 12:30:09 +00:00
cpq 1b0636c2d2 More checks in mg_ws_send 2021-01-02 12:20:08 +00:00
cpq 2f9d2bbdf6 Update readme 2020-12-29 18:15:06 +00:00
cpq 21a1b2c15c Update readme 2020-12-29 17:59:05 +00:00
cpq bdef3d6afd Fix win98 test 2020-12-28 06:32:55 +00:00
cpq a882aab30e Add captive dns server example 2020-12-28 05:25:29 +00:00
cpq 788b577d65 Add README 2020-12-27 01:32:58 +00:00
cpq 71a22adc06 Add ESP8266 example 2020-12-27 01:29:42 +00:00
cpq 7d1ef2ffe8 Add mingw tests to actions 2020-12-25 19:28:05 +00:00
cpq 55f5f74658 Add mingw gcc and g++ tests 2020-12-25 19:24:51 +00:00
cpq e1fd82bc46 Remove unused code 2020-12-25 15:04:43 +00:00
cpq 49b8480bfb Add http-reverse-proxy example 2020-12-25 04:32:56 +00:00
cpq b2ab484883 Fix #954 2020-12-24 19:10:54 +00:00
cpq 4c3b97be7d Squash -DMG_ENABLE_FS=0 build warning 2020-12-24 18:48:28 +00:00
cpq 60e1b64455 Fix https://github.com/cesanta/mongoose/issues/1030 2020-12-24 17:01:49 +00:00
cpq 6bcd02bb1c Enhance HTTP client example 2020-12-24 16:52:58 +00:00
cpq 66f302a613 Make DNS debug log less verbose 2020-12-24 16:52:33 +00:00
cpq 1716af6c72 Add HTTP client code 2020-12-24 16:52:12 +00:00
cpq 749326c83a Add more mg_http_parse unit tests 2020-12-24 14:33:23 +00:00
cpq 9657577c00 Fix typo in fuzz test 2020-12-24 09:09:25 +00:00
cpq 9f5216d259 Add more fuzz tests 2020-12-24 09:07:55 +00:00
cpq c8826e8f9c Refactor mg_ntoa and mg_straddr 2020-12-24 08:05:54 +00:00
cpq 25bc13ef1e Squash some warnings under mingw crosscompiler 2020-12-24 07:26:50 +00:00
cpq 4d123a15f9 Drop deprecated register keyword 2020-12-23 21:20:48 +00:00
cpq 2cf1b09767 Workaround for WIN32 C++ snprintf/vsnprintf/strdup calls 2020-12-23 21:05:46 +00:00
cpq abfd81cb9d Fix WS frame length encoding for len 0xffff 2020-12-23 16:18:49 +00:00
cpq 3895678bee Use MG_EV_WS_CTL for WS control messages 2020-12-23 11:58:08 +00:00
cpq e0a1feafe0 Fix localhost resolution 2020-12-23 10:15:09 +00:00
cpq c75eb24eb8 Add proxy client example 2020-12-22 21:01:14 +00:00
cpq c3aae185df Add ipv6 server test 2020-12-22 10:16:31 +00:00
cpq 2e87783246 Add IPv6 client test 2020-12-22 09:44:59 +00:00
cpq fbab767b9f Fix mg_prefix job 2020-12-21 12:39:03 +00:00
cpq 7bc38b5eaa Add examples build, fix prefix build 2020-12-21 12:33:27 +00:00
cpq b93456f512 Do not create socket until resolved 2020-12-21 12:26:44 +00:00
cpq ddb700eee5 Fix openssl build 2020-12-20 21:50:46 +00:00
cpq 1052ee0766 Fix openssl build, and add openssl test 2020-12-20 21:45:58 +00:00
cpq 29534218d7 IPv6 related refactoring 2020-12-20 16:55:33 +00:00
cpq d7abd53062 Always send MG_EV_CONNECT on TCP connect 2020-12-18 15:13:19 +00:00
cpq aede72fa37 Refactor HTTP client 2020-12-18 14:29:30 +00:00
cpq b0a5165b44 Uload coverage 2020-12-18 11:47:56 +00:00
cpq 4919f792f2 Make build badge a link 2020-12-18 11:32:59 +00:00
cpq d5927f5d50 Remove travis - migrated to Github Actions 2020-12-18 11:31:31 +00:00
cpq e68330e045 Rename workflow 2020-12-18 11:26:17 +00:00
cpq b5d5b3763f Add workflow badge 2020-12-18 11:24:36 +00:00
cpq b6a6687c1e Rename workflow 2020-12-18 11:24:06 +00:00
cpq 3843b670a5 Fix typo 2020-12-18 11:14:21 +00:00
cpq 249efdd378 Add windows test 2020-12-18 11:12:08 +00:00
cpq 18ce1669fc Add mac test 2020-12-18 11:09:03 +00:00
cpq e8d3b8030e Install mbedtls 2020-12-18 10:56:35 +00:00
Sergey Lyubka a752abf318 Create test.yml 2020-12-18 10:41:27 +00:00
cpq d3ebcaf5d2 Remove unneeded defines that break vc2015 build 2020-12-18 09:48:28 +00:00
cpq 0abb8322d9 Disable noisy debug 2020-12-18 09:48:05 +00:00
cpq 99ed58ec4d Better docstrings 2020-12-18 09:08:28 +00:00
cpq 04450ec659 Update http server example to showcase SSL 2020-12-18 09:01:14 +00:00
cpq 82a378e519 Add extra param to http_reply() 2020-12-17 22:47:55 +00:00
cpq 29d31ba919 More boundary checks for mg_dns_parse() 2020-12-17 19:14:17 +00:00
cpq 4519ea568d Add conditional for SSL_use_certificate_chain_file() 2020-12-17 12:12:46 +00:00
cpq 9f88f31f01 Add timer example 2020-12-17 11:44:30 +00:00
cpq 4bdea2b467 Add README to the esp32 example 2020-12-17 11:24:28 +00:00
cpq 2252a74cd7 Note on UDP 2020-12-17 11:19:13 +00:00
cpq d1fa7b88e0 Disable brew update 2020-12-16 14:05:36 +00:00
cpq 9ecf42578c Fix screenshot link 2020-12-16 10:54:47 +00:00
cpq 754fc25924 Add description & screenshots 2020-12-16 10:54:09 +00:00
cpq d9551c75b1 Refactor MQTT parsing 2020-12-16 10:14:00 +00:00
cpq 8d45cf6972 Add mqtt-server example 2020-12-15 20:29:47 +00:00
cpq f176e1ae59 Handle more mime types 2020-12-15 11:58:30 +00:00
cpq fa8f62fb5d Squash warnings under linux 2020-12-14 14:05:01 +00:00
cpq 0c142f20d7 Using linux for docker tests 2020-12-14 13:09:56 +00:00
cpq b641fc6b79 Add esp32 example 2020-12-14 12:58:27 +00:00
cpq 1252a61479 More docs 2020-12-14 09:36:46 +00:00
cpq 5f631c0b96 More docs 2020-12-14 09:35:03 +00:00
cpq 348c579521 Add dns test case 2020-12-14 09:31:23 +00:00
cpq 7ce9cdf0b9 More docs 2020-12-14 09:31:03 +00:00
cpq 09beadb98a Fix c++ fuzzer build 2020-12-13 16:56:30 +00:00
cpq 5b265a76bd Add minor case to fuzzer 2020-12-13 16:33:46 +00:00
cpq c5a4a1c6f2 Remove debug leftover 2020-12-13 00:37:04 +00:00
cpq 88ada54045 More tests 2020-12-12 20:38:09 +00:00
cpq c5b1c08d05 Use MSG_NONBLOCKING for recv/send 2020-12-12 16:48:47 +00:00
cpq a0765ade6b Use -DMG_ENABLE_LINES for fuzzer build 2020-12-12 14:23:28 +00:00
cpq 54250f5fbf Rename, use hyphen 2020-12-12 10:22:45 +00:00
cpq f3f397f31e Add MQTT client example 2020-12-12 10:03:19 +00:00
cpq d806ed5d5f Better coverage 2020-12-11 22:58:50 +00:00
cpq 37e9a2ee95 Fix C++ build error 2020-12-11 18:26:54 +00:00
cpq 7ad6a08002 Fix C++ build error 2020-12-11 18:21:29 +00:00
cpq 90686ee5c9 Add ws examples 2020-12-11 17:35:58 +00:00
cpq 85c5577955 mg_dns_parse_name() recursion protection 2020-12-11 14:02:52 +00:00
cpq 30d4a1ad0f Fix mg_sntp_parse() 2020-12-11 13:16:51 +00:00
cpq 1b551741b8 Fix mg_url_decode fuzz 2020-12-11 09:35:50 +00:00
cpq 369f44adfa Add version.h 2020-12-10 17:46:26 +00:00
cpq 763f4551d5 More log messages 2020-12-10 17:42:59 +00:00
cpq 42d7865e14 Pre-built desktop server 2020-12-10 17:39:40 +00:00
cpq cf62702f08 Switch to hivemq 2020-12-10 16:36:24 +00:00
cpq 14ccd78782 Update README 2020-12-10 14:21:38 +00:00
cpq 6c4b5efd98 Add restful and client example 2020-12-10 13:26:05 +00:00
cpq 05a43c563c Update READMEs 2020-12-08 16:53:35 +00:00
cpq 94d2e86b60 More docs 2020-12-08 16:26:17 +00:00
cpq d1b8f9e01f Fuzz-test mg_http_var and base64 2020-12-07 18:52:40 +00:00
cpq 228acefa36 Fix native socketpair call 2020-12-07 10:55:50 +00:00
cpq d1d8a77bf6 Use socketpair syscall when available 2020-12-07 10:25:28 +00:00
cpq 7ea3293aba More tests 2020-12-07 08:54:58 +00:00
cpq 082a498afd Fix badges 2020-12-07 08:08:21 +00:00
cpq 866c987409 Tuning test 2020-12-07 05:46:47 +00:00
cpq 1d0e65d17a Tuning test 2020-12-07 05:39:07 +00:00
cpq 136a37ef73 Tuning test 2020-12-07 05:18:07 +00:00
cpq 0ce49b5c71 Tuning test 2020-12-07 05:08:21 +00:00
cpq 490ad3834b Tuning test 2020-12-07 05:00:27 +00:00
cpq bcc62c96c8 Tuning test 2020-12-07 04:56:50 +00:00
cpq 15d6cb3065 Tuning test 2020-12-07 04:44:23 +00:00
cpq a490660b38 Tuning test 2020-12-07 04:19:26 +00:00
cpq 72019b7427 Tuning test 2020-12-07 04:18:29 +00:00
cpq 21c0024a2f Tuning test 2020-12-07 03:59:42 +00:00
cpq d7a02d13e4 Add test++ linx++ 2020-12-07 03:47:37 +00:00
cpq cb220837b9 Tuning test 2020-12-07 01:27:44 +00:00
cpq ddaae51d42 Tuning test 2020-12-07 01:12:21 +00:00
cpq 629e55f97d Tuning test 2020-12-07 01:00:35 +00:00
cpq 909ebad276 Install deps 2020-12-06 23:32:15 +00:00
cpq cb7743fa39 Move tests -> test 2020-12-06 23:19:56 +00:00
cpq 6197842bca Merge branch '7.0' 2020-12-06 22:52:11 +00:00
cpq 77d461dcbf Remove travis build 2020-12-06 22:51:32 +00:00
cpq 47b6060910 Add docs 2020-12-06 21:12:05 +00:00
cpq 47d3fe5af6 Add travis build 2020-12-05 11:58:32 +00:00
cpq 6691a2fdad Add badges 2020-12-05 11:46:12 +00:00
cpq 746f56f42a README update 2020-12-05 11:41:23 +00:00
cpq 87de05881c Add travis build 2020-12-05 11:34:58 +00:00
cpq f2fba1d200 7.0 refactor 2020-12-05 11:26:32 +00:00
Sergey Lyubka 34d4fb8cf0 Merge pull request #1157 from rojer/qq
Add mg_next_query_string_entry_n() and mg_url_decode_n()
2020-10-26 13:25:31 +00:00
Deomid Ryabkov be64f81eee Add mg_next_query_string_entry_n() and mg_url_decode_n()
Move to mg_util.h so encode and decode are next ot each other.

Pull out mg_next_list_entry_n() for advanced use cases.

Add unit tests.
2020-10-24 22:53:50 +01:00
Sergey Lyubka 9fe1c93c9b Merge pull request #1143 from rojer/cs_log_lock
Add cs_log_{lock,unlock}
2020-08-28 20:46:37 +01:00
Deomid Ryabkov a4b6d58b24 Add cs_log_{lock,unlock}
In implementatiosn that have preemptive scheduelrs these can be implemented
to ensure logging from different threads is properly serialized.
2020-08-28 20:29:13 +01:00
Sergey Lyubka 86f391c701 Merge pull request #1139 from rojer/warns
Fix warnings and sync line numbers of unamalgamated sources
2020-08-20 00:45:02 +01:00
Sergey Lyubka 36de38bd11 Merge pull request #1138 from rojer/1135
Add missing range check in mg_get_http_header()
2020-08-20 00:44:36 +01:00
Deomid Ryabkov a308872c88 Fix warnings and sync line numbers of unamalgamated sources 2020-08-19 22:02:50 +01:00
Deomid Ryabkov a369160296 Add missing range check in mg_get_http_header()
h/t BushraAloraini

Fixes https://github.com/cesanta/mongoose/issues/1135
2020-08-19 21:48:45 +01:00
Sergey Lyubka 0a09b46c94 Merge pull request #1128 from rojer/amalgam
Sync src with amalgamated versions
2020-07-12 15:32:42 +01:00
Deomid Ryabkov b0a1cd7b0d Sync src with amalgamated versions
Now src contains exactly what's embedded in mongoose.c and .h, nothing more.

Added `tools/amalgam.sh` to aamlgamate both files at once.

There are no functional changes to mongoose.c, .h in this PR, only slight filename changes.
2020-07-08 02:08:49 +01:00
novlean 73a2b92278 Merge pull request #1124 from cesanta/novlean-patch-1
added MWS white paper
2020-06-24 17:08:49 +01:00
novlean c3bb5bd89e added MWS white paper
Download “9 Things NOT to do when embedding a web server” white paper.
2020-06-24 17:08:35 +01:00
Sergey Lyubka d22ff2fce7 Really revert 4880069 2020-06-11 19:08:55 +01:00
Sergey Lyubka fee2980d95 Merge branch 'master' of github.com:cesanta/mongoose 2020-06-11 19:04:45 +01:00
Sergey Lyubka d6693ed360 Revert 4880069 2020-06-11 19:04:24 +01:00
Sergey Lyubka 4880069775 Fix #1112 2020-06-11 18:38:42 +01:00
Sergey Lyubka 5d217a1262 Merge branch 'dev' of github.com:cesanta/mongoose into dev 2020-06-11 18:29:58 +01:00
Sergey Lyubka f778d22eac Make it possible to override default FS update algorithm
PUBLISHED_FROM=774a111548da97bd9d195e177b5fb66b0fd66135
2020-06-11 18:27:48 +01:00
Sergey Lyubka 3aa76dcaec Subst CREDPARAMS
PUBLISHED_FROM=545e8dff4ea0bef061c893252c613e3429f56184
2020-06-11 18:27:46 +01:00
Deomid "rojer" Ryabkov 4680573a6b Fixes for -pedantic build mode
PUBLISHED_FROM=d0a15356cf047e579c74869ce3e8fe813752e8c7
2020-05-23 15:55:27 +00:00
Deomid "rojer" Ryabkov 95fcb261eb Fix processing of keep-alive requests when chunks are consumed
PUBLISHED_FROM=136ce2ed4f143d7ee246e5fd1078c431e205bb3a
2020-05-22 23:07:38 +00:00
Sergey Lyubka 5867c67da2 Allow OpenSSL session reuse on 2-way SSL, integrate https://github.com/cesanta/mongoose/pull/877
PUBLISHED_FROM=6e2568b963869d062dd51b590f8e536d043c4ca2
2020-05-22 18:56:31 +00:00
Sergey Lyubka 80d74e9e34 Merge branch 'dev' 2020-05-21 16:45:34 +01:00
Sergey Lyubka 43a0b500f5 6.17 -> 6.18
PUBLISHED_FROM=7893a216b1f7e86e845122eb425e4fed271244b4
2020-05-21 16:42:09 +01:00
Sergey Lyubka 3d53ed17fb Allow OpenSSL session reuse on 2-way SSL, integrate https://github.com/cesanta/mongoose/pull/877
PUBLISHED_FROM=6e2568b963869d062dd51b590f8e536d043c4ca2
2020-05-21 16:17:14 +01:00
Sergey Lyubka 4ea452307e Update certs used for SSL test
PUBLISHED_FROM=2236ecf7fe06bdaf9a89e697b83ff69e1f8c805c
2020-05-21 16:17:12 +01:00
Deomid "rojer" Ryabkov e61f20f1ed Convert amalgam.py to Python 3
No mongoose.{c,h} diffs

PUBLISHED_FROM=a995a6d6548a914087969e28908f4e8c9ef1d379
2020-05-09 10:48:41 +00:00
Sergey Lyubka ca11f5ab49 Fix OpenSSL error issue
PUBLISHED_FROM=a3bcdb68f48a4de4a4f55b4399792fdd5211c88d
2020-05-02 11:19:29 +00:00
Sergey Lyubka 000d24d31a Add http proxy client example
PUBLISHED_FROM=443a0d3db63df1b78555a9fa4eff808bef3a9a01
2020-03-25 16:32:49 +00:00
Sergey Lyubka ef92f2e9c5 Integrate cesanta/dev#1062 - Fix dereferencing in mg_http_free_proto_data_endpoints
PUBLISHED_FROM=47fd1a4de07d2c53c994d29c88ac1d3a7f61c1a0
2020-02-21 14:30:21 +00:00
Sergey Lyubka 4e89eac8dd Integrate cesanta/dev#1074 - Fix typedef bool for MSC
PUBLISHED_FROM=f52fe15edd617d9f1ba2aa4051c116e79671554d
2020-02-21 14:24:50 +00:00
Sergey Lyubka b015e33ea5 Integrate https://github.com/cesanta/mongoose/pull/1096 - dir listing nits
PUBLISHED_FROM=a343bd61f98cbcc0f8cab02a62b912e494c27601
2020-02-14 08:30:56 +00:00
Sergey Lyubka 96e762d4a1 Change contributions section
PUBLISHED_FROM=676548efdb09989c300693a81dd592fe1cd987b0
2020-02-14 08:30:54 +00:00
Sergey Lyubka 359060a151 mongoose.h 6.17 2020-02-11 12:11:10 +00:00
Sergey Lyubka af1aff7fbb mongoose.h 6.17 2020-02-11 12:10:13 +00:00
Sergey Lyubka 517ef216c1 6.16 -> 6.17
PUBLISHED_FROM=c0cbd13faf84fdac1f4566be02b596a232b68713
2020-02-11 11:54:54 +00:00
Sergey Lyubka 734c13cdf5 Squash win32 warnings
PUBLISHED_FROM=3819e74efb9ac8ff84a68105107afcacaeeab92a
2020-02-11 11:52:07 +00:00
Deomid "rojer" Ryabkov 1bf3ad2426 MQTT ping fixes
* Actually drop the connection when no response to ping arrives within the next interval.
 * Avoid sending immediate ping when wall time is adjusted, it's usually spurious.

PUBLISHED_FROM=8049280b58edfb94dd0fcb6a1e89ffefe69bcea1
2020-02-11 08:04:02 +00:00
Deomid "rojer" Ryabkov 884b9a4813 Add Content-Encoding: gzip when serving .gz files
If file ends with .gz and has known "secondary extnesion", i.e. test.html.gz,
its content type is determined by the secondary extension and content-encoding is set to gzip.

PUBLISHED_FROM=a238763b4424bafabec2e58ccae4522cacdd7c78
2020-02-01 08:33:49 +00:00
Deomid "rojer" Ryabkov 7153690016 Keep the size of the structure the same in non-SSL build
PUBLISHED_FROM=8f93bee72bc18efff64354203ee6268f4f8e8768
2020-01-31 11:01:35 +00:00
Deomid "rojer" Ryabkov f00b3a2b3a Move ssl_if_data to the end of mg_connection
PUBLISHED_FROM=4fb65477b03bedc3206ac286e8236f0f9536f20e
2020-01-31 09:48:30 +00:00
Deomid "rojer" Ryabkov c2b5e4f3b8 Fix a leak when CA certificate file is invalid
Also free up some RAM by not allocating ca_cert when `MBEDTLS_X509_CA_CHAIN_ON_DISK` is enabled.

PUBLISHED_FROM=5e5f4103707de98c929973d2aed0aaedf0bb60da
2020-01-22 10:03:30 +00:00
Deomid "rojer" Ryabkov bc15e9ce9a Fix value of MG_MQTT_DUP
PUBLISHED_FROM=de1772bd6ea01f3dc467ceebb3b2af5cbe8eb240
2020-01-20 09:33:25 +00:00
Deomid Ryabkov 70dc6d8dc9 Add mg_strcasecmp()
CL: Add mg_strcasecmp()

PUBLISHED_FROM=cd2a26fa12473bfa0f5e7a0a1d34fb86562ee082
2019-12-29 19:39:45 +00:00
Deomid Ryabkov 10b11b03a8 Add mg_dns_encode_name_s for non-NUL terminated strings
PUBLISHED_FROM=012e2939021d1b275a39632fd2982891d2c98c4e
2019-12-29 19:33:41 +00:00
Sergey Lyubka cb602f178c Fix int overflow in parse_mqtt()
PUBLISHED_FROM=f9106d2f746c67ae004aeab12685eaf9cd558cd8
2019-12-23 11:13:41 +00:00
Sergey Lyubka 464113c5ae Sync mongoose changes
PUBLISHED_FROM=8b6ebf46728aca40f916dde88e372b4540ed6ea4
2019-12-19 11:12:57 +00:00
Deomid Ryabkov c34f6c54e7 Fix ota-shadow logic
PUBLISHED_FROM=68a57c967f8864946244893c71a397ab4e27d75d
2019-12-07 09:03:26 +00:00
Sergey Lyubka 8fb58ebbca Lsm
PUBLISHED_FROM=5f465d245bb9ada5202cdd23ddc5b9856df26951
2019-11-04 13:48:28 +00:00
Sergey Lyubka dce60c6dbb Merge pull request #1054 from M4GNV5/master
fix typo in tools/README.md
2019-10-07 09:08:58 +01:00
Jakob Löw f668d08804 fix typo in tools/README.md 2019-10-01 00:14:11 +02:00
Sergey Lyubka c41a22195c Merge pull request #1020 from nliviu/patch-2
Fix ASAN build for examples/cookie_auth
2019-09-30 07:46:39 +01:00
Sergey Lyubka 900c05213b 6.15 -> 6.16 2019-09-30 07:44:10 +01:00
Sergey c5850e4b05 Merge branch 'dev' 2019-09-30 07:41:04 +01:00
Sergey Lyubka ff4649fe42 Better UI
PUBLISHED_FROM=50f0cafa84cd06428f0da376d85766dcf62af9da
2019-07-12 12:33:28 +00:00
Sergey Lyubka 1a38e91042 Next
PUBLISHED_FROM=6fa0be81ce429b8db9e3ed572cb4a876b6fb2693
2019-07-12 09:33:26 +00:00
Sergey Lyubka b6196371bb Lsm
PUBLISHED_FROM=18d9d1e6411db84788c527d1c34ad2adc846df00
2019-06-26 10:33:24 +00:00
Sergey Lyubka d5beb7ba3f Merge branch 'dev' 2019-06-13 09:50:09 +01:00
Sergey Lyubka 19acf23c49 6.14 -> 6.15
PUBLISHED_FROM=69f3a5f14d4ebce0fb89728fc345f90f1e7b1700
2019-06-13 08:49:37 +00:00
Sergey Lyubka 5cd3291fec Merge branch 'dev' 2019-06-13 09:45:43 +01:00
Sergey Lyubka b3e0f780c3 Fix heap-based overflow in parse_mqtt
PUBLISHED_FROM=3306592896298597fff5269634df0c1a1555113b
2019-06-13 08:18:14 +00:00
Sergey Lyubka 2bdbfc27f6 Integrate https://github.com/cesanta/mongoose/issues/1008
PUBLISHED_FROM=1b7bf2d7318568851e6c8f07451cd3982d9498b6
2019-06-13 07:48:28 +00:00
Sergey Lyubka 3fc61a3edc Fix mg_resolve2()
PUBLISHED_FROM=b0df728a75073c6ea9fc1984bb6a6b463f539347
2019-05-24 12:33:25 +00:00
Liviu 12339bbf4c Fix ASAN build
The ASAN build fails with
```
cookie_auth.c:62:7: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
  if (cookie_header == NULL) goto clean;
      ^~~~~~~~~~~~~~~~~~~~~
cookie_auth.c:84:10: note: uninitialized use occurs here
  return ret;
         ^~~
cookie_auth.c:62:3: note: remove the 'if' if its condition is always false
  if (cookie_header == NULL) goto clean;
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cookie_auth.c:65:3: note: variable 'ret' is declared here
  struct session *ret = NULL;
  ^
cookie_auth.c:62:7: error: variable 'ssid' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
  if (cookie_header == NULL) goto clean;
      ^~~~~~~~~~~~~~~~~~~~~
cookie_auth.c:81:7: note: uninitialized use occurs here
  if (ssid != ssid_buf) {
      ^~~~
cookie_auth.c:62:3: note: remove the 'if' if its condition is always false
  if (cookie_header == NULL) goto clean;
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cookie_auth.c:64:3: note: variable 'ssid' is declared here
  char *ssid = ssid_buf;
  ^
2 errors generated.
```
2019-05-08 14:54:31 +03:00
Deomid Ryabkov 1fb9f922b0 Fix mgos compile check
CL: none

PUBLISHED_FROM=a1320658181aa19cd1a269d7ae62e11b3439ef84
2019-05-03 16:36:08 +00:00
Deomid Ryabkov b93bc02ab0 Delete mos tool and related libraries from dev
Moved to https://github.com/mongoose-os/mos

PUBLISHED_FROM=8a0475678dba38fd6e057b8a530e9d08054ff74f
2019-05-02 12:03:33 +00:00
novlean 747e393a54 updated link to forum
PUBLISHED_FROM=784159d816e78f18fbfa6826f18bdea7d88dccbb
2019-04-29 12:40:14 +00:00
Deomid Ryabkov 4e8660a21f RS14100 fixes
CL: none

PUBLISHED_FROM=4d5d68f92d6c082b5b0c25ed8935fc097939001f
2019-04-24 19:16:41 +00:00
Deomid Ryabkov 3fe77fa9a6 RS14100: Optimize flash reads
CL: none

PUBLISHED_FROM=49d4f4a3c83520fd6ec9714b74333f75f3a2aa1c
2019-04-24 16:18:28 +00:00
Deomid Ryabkov b4fbaf7c13 Fix locking in lwip net_if
Was not being enabled when it should have been.

CL: Fix locking in lwip net_if

PUBLISHED_FROM=4810e73417c7599f0ea08a09812ed320d02f7cae
2019-04-23 20:03:44 +00:00
Deomid Ryabkov 9884241df8 mg_net_if_lwip: Fix invoking callbacks on tcpip thread
tcpip_callback doesn't wait for the callback to run (as was previosuly assumed).

CL: mg_net_if_lwip: Fix invoking callbacks on tcpip thread

PUBLISHED_FROM=930c45f1346f9c3b024e5e684f4a452c762db92b
2019-04-15 16:33:40 +00:00
Deomid Ryabkov 63d7a4fa45 Core dump analysis improvements
* ARM
   * Provide MSP and PSP
   * Provide FreeRTOS task info
   * Profide target specification XML (extra regs and FPU / no FPU Cortex cores)
 * ESP32
   * Use uxTaskGetSystemState instead of uxTaskGetTaskHandles
 * General cleanup and refactoring

CL: Core dump analysis improvements

PUBLISHED_FROM=3297ffb2e6069a3a6a598367273bc2183063cf1e
2019-04-10 19:18:33 +00:00
Deomid Ryabkov 8f4b6c41a2 Make FreeRTOS a library, upgrade to 10.2.0
All the platforms except esp32 (which uses heavily patched 9.0 from IDF) and esp8266 (doesn't use RTOS at all) are using the same version of FreeRTOS now.

CL: Make FreeRTOS a library, upgrade to 10.2.0

PUBLISHED_FROM=a4f7949a9f1546d23fc183412445859830f02d1a
2019-04-01 19:02:26 +00:00
Deomid Ryabkov 4493d65ec9 RS14100: Flash and FS support, increase CPU and flash clock
Run CPU at 180 MHz, flash at up to 100.

CL: RS14100: FS support, increase CPU and flash clock

PUBLISHED_FROM=e9f995bf03e4e36dc66e19a2a2d60ae1675ecaae
2019-03-28 23:18:36 +00:00
Deomid Ryabkov e5910da300 Deliver EV_CLOSE to the last endpoint handler
CL: mg: Deliver EV_CLOSE to the last endpoint handler

PUBLISHED_FROM=02ee2c6627ed9ee1d35022244f71dfe1877ce2c0
2019-03-19 13:15:41 +00:00
Deomid Ryabkov c277a1d878 Do not amalgamate platform_custom.h include
CL: none

PUBLISHED_FROM=4f84111ef76bd609348c439304f46556ce5d4497
2019-03-12 11:48:27 +00:00
Deomid Ryabkov 7820ad3a59 RS14100: Blinky
The humble beginning...

CL: RS14100: Blinky

PUBLISHED_FROM=7f1dc4d826122ababae44b52c52ed84b15d0ae5c
2019-03-08 23:03:39 +00:00
Sergey Lyubka 23533b83a4 Allow NULL handler for mg_bind and mg_connect
CL:  Allow NULL handler for mg_bind and mg_connect

PUBLISHED_FROM=4963d5c022c2c57dd03101d9c7e72ca910c3bb61
2019-03-06 12:33:24 +00:00
Deomid Ryabkov ab650ec5c9 Merge branch 'dev' 2019-03-04 15:19:32 +00:00
Deomid Ryabkov 8f36597048 Mongoose 6.14
PUBLISHED_FROM=3e6e17d1f1cfb05efc37d76279dcbedb7f1add5d
2019-03-04 15:15:35 +00:00
Deomid Ryabkov d0213ee90a ESP32: Add support for the 3/4 key encoding scheme
* Add calculated redundancy values when writing eFuse blocks 1-3
 * Perform 192 -> 256 bit key extension when encrypting images for flashing

Fixes https://github.com/cesanta/mos-tool/issues/37

CL: mos: ESP32: Add support for the 3/4 key encoding scheme

PUBLISHED_FROM=16639fb25d5200550ad2097929239d896e188b5b
2019-03-04 09:18:28 +00:00
Deomid Ryabkov 1e9fabe1ca Fix handling of WS handshake error response
Check response code, make sure it's 101.
Pass http_message to the client to keep it appraised.
This represents a slight change in the API -
in case of an error MG_EV_WEBSOCKET_HANDSHAKE_DONE will now be delivered where previosuly connection would just hang.
Clients that do not examine the argument may for a moment think handshake has succeeded but in fact connection will be closed immediately.

CL: mg: Fix handling of WS handshake error response

PUBLISHED_FROM=645a43d9e5bee216e54411f85827c9b974e9a7d1
2019-02-14 21:19:34 +00:00
Deomid Ryabkov 148d3f0562 STM32F2 and Particle Electron board support
CL: STM32F2 and Particle Electron board support

PUBLISHED_FROM=20dede6546e9f99d2829508177924790d87e985a
2019-02-12 13:36:54 +00:00
Deomid Ryabkov c3057df3f5 Fix mongoose CI test
CL: none

PUBLISHED_FROM=9510e460251c250cb6a67a40edc0af515044f9fe
2019-02-08 17:38:56 +00:00
Deomid Ryabkov 0b2e474d52 Improve ESP flasher baud rate setting
Use old baud rate and autodetected divider to calculate new divider.

This works better with higher baud rates and drifting clocks.

CL: mos: Improve ESP flasher baud rate setting

PUBLISHED_FROM=7761e756c3ae7cc76e3b9a4fe3e40d06a779b2e8
2019-02-08 17:38:55 +00:00
Deomid Ryabkov 95a36b1759 Log file:line instead of function; add cs_log_set_file_level()
cs_log_set_filter() is removed in favor of cs_log_set_file_level() which
allows setting log verbosity of individual files and/or lines.

E.g.: `mg_=1,mjs=1,=4` - level for for everything except mjs and mongoose.

We use the fact that we are usually pretty careful with our file names and use prefixes consistently.

In mos, `debug.file_level` sets the option on boot and `Sys.SetDebug` is updated to parse `file_level` option to change it at runtime.

CL: Log file:line instead of function; add cs_log_set_file_level()

PUBLISHED_FROM=49f18d4d0d3dd224865129a4f8fe6cccd1d9bc12
2019-01-30 12:57:19 +00:00
Deomid Ryabkov 86ffa3a3ea Properly support MQTT wildcards when matching topics
CL: mg: Properly support MQTT wildcards when matching topics

PUBLISHED_FROM=aa60a71d488f4b56dff0951886c8a9a4066fd4f2
2019-01-22 12:19:04 +00:00
Deomid Ryabkov 69e2b2985d Add mg_strfree()
CL: Add mg_strfree()

PUBLISHED_FROM=b80566218986e0607a9d2758bf776a1031b27212
2019-01-16 22:48:59 +00:00
Бобби c431904b56 Send extra options with OPTIONS
CL: Send extra options with OPTIONS. Integrate https://github.com/cesanta/mongoose/pull/657

PUBLISHED_FROM=6ee609a92febd8d908f7713f94fb73657443a09a
2019-01-16 11:33:57 +00:00
Deomid Ryabkov c2a10601b9 Fix nsleep100 on STM32
CL: Fix nsleep100 on STM32

PUBLISHED_FROM=cabb98a0541bac9bb66bfa702d54bf8ff20063e7
2019-01-08 20:43:55 +00:00
Deomid Ryabkov e9a8e5468d Convert Python scripts to Python 3, delete unused ones
CL: none

PUBLISHED_FROM=4bbc2175634e20a726dd4b2dadff57f945b261d0
2018-12-25 20:38:58 +00:00
Sergey Lyubka 22e602debb Check for NULL in tcp_recved_tcpip()
CL: Check for NULL in tcp_recved_tcpip()

PUBLISHED_FROM=3f5bbc2e35b79d363eac4b99a1f0d17c9b81d4ec
2018-12-21 13:03:48 +00:00
Deomid Ryabkov 455cec67a5 CC3220: Enterprise auth support
CL: wifi: CC3220: Enterprise auth support

PUBLISHED_FROM=ce445eb5b740073c9a3f9811f1acd404ce134f2e
2018-12-18 18:19:21 +00:00
Deomid Ryabkov e2dfac946d Ensure that user sees all the data before connection is closed
If user throttles receive by setting recv_mbuf_limit,
after the net interface reports connection as closed we must wait
for data to trickle through before disposing of it.
There can still b data in the buffers (e.g. SSL).

CL: mg: Ensure that user sees all the data before connection is closed

PUBLISHED_FROM=22be0fa368950a9fdb03cfb00febc7c0a1674b01
2018-12-10 21:04:49 +00:00
Бобби c198d2e5f1 Make MG_CTL_MSG_MESSAGE_SIZE overridable
CL: Make MG_CTL_MSG_MESSAGE_SIZE overridable

Fix https://github.com/cesanta/mongoose/pull/987

PUBLISHED_FROM=b0a7c67297b98f616c9eadcd3c34b8747939c918
2018-12-07 10:04:00 +00:00
Deomid Ryabkov 9a70abef24 Add mbuf_append_and_free() and mbuf_move()
CL: Add mbuf_append_and_free() and mbuf_move()

PUBLISHED_FROM=bdf73906dd93b2ebeace160596508e15480b54b4
2018-12-05 21:49:01 +00:00
Deomid Ryabkov 53e1c469a2 Add ability for multipart data handler to provide pushback
It can specify how much data was actually processed and the rest will be re-delivered on next poll.

CL: mg: Add ability for multipart data handler to provide pushback

PUBLISHED_FROM=e0168c5064c3a32921c9209bc09f4da2079cd616
2018-12-05 16:02:56 +00:00
Deomid Ryabkov 139c2061a8 Add create-fw-bundle command
Replacement for fw_meta.py commands and also supports unbundling .hex files.

General syntax is:

```
 $ mos create-fw-bundle -o fw.zip part1:prop1=val1,prop2=val2,... part2:...
```

Example of building a mos fw bundle for ESP8266:
```
 $ mos create-fw-bundle -o fw.zip --platform esp8266 --build-info=build_info.json \
    boot:addr=0x0,src=rboot.bin,update=false \
    boot_cfg:addr=0x7000,size=0x1000,fill=0xff \
    fw:addr=0x100000,src=demo-c.bin \
    fs:src=fs.bin,type=fs,addr=0x8000,fs_size=262144,fs_block_size=4096,fs_page_size=256,fs_erase_size=4096
```

Example of converting a HEX file to a bundle:
```
 $ mos create-fw-bundle -o fw.zip host:type=host,src=hostfw.hex
```

CL: mos: Add create-fw-bundle command

PUBLISHED_FROM=35f52ea53e4b5900463415257323a4c08cf45deb
2018-11-28 20:34:06 +00:00
Deomid Ryabkov 15b361fbac Add mbuf_clear()
PUBLISHED_FROM=754b98b3000b24ad3b3d9cc0b4c480ca005a1c3f
2018-11-23 15:50:55 +00:00
Deomid Ryabkov 3130e59244 Stop reading if connection is closing
CL: none

PUBLISHED_FROM=3b74ca02e2960bbbf130f6d95aef679f2917e824
2018-11-02 18:12:34 +00:00
Deomid Ryabkov 93286836f9 Read all available data during recv poll
CL: mg: Read all available data during recv poll

PUBLISHED_FROM=b081025b9fb392c988924c7097b5333c38053f6f
2018-11-02 14:50:32 +00:00
Deomid Ryabkov 91b57aa9a8 Add MG_MK_STR_N() and mg_str_starts_with()
CL: Add MG_MK_STR_N() and mg_str_starts_with()

PUBLISHED_FROM=f01003efc6aa6ff45fa99c7ad6e5319f5002f22d
2018-10-29 15:50:31 +00:00
Deomid Ryabkov 220231e647 Fix digest auth result comparison
Should use length of the exected response, not the response sent by the user.

CL: mg: Fix digest auth result comparison

PUBLISHED_FROM=23375133b8babac0b276b51395917ad975e1bd3c
2018-10-15 16:47:18 +00:00
Deomid Ryabkov c438bb0bc5 Make mg_rpc more easily portable
CL: none

PUBLISHED_FROM=2e77d72cdf82454349a7fe29cc77bd0b90ac4369
2018-10-09 12:04:12 +00:00
Deomid Ryabkov 95afa323c0 Merge pull request #978 from cesanta/dev
Mongoose 6.13
2018-10-08 14:06:45 +01:00
Deomid Ryabkov bc56353a79 Mongoose 6.13
CL: none

PUBLISHED_FROM=32418b7da17a68193e88405547152f58a4dd877f
2018-10-08 12:20:32 +00:00
Deomid Ryabkov 1ffccdb7b2 Remove a spammy log line
PUBLISHED_FROM=b3ec2b3b43a464700a6e6d75b7336f823549cce3
2018-10-04 15:48:48 +00:00
Deomid Ryabkov e79fe4b8f0 Update mbedTLS to 2.13.1
CL: Update mbedTLS to 2.13.1

PUBLISHED_FROM=bd1216f727605a901f062a044c0c0ca762f4a6d1
2018-10-04 10:06:35 +00:00
Deomid Ryabkov aaf1fc3a4a Schedule a poll when LwIP reports TCP data sent
PUBLISHED_FROM=0cf3029d9a9b851882325e2298b878bc83fc2d33
2018-09-28 11:03:47 +00:00
Deomid Ryabkov 8b42353039 Check HTTP chunk size, ensure it's reasonable
CL: mg: Check HTTP chunk size, ensure it's reasonable

PUBLISHED_FROM=d9f6babd314c092b42ce9e7fe31d6b30a38366a2
2018-09-27 12:51:21 +00:00
Deomid Ryabkov 05c687e251 Fix handling of keepalive HTTP requests/responses
Clean the HTTP connection state when ia request/response has been fully
buffered and handler invoked.

Fixes https://github.com/cesanta/mongoose/issues/971

CL: mg: Fix handling of keepalive HTTP requests/responses

PUBLISHED_FROM=70c854aa306aacb9161f6ee48841f38dc0312e6b
2018-09-27 12:51:18 +00:00
Deomid Ryabkov 492b8f6950 CC3200: Fix boot loader regression
Go back to Ubuntu 16.04 and older gcc-arm (4.9.3).

Boot loader just won't run when compiled with newer GCC (7.x).
It's likely that it can be fixed with compile switches but I couldn't figure it out quickly, so going to just downgrade for now to get it back to workign state.

CL: CC3200: Fix boot loader regression

PUBLISHED_FROM=b70b03bd17e03c7dae02328b32b855f3ca3ad6a9
2018-09-25 20:32:35 +00:00
Deomid Ryabkov 8ccee82059 Add mgos_gpio_blink()
CL: Add mgos_gpio_blink()

PUBLISHED_FROM=a5d2e2f44413d1ab363abeeaf0fb497bd8f63d6d
2018-09-25 20:32:33 +00:00
Deomid Ryabkov b99a94a652 Fix build w/o logging
PUBLISHED_FROM=694346bd6562c55e5ab00886df47f7cbfb0a3720
2018-09-25 11:34:05 +00:00
Deomid Ryabkov 41e5d7e471 Use mbedTLS from mongoose-os-libs/mbedtls
mbedTLS is just another lib now

CL: Use mbedTLS from mongoose-os-libs/mbedtls

PUBLISHED_FROM=bae4739d22e871bd268b8a3233dbb69634770243
2018-09-20 20:38:11 +00:00
Sergey Lyubka 1adea37c45 Integrate https://github.com/cesanta/mongoose/pull/667, fix documentation
CL: Integrate https://github.com/cesanta/mongoose/pull/667, fix documentation

PUBLISHED_FROM=80a939fc3276b89c29716e7373f674dba86769ee
2018-09-20 15:34:36 +00:00
Deomid Ryabkov 98f6c8aa4f Trim recv_mbuf when we know the size of the data
CL: none

PUBLISHED_FROM=e354b67ab6f8246af50c601f5f70d36c029601ea
2018-09-17 16:04:00 +00:00
Deomid Ryabkov 341ae53e85 Update mongoose.h (amalgamation)
PUBLISHED_FROM=1fbe72f99bda5745c4b9b9def0601bdc5bf70e65
2018-09-14 21:19:15 +00:00
Sergey Lyubka 291fc024cd Docs nits
CL: Docs nits

PUBLISHED_FROM=1a2fc8080d94673acf300c6f07aba3a1e6272295
2018-09-14 08:03:58 +00:00
Deomid Ryabkov f63d833a33 Update STM32 build image
* Update CubeL4 to 1.13.0
 * Rebuild OurTLS with `-DMBEDTLS_X509_CA_CHAIN_ON_DISK`
 * Add `-Wextra` and fix build issues

CL: Update STM32 build image

PUBLISHED_FROM=a7eacff7580bab6c6e40bdaf6164df575a717c55
2018-09-11 11:49:08 +00:00
Deomid Ryabkov ab035901f8 ISM43XXX networking support (TCP, UDP client)
Listeners still TODO

CL: ISM43XXX networking support (TCP, UDP client)

PUBLISHED_FROM=b58ba88b9e6bd7b55ccb607d0b69cea98cb52fa5
2018-09-11 06:34:08 +00:00
Deomid Ryabkov 20f54059ad STM32: Make LWIP optional
CL: STM32: Make LWIP optional

PUBLISHED_FROM=eebffe7800a74d7b69aafd95e476b2e90328be98
2018-09-06 11:27:58 +00:00
Deomid Ryabkov 563c31303e Add net_if_null, a no-op net interface
Can be used for cases where device has no networking but mongoose is still needed for its event loop.

CL: mg: Add net_if_null, a no-op net interface

PUBLISHED_FROM=e79b4a8667508bbde1437dda9dad77ce3a3aa630
2018-09-06 08:34:17 +00:00
Deomid Ryabkov 421e099f2b Refactor mg polling
* Change return type of mg_mgr_poll to return number of events
 * Add mg_mgr_min_timer
 * Refactor main poll loop to remove LwIP-specific stuff

CL: Refactor mg polling

PUBLISHED_FROM=dc94618b32fa3c84a2f053bd04d134297780ec82
2018-09-06 06:34:18 +00:00
Бобби 955d4a3129 Fix file upload on windows
CL: Fix https://github.com/cesanta/mongoose/issues/962 - file upload on windows

PUBLISHED_FROM=85688eee147a1df468cca92f4ac61526ce9c02bf
2018-08-21 15:06:40 +00:00
Deomid Ryabkov b84981ad03 STM32 OTA support for L475-IOT01 and DISCO-F746
A smattering of other related changes

CL: STM32 OTA support for L475-IOT01 and DISCO-F746

PUBLISHED_FROM=e7142337086d09ba21437455b22d00db47ab33f1
2018-08-18 07:49:30 +00:00
Deomid Ryabkov 777b8e94e2 Merge branch 'dev' (Mongoose 6.12) 2018-08-13 19:30:06 +03:00
Sergey Lyubka 6df642623a Delete CONTRIBUTING.md 2018-08-13 19:28:18 +03:00
Deomid Ryabkov 0a3e186f11 Mongoose 6.12
CL: Mongoose 6.12

PUBLISHED_FROM=8008e4db2f6d94d972fb6e1077525e262c8744aa
2018-08-13 14:41:42 +00:00
Deomid Ryabkov c2d83a9db0 Don't touch send_mbuf when sending MQTT messages
h/t @M4GNV5

Fixes https://github.com/cesanta/mongoose/issues/943
Closes https://github.com/cesanta/mongoose/issues/944

CL: mg: Don't touch send_mbuf when sending MQTT messages

PUBLISHED_FROM=da7b4f8acec2e403caa4addd5739d036a6a74c76
2018-08-13 14:04:49 +00:00
Deomid Ryabkov f33d3a4e02 Fix body length calculation in mg_handle_cgi
Fixes https://nvd.nist.gov/vuln/detail/CVE-2018-10945

CL: mg: Fix body length calculation in mg_handle_cgi

PUBLISHED_FROM=0c30cf36fdb67c75f6148468701e23d6ee72d953
2018-08-13 13:05:22 +00:00
Deomid Ryabkov 86b8a56b05 Add host name verification for OpenSSL
Closes https://github.com/cesanta/mongoose/pull/955

CL: mg: Add host name verification for OpenSSL

PUBLISHED_FROM=e35dd636ba7ce63116f0a38031074d22f6cd5dac
2018-08-13 13:05:21 +00:00
Бобби ac6ec15aed Make esp8266 compilation a little less verbose
CL: Make esp8266 compilation a little less verbose

PUBLISHED_FROM=0ec1412ea32243f263d52fbe0877ecca1efc5aef
2018-07-23 15:26:47 +00:00
Deomid Ryabkov 31632c6361 Fix build with CS_ENABLE_STDIO=0
Closes https://github.com/cesanta/mongoose/pull/945

CL: Fix build with CS_ENABLE_STDIO=0

PUBLISHED_FROM=7d15f17fc42241facdba5b1004b5b7f3dda599dc
2018-07-12 20:42:45 +00:00
Deomid Ryabkov 98c99279c3 Fix warnings on newer versions of GCC
PUBLISHED_FROM=f1d25145446057fed9e8d634ca637364ca43a5e8
2018-07-09 08:34:29 +00:00
Deomid Ryabkov cdb8d7b692 Add mg_strstrip: trims whitespace at the ends of s
CL: Add mg_strstrip: trims whitespace at the ends of s

PUBLISHED_FROM=a7e10054ac25fa2b3a878876da93a6b30d9507b3
2018-07-07 14:04:42 +00:00
Deomid Ryabkov 93ac3e19f0 Stringify multi-word macros correctly
Use vararg macros for this.

PUBLISHED_FROM=735c40b79dedef17a1fdbb5b846e984df0ae7018
2018-07-03 15:05:23 +00:00
Deomid Ryabkov 6a51af9efe Fix a bug in mg_mgr_init_opt with opts.num_ifaces
h/t @YankunLi

Closes https://github.com/cesanta/mongoose/pull/939

CL: mg: Fix a bug in mg_mgr_init_opt with opts.num_ifaces

PUBLISHED_FROM=a87518b3505429a3cf9cd6d84b3b781e7dbdcfd5
2018-06-27 08:50:07 +00:00
Deomid Ryabkov 9d73b3470b Add LFS (littleFS) library
CL: mos support for LFS (littlefs) https://github.com/ARMmbed/littlefs

PUBLISHED_FROM=e72957b4fb2c78949af4cf6d5bfef135ddba9fd9
2018-06-26 16:49:42 +00:00
Deomid Ryabkov 1c8449cea6 Fix pipelining issue with multipart upload
Do not clear buffer at the end of multipart request to allow following request to proceed.

Closes https://github.com/cesanta/mongoose/pull/940

CL: mg: Fix pipelining issue with multipart upload

PUBLISHED_FROM=cc7d38b126eaa863553ee4e124cfafcd72030fcf
2018-06-26 12:05:04 +00:00
Deomid Ryabkov 3bbbd41196 Add missing CC3220 sub-header to mongoose.h
CL: Add missing CC3220 sub-header to mongoose.h

PUBLISHED_FROM=a143485b629109c6e16c66b035f02f7552f76129
2018-06-21 16:34:56 +00:00
Deomid Ryabkov 339bbee0df mg_file_upload_handler: Support multiple files
curl -F file1 -F file2 ...

Add a unit test and fix a minor memory leak when returning an error.

CL: mg_file_upload_handler: Support multiple files

PUBLISHED_FROM=5c4bf2be676346fb782e80f50f79df6a6721ac88
2018-06-20 13:35:31 +00:00
Deomid Ryabkov 9ba6eb716d mg_lwip: Fix race during clean conenction teardown
Set CLOSE_IMMEDIATELY flag when destroying conn.
This avoid some races in LWIP adapter.

CL: mg_lwip: Fix race during clean conenction teardown

PUBLISHED_FROM=5c67982390dfaf83527e85d1291f64c6050aa932
2018-06-18 16:35:04 +00:00
Deomid Ryabkov d949c19c7e mgos_nsleep100 impl for ARM-based platforms
startup cleanup on CC3220

CL: none

PUBLISHED_FROM=0998fad82fbcdbde30dca42833f2e48d148592bf
2018-06-06 08:04:33 +00:00
Deomid Ryabkov 1299d6118f Add MG_HIDE_SERVER_INFO
Closes https://github.com/cesanta/mos-libs/pull/2

CL: Add MG_HIDE_SERVER_INFO

PUBLISHED_FROM=ed8a5b65f1c8238df414cd1c1f8bb1f579082f55
2018-05-17 16:20:44 +00:00
Deomid Ryabkov 244ff92e78 Minor build optimization
PUBLISHED_FROM=9997c64ed0c713b5b8b29df7a49b532e880eac53
2018-05-10 19:05:40 +00:00
Deomid Ryabkov 53f34dea04 Fix TZ on ESP8266
CL: Fix TZ on ESP8266

PUBLISHED_FROM=435a501a8b52524bccb67bb5a8ae7e09dfb4d44a
2018-04-26 15:26:39 +00:00
Sergey Lyubka 1f5c3fac31 Delete CONTRIBUTING.md 2018-04-17 15:08:35 +01:00
Sergey Lyubka 7014258c8d Remove copyright notices - that explained in the CLA.
CL: none

PUBLISHED_FROM=9cb4b915906d471ef5de4e0825567d0b942d3f7b
2018-04-17 11:45:31 +00:00
Deomid Ryabkov 1614e7ba8d Restore FFI-ability of struct mg_str
mgos_dlsym needs to include mg_str for ffi_exports to be able to use it

PUBLISHED_FROM=a2dd167c8e8f9e9b7316a856f19a4603080c3632
2018-04-13 17:12:07 +00:00
Deomid Ryabkov 43b5a4e735 Add a special attribute to printf-like funcs
Enables extra compile-time checks

CL: none

PUBLISHED_FROM=9f7d658fbda5c721cf40293bf29967bb056d0437
2018-04-13 17:12:06 +00:00
Deomid Ryabkov 43191db63e Fix boot loader UART baud rate on soft reboot
Also remove `-O3` optimization flasg, it negates `-Os`. Saves ~400 bytes.

CL: none

PUBLISHED_FROM=f40f42e4f54a8e0e003ab65ec8f5838c2d932876
2018-04-11 18:35:15 +00:00
Deomid Ryabkov e89be2e944 Add mg_url_encode_opt()
CL: Add `mg_url_encode_opt()` - a parametrized version of `mg_url_encode()`

PUBLISHED_FROM=17fa57a7a5325b51b6e3aef3855eac4e82c35782
2018-04-10 11:04:31 +00:00
Deomid Ryabkov c2fbff6d0e Fix mg_http_parse_header
Per standard, cookies are delimited by `; `.

CL: Fix mg_http_parse_header: treat ";" as a delimiter.

PUBLISHED_FROM=039243c30f5fabf4a4700a43506f841b3268306a
2018-04-10 10:19:36 +00:00
Deomid Ryabkov b8eca17c55 Reamalgam mongoose.{c,h}
PUBLISHED_FROM=8828792097bd19774472b8a2e61420565684d174
2018-04-03 16:08:21 +00:00
Sergey Lyubka 4650e491df Apache license to common/
CL: Apache license to common/

PUBLISHED_FROM=901e9e4b12a31289b3515d1f86dd56a7f0f35c5e
2018-04-03 11:49:59 +00:00
Deomid Ryabkov 3e33e57707 Mongoose net_if and ssl_if refactoring
A major cleanup, disentangling net_if and ssl_if.
Pulled a lot of common logic into the core and reduced size of net_if implementations.

CL: Mongoose net_if and ssl_if refactoring

PUBLISHED_FROM=29bd4dcb264a1fd96b3dd164e2d880e1c2c0921e
2018-03-30 23:19:49 +00:00
Deomid Ryabkov c80f4c5313 Fix an edge case in multipart HTTP upload parsing
Consume buffer as soon as we know there is no boundary there, no need to delay until next chunk arrives.
This prevents stall where buffer fills up in one go and next chunk never arrives.

CL: Fix an edge case in multipart HTTP upload parsing

PUBLISHED_FROM=025f9001d272df2a75ece22b199b1944d5db9840
2018-03-30 19:35:20 +00:00
Deomid Ryabkov 132ecbec2f Fix Mongoose and Frozen include paths
In preparation for making moving to lib.
Reduce amount of makefile copypasta a bit.

CL: none

PUBLISHED_FROM=70a016491f9605e37708385bdd698f48a8d64119
2018-03-28 14:12:23 +00:00
Deomid Ryabkov 0a90cab44a Improve mbuf allocation behavior
* Limit total amount of headroom, in absolute terms (`MBUF_SIZE_MAX_HEADROOM`).
 * If unable to allocate with headroom, fall back to allocating the required minimum.
 * For mOS, set default `MBUF_SIZE_MULTIPLIER` to 2 to avoid floating point operations.
   Since max headroom size is now capped to 128 bytes, this will not result in much of a bloat.

PUBLISHED_FROM=11d4fc65a46a805bb7c8960f89a3d0b753c58bb8
2018-03-22 07:49:57 +00:00
Serge A. Zaitsev d16dbc197f mongoose: fix http pipeline
mongoose: fix formatting

mongoose: fix formatting

mongoose: remove debugging messages

PUBLISHED_FROM=1194e018001cc5f2b598096593d7aac4ec8dc04d
2018-03-20 16:41:56 +00:00
Serge A. Zaitsev 127f27e375 mongoose: unit test for http get pipeline
PUBLISHED_FROM=00e8634913232eb2e50a0d739f85e81706dbc400
2018-03-17 16:35:04 +00:00
novlean 6523cc4da0 2018
PUBLISHED_FROM=63ce52177f5f13cb76f0fcb4689efb65a04318a2
2018-03-12 21:20:20 +00:00
novlean 2516da1c89 updated to 2018 2018-03-12 16:49:45 +00:00
Serge A. Zaitsev 0ae2b82b60 freshen: early attempts to make ota and config work
freshen: implement ota rollback

freshen: api for rpc

freshen: implement rpc api (without transport)

PUBLISHED_FROM=9f935f676161c81464a0dc53d5d8d085b2437ffb
2018-02-27 14:19:33 +00:00
Sergey Lyubka dab526936f Add missing test files to mongoose repo
PUBLISHED_FROM=9a81cc34aa0039a75c851bc3685055f46936252e
2018-02-23 11:19:42 +00:00
Бобби 780077d118 Fix mg_socketpair for lwip + UDP
CL: Fix mg_socketpair for lwip + UDP

PUBLISHED_FROM=6dd09136b3837016026523fb34acb5cc893cadbe
2018-02-18 16:49:38 +00:00
Deomid Ryabkov ad8f1d88d4 Fix buffer size passed to inet_ntop()
Fixes https://github.com/cesanta/mongoose-os/issues/394

CL: Fix buffer size passed to inet_ntop()

PUBLISHED_FROM=4a6702527627ccbb780f45200274b09a28be69ee
2018-02-13 12:49:53 +00:00
Deomid Ryabkov a3c4a48ef7 Make sure test assertions are evaluated once
E.g. if `ASSERT_EQ(myfunc(), 123)` fails, `myfunc()` would be invoked again to print the actual value.
This can cause confusion sometimes.
To avoid this, we cast arguments to double, which is wide enough for most cases and we provide a variant for 64 bit value types for when it's not.
We also perform a check and fail if argument to the check results in loss of precision.

CL: none

PUBLISHED_FROM=a14551289d92e8a5dead21d16471ebddebe938a8
2018-02-10 12:19:40 +00:00
Deomid Ryabkov 84a11fe3b1 Count both tests and individual checks
CL: none

PUBLISHED_FROM=ab7f50e1c68154832e862ebfb4a02d385ef7c6be
2018-02-08 19:20:00 +00:00
Dmitry Frank 2a3cfc9858 Bump mongoose version to 6.11
PUBLISHED_FROM=92604e1b7c65009a6214fea9f1b2460df721d38e
2018-02-08 16:51:43 +00:00
Dmitry Frank b9b20c6494 Implement mg_http_parse_header2()
Which is a replacement of (deprecated) `mg_http_parse_header`, but,
similarly to `asprintf`, allocates a new buffer if the client-provided
one is not large enough.

Also use it throughout mongoose code, and thus some header-related
limitations are removed; in particular,
https://github.com/cesanta/mongoose/issues/813 is fixed.

CL: Mongoose Web Server: Deprecate `mg_http_parse_header()` and implement `mg_http_parse_header2()` instead, which allocates a new buffer if the client-provided one is not large enough (similarly to `asprintf`).
CL: Mongoose Web Server: Fix limitations of header value lengths, e.g. when parsing authentication headers such as nonce, etc.

PUBLISHED_FROM=c75b1bbbbdb294ea85075ce69b1368f115fdd1ef
2018-02-07 23:04:29 +00:00
Deomid Ryabkov a8a7d2cf7e Minor tweaks for testing
PUBLISHED_FROM=d52aea1648ed8ec8dd2e71168884795d995b1826
2018-02-07 20:19:31 +00:00
Deomid Ryabkov 50ecc30b4d Commonize unit test main()
CL: none

PUBLISHED_FROM=ee76407d89f3fcbe3da23810117a374d06af0a25
2018-02-07 16:19:32 +00:00
Deomid Ryabkov cd89db5c2f Add a convenience macro invoke subroutines
To properly fail a test in a subroutine, return value needs to be passed up.
This snippet makes it short.

PUBLISHED_FROM=2f6328b5eb2921a4caa53d8887c02f73a5d817ea
2018-02-07 14:49:23 +00:00
Deomid Ryabkov 1ed99999bd Add ASSERT_{TRUE,FALSE} convenience macros
PUBLISHED_FROM=3cd6dd7f04b650ca637788d1017b6b5146c79569
2018-02-06 16:49:32 +00:00
Dmitry Frank 4afebdcb2b Add UDP client example
CL: Mongoose Web Server: Add UDP client example

Resolves https://github.com/cesanta/mongoose/issues/886

PUBLISHED_FROM=fcce2f1de3a800147e9246ffa01c428c1b8f552b
2018-02-06 13:34:33 +00:00
Dmitry Frank c3d9d17e34 Remove "mongoose" prefix from includes
In certain files it was necessary to make tests work from public
mongoose repo, so this commit makes things consistent.

PUBLISHED_FROM=694454d0ff007229c65d524a2a2beaf126420f15
2018-02-05 20:20:05 +00:00
Dmitry Frank 7bf5144e62 Make tests work on public repo as well
PUBLISHED_FROM=78acb18d597b6f47f31da13087fa6685f21ce445
2018-02-05 14:35:37 +00:00
Dmitry Frank 3eb4eb8074 Fix mongoose docs generation
PUBLISHED_FROM=331821dcd1f7dc8a94581cd8a9b51aa00a89fddc
2018-02-03 01:20:48 +02:00
Deomid Ryabkov ab000c684a Fix includes
Even though it makes no prectical difference due to the way amalgamation works

CL: none

PUBLISHED_FROM=6977833f2b469e5b969385ad9ae21a28af76746f
2018-02-03 01:20:47 +02:00
Dmitry Frank aba60dadec Add mg_ prefix to mongoose sources
CL: none

PUBLISHED_FROM=d6ebe5fa88c61ae3b8569897d9b09d54610bec73
2018-02-03 01:20:47 +02:00
Dmitry Frank f29457e967 Remove tunneling from mongoose
CL: Mongoose Web Server: Remove tunneling functionality which was used by nobody

PUBLISHED_FROM=38b9e8ae7b0a5a1dbba5cff4074843dc681267d3
2018-02-02 21:50:13 +00:00
Dmitry Frank 8742fac5d8 Publish mongoose src and tests
CL: Mongoose Web Server: Publish sources and tests

Resolves https://github.com/cesanta/mongoose/issues/745

PUBLISHED_FROM=7ecd7a3c518cfa614a6ba0838678dcb91b75a8c0
2018-02-02 15:49:55 +00:00
Dmitry Frank 0ab1c7ef76 Fail if passed a NULL handler
Before it resulted in an endless recursion.

Resolves https://github.com/cesanta/mongoose/issues/871

CL: Mongoose Web Server: Fail if passed a NULL handler to `mg_bind` or `mg_bind_opt`.

PUBLISHED_FROM=376e5d330a643fa530f6a27a422a1500f986c721
2018-02-02 06:35:12 +00:00
Dmitry Frank 47abc641f1 Fix nonce in digest authentication
CL: Mongoose Web Server: Digest authentication: Fix nonce validity check (expired nonce or nonce from the future did not cause the the check to fail)
CL: Mongoose Web Server: Digest authentication: Fix nonce request value; it worked before because nonce validity check was broken as well
CL: Mongoose Web Server: Digest authentication: Add `nonce` argument to `mg_http_create_digest_auth_header()`: clients should use the value received from the server's authentication request.

Resolves https://github.com/cesanta/mongoose/issues/809

PUBLISHED_FROM=5e59f90ed6b2a4311ed6763159da81c2aaf6af4c
2018-02-01 22:05:43 +00:00
Dmitry Frank 7519b2ef3a Improve websocket implementation
CL: Mongoose Web Server: Websocket: Respond to Ping with Pong
CL: Mongoose Web Server: Websocket: Properly close a connection with Close frame (in response to a client's close and when protocol failure is detected)
CL: Mongoose Web Server: Websocket: Fix support of fragmented messages
CL: Mongoose Web Server: Websocket: Add support for control frames interjected in the middle of a fragmented message

PUBLISHED_FROM=e2b3794aaacc64633540c493194cccc62afa2077
2018-02-01 13:20:19 +00:00
Dmitry Frank ce8657f12f Fix corner case in preparing cgi env
`path_info` was dereferenced without checking for NULL, and a few lines
below, it was checked for NULL.

CL: none

PUBLISHED_FROM=9f14dc68c152b9b1119b276f047686d831bace38
2018-01-30 20:39:54 +00:00
Dmitry Frank 8e366916d5 Ensure that the name buffer is null-terminated
CL: none

PUBLISHED_FROM=f165b556582f712c2c1c752e01c41d22fe593397
2018-01-30 20:39:53 +00:00
Dmitry Frank 33f53ab000 Don't ignore setsockopt return value
PUBLISHED_FROM=f3c1fcf015f6f72eca2eb3d5dad469cd66a837a9
2018-01-30 20:39:52 +00:00
Dmitry Frank bd15ad4301 Improve err handling in pubsub example
PUBLISHED_FROM=7660e252e1ac84bf2245718c548fb00288ff4e47
2018-01-30 20:39:51 +00:00
Dmitry Frank e5b3b8ad32 Ensure not to overflow buf in udp server example
PUBLISHED_FROM=413f5073b0fc267d66ce04d8d40e9e9d7abac94d
2018-01-30 20:39:50 +00:00
Julien Ammous e116c48bef Remove redundant initialization
CL: none

PUBLISHED_FROM=9d68cdc298c520798468b43a19c84251bd0c21b4
2018-01-30 19:39:08 +00:00
Julien Ammous 7d7bb3b388 Don't use user_data in mqtt server
Integrates https://github.com/cesanta/mongoose/pull/884
Closes https://github.com/cesanta/mongoose/issues/883

CL: Mongoose Web Server: Don't use user_data in mqtt server

PUBLISHED_FROM=7785784a766e0ba7514bbba604cde14e7bad3f73
2018-01-30 19:39:05 +00:00
Dmitry Frank 0b4bf13335 Fix mg_parse_multipart in case of malformed req
CL: Mongoose Web Server: Fix mg_parse_multipart in case of malformed request

PUBLISHED_FROM=9b33b03e9ab2ca204ad2f8d061df169246644072
2018-01-30 19:39:03 +00:00
Dmitry Frank 228984a3fc Fix a corner case in receiving UDP data
CL: none

PUBLISHED_FROM=9c13882517374644c6d799976f1048f04ae446d7
2018-01-30 14:35:15 +00:00
Dmitry Frank f084ad8008 Fix pubsub example
CL: Mongoose Web Server: Fix publish-subscribe example

PUBLISHED_FROM=04fdb66c1d4eb56798a5be2634f9f9bb2f18f288
2018-01-30 14:35:14 +00:00
Dmitry Frank 255da78bed Fix socket leak when there are too many open fds
CL: Mongoose Web Server: Fix socket leak when there are too many open file descriptors

Fixes https://github.com/cesanta/mongoose/issues/870

PUBLISHED_FROM=c802b6834a54eca37821d46efde192c527e0a6b7
2018-01-30 13:37:42 +00:00
Dmitry Frank 5d5badfcee Fix memory leak in big_upload example
PUBLISHED_FROM=e6ccbd73b27985fbf9949adc3e07c90a75f75603
2018-01-30 12:51:15 +00:00
Dmitry Frank 4cf9f99ae9 Fix docs link
PUBLISHED_FROM=2b18b68e500a3d6123e80bd4db19e3b3b9900012
2018-01-30 09:50:44 +00:00
Dmitry Frank 673f25f75a Include stdbool.h for NRF52
Fixes https://github.com/cesanta/mjs/issues/82
Integrates https://github.com/cesanta/mjs/pull/85

PUBLISHED_FROM=2f5f50c25ec1c92fdfb783cd95cb57f0cb20642b
2018-01-29 22:35:15 +00:00
Бобби 961fb96bb7 Fix OOB access in mg_match_prefix_n()
CL: Fix OOB access in mg_match_prefix_n().
    Made mg_match_prefix_n() return non-negative result.

PUBLISHED_FROM=611454df6a6c55bfa7ddf05e7d268a86fa0457a8
2018-01-27 13:50:13 +00:00
Deomid Ryabkov d6475fcd19 Fix TCP RX path regression in SSL mode
CL: Fix TCP RX path regression in SSL mode

PUBLISHED_FROM=2cfdb33e5f711bbc4b98e2d24ba3377de0f1d3c5
2018-01-18 11:04:45 +00:00
Dmitry Frank ac538f755f Close undrained and stuck http connections
CL: - Mongoose Web Server: close undrained and stuck http connections

PUBLISHED_FROM=a11656b195dbe2ef8473455a171a583e37cedb2c
2018-01-16 15:20:47 +00:00
Deomid Ryabkov 5b2eb4f0e1 Enable building with CS_ENABLE_STDIO=0
h/t @kzyapkov

PUBLISHED_FROM=d15a5a0057f69f2f755af6436e676b1b179d069d
2018-01-15 20:20:36 +00:00
Deomid Ryabkov 10c274c774 STM32 Ethernet support
AWS MQTT connection works

Also fixes https://github.com/mongoose-os-libs/ethernet/issues/1 (because why not).

PUBLISHED_FROM=7b0fa8894f2127335d075f2a97fcd37b932006b2
2018-01-12 13:02:29 +00:00
Deomid Ryabkov eb3b81297d Use stock ARM GCC and Newlib from Ubuntu distro
Standardize common packages in build images, to make better use of Docker image cache.

PUBLISHED_FROM=a080e83cf5dd80feaf7960147dee36413244a92c
2018-01-04 11:56:42 +00:00
Dmitry Frank 80f4133bbf Get rid of magic numbers in parse_mqtt
PUBLISHED_FROM=63cc7ed8c3378bebf209d3620efb09d73675370c
2018-01-02 10:50:38 +00:00
Dmitry Frank d10fb9451c Move the recv limit check to mqtt
PUBLISHED_FROM=028d6f56ec1cc15484c995335f00d087b590faef
2017-12-29 17:35:29 +00:00
Dmitry Frank 88ae2ecadb Drain rx_chain before closing the connection
PUBLISHED_FROM=08eee4052dd9bbc364875a577409cb78665dee30
2017-12-29 07:50:43 +00:00
Dmitry Frank 85d19dad47 Respect recv_mbuf_limit in lwip
PUBLISHED_FROM=470ff0f484bff3e4478651f0b64cc160bba8ebfc
2017-12-28 12:49:54 +00:00
Dmitry Frank c5cc414181 Improve docs of str_util.h
PUBLISHED_FROM=de02f5cc6a9d854e92cf674e5382f793709da831
2017-12-17 14:50:54 +00:00
Dmitry Frank 17703fe3e8 Improve docs for logging
PUBLISHED_FROM=72f0892ecfba5b1c3c2a70f0ecd5715578d7ffce
2017-12-16 17:55:53 +00:00
Dmitry Frank 04aeeba2fa Add inet_ntop and inet_pton to esp8266
PUBLISHED_FROM=0a321ace3753a518e299b795fb7a4eed19708bb6
2017-12-14 21:51:00 +00:00
Бобби 4e11d5cdbf Move shadow to event API
PUBLISHED_FROM=cd059adee921dd10fd89100b0e2500ff8d7743eb
2017-12-14 13:32:11 +00:00
Dmitry Frank be63c0dc89 Improve docs
PUBLISHED_FROM=3b75fd8247ba9028e0ef0c3e211e7c1a80013951
2017-12-04 10:06:08 +00:00
Sergey Lyubka 987bc1d580 Use 8k iobuf limit for aws
PUBLISHED_FROM=971951e1eeb82078b986cd6e25e52cfc1ccef286
2017-12-02 21:26:35 +00:00
Dmitry Frank ddd35c0cba Fail if authn file is configured but doesn't exist
PUBLISHED_FROM=2c176091ffb6c7c5cfe8ea4f05b6109e00b33383
2017-11-28 19:35:22 +00:00
Sergey Lyubka c97b615785 Fix mg_parse_uri()
PUBLISHED_FROM=e5b829d93ecf946e5bdbbf33132be7068ffe0dd2
2017-11-28 16:45:52 +00:00
Dmitry Frank 9ab6d084df Expose digest auth checking functions
PUBLISHED_FROM=1bfc6e332f56b68eb6155bb729a97a0d8d5a316c
2017-11-28 10:05:36 +00:00
Deomid Ryabkov cf8d0a25aa Rename base64.{c,h} to cs_base64.{c,h}
To avoid name clashes.

PUBLISHED_FROM=e6ae32ec48f9b599eace7a9214a1863cdc185fd9
2017-11-24 11:36:12 +00:00
Бобби 0a0852b576 Document mg_match_prefix
PUBLISHED_FROM=b85fe1ee1e7bae4528c1240d8531c410728d0709
2017-11-23 11:53:02 +00:00
Deomid Ryabkov 90716417c9 Compatibility with LwIP 2.0
2.0 redefined LWIP_VERSION in a way that is no longer compatible with use by preprocessor (boo).
also, tcp_pcb.acked is gone, but we only use it for debug, so it doesn't matter.

PUBLISHED_FROM=776f90a08bd5024fa8a61dae257af6c60ec6710d
2017-11-23 10:05:43 +00:00
Deomid Ryabkov 101afbc9b8 Use weaker but faster cipher suites
ECDHE is way too slow on ESP8266 w/o cryptochip, this sometimes results in WiFi STA deauths.
Disable DHE completely because it's just hopelessly slow.

PUBLISHED_FROM=d9c8e95b7d5c992f9e127726c569f187b1e0b453
2017-11-21 15:33:00 +00:00
Бобби a197646867 Integrate cesanta/mongoose-os/pull/370
PUBLISHED_FROM=5bee629477514370f9b670771e786c4f4ddae934
2017-11-09 09:49:28 +00:00
Бобби 00d1d2c0e7 Make mjs & frozen vc98 & vc2017 friendly
PUBLISHED_FROM=7cde8b374d5e318b5cdd69fc5b4de86b2a9552f5
2017-11-08 16:04:08 +00:00
Deomid Ryabkov 6e50fe4475 Mongoose 6.10
PUBLISHED_FROM=c61fa89018f8cef4f798e094acff8d36c72869f2
2017-10-31 10:01:27 +00:00
Deomid Ryabkov 7942803a75 Fix MQTT SUBSCRIBE parsing
Make sure topic is properly NUL-terminated.
Ignore SUBSCRIBE requests with no topic expressions.

PUBLISHED_FROM=a00f39dda44fe63299e971a91a98f8ee57dd2a64
2017-10-30 15:34:22 +00:00
Deomid Ryabkov a8b74a9021 Fix bug when network conn is closed before CGI
NULL out cgi_nc->user_data so it doesn't touch nc anymore.

PUBLISHED_FROM=de2f76981c377d8951fb8e18e8b3d41dbfcf38b1
2017-10-30 14:20:27 +00:00
Deomid Ryabkov 27a9a62843 Fix SimpleLink listener for SSL
Must set SSL parameters before invoking sl_Listen

PUBLISHED_FROM=9147e7aa945f75e73d5c7cd7987cb5749025a86b
2017-10-24 07:19:45 +00:00
Deomid Ryabkov 9b268b6c77 Fix timer handling
ev_timer_time may remain the same for legit reason, so to prevent looping, instead, reset it before invoking the handler.
To let user know what the initial setting was, pass it as the argument instead of current time (which is kind of pointless).

PUBLISHED_FROM=fa328009f097f9b49b5b0dd13a38ee6d6e6518de
2017-10-21 09:19:42 +00:00
Sergey Lyubka 3b3ac48edd Fix potential leak in socks client
PUBLISHED_FROM=2cb4449d2f36d59db2b0dc37c46b35de6a461810
2017-10-19 13:49:43 +00:00
Sergey Lyubka 598e96a0cc Make amalgam work on windows
PUBLISHED_FROM=92f43c7b0a705ff40c4aea07f2ee0627f8e0e4a1
2017-10-19 13:49:42 +00:00
Бобби b5dd0e8093 Use verbose flags in both socks client and server
PUBLISHED_FROM=d17e96a97e1621e9788844bcd627c3143d37315c
2017-10-19 13:24:30 +00:00
Deomid Ryabkov 9b24fdfd1d Reformat mongoose
PUBLISHED_FROM=5202fa46a6a834bde35168ba566d3dce7c48f453
2017-10-19 13:24:26 +00:00
Бобби 8313896a85 Unbind things from v7
PUBLISHED_FROM=d20f138ae37c99a34cc29e7bfb327d7834404d93
2017-10-18 16:05:25 +00:00
Бобби 8193302162 Initial socks5 client & server implementation
PUBLISHED_FROM=05d3cca6223c963e7ae89dde3628fa8fad46e6bd
2017-10-18 14:05:13 +00:00
Бобби 6e3e5560d0 Move mongoose docs to https://cesanta.com/docs/
PUBLISHED_FROM=ebf5568abe82952ab2751298185a10189098013f
2017-10-16 15:18:24 +00:00
Dmitry Frank f0c6630a16 BREAKING: Sys config API change
Now apps should use getters and setters instead of accessing struct
fields directly, e.g. instead of `get_cfg()->update.timeout` it should
be `mgos_sys_config_get_update_timeout()` to get the current value, and
`mgos_sys_config_set_update_timeout(123)` to update the value.

For now, the config structs are public, but they will be made private
soon, so use accessors to keep your code working.

PUBLISHED_FROM=f7d582421a8d7e4d1ed50a280f2670d8b62f8d45
2017-10-11 11:15:48 +00:00
Deomid Ryabkov 1db747da29 Do not double-count recved bytes
Mongoose would report consumed bytes twice if mg_call is invoked recursively (e.g. proto_handler uses mg_call to invoke user's handler).
Reporting twice as much recved as was delivered effectively disables LwIP's TCP throttling and causes buffers to grow too big.

PUBLISHED_FROM=4ad5cd5db4dd54623bd6de2d50d32ddcc9e2b08a
2017-09-14 13:51:03 +00:00
Deomid Ryabkov 8065439f96 Acquire lock when manipulating rx in SSL recv path
PUBLISHED_FROM=a34cfa3ebc12daf75d7f24c8d3f3707dcc33d9a2
2017-09-14 11:06:24 +00:00
Deomid Ryabkov 62c896a872 Merge pull request #856 from cesanta/dev
Mongoose 6.9
2017-09-13 14:57:33 +03:00
Deomid Ryabkov 2db07dfc3b Mongoose 6.9
PUBLISHED_FROM=9e9047060b688291655ed227d19b7937fa9a147d
2017-09-13 11:36:46 +00:00
Sergey Lyubka 34eb3f1e66 Merge pull request #855 from cesanta/dev
Mongoose 6.8
2017-09-13 11:48:50 +01:00
Deomid Ryabkov 9d30e892e9 Mongoose 6.8
PUBLISHED_FROM=082d0bf5e9b06b850382ce502c7f5b4d68a6a328
2017-09-13 09:21:30 +00:00
Dmitry Frank 0aaba7a461 Add cs_timegm
Which is a slightly modified version from
https://stackoverflow.com/questions/283166/easy-way-to-convert-a-struct-tm-expressed-in-utc-to-time-t-type

PUBLISHED_FROM=b73f920ca42c45473c23337782e815306bdf69f1
2017-09-12 16:20:16 +00:00
Deomid Ryabkov 3d6b568c6e Prefer ECDHE with CBC over DHE ciphersuites
PUBLISHED_FROM=4ddfc25af77247fac7e7d04cc0e56d6f3800f87b
2017-09-07 11:04:38 +00:00
Deomid Ryabkov 2b2816cfe4 Store reassembled WS frame length in proto_data
PUBLISHED_FROM=7bbe7dd20dca8435c786dca30200a4973ae0827d
2017-09-06 19:05:00 +00:00
Deomid Ryabkov 2fa18b47db Fix DNS name uncompression
PUBLISHED_FROM=07e820f539fa5feca2ad1cf81faca8404b773a65
2017-09-06 18:05:29 +00:00
Deomid Ryabkov c8af7cdd27 Check for int overflow when parsing WS frames
PUBLISHED_FROM=b7325b38e881455df703b0b628c41931565ccb33
2017-09-06 17:34:37 +00:00
Deomid Ryabkov f857f6394f Access QoS field after validating topic length
PUBLISHED_FROM=6f2d9849d75ca1ec2b6dade11ccad8d0c5d4b3bd
2017-09-06 15:35:15 +00:00
Deomid Ryabkov 97d733e129 Fix MQTT broker SUBSCRIBE request parsing
Add checks on the number of subscribe requests per packet and overall per-session subscription limit.

PUBLISHED_FROM=faaf5c50af31a0694c9308a664f2e418dbb0eb18
2017-09-06 13:23:13 +00:00
Deomid Ryabkov 77e44c7c0e Harden MQTT variable length parsing
PUBLISHED_FROM=e16ee57bc30277e5b5684e53da78e69baaf9f779
2017-09-06 11:49:43 +00:00
Наше вам с кисточкой abf89d32d9 Make C ws client work with Go
PUBLISHED_FROM=263553121b992ec0f66b0275b4e10f4176281812
2017-09-01 08:35:53 +00:00
Deomid Ryabkov 177e05deb2 CC3220: AWS connection works
PUBLISHED_FROM=5831462c5be0b79afff32130a1f45784f32bc524
2017-08-31 21:52:31 +00:00
Deomid Ryabkov eb5645241c CC3220: WiFi, basic networking support
PUBLISHED_FROM=db89a45a536f0234d6d5cf740354c0dbeeff1f26
2017-08-31 15:32:50 +00:00
Deomid Ryabkov 202300952c CC3220: GPIO, sys_config and mgos_init support
```
Using port /dev/ttyACM0
[Aug 30 19:33:02.105]
[Aug 30 19:33:02.114] cc32xx_init          c_no_libs 1.0 (20170830-163205/mos8@6587ffd6+)
[Aug 30 19:33:02.123] cc32xx_init          Mongoose OS 2017083016 (20170830-163205/mos8@6587ffd6+)
[Aug 30 19:33:02.130] cc32xx_init          RAM: 253588 total, 240044 free
[Aug 30 19:33:04.430] cc32xx_start_nwp     NWP v3.4.0.0 started, host driver v2.0.1.19
[Aug 30 19:33:04.437] mgos_vfs_dev_open    slfs_container ({"prefix": "spiffs.img.0"}) -> 20005a64
[Aug 30 19:33:04.450] cc32xx_vfs_dev_slfs_ 20005a64 spiffs.img.0.0 262144 0xfffffffffffffffe
[Aug 30 19:33:04.457] mgos_vfs_mount       Mount SPIFFS @ / (dev 20005a64, opts ) -> 20005a74
[Aug 30 19:33:06.102] mgos_vfs_mount       /: size 233681, used: 4016, free: 229665
[Aug 30 19:33:06.108] mgos_vfs_mount       Mount SLFS @ /slfs (dev 0, opts ) -> 20005ed4
[Aug 30 19:33:06.114] mgos_vfs_mount       /slfs: size 0, used: 0, free: 0
[Aug 30 19:33:06.718] mgos_sys_config_init MAC: 04A316459442
[Aug 30 19:33:06.720] mgos_sys_config_init WDT: 30 seconds
[Aug 30 19:33:06.724] Hello, world!
[Aug 30 19:33:06.728] mgos_init            Init done, RAM: 253588 total, 236544 free, 235864 min free
```

PUBLISHED_FROM=7e83c9ddcc642bd324a40e125d6636ece824fb18
2017-08-30 17:49:34 +00:00
Deomid Ryabkov c7bea65ae7 CC3220 FS support
For now, we only support SPIFFS-in-a-box, same as CC3200.
On CC3200SF it should be possible to have SPIFFS on built-in flash, but that is left for later.

PUBLISHED_FROM=dee337c8cd8ed288c22abe9960eef81e6e90cc4a
2017-08-30 16:50:03 +00:00
Deomid Ryabkov d5a9000d46 Harden MQTT parser some more
PUBLISHED_FROM=5e7fcc7bf145aa8e1045e8d627b1c0731bb4341b
2017-08-30 12:49:30 +00:00
Deomid Ryabkov f62018451f Fix subscription parsing in MQTT broker
Also, do not accept PUBLISH and SUBSCRIBE before a sucessful CONNECT.

PUBLISHED_FROM=b5096cdc2ec5da1358244c428efbbb2e20be1a05
2017-08-30 08:49:35 +00:00
Deomid Ryabkov 0a93e301c9 CC3220: Exception handling, NWP init
Also make CC3200 use newer ARM compiler, generates slightly smaller code.

PUBLISHED_FROM=a0be49d7ea864a95886f7110887a59f6f11802d7
2017-08-29 21:49:53 +00:00
Dmitry Frank 6fe9cae62a Add mg_next_comma_list_entry_n()
And mgos_conf_check_access_n()

PUBLISHED_FROM=c7de937b4f5463ca463d604183a4ee831617bd6d
2017-08-27 12:49:28 +00:00
Deomid Ryabkov 38e984a008 CC3220 first steps
Achievement unlocked: CC3220 port prints a boot banner.
Then locks up.

Included in this PR is refactoring to pull out common parts to be shared with CC3200.

PUBLISHED_FROM=5fb9d9a00bb9ce7f63dde20bc1876076b76d5257
2017-08-26 17:05:00 +00:00
Our CI Bot 09e4254718 Add mqtt_over_websocket_server example
Fixed bug in websocket handshake:
now adding Sec-WebSocket-Protocol header in handshake response.

PUBLISHED_FROM=e4a71ff9dc4aeec63db40cb7f356dc5b25c1215a
2017-08-24 10:34:35 +00:00
Dmitry Frank d4b55c4ceb Separate digest auth from HTTP headers parsing
PUBLISHED_FROM=f97569ae2f31ab94ce4875eae4d0a198f719c388
2017-08-22 19:51:53 +00:00
Deomid Ryabkov 7d5479985d Enable LWIP net_if locking on ESP32 (doh!)
https://forum.mongoose-os.com/discussion/comment/4620/#Comment_4620

PUBLISHED_FROM=679dd48e078615ef4f57d1879957b734f549ef2e
2017-08-21 14:24:51 +00:00
Deomid Ryabkov 6517af3dea CC3220 blinky
Ignore all the mess, this is just the beginning...

PUBLISHED_FROM=41ab3c5af0b1d07204619dd4d8dc2e84b6a54f32
2017-08-21 07:52:09 +00:00
ruslanvaliullin 7632a5e4af Fix ignoring DhcpNameServer
PUBLISHED_FROM=73d6767e4aaa7249eeb5d76f9e7160be041292ca
2017-08-17 15:51:21 +00:00
ruslanvaliullin 7f20c41dd5 Implement rmdir & sleep func instead macros
PUBLISHED_FROM=62c73e5fb4f70e2b5b8824ce092012508640b173
2017-08-17 14:32:36 +00:00
ruslanvaliullin 66b23b11b0 Fix Nmap reset on ESP8266
PUBLISHED_FROM=7b9c85e7708721f2c6d0e2fc8ad5c32c61b48854
2017-08-16 17:40:48 +00:00
Deomid Ryabkov 448b44094a Add automated check for extern "C"
Fix headers that didn't have it

PUBLISHED_FROM=ce8140783d4b661f16278a4a5adc957b21965473
2017-07-27 11:19:56 +00:00
Sergey Lyubka 8bbb44f90c Always send MG_EV_HTTP_CHUNK
PUBLISHED_FROM=33957356e1510b73b37768496c74a6bf12630215
2017-07-21 13:34:52 +00:00
Deomid Ryabkov 0fba87c755 Make mg_url_encode public
Change the API to heap-allocate the string and get rid of a bunch of fat stack buffers.

PUBLISHED_FROM=c793dc64a9a044a9769d92ea16859f5d704a2181
2017-07-21 12:06:52 +00:00
Sergey Lyubka fea648496c Fix https://github.com/cesanta/mongoose-os/issues/318
PUBLISHED_FROM=2fc7b59b2edd0f473acd22067439471778acef8e
2017-07-20 08:05:12 +00:00
Sergey Lyubka 944a6b761c Fix https://github.com/cesanta/mongoose/pull/824
PUBLISHED_FROM=ed2c39b9e00a7374af7fed5af0c9acd6c330334a
2017-07-17 14:28:35 +00:00
Sergey Lyubka f1ae183752 Fix https://github.com/cesanta/mongoose/pull/829
PUBLISHED_FROM=6e56c250fe62010e25b6ed489c0d608163ba629c
2017-07-17 14:28:34 +00:00
Sergey Lyubka a0ece4e969 Fix links for MWS readme
PUBLISHED_FROM=c6c31d47eedcfe09b675e3f56d967da5b22809f6
2017-07-17 12:18:57 +00:00
Sergey Lyubka 0bb14abbdd Nitpick for MQTT example
PUBLISHED_FROM=a0dd26c00b41363f1cc58c28f530fbdf272ed146
2017-07-14 10:52:37 +00:00
Deomid Ryabkov 4c37e49274 Disable insecure and deprectaed SSL protocols
Also allow disabling conmpression and forcing server cipher list.

PUBLISHED_FROM=5539deec9c2382ba34597872dd7f3a5abc0cc311
2017-07-05 17:04:31 +00:00
Deomid Ryabkov 2a2bc33a89 Add mg_strstr
PUBLISHED_FROM=4306e870e2cab854febb6becc198ca2247e2e002
2017-07-05 16:20:32 +00:00
Dmitry Frank 41558bbf64 Fix formatting
PUBLISHED_FROM=4d4d49136e13ba8035d452a4f64fcaf48f15bdb3
2017-07-04 19:35:55 +00:00
Sergey Lyubka 4d0cc95ff4 Add JS net api test
PUBLISHED_FROM=f2821b104f8f2fc196ce4064b7c9f35ea152368d
2017-07-04 19:04:45 +00:00
Deomid Ryabkov cfd28a4f7a Add mg_strchr
Write unit tests for some mg_str functions.

PUBLISHED_FROM=1fc7e1d5d5ef259d4023f295aec8651caa3e7e86
2017-07-03 15:05:54 +00:00
Deomid Ryabkov 5a0b6fc35a Use SSL_CTX_{get,set}_app_data to store context
h/t @hendrikw01

Fixes https://github.com/cesanta/mongoose/issues/826
Closes https://github.com/cesanta/mongoose/pull/831

PUBLISHED_FROM=d5e1285bee9bcbb85d581ee62972a2fde7d9c0db
2017-07-03 11:04:40 +00:00
Dmitry Frank 3e59e1c465 Fix formatting
PUBLISHED_FROM=1803e726eee7bb64496d70389655083eb70257ab
2017-07-02 20:05:53 +00:00
Sergey Lyubka ae611a6e55 Clean up v7 from mongoose
PUBLISHED_FROM=efa9cc3aaf0c5ae8841e029370f882b615cebf1b
2017-07-01 08:51:09 +00:00
Sergey Lyubka a7a2e3deb1 Introduce log filter
PUBLISHED_FROM=b8f538f87e034452032284d45b78090338e87f72
2017-06-29 14:34:28 +00:00
Deomid Ryabkov cae0a1cbc0 Fix mongoose amalgamation
PUBLISHED_FROM=16ae777c949caf87e7dce428d62fa8878a30d318
2017-06-28 19:13:47 +00:00
Sergey Lyubka 244e5f67d3 Commonize pattern matching functions
PUBLISHED_FROM=e69e298a51dbe0f9c47184169ecad06eef0676fc
2017-06-28 18:35:37 +00:00
Dmitry Frank ff078882d5 Don't define fileno stub in C++
PUBLISHED_FROM=98fb6c78d20a98dfba07ba6671bd51a394bbc4ca
2017-06-27 15:19:50 +00:00
Sergey Lyubka 8d76733fad Make mg_conn_addr_to_str return len
Also amend api_net.js to use returned length.

PUBLISHED_FROM=38e15f9587edf28049c5b9e5f126b4db159910e8
2017-06-26 21:02:02 +00:00
Deomid Ryabkov fb3a5a7d90 Disable cert verification when ssl_ca_cert is '*'
PUBLISHED_FROM=578706e48a2c1fbbf5e9aaab3eba743e7d13fa61
2017-06-21 14:23:30 +00:00
Deomid Ryabkov f374ac5f9a Do not close already closed connection
PUBLISHED_FROM=9e345f2319141f20b89e28a2d29adba21ea213e1
2017-06-20 20:06:18 +00:00
Deomid Ryabkov 02707364f0 Lower conn accept message verbosity to DEBUG
Raised in previous commit by mistake

PUBLISHED_FROM=31a73fb610c34ed0c85d081bfa11a8067f216696
2017-06-20 19:14:33 +00:00
Deomid Ryabkov 104106b9cf Invoke tcp_accepted() on the listening pcb
As required by the LWIP API

PUBLISHED_FROM=7bfc6d816aa69f8fdd7592ade48b2d52e2d4991a
2017-06-20 19:14:31 +00:00
Deomid Ryabkov 474e065a30 MAX_PATH_SIZE -> MG_MAX_PATH
PUBLISHED_FROM=32bda9e86a11cad3b908d211a1f7bc9d27312874
2017-06-20 18:06:36 +00:00
Deomid Ryabkov 27094896b1 mOS filesystem refactoring: introduce VFS
With different filesystem implementations and storage drivers, like grown-ups have :)
This is not currently used to add any new functionality, we still have
only one FS and driver on ESP8266 and ESP32; CC3200 has two: SPIFFS and SLFS.
This will be used soon to implement filesystems on additional SPI flash chips and SD cards.

PUBLISHED_FROM=293960fef82952c505e9b1925aac7724c7308362
2017-06-13 15:35:38 +00:00
Dmitry Frank cd48bcfd7d Don't ignore userdata in mg_bind
PUBLISHED_FROM=0ffcd770535efa66ff1b6f9201f2caf832bd5055
2017-06-09 19:05:40 +00:00
Sergey Lyubka 5baeba53d7 Reorg docs
PUBLISHED_FROM=657a53762ada0ab3fe715a15939eb510a637e37f
2017-06-09 19:05:34 +00:00
Dmitry Frank 3a3b433849 Don't ignore userdata in mg_bind
PUBLISHED_FROM=0ffcd770535efa66ff1b6f9201f2caf832bd5055
2017-06-09 16:18:45 +03:00
ruslanvaliullin a2192ae483 Add mbuf_append result check
PUBLISHED_FROM=967a7ff3684e548ddbfe92365f7718a99e14d098
2017-06-07 18:50:24 +00:00
Deomid Ryabkov 023b55f2e5 MQTT client keep alive fixes
- Move keep alive management up to the Mongoose library
 - Only outgoing control messgaes should reset keepalive timer
 - Add unit test

https://forum.mongoose-os.com/discussion/1155/mqtt-keep-alive-compliance-issue

PUBLISHED_FROM=f86e30744ded53a6f7f96afec066b4ff3b4372c0
2017-06-04 21:50:23 +00:00
Deomid Ryabkov e4309d472b Annotate cs_log_printf with format attribute
This adds compile-time checks for format strings.

Fix issues exposed by this.

PUBLISHED_FROM=b9f820d8ad44fce9186dfdad4fe109fafa5371ce
2017-05-30 12:05:34 +00:00
Deomid Ryabkov c5452fc2ec Don't ignore non-merge commits when publishing
Merge commits are not explicitly ignored either: they're just naturally
ignored as empty commits.

PUBLISHED_FROM=12871fd4c9b1e9de4e57e13d810bffd98ddba299
2017-05-28 13:22:49 +00:00
Dmitry Frank f78ee9d42e Don't ignore non-merge commits when publishing
Merge commits are not explicitly ignored either: they're just naturally
ignored as empty commits.

PUBLISHED_FROM=2c814104eedd76ee90813488277ecaaf2baf6315
2017-05-28 13:22:48 +00:00
Deomid Ryabkov c8416cc17d NULL out name server field properly
Fixes https://github.com/cesanta/mongoose-os/issues/260

PUBLISHED_FROM=e95076915d52edb2298e3ea386281c277e42c89a
2017-05-26 14:44:11 +00:00
Deomid Ryabkov cf0a969a65 ESP8266 and ESP32 build image updates
ESP32: 2.0-r6
ESP8266: 2.0.0-1.5.0-r5

This brings updated mbedTLS with support for on-disk CA chains:
https://github.com/cesanta/mbedtls/compare/esp32_2.0-r5...esp32_2.0-r6
ESP8266 gets bigger rollup (ESP32 got those changes earlier, seems ok):
https://github.com/cesanta/mbedtls/compare/esp8266...esp8266_2.0.0-1.5.0-r5

Saves ~1.5K RAM for now, but will allow adding more roots to ca.pem without wasting RAM.

Refactored docker build for ESP8266 in the same way as was done earlier for ESP32.

PUBLISHED_FROM=db8eb0f91875d02266a8baaf1141c0d65eb59674
2017-05-25 17:20:18 +00:00
Deomid Ryabkov 06670d3401 Fix double-removal of send_mbuf data with SSL on
Other minor fixes.
Also decrease idle poll interval to 100 ms, as a workaround for some cases of incorrect next poll delay computation.

Added HW tests for SSL fetches.

Fixes cesanta/mongoose-os#262

PUBLISHED_FROM=4d19f845768b4b3b990d25959d4211972368d7fc
2017-05-19 16:20:00 +00:00
Deomid Ryabkov acfc66cd60 Correctly report bytes sent via SSL
This prevented hexdump from showing data sent over SSL when using LWIP net_if

PUBLISHED_FROM=aa520a27bdd21294484c52bf33c8580f3b4bad65
2017-05-11 10:07:09 +00:00
Deomid Ryabkov 6f140202ad Fix LWIP net_if when RTOS is used; use for ESP32
All calls to core LWIP APIs should go through the tcpip thread.

PUBLISHED_FROM=ebe8c7f043394a75a46810f2b6626582c63b9e68
2017-05-09 16:27:53 +00:00
Sergey Lyubka cfe77a3d58 Move struct http_message::body
Rationale: this is the optimisation to make JS FFI-ed API
work nicer. We don't have strucuture introspection now,
and do not generate offsets automatially. Thus, using a
stable well-known location of the parsed message body is
better, in case of number of HTTP headers macro changes.

PUBLISHED_FROM=55bf25ac77060a9c81dfecd6601f037562530801
2017-05-06 11:26:53 +00:00
Sergey Lyubka a0527a7f0e Fix esp8266 rtos example build
PUBLISHED_FROM=80055394237617605c57a07ac29c43d5197cbf5c
2017-05-05 10:25:41 +00:00
Sergey Lyubka c90cffa688 Fix docker invocation
PUBLISHED_FROM=064b5e508017b0115239fc880f21ca08b9422a25
2017-05-05 09:55:12 +00:00
Deomid Ryabkov d7a633bfa3 Fix timers when polling loop gets delayed
Past due timers should be brought forward to restore interval.

PUBLISHED_FROM=dbe1b8b98804cf8de81e1dbe814222422363278f
2017-05-03 12:51:15 +00:00
Deomid Ryabkov 0ea3cdd228 Implement sending stdout and stderr to MQTT topics
Configured via `debug.std{out,err}_topic`

PUBLISHED_FROM=66c581c38c5039aa9ecc406f8aac0b7e3c6541fc
2017-05-02 21:23:58 +00:00
Deomid Ryabkov ddef065493 Enable SNTP on CC3200
PUBLISHED_FROM=cea0fc4db21f5b68fd3e779334989fef84a1637a
2017-05-02 21:05:40 +00:00
Ruslan Valiullin ac857d18db Add mg multithreaded example
PUBLISHED_FROM=8a3424ba6260b0351d7c06270dc141d804ae7f77
2017-05-02 15:55:53 +00:00
Deomid Ryabkov 663e928d65 Fix mg_strdup_nul
PUBLISHED_FROM=25bc4d20016bcb71c4e2e4b7be8d2d0566fdfa2e
2017-04-27 14:39:46 +00:00
Deomid Ryabkov 189cd8c5f6 Add mg_assemble_uri
PUBLISHED_FROM=533e134a48e0fca55509c3eb16b0a6b64c1188e8
2017-04-27 13:50:33 +00:00
Deomid Ryabkov 692f436b3d Make mg_connect_ws accept http:// URLs
As well as URLs without prefix

PUBLISHED_FROM=ee298f6575603c8b384888633fe16413695ba70d
2017-04-27 10:51:31 +00:00
Deomid Ryabkov 2e65ce8272 Fix mg_parse_uri for URIs with fragment but no qs
PUBLISHED_FROM=8fb53581e8979c28026f9c2bcacb89de740c18cf
2017-04-26 14:50:38 +00:00
Deomid Ryabkov a35e5bd966 A function to make a NUL-terminated copy of mg_str
PUBLISHED_FROM=c1310b7d62f3ad6e2f24fea9f5229588c56b0bbe
2017-04-25 10:47:30 +00:00
Deomid Ryabkov 83fe5a17f3 Make mg_connect_{http,ws} use mg_parse_uri
Remove the specialized URI parser, clean up code a bit.

Fix parsing of URIs with IPv6 hosts (http://[2001:2:3::4]:567/)

PUBLISHED_FROM=968ad97585d928123106ce3828920ee073113f83
2017-04-24 14:59:52 +00:00
Deomid Ryabkov 49bbfaf130 Fix mg_lwip_if_get_conn_addr when there's no pcb
Connection may not (yet) have a TCP or UDP PCB associated with it.
mg_lwip_if_get_conn_addr should not crash in this case.

PUBLISHED_FROM=fd0ed683b18b3f549135c9d79eeadfc7348ab05a
2017-04-21 19:33:17 +00:00
Sergey Lyubka cd9c7dcbec Correct negative AAAA answer with NSEC RR
PUBLISHED_FROM=c7e3132d55e603f159019e3f0290e01b189e75e0
2017-04-19 12:57:45 +00:00
Deomid Ryabkov f868fc861b Enable hosts and resolv.conf lookups on UNIX only
Not relevant for other platforms

PUBLISHED_FROM=65b8959ee677555e2fb330c84d443e0a93d9fd1c
2017-04-18 22:39:24 +00:00
Deomid Ryabkov 84907d5bc4 Ignore tcp sent cb when there's no asscociated nc
TCP ACK may arrive after the we've corresponding mg_connection has already been closed.
Fixes cesanta/mongoose-os#235

PUBLISHED_FROM=8164b86131ef08c1b2a6a08630920d600b3f91ac
2017-04-18 14:38:08 +00:00
Deomid Ryabkov 1cee8a16b9 Fix mg_socket_if_get_conn_addr for UDP sockets
Remote address is not associated with an outgoing UDP socket.
Instead, it is stored in mg_connection.sa

PUBLISHED_FROM=16f82ee8a69b995d684ec96b8db6b5591cd400db
2017-04-18 12:41:54 +00:00
Deomid Ryabkov 57e32b87c7 Fix MQTT will_message length calculation
PUBLISHED_FROM=d2400f6ef4837411586fb27db0b1fa03d94283c6
2017-04-17 07:24:54 +00:00
Ruslan Valiullin 6926655513 add to cgi doc note about zombies
PUBLISHED_FROM=fb1796f11a595befd160bd5ab1088b6e39f16757
2017-04-15 06:44:43 +00:00
Ruslan Valiullin 8354319e72 websocket_chat added MG_EV_HTTP_REQUEST
PUBLISHED_FROM=6f5e1b4a97ada21025f892d3348808bffb469dfa
2017-04-14 12:57:30 +00:00
Deomid Ryabkov f9596cc1db Perform endpoint auth check on multipart requests
https://github.com/cesanta/mongoose-os/issues/229#issuecomment-293613426

PUBLISHED_FROM=1c34db7ab2598eca1db0266cc6cdd31c32a16fff
2017-04-12 16:59:49 +00:00
Deomid Ryabkov b2e2ad9a45 Fix hexdump on ESP8266, deliver MG_EV_SEND [...]
[...] after handing data off to LWIP, do not wait for ACK.
We don't do it in net_if_socket, don't do it here either.
Also prevents multiple send attempt on the same send_mbuf data.

PUBLISHED_FROM=4e5a677ebda84af1514f34299e53ce856a537883
2017-04-12 15:54:29 +00:00
Deomid Ryabkov a07fb2be51 Log DNS failures in mOS
To aid disagnosing cases like https://forum.cesanta.com/index.php?p=/discussion/397/retries-connecting-to-aws-broker

PUBLISHED_FROM=98680b594dbed42234fc53050c9df292feb32f35
2017-04-11 15:51:27 +00:00
Deomid Ryabkov 7f259f2a79 Add optional digest auth to mOS HTTP server
If http.auth_{domain,file} are configured, all HTTP requests require valid digest authorization header.
This applies to files served by mg_http_serve as well as synamic endpoints such as /update and /rpc.

mongoose-os#229

PUBLISHED_FROM=824d594147cfeb2428b463d24478b207839aa5e2
2017-04-11 10:39:45 +00:00
Deomid Ryabkov 7c0493071f Fix a typo
PUBLISHED_FROM=183a1bb571d0e2f5c23181107d30417f73c1eeb1
2017-04-11 11:22:42 +01:00
Alexander Alashkin c60fe0c6f6 Fix crash in multipart handling
Close cesanta/dev#6974

PUBLISHED_FROM=4d4e4a46eceba10aec8dacb7f8f58bd078c92307
2017-04-11 11:22:18 +01:00
Sergey Lyubka 8ce34af9f3 Clean send_mbuf in mg_if_sent_cb, fix hexdump
PUBLISHED_FROM=3d222e548a3323b957376666e6702b408843b5a3
2017-04-11 00:06:03 +00:00
Sergey Lyubka 82761bb875 Bobify format targets
PUBLISHED_FROM=2c1d372e4db856e23266c29195c07968abc2ec81
2017-04-10 22:50:30 +00:00
Deomid Ryabkov 08a10a8af5 Handle multiple MQTT messages per RECV event
PUBLISHED_FROM=fc98c51254dd94d3f443fb66e49449da7d9e754c
2017-04-10 15:51:13 +00:00
Dmitry Frank bd130136bc Commonize arg checking in cfunctions
Add `mjs_check_arg()` which checks whether argument is provided, and
checks its type. It simplifies code and makes it smaller (because
error strings are not ad-hoc, so they are not duplicated)

As part of that, also commonize type stringifying: implement
`mjs_stringify_type` and reimplement `mjs_typeof` on top of that.

Use `mjs_check_arg()` in `mjs_string_slice()` and
`mjs_string_char_code_at()`.

PUBLISHED_FROM=0b72cf479738ff405d991cbd4bf9e75edda0f111
2017-04-10 10:09:07 +00:00
Ruslan Valiullin fb04203b72 Fix eintr, zombie
PUBLISHED_FROM=f6d7d0f9c6de8ffeeb3bcd8aace6c1434281ddf7
2017-04-09 16:07:59 +00:00
Deomid Ryabkov 4172c190e5 Fix MQTT handshake; change to version 3.1.1
Differences between 3.1 and 3.1.1:
https://github.com/mqtt/mqtt.github.io/wiki/Differences-between-3.1.0-and-3.1.1

None of them are breaking.

PUBLISHED_FROM=cf2abd28deb1dabf787e07bcfdb335ff72462865
2017-04-08 07:21:01 +00:00
Deomid Ryabkov 920abd627b Minor SNTP fixes
PUBLISHED_FROM=03d04996f160f777339eec9528f2f187e1051ff9
2017-04-07 11:10:37 +00:00
Deomid Ryabkov 02b7399f9a Fix a typo
PUBLISHED_FROM=183a1bb571d0e2f5c23181107d30417f73c1eeb1
2017-04-03 14:20:16 +00:00
Alexander Alashkin b8402ed073 Fix crash in multipart handling
Close cesanta/dev#6974

PUBLISHED_FROM=4d4e4a46eceba10aec8dacb7f8f58bd078c92307
2017-04-03 09:25:12 +00:00
Deomid Ryabkov 06c5c4d2a4 Handle NULL tpcb in mg_lwip_tcp_write
This can happen if the underlying LWIP TCP PCB has been destroyed (we got tcp_error_cb).

PUBLISHED_FROM=7a060aa4ca2a0c5a818fe9bc6b08cd0733c0ef8f
2017-03-30 15:32:33 +00:00
Alexander Alashkin 57a4ec31d1 Fix MinGW compilation
PUBLISHED_FROM=66b2dee87dc50de5f2891dee789beec89c3f6fb4
2017-03-30 12:18:56 +00:00
Alexander Alashkin 511c9a6d4a Add simple mongoose/esp32 example (w/out mOS)
PUBLISHED_FROM=0e407a2fb328107540d753123fe027f43860d0ef
2017-03-29 13:53:25 +00:00
Ilia Penev 8ec47111d5 Fix COAP compilation
PUBLISHED_FROM=0a0ef6f68d743cbba91d9ba911f1c5be69e6aac7
2017-03-29 12:47:33 +00:00
Alexander Alashkin 8b67274cc0 Fix mg_get_http_var retval
PUBLISHED_FROM=257deff5ea20302627e77a0f29cf2359276a41d4
2017-03-24 13:24:37 +00:00
Dmitry Frank af22fb7a06 Include mg_mem.h into str_util
PUBLISHED_FROM=990564aa54946b2a5b52d3a9c31f80b8e93c6b44
2017-03-23 22:07:22 +00:00
David Hargat df5fff5e72 Consistent MG_MALLOC, MG_REALLOC and MG_FREE calls
PUBLISHED_FROM=e7f306b5d1a1366d3ec71fa238c5e18c03aadf8d
2017-03-23 18:54:06 +00:00
benrubson d9243d1c0b Fix MD5 disabling
PUBLISHED_FROM=bb03593fb2abfb79daa3118b786428ee3e693e3d
2017-03-21 10:50:32 +00:00
Alexander Alashkin 2fb145d39d Fix DISABLE_MD5 and DISABLE_SHA1 naming
PUBLISHED_FROM=2babde0d0c6add14aa500f4bf1c833715d979c6c
2017-03-21 10:24:11 +00:00
Yiming Sun 14094aaef7 Fix typo
PUBLISHED_FROM=56fdeaf4965ef26c398267c8656735bb52e45085
2017-03-21 08:50:43 +00:00
Alexander Alashkin ec752645ee Remove ajax_upload
PUBLISHED_FROM=599ccd99e7bf422cac5e8b1f5ccebe3cac2780e8
2017-03-21 07:35:52 +00:00
Sergey Lyubka ceb2f1da41 Update upload example
PUBLISHED_FROM=a28c1da3f0dd597792439246313ca39984ab7536
2017-03-20 17:23:38 +00:00
Alexander Alashkin aab857a66e Add ajax_upload to big_upload
PUBLISHED_FROM=7c919ba3a2afa74cec9947e78299b4bb7a64b4bc
2017-03-20 16:55:31 +00:00
Alexander Alashkin 066be0fe30 Add ajax_upload example
PUBLISHED_FROM=c5691d4321fff2e03f689b0195abd1ec6a188418
2017-03-20 10:51:24 +00:00
Alexander Alashkin 380e87ddfa Honor DNS server from DHCP
PUBLISHED_FROM=10772301ef115c31ada3521ff4235c33a421b782
2017-03-20 09:53:12 +00:00
Alexander Alashkin e9a7a2af18 Fix WinCE compilation
PUBLISHED_FROM=51d68829414739b04fafc9198d86b817c38d71d2
2017-03-17 15:19:29 +00:00
Deomid Ryabkov a83e7d8c42 Properly shut down the SSL connection
By sending close_notify

PUBLISHED_FROM=028a001cb9470a16cc7a6544805bfb042a435779
2017-03-15 23:12:57 +00:00
Dmitry Frank bf7dd7ac63 Add separate userdata for each http endpoint hdlr
PUBLISHED_FROM=29a204c2c7f35724b6f1e8435edb94869da2362c
2017-03-15 17:43:19 +00:00
Dmitry Frank 0fc3370859 First step towards separate userdata argument
PUBLISHED_FROM=93fe1cc2c5e2513509511a81e5919cbd37056b10
2017-03-15 00:52:59 +00:00
Deomid Ryabkov c416012f97 MGOS SNTP support for ESP8266 and ESP32
PUBLISHED_FROM=8e07541e7a3b951dcfd08381b46f6143773eae45
2017-03-13 17:53:35 +00:00
Deomid Ryabkov d3a8862bd8 Make interface vtables const
Frees up a bit of ram on ESP

PUBLISHED_FROM=0ea046cc63704481bca138b3096937669b94733d
2017-03-11 00:11:56 +00:00
Deomid Ryabkov 08353731ef Fix MQTT PUB{ACK,REC,REL,COMP} and UNSUBACK flags
Flags should be 0 for all of these, except PUBREL (flags = 2).

PUBLISHED_FROM=46bf63fe12020d4cb493e52ceb3bae0291484b40
2017-03-08 00:23:14 +00:00
Deomid Ryabkov 16700244b0 Fix parsing of MQTT QoS > 0 PUBLISH messages
Message ID comes after topic, not before.

PUBLISHED_FROM=1ec2a56e290b67061b18c745671dc7f089b9cc0d
2017-03-07 23:52:42 +00:00
Deomid Ryabkov 49ca223e9c Minor memory optimization
Release pbuf sooner: after copying data from, before invoking user code

PUBLISHED_FROM=b877c96ef602bbca26762b18b9dde17eb880d1f9
2017-03-07 17:19:47 +00:00
Sergey Lyubka 38efe632ae Squash warning
PUBLISHED_FROM=72d80f8ed2c10866b44d56d8133c76b22bc105b0
2017-03-06 21:51:43 +00:00
Deomid Ryabkov 39a3bb7e44 Log method and URI in mg_http_handler
PUBLISHED_FROM=34c3e49d523b0f5c7056f91e4b422f21f5694df9
2017-03-02 09:36:08 +00:00
Alexander Alashkin 920e8d9145 Add shims for mongoose file operations
PUBLISHED_FROM=b5b12cdf4273f21dbcdac9bfb6a06063152914c9
2017-03-01 10:06:47 +00:00
Alexander Alashkin aed6d05d8c Do not test reassembled buffer for WS_OP_CLOSE
PUBLISHED_FROM=0e8de208b553b63c8367f66893389587bd17359f
2017-03-01 10:06:46 +00:00
Alexander Alashkin d85d95a40b Fix potential out-of-bound
PUBLISHED_FROM=71b40189bcedbe9338915c1aad939835125dad26
2017-03-01 10:06:45 +00:00
Alexander Alashkin b5dd54a404 Fix doc typos
PUBLISHED_FROM=1bdacf793b35ebe70d0a3a9d64260dd2bd135c73
2017-03-01 06:19:58 +00:00
Yiming Sun f7c0a2ee15 Fix server_example.md
PUBLISHED_FROM=dfbfeaae983daa0412964ac0402759f632bf7aeb
2017-02-28 11:05:31 +00:00
Yiming Sun 874b5bfdbf Fix comment in mongoose.h
PUBLISHED_FROM=35e8f18aa611b45c271d0178d9197291bfa9726d
2017-02-28 10:50:21 +00:00
Yiming Sun 71d09722be Fix http_client doc
PUBLISHED_FROM=f415ddbac47e3069d3ab29467a23f6b8dab0066f
2017-02-27 20:20:33 +00:00
Dmitry Frank 349d25dccf Fix # matching logic
E.g. given the expression `foo/#`:

- `foo/bar` matches
- `foo/` should not match
- `foo` should not match

PUBLISHED_FROM=40f3290cb9a478b22d9f1ab6382884b5de70e266
2017-02-24 15:35:20 +00:00
Dmitry Frank 3942914945 Fix subscription to wildcard topics
`mg_mqtt_match_topic_expression()` and friends are public now.

So far, only `#` is supported.

PUBLISHED_FROM=20c031bcf34be84771c4a9c456318634eb9a517c
2017-02-24 14:21:33 +00:00
Dmitry Frank 60c16bbb5d Fix mos docker image name
PUBLISHED_FROM=91016ab1629a65976d2cc2f00aec4e1667cb4a8f
2017-02-23 21:35:24 +00:00
Sergey Lyubka 70b5f4130e Add http post example
PUBLISHED_FROM=94f830a5fa4b806fb2cf60c93a9e8744022ff8d7
2017-02-23 17:50:14 +00:00
Sergey Lyubka 17cfecc5c3 Mongoose examples fixes
PUBLISHED_FROM=b47a5b6987ee8d9e7c9bae2bd4d2943d2e7f76a9
2017-02-20 10:05:57 +00:00
Deomid Ryabkov ebdd18769b Add core dump and exception handling to RTOS port
PUBLISHED_FROM=dba64da598b45469c7fd458865c75d3eb6853c2d
2017-02-19 10:05:31 +00:00
Deomid Ryabkov f974fddd2a Fix ESP8266_RTOS example; add mos flashing
PUBLISHED_FROM=d87814d40f0acdc7a96fbd132c2157ccb499c7c6
2017-02-17 14:51:49 +00:00
Dmitry Frank b1a46da309 Implement Array.prototype.length
We don't have a real Array.prototype of course, just `[1,2,3].length`
behaves like we do.

PUBLISHED_FROM=456379377652cb60fc6f9521d8d358480237c58a
2017-02-17 14:51:48 +00:00
Deomid Ryabkov 81879be4be RTOS stability improvements
PUBLISHED_FROM=2992473e6c05c1dc95878cc549eccba7abcedccf
2017-02-16 16:05:22 +00:00
Deomid Ryabkov 0a094d4c1f Decouple mg_lwip_accept_cb from mg_if_accept_tcp_cb
Must be invoked on mongoose main task, not on LWIP

Also request immediate poll oif there is data to be sent and space to
send it.

PUBLISHED_FROM=53576651452d8d7193da9e63f5b97f6f8729c45b
2017-02-16 12:19:23 +00:00
Deomid Ryabkov 66a96410d4 ESP8266: Add RTOS SDK port (MGOS_ESP8266_RTOS=1)
PUBLISHED_FROM=ca5332e63700274ed9aeea9d9d1802e89fa788fa
2017-02-16 11:05:34 +00:00
Deomid Ryabkov d4b23f08b6 Implement client support for TLS-PSK
For both OpenSSL and mbedTLS

PUBLISHED_FROM=0bfd5f128b4c4c062cb6f0ca0da9b30790aa8bf8
2017-02-15 08:20:53 +00:00
Deomid Ryabkov d6d956b9d8 Do not prefix successfulresponse with "Error: "
It's confusing

PUBLISHED_FROM=9158ccd920dabf92963e76aa96a988753b9c427d
2017-02-13 15:05:11 +00:00
Deomid Ryabkov 383b2a48c5 Update logo in connected_device examples
PUBLISHED_FROM=6319df7f49dc921ddb672ba9789dfbbff8c25d9f
2017-02-13 14:05:04 +00:00
Sergey Lyubka ab1c464950 Fix https://github.com/cesanta/mongoose/issues/765
PUBLISHED_FROM=f7f8ce9421d96a5f0d90afe4c930c53662b4e907
2017-02-11 04:50:44 +00:00
Deomid Ryabkov f20b5191f2 Check UDP pbuf for being NULL
cesanta/mongoose-os#186

PUBLISHED_FROM=30460b56211eb0dff4d05bff45f256ac1da2caf4
2017-02-10 02:35:08 +00:00
Deomid Ryabkov fc113d64f5 Add mg_hexdumpf: mg_hexdump that outputs to a file
PUBLISHED_FROM=f0fe58c9f01ef0c7b491ed0e5f51b983e4119507
2017-02-09 10:33:33 +00:00
Deomid Ryabkov 6f6b12bee7 Lower verbosity of a debug message
PUBLISHED_FROM=6ff979319c31363df16cedf99b2432bd83db1473
2017-02-09 10:21:15 +00:00
Deomid Ryabkov 4e6c2867da UDP fixes: move recv callback into event loop, ...
...and fix a leak where UDP connections with SEND_AND_CLOSE set would not be closed

PUBLISHED_FROM=d60f1fc037e8e57671c7d3146fabc1f068bbb514
2017-02-09 10:21:12 +00:00
Alexander Alashkin 54989e819a Fix multipart parsing
Close cesanta/mongoose#770

PUBLISHED_FROM=ae55988f1c6ccdff172b8db405adb36c91289d95
2017-02-08 10:54:46 +00:00
Dmitry Frank bf505bb68d Update readme of nrf examples
And also fix `flash` target for nrf51

PUBLISHED_FROM=decc6242380eb7070bfbcb26c57780e756588cc3
2017-02-08 08:25:32 +00:00
Deomid Ryabkov 4072062b72 Add MG_SSL_IF_MBEDTLS_MAX_FRAG_LEN
And set to 1024 for mOS.

PUBLISHED_FROM=ee3a66ad935cfb50355ebd7bae59c8230914878d
2017-02-08 08:25:31 +00:00
Alexander Alashkin d6ba37dc3c Correct msg len for chunked encoding
Close cesanta/dev#6485

PUBLISHED_FROM=172ab4f18f1fb3e6110ad03eea18a7f87f2e531a
2017-02-07 12:25:06 +00:00
Alexander Alashkin a58d21aa28 Add overrun protection to mg_sock_to_str
Relate to cesanta/mongoose#780

PUBLISHED_FROM=145d94c52be03ac2d909eae8166774ffd40f0df1
2017-02-07 12:25:05 +00:00
Alexander Alashkin 6e8d4129b2 Use _exit in CGI. Close cesanta/mongoose#779
PUBLISHED_FROM=bfe62d3824ee3a6e66b7d1a57ee7bad3b726649d
2017-02-07 11:09:49 +00:00
Alexander Alashkin 2485a8f8d9 Fix signs comparison. Close cesanta/mongoose#774
PUBLISHED_FROM=a875606de6f4b2c202b25ce20efcb1ca33eb75b8
2017-02-07 08:25:31 +00:00
Sergey Lyubka 1ae908f6d5 Add mqtt codec
PUBLISHED_FROM=f780559966a6a955603e05aeaa5dde8455bff991
2017-02-06 17:39:02 +00:00
Alexander Alashkin 6b923bdff1 Add stm32/cube to hwtests
PUBLISHED_FROM=478792d0479ba2154f0a65eea066f6ae6f235f84
2017-02-06 17:25:16 +00:00
Alexander Alashkin d39969d1e6 Restore links to mongoose/examples
PUBLISHED_FROM=67dc5d1ed30dc2500032be73dcdb214bd62c59d0
2017-02-06 14:09:01 +00:00
Alexander Alashkin eaef5bd133 Revert "Stop publish examples to mongoose repo"
This reverts commit 1a17e17c462bdd4e1d26d8742f8b7087273e04c2.

PUBLISHED_FROM=80028de308c9a021955d1425d2bfee8feb85f193
2017-02-06 14:08:59 +00:00
Sergey Lyubka 7cc7df8c0e Merge pull request #778 from cesanta/remove_examples
Remove examples
2017-02-03 10:23:29 +00:00
Alexander Alashkin 551f393da7 Remove examples 2017-02-03 12:17:07 +02:00
Sergey Lyubka e81f8373a2 Update mongoose docs
PUBLISHED_FROM=cfd0018a5824c5ccac532558be86c17cda64ce50
2017-02-02 14:24:49 +00:00
Sergey Lyubka dfa83f2c85 Fix TCP close sequence
PUBLISHED_FROM=ed6cf7fd63b6f80d5c37ab93899ecd09bac6102b
2017-02-01 20:26:46 +00:00
Alexander Alashkin 91bdbc5193 Fix warn in mg_lwip_if_poll
PUBLISHED_FROM=0bcb3e892e1ba2329aef5d17375fe4d3879dc666
2017-01-31 13:39:29 +00:00
Alexander Alashkin 707b9ed2d6 Remove mg_enable_multithreading. Close cesanta/dev#6511
PUBLISHED_FROM=7864ffa26cb553f5d4a93248f67c288327ec23b0
2017-01-30 13:55:49 +00:00
Alexander Alashkin cd6b846e22 Fix mongoose/mbed compilation
PUBLISHED_FROM=c754e6961fc197d3057740169f55025b305b6936
2017-01-30 13:10:47 +00:00
Alexander Alashkin 807e4ea6ec Fix STM32F4_CC3100 Mongoose example compilation
PUBLISHED_FROM=7a67a67d2f0007e241e4ccb57bc24a43ba20bfde
2017-01-30 12:09:43 +00:00
Alexander Alashkin 507e8bfac9 Drop Arduino support
PUBLISHED_FROM=85768c0d2536d9c31885a5127710b9756e3229a3
2017-01-30 09:39:15 +00:00
Deomid Ryabkov 2ea63a0ea6 Limit len of prefix; makes log tidy w/ long names
PUBLISHED_FROM=570530179da327f8bb156bbbd7c557014c1630c1
2017-01-30 09:24:48 +00:00
Deomid Ryabkov 7988acbff4 Raise log level of mbedTLS socket evs to LL_DEBUG
PUBLISHED_FROM=ed0ac4133342c733977e7884a6bbadab7ee74127
2017-01-26 12:38:30 +00:00
Alexander Alashkin b8c3740446 Map STM32 pins to MOS pins
PUBLISHED_FROM=6724de19c28f972a785b0d5e7dd4b41889e04850
2017-01-25 09:08:43 +00:00
Deomid Ryabkov 7bdbd80552 Fix ESP32 encr. OTA; clean up {open,read,close}dir
Fixed a bunch of things to make OTA work on ESP32 with flash encryption:
writes to app aprtitions must be 32-byte aligned and mod 32 in size.
When merging filesystems during update, use spiffs_vfs_* functions so
that old fs is properly decrypted.

Refactored cs_dirent stuff: SPIFFS support moved to spiffs_vfs.c,
added dirent.h on ESP8266 and CC3200 which includes cs_dirent.h
Define DIR and dirent only if asked (ESP8266, CC3200, WIN32).

PUBLISHED_FROM=58b0d05cdc41b1a9e02d341e2a1cdcb012829232
2017-01-24 12:53:35 +00:00
Alexander Alashkin 577ad2599c Enable additional services for stm32/cube
PUBLISHED_FROM=b22a136bc630b7cf4a62fd9d91b85e0e939a7f82
2017-01-18 15:10:28 +00:00
Alexander Alashkin 4d9f8168b8 Change Mongoose version to 6.7
PUBLISHED_FROM=e18f33e14f4c0e1cb004aa264dd64ca5a0056190
2017-01-17 09:08:53 +00:00
Deomid Ryabkov f1d0b451b1 ESP32: Update esp-idf
cesanta/esp-idf is rebased onto espressif/esp-idf#aece3d6fc62fd91d3c5a87e0ab2ddb5ac51d8ff0

A few wifi changes and VFS support for directory-related functions.

PUBLISHED_FROM=7823db802945122aa1b5453da8abd8e380cbf2fa
2017-01-13 00:44:47 +00:00
Dmitry Frank ac921d4657 Improve includes in the amalgamation script
Now it also tries to find the included file relatively to the "parent"
file. This is required for amalgamation of the frozen into mjs, since
`frozen.c` includes `frozen.h` instead of `frozen/frozen.h`.

PUBLISHED_FROM=8f670a1509a30cfdfb22e454b7851f4cf28fb98d
2017-01-13 00:24:43 +00:00
Alexander Alashkin f046434f3b c_hello/stm32-cube, part 2
PUBLISHED_FROM=1f767c1383c1dcd366e667681aebd41c30a102f3
2017-01-11 23:07:59 +00:00
Alexander Alashkin 58b9ee41fa Use LWIP in stm32/cube
PUBLISHED_FROM=da389ddabf96918fd1bc022e0696dbb4542c71c1
2017-01-11 12:37:44 +00:00
Alexander Alashkin d28d7a67f2 c_hello/stm32-cube, part 2
PUBLISHED_FROM=fe7230811b7f12286c5ac6de1ef8fb068cd61145
2017-01-10 18:38:24 +00:00
Deomid Ryabkov 20370e65d6 Fix parsing of SSL cipher suite specs for mbedtls
The list of cipher suites must be retained while the context is alive.

PUBLISHED_FROM=a3a82e42c1214c54ae1a40fbc49bc26bca32c053
2017-01-10 13:38:08 +00:00
Deomid Ryabkov 67626d49c9 Add ssl_cipher_suites to mg_{bind,connect}_opts
Optional specification of SSL/TLS cipher suites.

PUBLISHED_FROM=e8968c6c7a92f10514d3ee575c2fb9be862e6cf8
2017-01-09 23:53:00 +00:00
Deomid Ryabkov cd9e179fcb Format for previous commit
PUBLISHED_FROM=609ef3587e4293b0cdbf865cfc466bbb85233361
2017-01-09 17:04:03 +00:00
Deomid Ryabkov 0ba28e6153 Raise verbosity of some log messages
These are not spammy and help debug issues with serving files

PUBLISHED_FROM=84b0ee174314373d472678a14ca87f575fda6e14
2017-01-09 17:04:02 +00:00
Alexander Alashkin de791765b2 c_hello for STM32/cube, part 1
PUBLISHED_FROM=13fe18cb6c92e5dd6d9e319c35e256e2b206a110
2017-01-09 17:03:57 +00:00
Alexander Alashkin e79121acb7 Fix link in documentation
PUBLISHED_FROM=d4337a442a8f5728826eb109bdca41ca03a18d2a
2017-01-09 17:03:46 +00:00
Dmitry Frank 4bdec5c1c1 Rename mongoose-iot to mongoose-os
URLs like mongoose-iot.com are left intact

PUBLISHED_FROM=b8502b163c26a2cb54598db57ba094333fe7cf54
2017-01-09 17:03:38 +00:00
Deomid Ryabkov fa39d2f2fa Remove a dead submodule entry
PUBLISHED_FROM=0b6e19e41c12675a487cb61c4f6e0aaba0be0758
2016-12-23 15:37:41 +00:00
Deomid Ryabkov c55d06ed57 Add directory listing support ot ESP32
PUBLISHED_FROM=336d6b28d6165ece75d25911058ffdd075a3c191
2016-12-23 12:37:07 +00:00
Deomid Ryabkov 3829873552 Support MIOT app builds for ESP32
PUBLISHED_FROM=44bcbb87c326a4e05e96dc0b094fd9dd1a9d4276
2016-12-21 21:47:06 +00:00
Deomid Ryabkov 54ebcc5bd8 Minor fixes to socket support when used with LWIP
- LWIP UDP sockets are always writable and they are not reported as
   such by select() (bug? featuyre?). TCP sockets are ok.
 - Always deliver MG_EV_POLL, whether we have other fd_events or not.
   Otherwise MG_EV_POLL would not be delivered at all to perma-writable
   UDP sockets (as they are on LWIP).
 - Ignore EAGAIN/EWOULDBLOCK errors while connecting, this happens
   during SSL handshake.

PUBLISHED_FROM=3b1ee0d2b0c672512da5c9d6141aba1112983426
2016-12-21 13:06:21 +00:00
Deomid Ryabkov 7782500dbb Commonize bitbang I2C master and use it in ESP32
Until issues with hardware I2C are resolved

PUBLISHED_FROM=78bced9f18b5bfbf547de06f813bf98c82eea6ea
2016-12-20 16:05:58 +00:00
novlean 86ec6bb2f8 updated for mOS 2016-12-20 14:59:08 +00:00
Alexander Alashkin 02499d672b Build c_mqtt/stm32 - part 1, with stubs
PUBLISHED_FROM=de4b9f3e9eeafa75bb8919abacd86fb23fdefc1b
2016-12-15 14:06:50 +00:00
Alexander Alashkin 8c2e641ed7 Simplest c_hello/stm32
PUBLISHED_FROM=3a22eb96ff011ef8327cd1b78b56a3af86ba2c84
2016-12-14 16:22:16 +00:00
Dmitry Frank 29c53082eb In cs_simplelink, check if MG_NET_IF is defined
PUBLISHED_FROM=20c87885c8f778139d3df20507d6870070bcc787
2016-12-14 13:21:54 +00:00
Deomid Ryabkov 2fa988fc7b Bring up main task, start MG loop and load config
PUBLISHED_FROM=7c81ec28457cda3a503e4ab01fc8593e474df4b8
2016-12-13 17:51:33 +00:00
Alexander Alashkin 72f1d444d3 Fix miot compilation in C++ mode
PUBLISHED_FROM=42997efb3ddc462c33d2cf7e8ef0e922797d9901
2016-12-13 15:21:26 +00:00
Deomid Ryabkov 7dcc94202d SPIFFS libc integration refactoring; ESP32 support
Factor out common part of SPIFFS libc interface support from the CC3200
port and reuse it for ESP32. Minor cleanups.

PUBLISHED_FROM=19ad4049372f83046abd8eba29cfc7c2cc405671
2016-12-13 10:37:09 +00:00
Sergey Lyubka a447ae5eab MQTT parsing fix
PUBLISHED_FROM=41f43cb0e707259740de3346308f746c2a3778fd
2016-12-13 10:37:06 +00:00
Dmitry Frank 54ad1e4e47 Prepare pic32 docker image and xc32 makefile
This PR does not include `fw/platforms/pic32` since it's too dirty.

PUBLISHED_FROM=db50ba389202da80355aafe5f2c1ceeca7bffe41
2016-12-12 21:35:49 +00:00
Deomid Ryabkov 39ea91cfc2 Test building with MG_ENABLE_FILESYSTEM=0
Fix errors so it builds.

PUBLISHED_FROM=db9fc9ef997d6b1847117e8db9aefdc7e540f4cc
2016-12-09 23:35:54 +00:00
Dmitry Frank 5ebff5d15e Rename pic32_harmony -> pic32
PUBLISHED_FROM=00ca7b2adabde94a683ac4d33be1f2bdbb17772f
2016-12-09 22:06:14 +00:00
Dmitry Frank 731512a947 Define mg_file_upload_handler() only if needed
Namely, define it if only `MG_ENABLE_HTTP_STREAMING_MULTIPART` and
`MG_ENABLE_FILESYSTEM` are on

PUBLISHED_FROM=3094738a4b76ceb09a3c2374e8d9d914b71c3441
2016-12-09 16:06:17 +00:00
Alexander Alashkin 304dbca63d Fix miot-mbed errors and warning, part 3
PUBLISHED_FROM=2f6fb7ea5abdcd4ca9b06956172938ee3bc28459
2016-12-09 12:36:00 +00:00
Dmitry Frank 18ff0fafe0 Implement stringify macro
And use it for `FW_ARCHITECTURE`. This is needed because with
Microchip's xc32, `-DFOO=\"bar\"` results in `FOO` being `bar`, not
`"bar"`, so we have to stringify differently.

PUBLISHED_FROM=d0aeebb55ef9e0e92a7f750104cd6600e0d9c636
2016-12-08 22:22:24 +00:00
Alexander Alashkin 25de791424 Fix miot-mbed compilation, part 2
PUBLISHED_FROM=bd87b901b7c1c1a4f9b0f875f0b024b672121d4a
2016-12-08 19:21:53 +00:00
Alexander Alashkin 6e88c9cfd1 Fix WEAK redefinition in mbed
PUBLISHED_FROM=6abc158f198f5bd032e5ab06cc0ba3373434cdbe
2016-12-08 16:21:37 +00:00
Marko Mikulicic 9937e88985 Fix comparisons
PUBLISHED_FROM=4d86de7f73ef9d4c0f236e1fe1201e5de792f19f
2016-12-07 18:05:56 +00:00
Sergey Lyubka 57f964a139 Add mqtt last will
PUBLISHED_FROM=fb856714ead67390dfd7ce9d208ae5ae19ce7c6d
2016-12-07 17:21:56 +00:00
Dmitry Frank cbd5835112 Include sys/types.h for PIC32 port
On PIC32MZ, this is required to get `ntohl` and friends.

PUBLISHED_FROM=82ab532cd3757df6f79215f3eaca90cd87f6c965
2016-12-02 16:06:42 +00:00
Alexander Alashkin fba32acb73 Replace memcmp with strncmp in mongoose
PUBLISHED_FROM=3c5859f06ab838bba7c95c4878c4e7e883329810
2016-12-02 13:51:30 +00:00
Sergey Lyubka 2fdb1f78a2 Fix amalgamation conflicts: POC
PUBLISHED_FROM=5b63325ade34b9032476fc88ac407816990f1cfc
2016-12-01 22:21:14 +00:00
Alexander Alashkin ea2069df51 Fix coredump in mg_reverse_proxy_handler
PUBLISHED_FROM=ca0ae588290f133ef7640ca538847a63c0cb544b
2016-12-01 09:21:11 +00:00
Alexander Alashkin 7267fc757d Fix mg_stat
PUBLISHED_FROM=e6fb19c5256b6d43359f21b325e16b415152f26f
2016-11-29 13:36:55 +00:00
Alexander Alashkin ea7d69060d Replace fopen with mg_fopen
PUBLISHED_FROM=764ea806a5d31bd545a5d99de80e2ee0234ebcab
2016-11-29 13:36:54 +00:00
Alexander Alashkin 6e5e2eb694 Restore HTTP errors descriptions
PUBLISHED_FROM=26becdaf7dd61481b88b166ea87d44a7bc796660
2016-11-29 11:22:06 +00:00
Deomid Ryabkov 51466df7b9 Check for SEND_AND_CLOSE after HANDSHAKE_REQUEST
Assume handshake request was declined if either MG_F_CLOSE_IMMEDIATELY _or_ MG_F_SEND_AND_CLOSE is set.

PUBLISHED_FROM=60af32a3f8890e826205465b9add2f58b1d46e5f
2016-11-28 15:51:14 +00:00
Deomid Ryabkov d6259332d4 Fix use-after-free
Free keys and cert before conf, not after

PUBLISHED_FROM=5628f56eb6973a779179d641fb425d0f14db39cf
2016-11-28 15:21:18 +00:00
Deomid Ryabkov 260229a4d1 Free certs and keys on client TLS connections
Renegotiation is disabled, so we don't need them.
Reduces per-connection usage when idle by 3K.

PUBLISHED_FROM=24b2ac9557107f7da412dae6a42257c9b7c812d5
2016-11-28 12:05:41 +00:00
Deomid Ryabkov 7776df241c Enable server name verification on mbedTLS
PUBLISHED_FROM=54774944d5402a5d6a351b4609428940c0ad20ea
2016-11-28 08:50:42 +00:00
Deomid Ryabkov e17fdcb077 Minor memory shavings on ESP8266; ~2.5K less
- Only allow one TCP segment in flight. Each segment is 1.5K and it
   adds up. This may increase latency, but memory is precious on ESP.
   At teh same time, optimize use of tcp_output: do not send a new segment
   on every write, only call tcp_output at the end of connection
   processing during poll.

 - Build LWIP with DNS disabled. We have our won resolver, and LWIP's
   allocates large static buffers (1K).

 - mbedTLS: Deallocate peer's certificate at the end of SSL handshake,
   reduces idle SSL connection footprint by ~1.5K.

 Some tweaks to the heap log viewer (which made all the above possible).

PUBLISHED_FROM=6e84bba64eacb2d737561e09313918104921ea80
2016-11-27 17:21:29 +00:00
Deomid Ryabkov d96629cdf4 Add support for PEM certs on SimpleLink
Also performs trnasparent SPIFFS -> SLFS cert copy.

If the file's extension is .pem, convert it to DER format and put on SLFS.

PUBLISHED_FROM=364caab21969ca28a05802c4dde93a11d1e0feda
2016-11-25 19:30:05 +00:00
Dmitry Frank 0c79fcfbd0 Add a flag to prevent a tunnel from reconnection
Also fixed a memory leak on reconnect: previously, each reconnect was
creating a `struct mg_connection` which was never reclaimed

PUBLISHED_FROM=eefdcf557e032ac81d5ed3aba55ac912e400148e
2016-11-25 11:36:14 +00:00
Alexander Alashkin 9125830de6 Fix stkovf in mg_resolve_async_opt
PUBLISHED_FROM=8e37c51c6b0bf7d0782f3a997360827471b95d2e
2016-11-25 08:21:38 +00:00
Alexander Alashkin 55963d0c9a Fix typo in platforms_esp
PUBLISHED_FROM=b17ef5bc8ec801fca91c89af5f97767a55911952
2016-11-24 13:21:09 +00:00
Deomid Ryabkov 44f7b91826 Fix use of SLFS from TI libc "device" interface
PUBLISHED_FROM=e1bb89268dfc4d51880b89b07fb2f69cb49e053b
2016-11-24 12:50:52 +00:00
Deomid Ryabkov 731ea5d50d Increase debug level of stat() and open() messages
Useful for debugging at level 3

PUBLISHED_FROM=b6a4565df0de0dccf37c182c71d2f4c852f2291a
2016-11-24 10:21:58 +00:00
Alexander Alashkin 9e517fde00 Implement SNTP client
PUBLISHED_FROM=ac54bcbc81a9ee688e8b90e261172be76a9fbacd
2016-11-24 09:51:58 +00:00
Dmitry Frank 1ff61837ac Fix mg_http_common_url_parse
The only client of `mg_http_common_url_parse` (namely,
`mg_connect_http_base`) expects `port_i` to be the index in the address
string at which the port was added.

PUBLISHED_FROM=b095926b5485e4674e3c59ff8481171831fb61ae
2016-11-23 18:06:50 +00:00
Deomid Ryabkov 3a8464e4b8 Reinstate fs_slfs_rename stub
Needed by TI libc for use with add_device

PUBLISHED_FROM=ff0713c5f4d04810894d8e1a82aaac25aa101365
2016-11-23 11:07:11 +00:00
Marko Mikulicic 39b0b8e2fd Fix clang formatting
PUBLISHED_FROM=ea64670e42ae58bbe26abee5d928f2afcd83bd46
2016-11-23 08:06:09 +00:00
Sergey Lyubka 3a61186491 Ubreak v7 build - add missing includes
PUBLISHED_FROM=01d691c9e06486cab0903b8db98e56fffc3fb234
2016-11-22 16:21:38 +00:00
Deomid Ryabkov 2180e1786c Allow use of absolute paths on SLFS
If the path starts with /, do not drop it.
There are no directories on SLFS, but use of /pretend/paths/to/files.txt
is common. What we do drop is the ./ prefix (added by mongoose when document_root=.)

PUBLISHED_FROM=5108bc078dfaf8f8afa4db554b4769d9d7b8a103
2016-11-22 15:52:04 +00:00
Deomid Ryabkov 8fb5e8ef19 mbedTLS support for LWIP net_if
PUBLISHED_FROM=a733ba6e06887a448f96f92679f6f8adbe9c61f7
2016-11-22 13:21:42 +00:00
Ilia Penev a8f54d1851 Integrate PR170
PUBLISHED_FROM=f1a804466bea6d6d77103525d76ef7b819b63477
2016-11-22 08:05:55 +00:00
Deomid Ryabkov c9721d4d7f Re-enable amalgam tools publishing
PUBLISHED_FROM=f7fb01509b3f3982724cc3b05e357d8dd385a546
2016-11-21 22:36:43 +00:00
Marko Mikulicic c848372bbe Rename tools/amalgam to tools/amalgam.py
PUBLISHED_FROM=7c6cb5517d0d2b13f29af29c511dd7f0baa5acc6
2016-11-21 22:19:19 +00:00
Marko Mikulicic a23daa1547 Move mg_a*printf to common
PUBLISHED_FROM=cccd28ef43ec4e08fa52340ce78bda10db5ac27a
2016-11-18 15:36:00 +00:00
Sergey Lyubka 9dba6c806b Add endpoint to list tunnels
PUBLISHED_FROM=f45d9832a884374f6f9ea3f2e0a8c9465f214896
2016-11-18 12:21:11 +00:00
Marko Mikulicic fc635a9340 Move mg_ncasecmp and sister to common string utils
PUBLISHED_FROM=182c43c3bd82190cb816c8ebaddccc13a94950d0
2016-11-17 11:21:17 +00:00
Alexander Alashkin 81f738af3f Fix mg_http_common_url_parse
PUBLISHED_FROM=51c44c445309aa0850b227949a0a0a6be433d08c
2016-11-17 11:05:57 +00:00
Alexander Alashkin f6165d23e4 Fix stack overflow in mg_hexdump
PUBLISHED_FROM=5025692f3f4593b3ea38af51f8f49e1ac4df6b88
2016-11-16 17:36:14 +00:00
Alexander Alashkin e4a4b6f260 Fix coredump in mg_tun_destroy_client
PUBLISHED_FROM=56ff5afe805e4680e02183a8c3887ea60ee5ebfe
2016-11-16 12:21:31 +00:00
Dmitry Frank 0ceee1dc05 Rename mg_ -> miot_ under fw
`MG_ENABLE_...` macros are not yet renamed because it involves some
logic change: e.g.  instead of defining `MG_ENABLE_MQTT`, one should
define `MIOT_ENABLE_MQTT`, which should imply `MG_ENABLE_MQTT` as well.

Macro refactoring is going to be done in another PR.

PUBLISHED_FROM=f8b66d5772846126b94223a729a6bd87897f8de6
2016-11-15 14:36:10 +00:00
Alexander Alashkin 8a6cf95fad Fix mg_match_prefix
PUBLISHED_FROM=4fdfa61e7b3b62083b0ac8fe74dd2dd3793f50fe
2016-11-15 13:36:31 +00:00
Dmitry Frank 37a7031f4e Minor formatting fix
PUBLISHED_FROM=c56b4ae00c454e6931ab29b095641bf0222f860c
2016-11-15 09:51:14 +00:00
Dmitry Frank 8874f3de9d Fix simplelink SSL context
It wasn't checked for `NULL`, and on CC3200 NULL dereferencing addresses
doesn't cause a crash, so it worked by pure luck: ctx->ssl_key was 0.
After `mg_` to `miot_` refactoring it's not the case anymore (presumably
because linker arranged objects in a different order), so this bug shown
up.

PUBLISHED_FROM=0f1cc73a078c18432c68ae0f9b14dd06b3bb4279
2016-11-15 09:06:03 +00:00
Marko Mikulicic 3c5d48ea13 Promote tun example to a unit test
PUBLISHED_FROM=0454cdeec5c7120eb4bf905fdd5b7abdcb4003c2
2016-11-14 18:06:04 +00:00
Sergey Lyubka a0d98b7a39 Fix msvc6 build
PUBLISHED_FROM=196199fd02ec9b20d1e76d1414bfafa624f9ebce
2016-11-14 17:51:07 +00:00
Marko Mikulicic 74b75899d3 Make cc3200 sprintf workaround smaller
in light of the root cause discovered by rojer
and addressed in cesanta/dev#5882 for the http connection code path.

PUBLISHED_FROM=aea563150a0411cbe3fdc6f7911529f3136cc76f
2016-11-14 17:06:31 +00:00
Deomid Ryabkov 240eca0b68 Avoid passing NULL to %.*s
CC3200 (TI's C library) doesn't like it

https://e2e.ti.com/support/development_tools/compiler/f/343/t/554883

PUBLISHED_FROM=d0e9fb7ebb7d189d1a76451d609f1f1861c7a837
2016-11-14 16:20:08 +00:00
Marko Mikulicic cd54b18de3 After establishing tun, remove http proto handler
PUBLISHED_FROM=8449d4df2a4caf7afc0f9b50f85bb01d79b8c4eb
2016-11-14 16:20:04 +00:00
Deomid Ryabkov 65e01dbabc Initial support for mbedTLS
PUBLISHED_FROM=edb1063d3fd64e3c732f16b8bf101c065cdacddd
2016-11-14 16:20:02 +00:00
Deomid Ryabkov 62276ce63e Add digital signature to test key usage; 2048 bit
Digital signature key usage is required for the key to be used for (EC)DHE.

PUBLISHED_FROM=b33366d484aff2c478b2f44b85dba33d04d3a808
2016-11-14 16:20:01 +00:00
Deomid Ryabkov f67fe352cf Pull out common SSL interface
Currently only OpenSSL API impl, but the plan is to add more.

PUBLISHED_FROM=c85b26fa2312047768bdcf3eca583e60862aba90
2016-11-11 20:51:01 +00:00
Marko Mikulicic 4805797752 Fix hexdump memory overflow
PUBLISHED_FROM=a6f3f33432ce43b6d4462de623ba61a53e7f18df
2016-11-11 16:05:53 +00:00
Marko Mikulicic 4c038508f2 Extract tun proto name constant
PUBLISHED_FROM=574362ea7d90a17cd49963a430559824cfcff802
2016-11-11 10:06:02 +00:00
Marko Mikulicic 15db11c0e6 Fix tunnel teardown
PUBLISHED_FROM=2c23e4a4dfc7129da657c5935f06335fc022394a
2016-11-11 08:21:37 +00:00
Deomid Ryabkov 97fe505bb4 clang-format more stuff in common
PUBLISHED_FROM=8b5c6f70d5582402f327c4da7baee7cc15ee13aa
2016-11-10 23:50:42 +00:00
Deomid Ryabkov fd45a6d31b CS_LOG_TS_DIFF -> CS_LOG_ENABLE_TS_DIFF; ifdef->if
PUBLISHED_FROM=48c8d4326ea8a24edd8d1ca011be9e7643219084
2016-11-10 16:21:28 +00:00
Marko Mikulicic e1a9ad7f82 Overload mg_bind to bind to tunnel
PUBLISHED_FROM=f554cc63dfea12455fe5e428c6ce5f3152774f8e
2016-11-10 13:07:17 +00:00
Deomid Ryabkov 296affc6e4 Make Krypton define KR_VERSION; use it to detect
PUBLISHED_FROM=ea039cdc30aec44db074871ff6b2d2582f98b5c9
2016-11-10 11:50:56 +00:00
Marko Mikulicic 1889e12b54 Support username:pass authority in HTTP/WS urls
PUBLISHED_FROM=39a1c2a271c5cd961670e11c830105c17ba0b2e4
2016-11-10 11:21:43 +00:00
Sergey Lyubka 5e91d919e0 Make mg_register_http_endpoint work for websocket
PUBLISHED_FROM=5bf5a007929b3b6275121f3cf949526e881fb482
2016-11-09 17:21:38 +00:00
Marko Mikulicic 5934846852 Make mg_tun_bind take separate user+pass
PUBLISHED_FROM=3ee9478275c4b9253b1dd4f98a69cecc89290bce
2016-11-09 15:51:08 +00:00
Marko Mikulicic 5045dfab74 Mongoose TCP tunnel
PUBLISHED_FROM=f03b963aaec02574e47c28ee8033551440b94f2d
2016-11-09 15:05:46 +00:00
Alexander Alashkin 499a7d6a37 Fix mg_is_error
PUBLISHED_FROM=80481f8dbcb93d04eee51ecc6366949420a61f2f
2016-11-09 13:50:52 +00:00
Alexander Alashkin f72c3fa9a7 Unbreak PIC32 compilation. Close cesanta/dev#5807
PUBLISHED_FROM=cfd7de45e4357a17719501b8ab004c2edbd3e87e
2016-11-09 11:21:02 +00:00
Alexander Alashkin d0c50632cd Fixes in MQTT for AWS support
PUBLISHED_FROM=2b82f3793b3c6d0cf1266e4cc0e67930f43002c5
2016-11-09 10:05:40 +00:00
Marko Mikulicic fffb54e2c6 Implementing MG interfaces
PUBLISHED_FROM=46496c2d5340a0bbe4fe1c6c9ff187bc65d2d35f
2016-11-08 22:36:13 +00:00
Deomid Ryabkov 8bf3bd48a6 Include sys/param.h on UNIX (to get PATH_MAX)
PUBLISHED_FROM=774764f9d316e111912dae1fcaf2933141c59a60
2016-11-07 16:36:05 +00:00
Deomid Ryabkov dbe976ad3e Disable parallel builds of the Tiva example
Causes issues on Windows - looks like "parallel" makefiles
do not handle spaces in directory names properly.

PUBLISHED_FROM=5d83e737e9f81041db21fd82c32146471eac1764
2016-11-07 14:05:46 +00:00
Deomid Ryabkov 9a8a6b53ae Minor fix to the LPC example
PUBLISHED_FROM=3a99921093957c2ba9c1a0938fa00b3a29784d81
2016-11-06 02:20:43 +00:00
Dmitry Frank 84132b7b2a Add readme for nRF51 example
And pre-create directories for SDK for both nRF51 and nRF52.

PUBLISHED_FROM=00caf156f48da92804c6af8efe323535fbc5497d
2016-11-04 19:35:50 +00:00
Dmitry Frank e69a7a1b25 Enable warnings on nRF5x examples
Now all warnings are disabled on SDK files, and enabled on our
application's files.

Fixed a couple of things in nRF52 which were unnoticed because all
warnings were disabled there from the beginning.

PUBLISHED_FROM=a33ab22d0ce85efea364b80478986b88f4b0a3a2
2016-11-04 19:05:54 +00:00
Dmitry Frank 7f2bdc217a Fix nRF51 compiler flag for GCC
PUBLISHED_FROM=f8b4e8650d72c2ec5525e0510fbc8a80f8645a14
2016-11-04 18:05:42 +00:00
Dmitry Frank 76bb35d5db Adjust udp_recv callback type for nRF5x
PUBLISHED_FROM=66db56192ae710e3f865fef47593b49e0ed4f133
2016-11-04 17:35:37 +00:00
Dmitry Frank 0187f297d1 Make nRF51 example work with GCC
Unfortunately it turns out Nordic's examples were able to build with GCC
just because they suppressed all warnings; I had to do the same here
because there are some macro redefinitions of arm-none-eabi-gcc and
lwip.

TODO: resolve that and do not suppress warnings.

PUBLISHED_FROM=e65c7b0f2451f85765d958d7f67eb9262f7bc929
2016-11-04 12:20:35 +00:00
Dmitry Frank 6ff49dc196 Fix nRF51 example and add RTT support to it
Now it works in hardware.

PUBLISHED_FROM=f223bde2d2bebe97513ce073eb887552bc3d93af
2016-11-03 22:50:36 +00:00
Alexander Alashkin cd778396ff Update mg_coap_add_option doc
PUBLISHED_FROM=cded8f36e2833e7c256ba6cbca0ebf1f6012dee7
2016-11-03 17:20:55 +00:00
Marko Mikulicic 0dcb50d39c Fix doc for MG_EV_WEBSOCKET_HANDSHAKE_REQUEST
PUBLISHED_FROM=79d3bc5ba7887e2126b64d2ea804c62606264ce2
2016-11-02 23:50:36 +00:00
Deomid Ryabkov fd763846e5 TI Tiva TM4C129 support and example project
PUBLISHED_FROM=c3d59657adff247f565bf0be59192e32d5d0bbf6
2016-11-02 18:55:04 +00:00
Alexander Alashkin f4f310cf51 Add WinCE example, update Mongoose for WinCE6.0
PUBLISHED_FROM=2a76ccddb62b63caeaca3785a07d7d0b94125eaf
2016-11-02 10:11:20 +00:00
Dmitry Frank 0798b72470 Add names to mg_event_handler_t's args
PUBLISHED_FROM=3caea25dec11260561349fa096547bd62ecdb509
2016-11-01 23:25:18 +00:00
Deomid Ryabkov 39a17f8a72 Add text msgs for HTTP status codes 400 and 503
PUBLISHED_FROM=1bd3308933354e147c4e8aa375728a1ede6d8ab4
2016-11-01 18:10:46 +00:00
Deomid Ryabkov 78454da3b3 BREAKING: Set MG_F_SEND_AND_CLOSE on UDP conns
Long-lived UDP "connections" i.e. interactions that involve more
than one request and response are rare, most are transactional:
response is sent and the "connection" is closed. Or - should be.
But users (including ourselves) tend to forget about that part,
because UDP is connectionless and one does not think about
processing a UDP request as handling a connection that needs to be
closed. Thus, we begin with SEND_AND_CLOSE flag set, which should
be a reasonable default for most use cases, but it is possible to
turn it off the connection should be kept alive after processing.

PUBLISHED_FROM=1677d8024aa9afa7e18d8a04d829b699f7f2f103
2016-11-01 14:26:00 +00:00
Alexander Alashkin e62dc8f3b2 Handle MG_EV_CLOSE in examples
PUBLISHED_FROM=57c62a4123a54ecb455dbf91f3fe562fb0cf2ec2
2016-11-01 08:58:38 +00:00
Deomid Ryabkov e99088348d Use ICACHE_FLASH to guess CS_P_ESP8266
Also, do not require -DRTOS_SDK and pick socket/low-level event manager
based on LWIP_SOCKET.

PUBLISHED_FROM=d4afbdf8dab62a1c6ac4ca075c4a58887223dba4
2016-10-31 22:57:59 +00:00
Deomid Ryabkov 6a12bd7abc Wrap LOG and DBG in do { ... } while(0)
PUBLISHED_FROM=c4f3d44ed16dba60db3198b90478c1b2e6f2a5c1
2016-10-31 20:11:37 +00:00
Deomid Ryabkov b39e30fb0c Example LPCXpresso project for NXP LPC4088
PUBLISHED_FROM=ec4c4ec1ca7fee10c67fbba5a603d59fe44a046d
2016-10-31 13:02:01 +00:00
Deomid Ryabkov 92b15395a4 Add CS_P_NXP_LPC - platform def for NXP LPC MCUs
PUBLISHED_FROM=d6ed793313a98545d5a89faafc8526b658ffff66
2016-10-28 18:12:08 +00:00
Alexander Alashkin 7411ff1fca Drop load_balancer example
PUBLISHED_FROM=d823db5e8b2831201e22bbdd3188e93bbbbbbb09
2016-10-28 17:33:08 +00:00
Marko Mikulicic f2e7facbc3 Fix master build
amalgamation, ansi C and queue.h usage issue

PUBLISHED_FROM=96a2b8a90d590da0f2d9939c1d2bc7a64d1fe36a
2016-10-28 14:29:58 +00:00
Sergey Lyubka f1b4f0c463 Fix SEGFAULT in MQTT server
PUBLISHED_FROM=6455082726781aab819a7f8645e81adaa7fc7669
2016-10-28 14:12:40 +00:00
Dmitry Frank c04e3f80b9 Make mongoose compile for nRF51
PUBLISHED_FROM=6af3ed56802d2619f673c36059370440a0c06397
2016-10-28 11:08:09 +00:00
Dmitry Frank 717e872fdd Fix nRF52 Keil project file
Keil actually saves project on disk only when the project is closed,
that's why these changes were missing before

PUBLISHED_FROM=d8ebdaa009ff5676bf6c16aaa2fe8356b03d3b8b
2016-10-27 18:37:09 +00:00
Dmitry Frank dbff932d8b Improve readme for nRF example
PUBLISHED_FROM=7b02f8e7bb85ce1b45f872610645e619de5e313a
2016-10-27 18:23:53 +00:00
Deomid Ryabkov 5c9f463cab Add MG_EV_HTTP_MULTIPART_REQUEST_END
This event is sent at the end of the request

PUBLISHED_FROM=0b841a26320e3edbf73126e2ed8d286d4e5f3fa8
2016-10-27 18:09:57 +00:00
Sergey Lyubka 3a8f47befd Mqtt: parsing auth info in the connect message
PUBLISHED_FROM=017e707ea2bd7b1d1972fbb92e5d98c74e17e9d0
2016-10-27 17:53:17 +00:00
Marko Mikulicic a3e2a41834 Improve error reporting of mg_connect_http
PUBLISHED_FROM=8149fc5ab3c6f7d6ec360473f0e6847040ca820b
2016-10-27 15:22:31 +00:00
Dmitry Frank b667bd709d Specify void arguments explicitly
PUBLISHED_FROM=345ac55417a9b012e89244d36bfb9ebf8e908637
2016-10-27 12:37:38 +00:00
Marko Mikulicic a4c668e37a Expose reverse proxy API for dynamic mounts
PUBLISHED_FROM=00772400bce7c15368d91741092ebc8ab0842e19
2016-10-27 12:08:05 +00:00
Marko Mikulicic 900bbe724a Mongoose forwarding
PUBLISHED_FROM=51652f0157bb951a43508f0fe948c62c351e96ba
2016-10-26 14:52:10 +00:00
Alexander Alashkin f5a2857620 Add PIC32/Harmony http_server example
PUBLISHED_FROM=c393396605d5418fda4ff386170bb9a6d6658a93
2016-10-26 13:53:09 +00:00
Deomid Ryabkov 2ef6f7248d Remove -DNO_BSD_SOCKETS, this macro is not used
PUBLISHED_FROM=b860ada45e76b0e04d214fedb04f5a7dd9c7d8f0
2016-10-26 13:07:03 +00:00
Alexander Alashkin 06b430e57f PIC32 Harmony TCP/IP support basics
PUBLISHED_FROM=31f8f61de954fa3a36ebad162bdb730c0db95b58
2016-10-26 12:00:13 +00:00
Dmitry Frank f061dcf8b6 Make nRF5 example fit better in nRF ecosystem
By making dir hierarchy replicate that of examples provided with the nRF
IoT SDK.

Also, example for Keil uVision IDE is added.

PUBLISHED_FROM=1a3d9a54d15eb1acfb1b5d162138576a387ed21c
2016-10-26 12:00:09 +00:00
Sergey Lyubka 99377bdd30 Fix user registration flow
PUBLISHED_FROM=bac8c10063215f7f7163f607213d15a3c5f81552
2016-10-26 11:02:09 +00:00
Deomid Ryabkov c6b5343c9b Target CC3200 example to production device
PUBLISHED_FROM=623dda0737c8426754044880713c1283c4b181b6
2016-10-26 10:39:04 +00:00
Sergey Lyubka 7f4e2a93d0 Sort docs API entries alphabetically
PUBLISHED_FROM=73ef8ae768585d3c204e6e022848f49e8f4a8de2
2016-10-26 08:28:07 +00:00
Marko Mikulicic c151f9bc59 Denoisify mongoose poll logging
PUBLISHED_FROM=ec1cb82cc2404cfe2abdf3bd445ddec3d4ff3e57
2016-10-25 16:55:50 +00:00
Deomid Ryabkov 204bf9acec Krypton + LWIP fixes
* Make kr_{send,recv} report status via return code instaed of errno
 * Move mg_if_* recv and connect callback invocation out of LWIP
   callbacks: these can be nested and we don't want that to happen
   to our callbacks. Instead, we post events for the event manager to
   process during next poll.

PUBLISHED_FROM=9b3c1de796fae381dea1641807e51d7a897a398e
2016-10-25 15:30:04 +00:00
Dmitry Frank e3bac87016 Make mongoose compile with ARMCC
(It compiles, but doesn't really work yet)

PUBLISHED_FROM=0382d355a343bdab9c9eeed87229efe90c30c40b
2016-10-25 09:56:40 +00:00
Marko Mikulicic 1f09505248 Fix byte order defines under OSX
PUBLISHED_FROM=327a8d729519aa0ad953594a32d63fddac4d1ec9
2016-10-25 08:34:47 +00:00
Sergey Lyubka 7f99013179 Make backend build under win32, MSVC98
PUBLISHED_FROM=961e25e133eff8ee168557f186713d5babbd0c5f
2016-10-24 21:49:11 +00:00
Dmitry Frank 8d72c2a7b2 Add HTTP example for nRF
PUBLISHED_FROM=d9d979057d5269ac32d16545dd2489485bda642a
2016-10-24 11:13:26 +00:00
Alexander Alashkin c722cfec18 Fix c++11 mg compilation
PUBLISHED_FROM=a121a15698884203a573741e73fefaa5923dce4d
2016-10-22 14:32:00 +00:00
Alexander Alashkin 835af2cae1 Fix CoAP/CC3200 compilation
PUBLISHED_FROM=00e4c01cc2bccd63b0f18b797e2c0503a489ef6f
2016-10-21 15:57:55 +00:00
Marko Mikulicic bd2a4097b2 Bump sha pointer to latest simplelink_mbed
PUBLISHED_FROM=d0c765e56e926c2f2e57cc95dc3ffbdef93c98c3
2016-10-21 12:13:11 +00:00
Ilia Penev fcc75c6a3f Fix CoAP packet size calculation
PUBLISHED_FROM=43532ec3951779d17438b457fe6de6dea8f514fd
2016-10-21 12:13:10 +00:00
Marko Mikulicic e08b234326 ARM mbed STM32+cc3100 demo
PUBLISHED_FROM=edf899f7493b70660006fd605f0301a44cd16356
2016-10-21 10:16:47 +00:00
Marko Mikulicic 5bd3df7a0f Fix mg_time on mbed and make DNS work around epoch
PUBLISHED_FROM=c1aeef9dc25baba794b3269b44441c5bafbca5a8
2016-10-20 22:36:39 +00:00
Deomid Ryabkov 5bbf24bf41 Fix line endings in console messages
PUBLISHED_FROM=b7cf888512e535fcb81371d797bf8a72440baeaa
2016-10-20 13:36:13 +00:00
Deomid Ryabkov ace1dc53b2 Fix DHCP message
PUBLISHED_FROM=9efa7b516d0541e9f6f8002aa24cf7115f0d9b2b
2016-10-20 12:51:30 +00:00
Deomid Ryabkov 100480a1d5 Tweak NXP example project settings
- Enable parallel build
 - Generate FW in bin format

PUBLISHED_FROM=ce7d827b42f5619c58287f5c71191c54261d8de1
2016-10-20 12:22:18 +00:00
Deomid Ryabkov a89a2df603 Fix SDK_PATH
PUBLISHED_FROM=df1d2f45c0eea6e3f9b749b539c696684be74155
2016-10-20 11:45:51 +00:00
Deomid Ryabkov 988ad66a12 Add Mongoose example project for NXP Kinetis K64
PUBLISHED_FROM=c3e39efb339ed9ae45ac4bbb3bd421704ea5a143
2016-10-20 07:51:19 +00:00
Dmitry Frank 85d6292b8f Add nRF port for Mongoose
Example is not yet added

PUBLISHED_FROM=2732386091a0d4cd8d4c6e64dc16467780ec72a5
2016-10-19 19:22:15 +00:00
Sergey Lyubka 98ab0950c9 Restore Mongoose README changes
PUBLISHED_FROM=6f3ba456089f4812ac7e5e1d7456f7f36a7157bc
2016-10-19 14:38:07 +00:00
Deomid Ryabkov a7f9043072 Add MG_ENABLE_FILESYSTEM to MSP432 examples
PUBLISHED_FROM=36289eddbb3c5c172c36ab737e2f23c763058ed2
2016-10-19 13:36:17 +00:00
Deomid Ryabkov 6d8b747ff2 Add MG_ENABLE_FILESYSTEM to CCS projects
Update compiler version to 5.2.8

PUBLISHED_FROM=5e9cd9571127d980b9d4dbe78f2aefb78a4d90f5
2016-10-19 12:41:56 +00:00
Deomid Ryabkov a17eae4142 Enable MQTT client by default
PUBLISHED_FROM=cb5d5afe166f637082d4b1d1bce5d9c263e91fd0
2016-10-18 15:51:31 +00:00
Deomid Ryabkov 7b05d70042 CS_P_ESP_LWIP -> CS_P_ESP8266;add CS_P_NXP_KINETIS
LWIP part has been finally fully split from the ESP part, and ESP
platform defs reduced to bare minimum. It is now possible to use LWIP
in either low-level or socket mode without any ESP dependencies,
and NXP Kinetis platform is the first to make use of it.

PUBLISHED_FROM=4a9055897609c812296bdab5b4943ffde641ced2
2016-10-18 12:38:06 +00:00
Sergey Lyubka f328907da4 Return "status": XX for all RESTful calls
PUBLISHED_FROM=92e6e136946fd1f376e6ecbeea30f106caccaae5
2016-10-18 11:51:36 +00:00
novlean 1cea7ba487 Update README.md 2016-10-18 11:40:10 +01:00
novlean 6848452149 Update README.md 2016-10-18 11:38:36 +01:00
novlean f9a1d47f13 Update README.md
Updated with changes.
2016-10-18 11:36:25 +01:00
Deomid Ryabkov 492dcdca8d MG_DISABLE_(DNS|(_SYNC)?_RESOLVER) -> MG_ENABLE_$1
Disable sync resolver by default.

PUBLISHED_FROM=dbaed194e5fe211c07564fe6880649a1aee7f662
2016-10-17 19:21:46 +00:00
Deomid Ryabkov 4ef3a778c1 Introduce MG_NET_IF var, replaces MG_NET_IF_*
Possible values:
  MG_NET_IF_SOCKET (1) - traditional BSD socket API
  MG_NET_IF_SIMPLELINK (2) - TI's SimpleLink socket interface
  MG_NET_IF_LWIP_LOW_LEVEL - a net_if implementation that uses LWIP's
    low-level API, when LWIP_SOCKET is not available.

PUBLISHED_FROM=a5c0aebb7b6bdb1f1f4cb3210763d16f3ab5e133
2016-10-17 18:21:58 +00:00
Marko Mikulicic 31c5ef1bc3 Don't clang-format non checked out things
mbed-os is a directory that gets checked out by the mbed cli
(a tool similar in spirit to miot) and it contains a lot of
.c sources, so many of them that clang-format burns your CPU.

While we're at it, also fix check_no_ifdefs when running under a commit
hook.

PUBLISHED_FROM=e5dd457ea3c4f9bd880f2491fb322dffa7abf70a
2016-10-17 17:06:23 +00:00
Dmitry Frank 4656e7b0dd Don't access nc->ssl if SSL is disabled
PUBLISHED_FROM=bdbd9416f73f84a3d8afbffe886d0922c36769d4
2016-10-17 10:07:37 +00:00
Alexander Alashkin 4216cf2ac1 Enable FS for WinCE
PUBLISHED_FROM=ec3ed105e29251bdd9b8ad08e8e56c0873ced8ae
2016-10-17 09:22:32 +00:00
Deomid Ryabkov 37e4f51668 MG_DISABLE_SOCKETPAIR -> MG_ENABLE_BROADCAST
PUBLISHED_FROM=81b6289a4b54043df557142f0de8cc66bc5190d4
2016-10-17 04:07:06 +00:00
Deomid Ryabkov 1dae0373c8 MG_DISABLE_POPEN -> MG_ENABLE_HTTP_SSI_EXEC
PUBLISHED_FROM=55b2b70a688234f6ebcfba37eced20ee5d5387a1
2016-10-16 23:21:56 +00:00
Deomid Ryabkov e928f36456 MG_DISABLE_HTTP(|_SSI|_WEBSOCKET) -> MG_ENABLE$1
Factor out SSI and WS code from http.c

HTTP + WS are enabled by default, but MQTT is built without HTTP
support as a compilation test.

PUBLISHED_FROM=925ed9a55abb193ed7deac1c9675a0e5b35dca50
2016-10-14 17:06:19 +00:00
Alexander Alashkin fcb94a1742 Port Mongoose to WinCE, part I
PUBLISHED_FROM=292d73fa3e90377b1f929ae47ae1073dab5a4089
2016-10-14 13:37:07 +00:00
Deomid Ryabkov 8ff010ca0f MG_DISABLE_FILESYSTEM -> MG_ENABLE_FILESYSTEM
PUBLISHED_FROM=026810475d98df117ab1dadf40276759190aad19
2016-10-14 12:37:13 +00:00
Deomid Ryabkov 241090a82b CS_DISABLE_(STDIO|HEXDUMP) -> CS_ENABLE_$1
PUBLISHED_FROM=9fd0cebfa8df53b5d9574a8d013305ddda5e7a18
2016-10-14 10:22:30 +00:00
Marko Mikulicic 618bef0eb2 Fix stm32f4_cc311 example and add it to CI
The build has been broken because MQTT has been disabled during some refactoring
but never caught because this example was never built on CI.

PUBLISHED_FROM=b67051ff948f1ac89448fc707f41cdf5d48cdaaf
2016-10-14 08:37:28 +00:00
Deomid Ryabkov 3b69f5d500 MG_DISABLE_DAV -> MG_ENABLE_HTTP_WEBDAV
PUBLISHED_FROM=62267ea0a8e10d8ba7bad590d1a56b179bcffce9
2016-10-14 07:06:13 +00:00
Deomid Ryabkov b298d46a40 MG_DISABLE_MQTT -> MG_ENABLE_MQTT
PUBLISHED_FROM=34e6028b68e286f81be7ba0f8ae73b760f144131
2016-10-13 21:08:22 +00:00
Deomid Ryabkov 75059d1bdc Rename MG_DISABLE_CGI -> MG_ENABLE_CGI
Also factor out CGI-related code from http.c, it's getting too big.

Build tests with -Wundef

PUBLISHED_FROM=a1e82fafba73812c249db0b49c59d1b48417b60d
2016-10-13 19:22:50 +00:00
Deomid Ryabkov 15e9a92798 Run V7 tests with -Wundef
PUBLISHED_FROM=e2375c5b10be12a75f6a5f9df56ebe9f5faa9331
2016-10-13 19:07:34 +00:00
Deomid Ryabkov bafc30bec6 Change from using #ifdef to #if for features tests
"#if FOO" still works with simple -DFOO, but gives more flexibility.
Specifically, if user expressed no preference (FOO is not defined),
we can apply reasonable defaults (this is the legitimate use of ifdef).

In short, from now on, please use

 #if MG_ENABLE_FOO

instead of

 #ifdef MG_ENABLE_FOO

Since we are all used to #ifdef, this change also adds a precommit check
to police this. Specifically, in *.h and *.c files that are Copyright Cesanta,
"ifdef" and "if defined()" are not allowed to be used with macros that contain
ENABLE or DISABLE, unless the like also contains "ifdef-ok".

Hence, if you are sure you want to use ifdef, use this:

 #ifdef MG_ENABLE_FOO /* ifdef-ok */

PUBLISHED_FROM=9be829448f53cff575d6cae8b9945fb12531c15a
2016-10-13 18:07:25 +00:00
Alexander Alashkin 0a8f839281 Mongoose 6.6
PUBLISHED_FROM=23d031720d8d6e170eab6bd615797f33e36a6701
2016-10-12 10:06:27 +00:00
Deomid Ryabkov ab48174bac esp_mg_net_if refactoring: split LWIP & ESP parts
esp_mg_net_if was a rat's nest of mongoose net_if and event manager
implementaions and the event loop task for the ESP8266 miot port.
From that, pieces that are related to LWIP support have been pulled out,
separated into net_if and event manager files, and event loop task
has been moved under the miot esp8266 dirrectory.

This is done to facilitate LWIP code reuse. This may not be the end of
it, but it's a start.

Note: custom retransmit logic has been removed for now. Can be
reintroduced later is necessary.

PUBLISHED_FROM=fd5bbf75714583ce95776d4c76b6c5b5dc535364
2016-10-11 18:38:10 +00:00
Marko Mikulicic 4439251f17 Add MBED as platform
Currently this allows V7 to be built on MBED; more
work is likely required to port mongoose.

PUBLISHED_FROM=32cd0a38349c8e9019af46d4ce7e1429e660db25
2016-10-11 10:29:41 +00:00
Deomid Ryabkov f9a6403b11 Add MG_EV_SSI_CALL_CTX
This is the variant of MG_EV_SSI_CALL with context of the SSI call being
processed in addition to the tag argument. Specifically, call handler
now gets access to the HTTP request and the name of the file being processed.

MG_EV_SSI_CALL is preserved for backward compatibility.

PUBLISHED_FROM=eeea7487c062505abdb23b6f64994ff7a6b60ff8
2016-10-04 23:51:29 +00:00
Deomid Ryabkov 786f46c655 Update TI compiler to 5.2.8
PUBLISHED_FROM=75a0ee6e842da6c8f9e8f1eb85165b64fada0d6a
2016-10-03 15:06:53 +00:00
Sergey Lyubka 5ebd9fe7a5 uart-to-websocket page content changes
PUBLISHED_FROM=e8db78b70a80ef63f1f6090b1ad5d16315e8f8c9
2016-10-03 15:06:52 +00:00
Deomid Ryabkov 2302ae5e88 Update TI compiler to 5.2.8
PUBLISHED_FROM=75a0ee6e842da6c8f9e8f1eb85165b64fada0d6a
2016-10-03 15:06:16 +00:00
Deomid Ryabkov 8b12263dbc Fix mg_http_send_redirect doc
PUBLISHED_FROM=77cd3df9959b0e3a2550d1581586e69878bbee0d
2016-09-30 13:06:39 +00:00
Alexander Alashkin 376d2666a5 Add PIC32MX/CC3100 mqtt_client example
PUBLISHED_FROM=cda885a9dc5d1203b7b59b13ea7fd7934b31260a
2016-09-30 12:39:35 +00:00
Deomid Ryabkov d90622630f Link MIOT for Linux statically
PUBLISHED_FROM=4f0adab828ebf06dbc3e0c4333bf0053f374b62f
2016-09-30 12:39:32 +00:00
Alexander Alashkin da447b1067 Add PIC32MX/CC3100 mqtt_client example
PUBLISHED_FROM=cda885a9dc5d1203b7b59b13ea7fd7934b31260a
2016-09-30 12:37:08 +00:00
Deomid Ryabkov 460d95afc5 Add mg_http_send_redirect and make examples use it
PUBLISHED_FROM=f45e06aeba1c00212078d539b6f74cb8bd054326
2016-09-30 11:22:00 +00:00
Alexander Alashkin 8f522048d8 Use gethostbyname for localhost
PUBLISHED_FROM=97c58e8624e0d4fa0f043acf6b20e2a1a5ca1b51
2016-09-30 06:50:52 +00:00
Deomid Ryabkov 147c095105 Report errors in the netcat example
PUBLISHED_FROM=f43dc48512ff13028a57571b537c41d9658034b5
2016-09-29 12:05:53 +00:00
Alexander Alashkin fecb11f2fa Add CoAP server example doc. Closes cesanta/dev#4917
PUBLISHED_FROM=ee7728db61721c0628a00ed702a47f7382ad7cd7
2016-09-29 11:50:59 +00:00
Alexander Alashkin 56e50c2dbe Add CoAP client example doc
PUBLISHED_FROM=51fd5cd50ae8c9fce43d95d06fec2e7582018d00
2016-09-29 11:05:59 +00:00
Deomid Ryabkov c1b5e9b260 Rename MSP432 example project
So they are distinct from CC3200 projects during import

Also update compiler version (5.2.7 -> 5.2.8)

PUBLISHED_FROM=23834212eb51ad068579726a2870e8e6ae87ab9c
2016-09-28 12:51:35 +00:00
Marko Mikulicic 286fa90ee9 Simple mDNS + DNS-SD impl
Main TODOs:
1. the spec requires the impl to resend the reply once and
   to send gratuitous updates

2. advertise our clubby services as DNS-SD sub-services.

---

Tested with:

1. https://play.google.com/store/apps/details?id=com.grokkt.android.bonjour&hl=en
2. https://play.google.com/store/apps/details?id=com.druk.bonjour.browser&hl=en
3. osx `dns-sd`

Works well enough; it doesn't have some glitches due the fact that we
don't retransmit yet and we don't send gratuitous updates.

PUBLISHED_FROM=38d7a50beb274d4aeeda5b0b58e44dfa0789da84
2016-09-28 08:51:47 +00:00
Deomid Ryabkov d63fb70c69 Publish the amalgamation tools
PUBLISHED_FROM=27ed0bd32e33252495b92361d2943a3450448f62
2016-09-27 15:36:56 +00:00
Deomid Ryabkov 4d76a3be4c Amalgamation changes - clean up paths
Make paths embedded in amalgamated files nice and relative.
This facilitates subsequent clean un- and re-amalgamation.

PUBLISHED_FROM=d83e6000617c54ceaeb78b80c25814996043fe66
2016-09-27 05:06:32 +00:00
Dmitry Frank d9c612ef2b Fix miot serial communication on Windows
PUBLISHED_FROM=426ff040865ea9626ba62bcbca3aa84fb40fd3ea
2016-09-26 20:21:42 +00:00
Sergey Lyubka 3b3ca1c1b3 Update README.md 2016-09-26 15:46:44 +01:00
Alexander Alashkin 2e748fdbf1 Fix handles leak in CGI
PUBLISHED_FROM=6052b7bfec6af33328cbe369da60e9672ebac437
2016-09-23 15:06:46 +00:00
Deomid Ryabkov 6c99691d1c Add build target for leenoox (using docker)
PUBLISHED_FROM=46a7902a727e0ba34c3dbbe5ee04d5119afbaaff
2016-09-23 15:06:45 +00:00
Alexander Alashkin fd067c8077 Fix handles leak in CGI
PUBLISHED_FROM=6052b7bfec6af33328cbe369da60e9672ebac437
2016-09-23 15:06:02 +00:00
Marko Mikulicic 04012760d1 Add small multicast server demo for mongoose
PUBLISHED_FROM=c5f6b0c64bc1e43030743b6aae5d06ae231df5dc
2016-09-23 10:21:37 +00:00
Alexander Alashkin 0ec1a141f1 Fix mg_http_parse_headers
PUBLISHED_FROM=7e88f60283d499732e8df663814067849d9567bb
2016-09-23 10:21:36 +00:00
Deomid Ryabkov 7414a4fb06 Stop pretending that sl_* API is BSD-compatible
PUBLISHED_FROM=355fea9a5a75ac926d4c64d41828ebcd96c04080
2016-09-22 19:51:06 +00:00
Deomid Ryabkov abbd44e276 Fix WS handshake nonce generation
PUBLISHED_FROM=ae8d436db9aee9aec7b5ac1cbee6bc4e32d8c6cf
2016-09-22 16:05:38 +00:00
Sergey Lyubka 13e80e6bd5 Add HTTP examples for MIOT
PUBLISHED_FROM=a7ca2e0b705390b32bf2bac44aaaf60c6fcc8522
2016-09-22 14:21:11 +00:00
Deomid Ryabkov ffa981d172 Update CC3200 sensor demo example
PUBLISHED_FROM=9e29cac6a7d4b632b7f4a3ab0fe5411368ad0f5a
2016-09-16 21:20:56 +00:00
Deomid Ryabkov 806f07db67 Fix MG_hello project build
PUBLISHED_FROM=450e5c045b6515fba0e0614c6d76a58712c72160
2016-09-15 13:36:09 +00:00
Alexander Alashkin 6746933a3d Fix Windows compilation
PUBLISHED_FROM=04bcd98025263f32d337730cf179bdfc35b683f1
2016-09-15 12:21:53 +00:00
Dmitry Frank 8cb2833fa7 Implement miot dev call
PUBLISHED_FROM=40d62ce03a4f739b458076395941e4ad7c932fb3
2016-09-15 12:21:52 +00:00
Alexander Alashkin 1730f3c0c9 Fix Windows compilation
PUBLISHED_FROM=04bcd98025263f32d337730cf179bdfc35b683f1
2016-09-15 12:21:21 +00:00
Sergey Lyubka d6dda04f4f Update mg_mgr docstring
PUBLISHED_FROM=da57dfe52e315dc1901d761289f0445be6e93cea
2016-09-13 11:37:47 +00:00
Artem Bulavin 1b0825ef4b Docs deployment via docs/make_doc
PUBLISHED_FROM=da5f7f80a9876ac4f1889a1176a3048f47980659
2016-09-13 11:37:46 +00:00
Sergey Lyubka 7249b2bd5f Update mg_mgr docstring
PUBLISHED_FROM=da57dfe52e315dc1901d761289f0445be6e93cea
2016-09-13 11:36:17 +00:00
Alexander Alashkin 238bf1a29e Fix MSVC2015 warnings in mongoose
PUBLISHED_FROM=9e2d5c45d112b9e9493d995b12fe989e93d66d5b
2016-09-13 08:51:20 +00:00
Alexander Alashkin 4cbf81da59 Use user timeout in multithreading polling
PUBLISHED_FROM=dbf75bfba087f1b0aa0531e5003ba3e69ed1a6ab
2016-09-12 14:21:05 +00:00
Alexander Alashkin d9b7ec18e7 Add MG_F_ENABLE_BROADCAST option
PUBLISHED_FROM=293a54ab09e6879b6f0c36975a137eeaeff92098
2016-09-12 12:36:56 +00:00
Alexander Alashkin ffed9c4d8c Copy flags for accepted connection
PUBLISHED_FROM=4787d59fdc9f4da525ddfae46e5203d06a596ef4
2016-09-12 10:51:11 +00:00
Sergey Lyubka 0dc0c5a0e0 Add WebSocket support to the netcat example
PUBLISHED_FROM=c494ab910d0b1b98ea6ea4024450c60d0abff01d
2016-09-09 22:29:34 +00:00
Dmitry Frank 57f826ece1 Implement miot cloud group add, list, delete
PUBLISHED_FROM=4b6f7b6fb4559e085c93f5f8827b8fae1701de70
2016-09-09 22:29:33 +00:00
Sergey Lyubka 729bdebc50 Add WebSocket support to the netcat example
PUBLISHED_FROM=c494ab910d0b1b98ea6ea4024450c60d0abff01d
2016-09-09 22:20:58 +00:00
Dmitry Frank 2a541175b5 Use void arguments list consistently in C code
On my way, fixed a couple of cases where we had `()` in the header, and
non-empty argument list in the source file.

PUBLISHED_FROM=5519526cf84e2bbd425a726fcc112fea1a95cbf1
2016-09-05 15:51:19 +00:00
Alexander Alashkin 5f93f7162f Add STM32F4/CC3100 example & Co
PUBLISHED_FROM=7f805d89dcb795c9b3ee637ef1dbdcfcf3323469
2016-09-05 15:06:21 +00:00
Sergey Lyubka 3640554503 Add DNS server example
PUBLISHED_FROM=0d71533fd475c152c29fe304ca95559512a6059d
2016-09-02 21:06:16 +00:00
Sergey Lyubka 12437fd7fe Refactor Mongoose documentation
PUBLISHED_FROM=e9a4e5c7b4a1d03b93a2a79e29de19e60e919929
2016-09-01 14:35:02 +00:00
Deomid Ryabkov 4120f953c7 Report bind error in simplest_web_server_ssl
PUBLISHED_FROM=73e7ed5dd69cbca00ad6f67125915fbfb296770b
2016-08-31 12:30:22 +00:00
Deomid Ryabkov 844c7787f9 Ignore SL_EAGAIN
It was observed that sl_Send can return SL_EAGAIN, despite the fact that
we only call write_to_socket if it was reported as writeable.

PUBLISHED_FROM=e4cbacb3f16bb7abb479222d7dcbfbe113a39161
2016-08-29 18:20:54 +00:00
Deomid Ryabkov 0fe9ec1499 C Clubby refactoring
Complete rewrite of the C Clubby implementation: it is now modeled after
the Go implementation, with a slight difference that codec and channel
are the same object (something we should probably do in Go as well, as
we only have a single type of channel so far, which is used with all
types of codecs).

This implementation also comes with a new external API,
which is hopefully cleaner and easier to use (see mg_clubby.h).

In this PR I am not adding any new types of channels, but a UART channel
as well as websocket listener channel will be added after this lands.

PUBLISHED_FROM=d545d4bb6434e2a02ad159f9e4b64e594a4797e7
2016-08-29 11:20:54 +00:00
Sergey Lyubka b3fb21dacc Add DLL building example
PUBLISHED_FROM=20d24793d766ee289c6bde95bd5ad01202cd614b
2016-08-26 09:21:09 +00:00
Alexander Alashkin 2deaf084e4 Fix clang -std=c99 compilation
PUBLISHED_FROM=fc3f24d40f92f206e5de4a2fd15100430db87717
2016-08-24 12:50:59 +00:00
Deomid Ryabkov 1b324510cc Add simplest_web_server_ssl example
PUBLISHED_FROM=8945dc72ce22d48c582e7cdd01348494677ac5bb
2016-08-22 22:20:45 +00:00
Artem Bulavin fd839f1827 Pointer to int casting warning
PUBLISHED_FROM=6bf2a710edaae6133d68eaf900ede14bba75ad5a
2016-08-19 09:05:55 +00:00
Alexander Alashkin f149f4aab1 Remove cs_dbg.h from amalgamated headers
PUBLISHED_FROM=993c4b1bec363e3f7975b83710e694792bedf5b3
2016-08-18 14:06:18 +00:00
Marko Mikulicic af6fc64ab9 Add restart flag to ourci workers
PUBLISHED_FROM=f85aaf2215f8323866eab9fb5143407b44fa1959
2016-08-16 17:21:03 +00:00
Artem Bulavin ff159bf30a Simple mongoose http urls crawler
PUBLISHED_FROM=4eead54610606827963e7c244fcd8ab9a13d4c07
2016-08-16 14:36:11 +00:00
Alexander Alashkin 8cdd19bcae Call MG_EV_ACCEPT on spawn
PUBLISHED_FROM=f1b4ce4334d24bf613db88ccb28cb3668390ce1d
2016-08-16 09:36:05 +00:00
Alexander Alashkin 2efc859829 Fix mt
PUBLISHED_FROM=6e33f546c4d096ef03103f6010124e5d568700b0
2016-08-15 16:21:14 +00:00
Alexander Alashkin d4a8351464 Remove port :5000 from docker.cesanta in Makefiles
PUBLISHED_FROM=b2454104b99100f23db0777f874ab8a33727acca
2016-08-12 15:36:30 +00:00
Deomid Ryabkov 5fa544fc78 Make mg_http_serve_file public
A way to serve a single, specific file as opposed to the hairy monster
that is mg_serve_http.

PUBLISHED_FROM=6ed1bc487b9d41d212a5907337182f23b040aecf
2016-08-09 10:51:02 +00:00
Deomid Ryabkov 1070dd2d87 Fix overrun in url rewrites, add tests
PUBLISHED_FROM=03dc62aa69dddcbe41d5bc5c014de248332da918
2016-08-09 10:06:12 +00:00
Deomid Ryabkov af98854ce4 Delete old cookie_auth example
PUBLISHED_FROM=c118b2796f697e8d5493bb3d534cee7406060c1a
2016-08-08 14:06:05 +00:00
Deomid Ryabkov 7cace648c0 Improve cookie auth example
Use templated index page and SSI calls instead of hard-coded html

PUBLISHED_FROM=eade9dfe283952ed5465cd0ff1924f61a14dea0c
2016-08-08 11:28:52 +00:00
Deomid Ryabkov 447bf4adb0 Compile examples with -Werror
PUBLISHED_FROM=5a24bda9029db3fc7bf04dc871656d65d551f4ab
2016-08-08 10:36:19 +00:00
Deomid Ryabkov 6572c1c692 Add a cookie auth and session management example
PUBLISHED_FROM=243437cf7d48b04aef3896bc4c5d4010975299a4
2016-08-08 10:36:19 +00:00
Dmitry Frank 7b48859f8d Fix mongoose comment a little
PUBLISHED_FROM=542e7c82fa494bef52222495301ab53dce43cd8f
2016-08-04 19:51:10 +00:00
Marko Mikulicic a6230bafe7 Make unamalgamated build work with bazel
PUBLISHED_FROM=c6756bc74e6c25e4c120024e3ee2e3406068ad92
2016-07-30 02:21:16 +00:00
Deomid Ryabkov cc8f1466c7 Turn on func. sections + dead section elimination
In CCS example projects

PUBLISHED_FROM=b3ab112f74ae475cb93bf06fdb7db811bbb99a59
2016-07-27 20:36:15 +00:00
Deomid Ryabkov 69f810febc Remove debug that slipped into prod code
PUBLISHED_FROM=7bacb1af60e85e4ed56a600fa3d1dbba1679db59
2016-07-26 18:39:48 +00:00
Dmitry Frank e5da7440d7 Bring back JS precompilation to CC3200
We haven't actually _fixed_ evaluation of precompiled bcode from
non-mmapped memory: we just never free it. For sane use case (do not
evaluate the same file more than once) it should be acceptable.

PUBLISHED_FROM=a9ca2d8fa72e9c40c93415d060ee8db697caa225
2016-07-26 15:36:00 +00:00
Dmitry Frank 849ec1684a Apply Mongoose docs edits by Ev
PUBLISHED_FROM=5cd78790a03580aa23dd3d2d8b825ad449083cc2
2016-07-26 15:06:04 +00:00
Alexander Alashkin 4f210cd8eb Fix error messages and more
PUBLISHED_FROM=11c57fc5ece01686e9cecab5e3bfce54a2825836
2016-07-25 17:21:23 +00:00
Evelyn 285f75764c Update mg_match_prefix.md 2016-07-25 17:37:20 +01:00
Evelyn 3586203753 Update mg_next_comma_list_entry.md 2016-07-25 17:36:46 +01:00
Alexander Alashkin e406de7e00 Remove extra error message
PUBLISHED_FROM=8b7fcfc1bc32ff9ff38e2904ddb730c83bf9fae4
2016-07-25 16:36:18 +00:00
Evelyn 53ed8502c9 Update mg_is_big_endian.md 2016-07-25 17:35:41 +01:00
Evelyn ac8c756879 Update mg_avprintf.md 2016-07-25 17:35:27 +01:00
Evelyn 07faacdaf9 Update mg_hexdump_connection.md 2016-07-25 17:34:35 +01:00
Evelyn 8464844518 Update mg_hexdump.md 2016-07-25 17:34:03 +01:00
Evelyn fe2d1ff027 Update mg_sock_addr_to_str.md 2016-07-25 17:33:17 +01:00
Evelyn 8d129e359e Update mg_conn_addr_to_str.md 2016-07-25 17:33:03 +01:00
Evelyn 39aa56457b Update mg_start_thread.md 2016-07-25 17:32:22 +01:00
Evelyn 8491d5da8b Update mg_open.md 2016-07-25 17:31:57 +01:00
Evelyn 681196e2c8 Update mg_fopen.md 2016-07-25 17:31:43 +01:00
Evelyn 836ad5ebab Update mg_stat.md 2016-07-25 17:31:28 +01:00
Evelyn a3ea1eddfb Update mg_base64_decode.md 2016-07-25 17:30:59 +01:00
Evelyn a2c06ac6ba Update mg_skip.md 2016-07-25 17:30:04 +01:00
Evelyn a5c697fa2d Update mg_coap_parse.md 2016-07-25 17:28:59 +01:00
Evelyn be199b4fe9 Update mg_coap_send_ack.md 2016-07-25 17:28:05 +01:00
Evelyn cc15320cfe Update mg_coap_send_message.md 2016-07-25 17:27:50 +01:00
Evelyn 70bae59ec6 Update mg_coap_free_options.md 2016-07-25 17:27:31 +01:00
Evelyn d4f3361805 Update mg_coap_add_option.md 2016-07-25 17:26:59 +01:00
Evelyn 332c855d40 Update mg_set_protocol_coap.md 2016-07-25 17:26:43 +01:00
Evelyn 01e3fa4d13 Update mg_mqtt_next.md 2016-07-25 17:26:26 +01:00
Evelyn 15a0f7a00a Update mg_mqtt_broker.md 2016-07-25 17:26:05 +01:00
Evelyn a751adba2a Update mg_mqtt_broker_init.md 2016-07-25 17:25:21 +01:00
Evelyn 10eed010df Update mg_mqtt_next_subscribe_topic.md 2016-07-25 17:25:00 +01:00
Evelyn 033ca26216 Update mg_mqtt_pong.md 2016-07-25 17:24:19 +01:00
Evelyn 40793cbdce Update mg_mqtt_ping.md 2016-07-25 17:24:10 +01:00
Evelyn 48a1b2ec75 Update mg_mqtt_unsuback.md 2016-07-25 17:24:03 +01:00
Evelyn 1a55556c66 Update mg_mqtt_suback.md 2016-07-25 17:23:53 +01:00
Evelyn 3edd3ccbe6 Update mg_mqtt_pubcomp.md 2016-07-25 17:23:39 +01:00
Evelyn 194933e037 Update mg_mqtt_pubrel.md 2016-07-25 17:23:30 +01:00
Evelyn 38deaedaef Update mg_mqtt_pubrec.md 2016-07-25 17:23:15 +01:00
Evelyn fc3dd5900c Update mg_mqtt_puback.md 2016-07-25 17:23:06 +01:00
Evelyn b1213425d0 Update mg_mqtt_connack.md 2016-07-25 17:22:53 +01:00
Evelyn 40f0b450a8 Update mg_mqtt_disconnect.md 2016-07-25 17:22:43 +01:00
Evelyn 0bab3977a8 Update mg_mqtt_unsubscribe.md 2016-07-25 17:22:35 +01:00
Evelyn 2c46760b77 Update mg_mqtt_subscribe.md 2016-07-25 17:22:22 +01:00
Evelyn 878c9ae5ae Update mg_mqtt_publish.md 2016-07-25 17:22:11 +01:00
Evelyn c8553de09e Update mg_send_mqtt_handshake_opt.md 2016-07-25 17:22:02 +01:00
Evelyn 6738858e11 Update mg_send_mqtt_handshake.md 2016-07-25 17:21:52 +01:00
Evelyn 61cd6ab86e Update mg_set_protocol_mqtt.md 2016-07-25 17:21:43 +01:00
Evelyn 77704b669a Update mg_dns_send_reply.md 2016-07-25 17:21:22 +01:00
Evelyn 770be613d7 Update mg_dns_reply_record.md 2016-07-25 17:20:33 +01:00
Evelyn 9790366449 Update mg_dns_create_reply.md 2016-07-25 17:19:44 +01:00
Evelyn 89f0a8c530 Update mg_set_protocol_dns.md 2016-07-25 17:18:19 +01:00
Evelyn f72a06e25a Update mg_dns_uncompress_name.md 2016-07-25 17:17:35 +01:00
Evelyn 8b975533e5 Update mg_dns_encode_record.md 2016-07-25 17:15:49 +01:00
Evelyn b32f7a9b57 Update mg_dns_copy_questions.md 2016-07-25 17:14:48 +01:00
Evelyn e1e0083897 Update mg_dns_insert_header.md 2016-07-25 17:14:27 +01:00
Evelyn ca08ac0e3c Update mg_send_dns_query.md 2016-07-25 17:14:13 +01:00
Evelyn a5b85b4462 Update mg_dns_parse_record_data.md 2016-07-25 17:14:03 +01:00
Deomid Ryabkov 3feab3a16d No-JS mode refactoring
Now JS is controlled with a make variable as opposed to a proproc define.

This allows skipping compiling a whole bunch of files when JS is
disabled, e.g. whole freezing step on ESP, or compiling v7.c on CC3200
which takes a while only to be discarded in its entirety later.

Var name is SJ_ENABLE_JS (note change from disable logic to enable to be in line with other stuff). Default is 1, meaning JS is enabled.

Also changed clubby knob in the same way: SJ_ENABLE_CLUBBY, default is 1 as well.

PUBLISHED_FROM=105277e9536e423d6363a51ff9acea9550a9c496
2016-07-25 15:06:00 +00:00
Evelyn 5d76e57b81 Update mg_set_protocol_http_websocket.md 2016-07-25 15:08:27 +01:00
Alexander Alashkin 9101cd0339 Use lld for ID
PUBLISHED_FROM=1246247fc29eb9a75b986ff7bb2d2350a52c03fc
2016-07-22 16:26:31 +00:00
Evelyn 4b2d3f5f5b Update mg_http_check_digest_auth.md 2016-07-22 16:23:52 +01:00
Evelyn 482a471abb Update mg_file_upload_handler.md 2016-07-22 16:23:16 +01:00
Evelyn 4d90bb0d02 Update mg_register_http_endpoint.md 2016-07-22 16:22:15 +01:00
Evelyn 202dfc18be Update mg_serve_http.md 2016-07-22 16:21:47 +01:00
Evelyn 13f4742699 Update mg_connect_http_opt.md 2016-07-22 16:21:30 +01:00
Evelyn 33e769bd75 Update mg_connect_http.md 2016-07-22 16:20:58 +01:00
Evelyn 992f3000ef Update mg_http_create_digest_auth_header.md 2016-07-22 16:20:04 +01:00
Evelyn 7ea4adae5e Update mg_url_decode.md 2016-07-22 16:19:38 +01:00
Evelyn 5ed9991135 Update mg_get_http_var.md 2016-07-22 16:18:42 +01:00
Evelyn dc2527c11f Update mg_parse_multipart.md 2016-07-22 16:17:58 +01:00
Evelyn bee95654f3 Update mg_http_parse_header.md 2016-07-22 16:17:08 +01:00
Evelyn 48296bb1cf Update mg_get_http_header.md 2016-07-22 16:16:21 +01:00
Evelyn 1ee9735354 Update mg_parse_http.md 2016-07-22 16:16:00 +01:00
Evelyn f8da303ca1 Update mg_printf_html_escape.md 2016-07-22 16:15:26 +01:00
Evelyn 6ae6ee9fd2 Update mg_send_head.md 2016-07-22 16:15:01 +01:00
Evelyn a11eafc5b3 Update mg_send_response_line.md 2016-07-22 16:13:59 +01:00
Evelyn efe53b57e4 Update mg_printf_http_chunk.md 2016-07-22 16:13:38 +01:00
Evelyn e2330944d4 Update mg_send_http_chunk.md 2016-07-22 16:13:20 +01:00
Evelyn 1c18906db7 Update mg_printf_websocket_frame.md 2016-07-22 16:12:07 +01:00
Evelyn 873ceb48bd Update mg_send_websocket_framev.md 2016-07-22 16:11:32 +01:00
Evelyn a48b955d89 Update mg_send_websocket_frame.md 2016-07-22 16:11:11 +01:00
Evelyn b92fae2bfb Update mg_connect_ws_opt.md 2016-07-22 16:10:30 +01:00
Evelyn 156be17191 Update mg_connect_ws_opt.md 2016-07-22 16:10:12 +01:00
Evelyn 92290cfe81 Update mg_connect_ws.md 2016-07-22 16:09:47 +01:00
Evelyn 29725c97f1 Update mg_send_websocket_handshake2.md 2016-07-22 16:08:59 +01:00
Evelyn 56b9cd14cb Update mg_send_websocket_handshake.md 2016-07-22 16:07:44 +01:00
Evelyn 3550cc8f48 Update mg_set_protocol_http_websocket.md 2016-07-22 16:03:38 +01:00
Deomid Ryabkov 6a3d01ee6b Depend on v7.c properly
PUBLISHED_FROM=cf49d0d345e4a7607c535f9578b8ed4160f2fccd
2016-07-22 14:31:13 +00:00
Evelyn 27986213aa Update mg_check_ip_acl.md 2016-07-22 15:23:11 +01:00
Evelyn a2d07ef983 Update mg_check_ip_acl.md 2016-07-22 15:13:59 +01:00
Evelyn 3cf4e32d9f Update mg_event_handler_t.md 2016-07-22 15:06:40 +01:00
Evelyn a54584b716 Update mg_set_timer.md 2016-07-22 15:06:00 +01:00
Evelyn 51907e2642 Update mg_enable_javascript.md 2016-07-22 15:04:58 +01:00
Evelyn 5dd9d37ef2 Update mg_enable_multithreading.md 2016-07-22 15:04:01 +01:00
Evelyn f900854e0d Update mg_socketpair.md 2016-07-22 14:54:30 +01:00
Evelyn d20e94f763 Update mg_printf.md 2016-07-22 14:53:54 +01:00
Evelyn 58de2ad2d7 Update mg_send.md 2016-07-22 14:53:28 +01:00
Evelyn f30c7b75d0 Update mg_set_ssl.md 2016-07-22 14:52:31 +01:00
Evelyn c5b8e55e12 Update mg_connect_opt.md 2016-07-22 14:48:10 +01:00
Evelyn 559874fce7 Update mg_connect.md 2016-07-22 14:41:40 +01:00
Evelyn 1875653b34 Update mg_bind_opt.md 2016-07-22 14:41:23 +01:00
Evelyn 6df770e72d Update mg_bind.md 2016-07-22 14:39:26 +01:00
Evelyn 51d415c8dd Update mg_add_sock_opt.md 2016-07-22 14:38:44 +01:00
Evelyn 63bf428c34 Update mg_add_sock.md 2016-07-22 14:37:21 +01:00
Evelyn a5d2772082 Update mg_next.md 2016-07-22 14:36:53 +01:00
Evelyn 43c317ef4c Update mg_broadcast.md 2016-07-22 14:36:13 +01:00
Evelyn 01ffdb69d0 Update mg_mgr_poll.md 2016-07-22 14:35:08 +01:00
Evelyn a78f346ac6 Update mg_mgr_free.md 2016-07-22 14:34:04 +01:00
Evelyn 4ae88c859e Update mg_mgr_init.md 2016-07-22 14:33:30 +01:00
Marko Mikulicic e8a97f12d7 Skip C build if not changed - step 1
Note: this is only the first step; the C sources won't be built until
the second step is done.

The actual build takes about 1.3s on cloud2 which still runs the docker
containers and image layers on the very slow spinning disk. cloud3 has
docker mounted on the SSD disk; measured speedups of 20-30%

PUBLISHED_FROM=c5acef1d64ebc8dca8ed31f51685c8b3090c5767
2016-07-22 12:51:18 +00:00
Evelyn 06aabdefbe Update mg_mgr_init.md 2016-07-22 13:48:35 +01:00
Deomid Ryabkov 15643f8e67 Use rand() instead of random(), it's more standard
Remove the random() stubs from the codebase

PUBLISHED_FROM=0f56ec7dffa0af1f5061a17d8801239d6f0e32a5
2016-07-22 11:06:16 +00:00
Deomid Ryabkov b987df1974 Refactor sys_config and ro_vars
Use the same config mechanism for ro_vars as for sys_config, get rid of a bunch of custom code.

PUBLISHED_FROM=d2be76cb97090669dd6a21e95d0ba821eaa1a313
2016-07-21 16:35:59 +00:00
Deomid Ryabkov cbe63d43df Prevent repeated invocation of Clubby handler
PUBLISHED_FROM=de348f944de60d116d9d1f5d18e920991c811fa8
2016-07-21 15:22:36 +00:00
Marko Mikulicic e91a7c9599 Reamalgam after .h edits
PUBLISHED_FROM=da1faa9b46cd0ff22dcba6d324b5847c4a0d42d8
2016-07-21 15:06:41 +00:00
Sergey Lyubka 3054952a5e Add %T to the API ref
PUBLISHED_FROM=f6679ea960b3aa0bc9142515548835ee0f78af67
2016-07-21 14:36:12 +00:00
Artem Bulavin 3244df9cd1 Added UI response on authentication, fixed non-clickable buttons
PUBLISHED_FROM=a4666982707fcc96cfe6e75903cab9ac225351e4
2016-07-21 14:07:13 +00:00
Dmitry Frank 1f75081f6e Add build option V7_NO_COMPILER
Which disables tokenizer, parser, AST, and compiler. On ESP8266, it
frees 21K of ROM.

PUBLISHED_FROM=ff4c53ace6b9056c595b9e12ef3453330d659775
2016-07-21 13:51:54 +00:00
Marko Mikulicic 2c83a50a8a Document %.*Q
PUBLISHED_FROM=5dc567f8978d5414835f7a2338a78ae9eb683f55
2016-07-21 13:38:48 +00:00
Deomid Ryabkov 1c80fc28ee Destroy net interface before invoking MG_EV_CLOSE
So that socket/connection/whatever is really closed by the time user code is run.

Speed up test_http_endpoints by using appropriate wait conditions.

PUBLISHED_FROM=5fc8a772cc2a9c3b8c9dbddde9f99b41ce4d334c
2016-07-20 14:52:12 +00:00
Sergey Lyubka 810eab9a58 Add SSI doc string
PUBLISHED_FROM=73540bf103672916eae35959d5e992a3616a6604
2016-07-20 11:07:37 +00:00
Deomid Ryabkov 256aa0296d Fix compilation for non-MGIOT projects
That don't have CONSOLE_UART defined

PUBLISHED_FROM=7930bb639baf81cff8ce53c6f81e9739668aae08
2016-07-15 13:34:59 +00:00
Deomid Ryabkov 2eb506c5e0 Make console output in SLFS adapter overrideable
PUBLISHED_FROM=455184fbe730cf62340046c73ffd8ae4b0e0a2c1
2016-07-15 13:19:51 +00:00
Deomid Ryabkov 9f78a2902b Fix SSL stuff
Do not use CA bundle on CC3200, it doesn't work.
Make ssl_ca_cert = "*" mean "no verification" and make sure
SSL is enabled on the connection when it's required, even w/o verification.

PUBLISHED_FROM=c8710a5d24ecfe174ef45b7f81c114d41faf5c12
2016-07-14 13:19:55 +00:00
Deomid Ryabkov 613ae4ee34 Fix led toggline in CC3200 sensor demo
PUBLISHED_FROM=10369c7903f3c9433e8c9f6f9725f014aed5768d
2016-07-13 20:04:48 +00:00
Deomid Ryabkov ab208b71c4 Do not define rename() when compiling with TI libc
PUBLISHED_FROM=e9878fc5d55b0b2da854573a7a84e8e14e2f301d
2016-07-13 19:49:47 +00:00
Alexander Alashkin 68dd8d277d Get rid of ubjson
PUBLISHED_FROM=e6f1dca95ec7ed3795adf493cca9cdcdc07381f5
2016-07-12 20:49:59 +00:00
Deomid Ryabkov 36a1927915 Mongoose 6.5
PUBLISHED_FROM=d151a5a0bf34b135a7a2c879f5a6bd5676af275a
2016-07-12 13:20:04 +00:00
Deomid Ryabkov 68437de416 Fix handling of socket write errors
PUBLISHED_FROM=7264edfb3b8e4e37f15f2993f479dfe0a9550b1d
2016-07-12 11:04:59 +00:00
Deomid Ryabkov 459cd1b095 Properly override rename on Newlib
Newlib implements rename as _link and _unlink, not _rename.
There is no _link on either SLFS or SPIFFS, so override rename directly.

PUBLISHED_FROM=ebb54664f8a3c8664ecab1fac021bef286a0e230
2016-07-11 16:49:56 +00:00
rojer 6f7f774080 Merge pull request #678 from tbfly/master
!): Fix for compile error in Android.
2016-07-08 16:51:53 +01:00
Deomid Ryabkov fc0bf1953a Fix and improve sorting on Mongoose index pages
Remember sorting settings in url fragment, reverse order on repeated
header click.

PUBLISHED_FROM=faa033eddc86d0aafc12a86aea4145646ea2c89c
2016-07-07 15:49:59 +00:00
Deomid Ryabkov c907e6c5fb Commonize mg_str
PUBLISHED_FROM=0e6a1c1a2356c1e12580e498c64ba7be367f601c
2016-07-06 23:49:57 +00:00
Deomid Ryabkov 29b3950ee7 Handle SimpleLink restarts in Mongoose
SimpleLink restart invalidates all sockets.
Listeners are restarted, outgoing connections are closed.

PUBLISHED_FROM=15567dfb822bffbd44d39ba0e69a7ac64fd7a1c8
2016-07-06 13:56:50 +00:00
Deomid Ryabkov 0e0c6b8357 Fix off-by one
cesanta/mongoose#677

PUBLISHED_FROM=4b62bdefac08fa3bedf511dc4d6f7463af3325fc
2016-07-06 13:56:48 +00:00
Sergey Lyubka 6f17f3e2c2 Add timers example to mongoose
PUBLISHED_FROM=1599cf1d06c8f177918cbcf574c28c9e93d56d39
2016-07-06 13:56:47 +00:00
Lu ZhiHe df107a272e !): Fix for compile error in Android. 2016-07-06 14:50:08 +08:00
Sergey Lyubka b7a0748312 Ditch JSON-RPC from mongoose
PUBLISHED_FROM=89b978c02be2f10eb930ff13673d45249fd67763
2016-07-01 11:35:18 +00:00
Alexander Alashkin 421b420a0c Fix mp+keepalive combination
PUBLISHED_FROM=dbfcfa91ad85d6447726d0d7e9fe15709f4c4646
2016-06-29 23:12:25 +03:00
Sergey Lyubka a478dc5935 Remove old mongoose logo
PUBLISHED_FROM=2dd69a5db6ca56215726b563e1551c683f21a768
2016-06-28 16:05:04 +00:00
Deomid Ryabkov 4d65cb1c0f Make Mongoose's SHA1 algo pluggable
PUBLISHED_FROM=bdaeed6628ffb544e31d7fd59475f3a2e78c2967
2016-06-28 10:05:31 +00:00
Deomid Ryabkov ced823cd95 Add a radio button to teh settins_panel example
PUBLISHED_FROM=2daba7380508df24d909f922c5009286b4d8e7cf
2016-06-28 09:27:44 +00:00
Deomid Ryabkov 79325bd219 Lower verbosity of a message
PUBLISHED_FROM=3b4cbc497c4a0eee2d46f561c0717415ca85c242
2016-06-27 10:50:32 +00:00
Deomid Ryabkov 5a19135c35 Ignore SL_ENOPROTOOPT w/ DOMAIN_NAME_VERIFICATION
Domain name verification feature was added in NWP service pack
(reported version: 2.6.0.5). Older versions do not support it.
There's not much we can do about it, so we just ignore the error.

PUBLISHED_FROM=9495250de1945aae4f2bdf7dddcd7bf1248e24c2
2016-06-24 13:35:33 +00:00
Deomid Ryabkov 290e5f83d4 Switch to TI compiler + UMM malloc for CC3200
Frees up ~19KB RAM:

Before:
  Code size: 210616
  RAM at startup: 48636 total, 34472 free
  RAM after sys init: 15024 free

After:
  Code size: 195784
  RAM at startup: 65096 total, 52980 free
  RAM after sys init: 34116 free

PUBLISHED_FROM=32a9cb8fb6d75cf428bc3548dd5684ce6e52c508
2016-06-22 19:05:07 +00:00
Deomid Ryabkov b535cb319a Ensure asprintf'd string is NUL-terminated
PUBLISHED_FROM=b4062780d22be37acdbecd86e5951245e2908ff8
2016-06-22 16:20:15 +00:00
Deomid Ryabkov e3a9c6afb4 Mass-fix header guards
PUBLISHED_FROM=7e5fc4da88069a6193d911660f522b43ed1a5d40
2016-06-20 10:50:01 +00:00
rojer 3f1a33e4b4 Handle errors better in listening code for CC3200
PUBLISHED_FROM=9d4ab680fa672690735b827f56e135330f72beed
2016-06-15 13:35:00 +00:00
rojer 441eaa7f6c Handle errors better in listening code for CC3200
PUBLISHED_FROM=9d4ab680fa672690735b827f56e135330f72beed
2016-06-15 14:32:44 +01:00
rojer 632153a1b4 Fix FNC CLI logging
PUBLISHED_FROM=171b25e15cad2c87eb40a8123fe8ea07e34c41f7
2016-06-15 14:32:36 +01:00
Sergey Lyubka f9d0ad9dc3 Do not leak in mg_connect_ws_opt()
PUBLISHED_FROM=e6de3b3747a1cd79c3930c2640fadc8356ffed61
2016-06-15 12:05:00 +00:00
rojer a67323fc12 Change main code image filename in CC3200 bundles
/sys/mcuimg.bin is just another file on SLFS, no reason to give it
special treatment. Preserve backward compatibility with old bundles:
translate sys_mcuimg.bin -> /sys/mcuimg.bin

PUBLISHED_FROM=be89a3d9785046f09279fef9e2bb6604eeaa576e
2016-06-13 15:04:54 +00:00
rojer 1daa5e69b1 Add timestamp to LB log
PUBLISHED_FROM=61b87fcee909241d5bdf2ba7407003c0c3cfbd72
2016-06-13 12:34:30 +00:00
Sergey Lyubka 1718490982 Simplify Contributions section in readmes
PUBLISHED_FROM=3a14579dabba4088e54350945dc17fd6ebb0d700
2016-06-10 12:34:41 +00:00
rojer 1d4f97bb4c SimpleLink net_if impl w/ async support; MG_F_SSL
SimpleLink sockets are suffciently different from BSD that all the
ifdefs have become too messy to warrant a separate net_if
implementation. As part of this we also implement proper async connect
support.

Added MG_F_SSL to identify SSL-enabled connections in a generic way,
since SSL state can be different depending on the implementation.

PUBLISHED_FROM=9cdb8c880b90683e4a26b972cf439d47d6f60917
2016-06-09 17:49:53 +00:00
rojer 183fc7ced9 clang-format *ALL* the things!
PUBLISHED_FROM=faf0beb7545eb426c941fc366b6f87667723eb4c
2016-06-09 11:19:57 +00:00
rojer dcf1cedec9 SimpleLink SSL support; split cert and key opts
SL requires cert and key to be separate files in DER format.

Date verification is disabled for now.

PUBLISHED_FROM=7d76150ed356140728a1e5fd82d8a0456347b7dc
2016-06-09 11:04:56 +00:00
Marko Mikulicic 845e608280 Clean docs while publishing
PUBLISHED_FROM=274a19d6988002fb029e614bffea4083002324a1
2016-06-07 20:40:26 +00:00
rojer d6ecfe7f24 Make error message more clear
PUBLISHED_FROM=f8e052f1a256f671de133135901b509d39608a82
2016-06-07 20:40:25 +00:00
rojer 06b6bf6185 Propagate nc->err to err on CC3200
PUBLISHED_FROM=db7254b5bf25961a700cbce954ef02d41b176500
2016-06-07 16:43:24 +02:00
rojer 04a38b446f Fix compilation with MG_DISABLE_HTTP_WEBSOCKET
Make restful_server and netcat examples compilation tests:
 - netcat doesn't use HTTP, compile it with MG_DISABLE_HTTP
 - restful_server doesn't use websocket, compile it with
   MG_DISABLE_HTTP_WEBSOCKET

h/t @labourcier, cesanta/mongoose#665

PUBLISHED_FROM=4494ac3cbd81e8314beb557ab301b4b44c4afb89
2016-06-07 16:43:24 +02:00
Deomid Ryabkov dfde5785a6 Use fw_meta script from the build image
PUBLISHED_FROM=996721b6d28ee25fcfcb514d716552c4afa238e1
2016-06-02 22:28:48 +01:00
Deomid Ryabkov 1a61455eef Magic numbers are magic
PUBLISHED_FROM=cec68bab53fc81b4085b81fba0c52e0c42b09f0f
2016-05-31 15:36:25 +01:00
Sergey Lyubka 9f2ecb0144 Minor rephrasing in Mongoose overview doc
PUBLISHED_FROM=1562c629ce08004a5243a61eed79e1c3161f1268
2016-05-30 11:17:41 +01:00
Sergey Lyubka 3265060dc8 Add Mongoose overview doc section
PUBLISHED_FROM=9fb2260cd76ae30b51db02053f4d2debf4cdf900
2016-05-30 11:17:40 +01:00
Alexander Alashkin 58b8acd68a Check malloc results, Contribute to cesanta/dev#3726
PUBLISHED_FROM=309be4a56754250406dd48f1abd30b68776f5c7e
2016-05-28 19:06:09 +01:00
Sergey Lyubka 3ec09ceedf Reference media files in doc directly
PUBLISHED_FROM=da22d5ea0aa366d7cb9bba838f8e173ae0178f5e
2016-05-28 19:00:05 +01:00
Sergey Lyubka 1ce4aa81ee Simplify doc generation infra
PUBLISHED_FROM=80e77fda1c358294f251ca77d3dd64e8ca9160e5
2016-05-28 19:00:04 +01:00
Dmitry Frank 177e829f4b Add v7 arg to _mk_ and _get_ functions
`v7_mk_undefined()` and `v7_mk_null()` are left unchanged, but marked
deprecated, and `V7_UNDEFINED` and `V7_NULL` are public now.

Xtensa code size with instrumentation: 590400 -> 590432, i.e. 32 bytes.
Xtensa code size without instrumentation: 530848 -> 531760, i.e. 912
bytes.

As objdump reveals, inside v7.c, `v7_mk_number` and others are inlined,
so the extra v7 argument is eliminated; outside of v7.c it's obviously
not inlined.

----

Also, v7_get_int() is added, which currently just casts stored double
value to int

PUBLISHED_FROM=e984b7308faf2380b3de388f238e0fae0aea545d
2016-05-28 18:59:27 +01:00
Marko Mikulicic b5b672ec89 Implement MQTT connect username/password
PUBLISHED_FROM=be604dc6b3650c78daaa02ea4db8cd067069b5e1
2016-05-18 12:07:20 +03:00
Deomid Ryabkov d41419c8d3 Update the CC3200 build image
* Add TI compiler
 * Remove cc3200prog, we don't use it
 * Update to Xenial (new Ubuntu stable release).
   It has ARM toolchain in the repos too, which is nice (no more PPA).

PUBLISHED_FROM=57d6650b438c5665023346abefbc953263e3f87b
2016-05-16 13:57:14 +03:00
Deomid Ryabkov 5e4d9dc17a Restore REMOTE_ADDR and SERVER_PORT CGI env vars
cesanta/mongoose#573

PUBLISHED_FROM=687722f0dbc3c49e6691e01e0d0b1ab2d181bd2f
2016-05-16 13:57:14 +03:00
Sergey Lyubka 4ac688e560 Make mg_http_check_digest_auth() public
PUBLISHED_FROM=f00b94cabc2a89d27d5bc78d68d67db0930811b4
2016-05-16 13:57:13 +03:00
Deomid Ryabkov 5d0a5cfe72 Add CPP guards to net_if.h
cesanta/mongoose#653

PUBLISHED_FROM=a676dbce6d04b78ca316a4601e9cbb676ecc88d2
2016-05-15 22:07:14 +03:00
Dmitry Frank d4b81bb911 Refactor v7_to_number -> v7_get_double and others
We wanted to avoid `to` since it implies some kind of conversion, but
these functions merely return underlying C entity.

Public API changes:

- `v7_to_number()` -> `v7_get_double()`
- `v7_to_boolean()` -> `v7_get_bool()`
- `v7_to_cstring()` -> `v7_get_cstring()`
- `v7_get_string_data()` -> `v7_get_string()`
- `v7_to_foreign()` -> `v7_get_ptr()`

Private API changes:

- `v7_to_pointer()` -> `get_ptr()`
- `v7_to_generic_object()` -> `get_generic_object_struct()`
- `v7_to_object()` -> `get_object_struct()`
- `to_js_function()` -> `get_js_function_struct()`
- `to_cfunction()` -> `get_cfunction_ptr()`

PUBLISHED_FROM=036ac18d442c1128106292ad3e7a818b177eec6a
2016-05-15 22:07:13 +03:00
Dmitry Frank 23122b327c Remove old docs, rename docs_new to docs
It would be probably good idea to also remove tools/docgen.py and
asciidoc.mk, but asciidoc.mk is still mentioned under `cloud/doc`, which
may contain some useful info which we'll need at least to review before
removing.

PUBLISHED_FROM=faf454d4c52a2f07ea8ac084cf0bd11a0c9c9b3b
2016-05-15 22:07:04 +03:00
Marko Mikulicic f443c64341 Temporarily disable appdash from docker-compose
Until I read the doc and find how to limit the retention,
otherwise it just eats all my ram and cpu and things start to fall
apart.

PUBLISHED_FROM=eb33fb44736f07b992270689217aca4af70513ff
2016-05-15 22:07:04 +03:00
Marko Mikulicic c84af7d1e2 Use stdint.h on MSVC >= 2012
Closes cesanta/mongoose#659

PUBLISHED_FROM=8a2e029715e5e7f9a2c75eea9b55270c51b273ef
2016-05-11 19:30:38 +02:00
Sergey Lyubka 19a28b3c81 Update cs_md5 description according to reality
PUBLISHED_FROM=b9c776bac4c8f2456c71b33641601fb38b30347e
2016-05-03 14:17:15 +02:00
Sergey Lyubka 69944c1d3a Add cookie auth example to Mongoose
PUBLISHED_FROM=88bc5059504cfedd078cab277a6d68d1e583fba1
2016-05-03 13:13:08 +01:00
Deomid Ryabkov 81bf4921d4 Compile mg-iot-cc3200 with ARM compiler, step 1
Code size: 167144 vs 199440

More changes to come (console support, warnings cleanup).

PUBLISHED_FROM=cbc06efcb354c240654518b493496a69293ebc2a
2016-05-03 13:13:04 +01:00
Deomid Ryabkov 91f6eedb24 Remove the definition of UNUSED
It's barely used in our code and conflicts with ont in SimpleLink SDK

PUBLISHED_FROM=ef0fc468d32c9a8e0df888c2de084c08ebe92ea7
2016-05-03 13:13:03 +01:00
Alexander Alashkin dae150a3a5 Split HTTP HWTest
PUBLISHED_FROM=69dc2fadfa0aad32290bd676331b57d0b5595c60
2016-05-03 13:13:00 +01:00
Deomid Ryabkov 8a81dce0c1 Handle orderly shutdown of remote sockets
When getting a EOF from remote, do not close immediately, drain the send
buffer.

PUBLISHED_FROM=e06cdaa2abc0d67d5d88bf3e72d887590a7aeccf
2016-04-29 15:16:46 +01:00
Deomid Ryabkov 203d4a79e2 Improved handling of sockets > FD_SETSIZE
PUBLISHED_FROM=0bf765bf2248d43514643f335592a77d5875618e
2016-04-29 15:16:45 +01:00
Deomid Ryabkov b04d47c3a9 Update README for CC3200 examples
PUBLISHED_FROM=53ce21efbb0e769089293b1aa11d2b2f3136161d
2016-04-28 13:51:20 +01:00
Marko Mikulicic 8fcd1906a2 Minor cleanup after line numbers feature
PUBLISHED_FROM=302ebfe7d711602e75c8db4bc843b0d52a382542
2016-04-28 13:51:19 +01:00
Marko Mikulicic 9939212379 Add c linkage guard to simplelink header
Closes cesanta/mongoose#649

PUBLISHED_FROM=deb804a1257f8a6ecc4bf0f877b70c32f1d39e43
2016-04-28 12:19:27 +02:00
Deomid Ryabkov 38752f1327 Add C decls to TI platform headers
h/t @kzyapkov, cesanta/mongoose#649

PUBLISHED_FROM=c21158c9476b9a4abd281ec99c7fa62ea5e708b8
2016-04-28 11:59:45 +02:00
Alexander Alashkin 6b51ec3371 Reaggange HWTests, move port(s) number to cfg
PUBLISHED_FROM=274bff744d9c3d12285f026d21c1c776946fae20
2016-04-28 11:59:44 +02:00
Deomid Ryabkov 5714056f9f Update websocket_chat, add websocket_chat_client
A number of people asked for a WebSocket client example,
websocket_chat_client is one.

PUBLISHED_FROM=c33e758c0a36a0aa919bdb6ef37ed1478d6b29e2
2016-04-27 17:48:40 +01:00
Deomid Ryabkov 21665e367c Auto-disable CGI if socketpair is disabled
h/t @danielinux, cesanta/mongoose#652

PUBLISHED_FROM=68c9a86280d63d01b6e4cb72aa6cfd766e4d4be3
2016-04-26 21:02:18 +01:00
Deomid Ryabkov dff844b40a Fix Mongoose forum link
It used to link to the SJS forum category, but should point to Mongoose
category instead.

PUBLISHED_FROM=288e1bf1969c46619360dcd8dfd039cdcbc7a59c
2016-04-26 13:30:09 +01:00
Deomid Ryabkov 54403dfcbc cesanta/iot -> cesanta/mongoose-iot
PUBLISHED_FROM=d73a6fff78a063ffe5aaafe841e89e87e37f85d7
2016-04-26 13:30:05 +01:00
Deomid Ryabkov 61672c7805 Properly handle keep-alive connections
HTTP/1.1 connections are keep-alive by default,
HTTP/1.0 are KA only if explicitly requested.

PUBLISHED_FROM=cb2070c2d4e4be6beeab4ae5914b8a01b04bc0cb
2016-04-26 13:30:03 +01:00
Deomid Ryabkov 69bb96113b Add a bit of branding to our responses
Server header and directory index footer

PUBLISHED_FROM=85ced96f70a0241a2970be7613994a3af7238ba9
2016-04-26 13:30:03 +01:00
Marko Mikulicic 51328efb22 Fix srcfs after rename of SJS to IOT
PUBLISHED_FROM=cf8cb1dd2319eafdf6b45a1299e4b12d4808a17c
2016-04-26 13:30:00 +01:00
Evelyn f159666ae3 Update README.md 2016-04-26 11:17:11 +01:00
Deomid Ryabkov 7fdb50807c Resolve *dir function decl conflict on Win32
We used to declare these functions twice: in plaform_windows.h
and cs_dirent.h. Removed decl from platform_windows.h and moved
cs_dirent.h to be privately included by mongoose.c

PUBLISHED_FROM=ab62370409e29e3c62a8b8eab0f75795b5d7ed0f
2016-04-22 16:19:18 +01:00
Marko Mikulicic 890c7b42dc Bulk rename of SJS to FW
PUBLISHED_FROM=03d2fa0b6bf762d09bf5e837cf31e2047bb6eefd
2016-04-22 16:19:17 +01:00
Deomid Ryabkov 55398684cc Ignore "non-errors" when sending
h/t @f00bard

PUBLISHED_FROM=5deab05502797bb6393e8dbbd5684aba4a72a799
2016-04-22 14:23:49 +01:00
Maxim Ignatenko c85edc38aa Switch to MySQL everywhere
PUBLISHED_FROM=1ab69ecfbd03ad3eef82ef785474744e5b5b2e4d
2016-04-22 14:23:40 +01:00
Deomid Ryabkov fa368b56ba Enable compiler optimizations on TI CCS examples
PUBLISHED_FROM=43169a199299bfe4ce349ad9d13f29d77d39ff3b
2016-04-22 12:32:43 +02:00
Deomid Ryabkov 41d7520585 Suppress a TI compiler warning
PUBLISHED_FROM=63810a48861c6e2b3e3eb8bab981927f6f85dd40
2016-04-22 12:32:32 +02:00
Alexander Alashkin 0f23618324 Disable http test
PUBLISHED_FROM=688b64acb8c87e3cd78c79ee2b7667378d697cd8
2016-04-22 12:32:22 +02:00
Deomid Ryabkov bf9a2b45ef SLFS file size hint
PUBLISHED_FROM=532200881406349585612ea5d59aaa323789a688
2016-04-19 17:44:26 +01:00
Deomid Ryabkov 063c017bb7 Update MG_sensor_demo description
PUBLISHED_FROM=7f9ce495d5de71859ad71f2b44db37fa66736835
2016-04-19 17:44:24 +01:00
Deomid Ryabkov 7519a3765b Minot tweaks to MG_sensor_demo
Fix WS connect address
Only update graphs when connected

PUBLISHED_FROM=3a3c4e2d21595f48c811b45fb391f7709dc0bcf7
2016-04-19 13:16:28 +01:00
Alexander Alashkin 56c687b39b Check for null in DNS handler
PUBLISHED_FROM=e8b719d491688032e6395b75d5859ffad7d7ea23
2016-04-19 12:27:49 +01:00
Deomid Ryabkov 083d398631 Only copy questions when creating reply
In particular, there may be additional records which should not be copied

PUBLISHED_FROM=6b348868cb62d7b3fc4df0e935ffd5a31a314a08
2016-04-19 12:27:48 +01:00
Sergey Lyubka 466183113f CC3200 Mongoose example fancy graphs
PUBLISHED_FROM=bb28c3e27228d7c1c95899445b7f450636c34949
2016-04-19 12:27:48 +01:00
Deomid Ryabkov 923c432977 Add C++ externs to common headers
Closes cesanta/mongoose#649

PUBLISHED_FROM=7d331576ba8f75a7a4ebf833e056dc22f6eda811
2016-04-18 16:06:58 +01:00
Deomid Ryabkov e433ba8d7b Clarify debug message a bit
PUBLISHED_FROM=c4f72d1b47508cdc560ec345064ecdfc3b529f5a
2016-04-18 16:06:55 +01:00
Deomid Ryabkov 848c884fff Make sure NWP is stopped before sl_Start
In SDK 1.2.0 TI decided to stop resetting NWP before sl_Start, which in
practice means that sl_start will hang on subsequent runs after the first.

See this post for details and suggested solution:

https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/p/499123/1806610#1806610

However, since they don't provide OS_debug variant of simplelink.a and
adding another project dependency will complicate our demo even more,
we just take the required bit of code.

PUBLISHED_FROM=c729c0fcbb240aa90a716edd43888de5881d6731
2016-04-16 10:32:42 +01:00
Marko Mikulicic 0769bbb7ff Fix mingw warnings
PUBLISHED_FROM=a7c1ec51999b29758d2983900add70069927b27b
2016-04-16 10:32:40 +01:00
Marko Mikulicic 7054b09584 Use invalid socket
Socket type is unsigned int on windows.

PUBLISHED_FROM=fb406d7542ea4d7a529f87b8a3a5a8ba27f5f934
2016-04-15 14:48:25 +01:00
Deomid Ryabkov 2633628ad1 Add MG_hello for CC3200; upload file form
Mg_hello is a simpler example for CC3200
File upload form is served on / if index.html does not exist
and always available on /upload

PUBLISHED_FROM=f844245b26febc4b952e7c52ee4519ddb542072d
2016-04-15 14:48:24 +01:00
Marko Mikulicic e5ae1c2ea3 Fix SJS websocket constructor
Closes cesanta/smart.js#119

PUBLISHED_FROM=b912e99d457dbf21b3f8ccc6a51d0990cc3db833
2016-04-15 14:48:17 +01:00
Marko Mikulicic d2844580a1 Fix mongoose examples krypton build
And add the build to the CI.

PUBLISHED_FROM=b9becbc113e569d7a0e6dcdfd2c34ce704a681bd
2016-04-13 19:19:31 +02:00
Sergey Lyubka 42f5a3e2f7 Use cesanta GA code
PUBLISHED_FROM=197c9c874ea950aae8f3fd475d2a3ff836d0caab
2016-04-13 19:19:27 +02:00
Deomid Ryabkov 8a62005a2d Use _stati64 on mingw64 in 32-bit mode
cesanta/mongoose#644, h/t @spuschhof

PUBLISHED_FROM=2df259156e347b941a75008ce07ea4fc2584dc2a
2016-04-13 12:33:52 +01:00
Sergey Lyubka 616f54c4a2 Better marketing teaser
PUBLISHED_FROM=68b1498bba92e6c23e8d8b2628d22b3bf0524be6
2016-04-13 12:33:50 +01:00
Deomid Ryabkov 2140e5992a Mongoose 6.4
PUBLISHED_FROM=5585ece71e9032b1357ea47fa8de626c52405650
2016-04-12 14:21:12 +01:00
Sergey Lyubka cd38c62430 Fix docs link. Better description
PUBLISHED_FROM=e8dbca39825b461ee671c85540fab1100ee5e4d1
2016-04-12 14:21:08 +01:00
Deomid Ryabkov 67ac6ae191 Fix parsing truncated DNS records
PUBLISHED_FROM=8b849b5dfd72bb3055df34113ec74e47c620af2e
2016-04-12 14:21:06 +01:00
Alexander Alashkin 7addae0fdd Unbreak master again
PUBLISHED_FROM=192978ebdb0df77c32af8675118c0067f093c0e7
2016-04-12 14:21:05 +01:00
Sergey Lyubka a3e8ba5506 Direct link to Mongoose binary
PUBLISHED_FROM=b0dc34c2ee8c9d3dbdabfaac2eb5ce28b3be9f13
2016-04-12 12:37:05 +01:00
Marko Mikulicic 6a302c38ab Fix ourci master port
It conflicted with Workspace service

PUBLISHED_FROM=bd891e246bfa4b8f47bcbc6c9f7e4401f5f6e052
2016-04-12 12:36:58 +01:00
Deomid Ryabkov 129bb6b1c3 Add MSP432 lib and example
PUBLISHED_FROM=57ff02457269938feae805f2972b96b15931d41a
2016-04-12 11:18:37 +01:00
Deomid Ryabkov c8b09c2238 Move mg_task to SimpleLink platform code
It'll be used for MSP432 as well

PUBLISHED_FROM=cb5dcda4cc5d9edc6dea71540d51ab00e252186e
2016-04-12 11:18:37 +01:00
Deomid Ryabkov 76364af243 Fix comment format in http.h
Functions decl must follow comment to be correctly documented

PUBLISHED_FROM=6ab035cda470c2c23240db4435abd8c241c71b0d
2016-04-11 10:56:06 +01:00
Alexander Alashkin 0efa8f9d3f Add UDP echo server Mongoose example
PUBLISHED_FROM=c0ea72104da23a97c81c9f671c9b91d9df2541d1
2016-04-11 09:43:08 +01:00
Deomid Ryabkov f36b452f00 MSP432 port, step 1
Doesn't actually work yet, but bits common with CC3200 (SimpleLink) are
moved out.

PUBLISHED_FROM=9d9a51cf7d8262694199c46bfd0ac514fc88889e
2016-04-11 09:43:07 +01:00
Dmitry Frank 0be132f3b5 Improve Android app
Now it can talk to backend as well to the demo device: `LCD.AddLine`,
`LED.Set`, `LED.Get`.

PUBLISHED_FROM=40f493cdabe6ad23a6f26a4563366bebb5071529
2016-04-11 09:43:04 +01:00
Deomid Ryabkov d31d8a764b Disable SL_INC_STD_BSD_API_NAMING in SimpleLink
And only define bits that we need afterwards.

PUBLISHED_FROM=b7e945dd16c7999753104428e29b5f0c1c9e666f
2016-04-08 10:56:18 +02:00
Deomid Ryabkov 68b29b683d Minor tweak to ESP8266 example
PUBLISHED_FROM=8fdac6c95ae29363fa0a8e519f926742531b9d00
2016-04-08 10:56:16 +02:00
Deomid Ryabkov eee293518c Add a README for CCS projects
PUBLISHED_FROM=3ccf4c043056677cd9c8fbd19e5e36961281af8c
2016-04-08 10:56:13 +02:00
Deomid Ryabkov c4adc86f5e Add CC3200 sensor demo CCS project
PUBLISHED_FROM=36fb960c2fe3d33ccdb8dbfbe4df6df24a9b1df9
2016-04-08 10:56:12 +02:00
Deomid Ryabkov 3ebda76def Add a CC3200 CCS Mongoose library project
PUBLISHED_FROM=27c466d4b289c1839ecd192e40a661728b546fa2
2016-04-08 10:56:11 +02:00
Deomid Ryabkov 7564623d46 Restore function of CS_DISABLE_STDIO
PUBLISHED_FROM=99c1c7a8cfcb84d283e4ed712f4da6879c41209c
2016-04-08 10:56:10 +02:00
Alexander Alashkin dc6b44571f Remove extra function from C-clubby
PUBLISHED_FROM=db9afcafce26d2048b1a5ebc90bcd1c06f555ed8
2016-04-08 10:56:07 +02:00
Deomid Ryabkov ccd0167e40 Switch to CC3200 SDK 1.2.0
PUBLISHED_FROM=857459178e3af50fa6626379d1f71a725cd3b68b
2016-04-06 08:25:50 +01:00
Alexander Alashkin 7dd1004b93 Fix mg examples
PUBLISHED_FROM=dec3ce8a13ff588637601cdb03dbe6196468ba4a
2016-04-06 08:25:50 +01:00
Deomid Ryabkov 19dd02acfd Remove epoll() support
1) It's broken; most likely in more ways than one
2) It doesn't make much sense as long as we maintain MG_EV_POLL and
   have to traverse the list of connections anyway.
3) In Mongoose, simplicity trumps performance.

PUBLISHED_FROM=61d2aeee4f74678bc186063c0977e720a8a414cb
2016-04-05 23:50:24 +01:00
Deomid Ryabkov 5e31914dc1 Fix AP configuration on CC3200
Factor out MG task for clarity and ease of reuse.

PUBLISHED_FROM=18f1aedd3c227b43a49f59a67076905917dd6cab
2016-04-05 23:50:23 +01:00
Deomid Ryabkov 8296e0f485 Do not allocate connection state for MG timers
PUBLISHED_FROM=c7cd64eea0ab7553450c452ac30bdd7a5032cbbe
2016-04-05 23:50:19 +01:00
Alexander Alashkin afa5e3f469 Enable SSL in SJ/WS
PUBLISHED_FROM=d7b3e083c7a7d5095c8e61bb6183ae7e6e068858
2016-04-05 23:50:16 +01:00
Alexander Alashkin f57fcbcb50 Implement connect_ws_opt and connect_http_opt
PUBLISHED_FROM=dcec33211d4c7933bd0a78fdb572556df93e51d2
2016-04-05 23:50:12 +01:00
Alexander Alashkin ce53e9dd2b Fix multipart handling for small files
PUBLISHED_FROM=b43cb8ca061d50ea8c0b6b20287b9382a4a6be22
2016-04-05 23:50:09 +01:00
Alexander Alashkin 55c2634416 Check listener when reusing UDP conn. Closes cesanta/dev#3139
PUBLISHED_FROM=f03f8fad30faee62f290d37b0b909ef49f301b80
2016-04-05 23:50:08 +01:00
Deomid Ryabkov fe0d340c03 Tighten Mongoose footprint defaults
Explicitly loosen them on the "big" platforms.

PUBLISHED_FROM=b4786428402c5da55738d3f7085ab12acf884e74
2016-04-05 23:50:07 +01:00
Alexander Alashkin 5a02c9dbed Fix create and close conn for UDP. Closes cesanta/dev#3162
PUBLISHED_FROM=071fb54d90750143751c1badc52757f0ba90bdb5
2016-04-05 23:50:05 +01:00
Marko Mikulicic 2c4ffcf70d Rename build dir to .build
This allows the bazel `BUILD` file to coexist on case insensitive
filesystems such as on OSX.

PUBLISHED_FROM=35def41bea62ddc623966e26814adddbf53315d5
2016-04-05 23:50:05 +01:00
Deomid Ryabkov 53c3e1338f Update SPIFFS to 0.3.4+
PUBLISHED_FROM=24a6704cdc2433f79e6995d2d83a3e1aac04a8d6
2016-04-05 23:50:04 +01:00
Evelyn 79454a9072 Update README.md 2016-04-04 14:05:44 +01:00
Evelyn 21c2c5650b Update README.md 2016-04-04 13:58:57 +01:00
Deomid Ryabkov 81ee559905 Roll CC3200 support into mongoose.{c,h}
This is less than ideal, but will do for now.

PUBLISHED_FROM=86cdc7eb8567b23520169976fb8a2103353b9416
2016-04-01 03:14:41 +01:00
Deomid Ryabkov 4a637a6e9a Refactor CC3200 example
Move data collection out of main.c

PUBLISHED_FROM=0340ebcea62a12275e915f325483603e72ff4183
2016-04-01 03:14:41 +01:00
Deomid Ryabkov aaf4802d80 Add file upload to CC3200 example
PUBLISHED_FROM=126bfdb9369f4bc2f09a21400caf797d995bef5b
2016-04-01 03:14:40 +01:00
Deomid Ryabkov 96310d761b Make CC3200 SLFS use "SL:" prefix
This is to make it compatioble with "devices" used in TI's libc.

Files without any "device" go to SPIFFS.

PUBLISHED_FROM=9adb888951389ccc43974537ee827a8240d79988
2016-04-01 03:14:39 +01:00
Deomid Ryabkov 96150bf568 Commonize file upload and make it part of Mongoose
PUBLISHED_FROM=23819ed308aeb8c1d6bdb08f5edd257df458ab38
2016-04-01 03:14:38 +01:00
Deomid Ryabkov f49df51544 Change mg_match_prefix_n to take mg_str
Part of general drive to use mg_str instead of pointer + length.
Adda unit test for mg_match_prefix.

PUBLISHED_FROM=1402506769b0941c6dbe6ae06e03e41df32d6008
2016-04-01 03:14:35 +01:00
Deomid Ryabkov 673796fb3a Improve HTTP erro reporting (send reason)
A few tweaks to TI example
Clean up mbuf_insert code a bit

PUBLISHED_FROM=00ed7aff05d6b760e10c7f14a503eccfc9a284bd
2016-04-01 03:14:32 +01:00
Deomid Ryabkov 482ab33c03 Move printing log prefix into a separate function
Reduces code size a bit and makes it cleaner

PUBLISHED_FROM=c08064102dc64f59dcdc1f80655f32e1ed94c850
2016-04-01 03:14:30 +01:00
Deomid Ryabkov fb53cd37e7 Make it possible to set log file
And use stdout for CC3200 demo because
  (1) an apparent bug which causes output sent to stderr to be
      printed v-e-r-y s-l-o-w-l-y (yes, it is really like that;
      https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/501881)
  (2) in CCS it is printed in BLOOD RED, which is annoying

PUBLISHED_FROM=36a86744bc8ea193e99e98670dadc7f3ab6ed53e
2016-04-01 03:14:29 +01:00
Sergey Lyubka c9fc7a1320 Fix JSON-RPC error formatting
PUBLISHED_FROM=9af7e0a2a90fab6e012174c154f62ee29c8b879c
2016-04-01 03:14:27 +01:00
Deomid Ryabkov 5f59b7e747 Enable SSI on CC3200 (w/o exec)
Disable CGI automatically, as it's never going to work.

PUBLISHED_FROM=37d7abc54be4637dfec5031bc3398e97a1be3090
2016-04-01 03:14:26 +01:00
Marko Mikulicic 024b24932c Redo amalgamation
Something went horribly wrong

PUBLISHED_FROM=879eac719f4a7feaa2b6ddf87cc86af72cdc1deb
2016-04-01 03:14:25 +01:00
Deomid Ryabkov 604c0b189f MG_CC3200 -> MG_SOCKET_SIMPLELINK; some cleanups
PUBLISHED_FROM=865b94073c5ed088847d05f57c1103119648fcaa
2016-04-01 03:14:25 +01:00
Alexander Alashkin 356f1f5119 Fix connection reuse in mg_if_recv_udp_cb
PUBLISHED_FROM=5d248fd465ade7f42293611bc2d60ed72439a489
2016-04-01 03:14:22 +01:00
Deomid Ryabkov 06659844b6 Making Mongoose compile with TI compiler on CC3200
Part 1

PUBLISHED_FROM=a949d11b5cc578adf050f1b1d00375a2f91dfc0b
2016-04-01 03:14:20 +01:00
Deomid Ryabkov 57cf363be9 Reamalgamate mongoose.h
PUBLISHED_FROM=2a83a296ff67e02c0ed761ae0060d1252c2be89f
2016-04-01 03:14:19 +01:00
Deomid Ryabkov 2fc1ff68cf Fix receive on UDP connections
Should only read on outgoing or listening "connections"

PUBLISHED_FROM=e84ff26b899a5f29ddef29ad6c5ba1d18e76e4ad
2016-04-01 03:14:18 +01:00
Deomid Ryabkov 6c4fecc4f7 TI compiler cannot analyze returns from branches
Thinks that mg_ws_random_mask does not return a value.
Help the poor, mentally challenged compiler.

PUBLISHED_FROM=e7c0c47dd2fcbb4e847515892939d69c7a573c2e
2016-04-01 03:14:17 +01:00
Deomid Ryabkov 0991ad7cc8 Minor cleanup
TI compiler detects "multipart" as unused

PUBLISHED_FROM=ababf8965a742418cff610df319e4d8c42e02439
2016-04-01 03:14:17 +01:00
Deomid Ryabkov d03b96b699 Reamalgamate mongoose.h
PUBLISHED_FROM=d61816815bd92a70c02ef327572b282426a001a9
2016-03-25 17:11:02 +00:00
Deomid Ryabkov a690c1442f Make CC3200 example work with XCC3200HZ
PUBLISHED_FROM=42b188c5ae85742681266fee21ec0b0472912743
2016-03-25 17:11:01 +00:00
Deomid Ryabkov d742b67878 Fix address stringification on CC3200 (SimpleLink)
PUBLISHED_FROM=b741acc999d0d2160528b4cb805f315b926ac65b
2016-03-25 17:11:01 +00:00
Deomid Ryabkov 41971a95b2 Add LED status and accelerator data feed
It is also possible to control LED by sending a command:
  {"t": 1, "v": 0/1/2}
0/1 = off/on, 2 = toggle

PUBLISHED_FROM=da176b70c4cd356c5d56eca58c2926619748d895
2016-03-25 17:10:57 +00:00
Deomid Ryabkov b6d700077a Add websocket data feed, send temperature data
PUBLISHED_FROM=e56601f99ccf80d8420b4b54b0ef7c272ec4a656
2016-03-25 17:10:56 +00:00
Deomid Ryabkov c091e6910b CC3200 build cleanup; commonized fw_meta targets
Some yak shaving along the way

PUBLISHED_FROM=09c7cfbd98dcec961970dfad3f38e67912a5b06c
2016-03-25 17:10:54 +00:00
Marko Mikulicic 35f633b533 Fix def_property owning
PUBLISHED_FROM=8e2f5f05e6bc7654217b1f5aaa8520366f9d6759
2016-03-25 17:10:51 +00:00
Evelyn 85e4ed7c25 Update README.md 2016-03-25 16:41:32 +00:00
Deomid Ryabkov 3b345a81c4 Add debug info to websocket conns
PUBLISHED_FROM=7454716e089be5c54359113cc188215e2475ea29
2016-03-22 12:51:48 +00:00
Alexander Alashkin a55c48a4ce Finally remove AVR from mongoose.h
PUBLISHED_FROM=23d528a7fcc98abcc4a95fd43a96d9c4ebabc5f7
2016-03-22 11:45:49 +00:00
Deomid Ryabkov 6f4c21c218 Do not bypass auth when handling CGI request
PUBLISHED_FROM=9faccf9fedd92d0fb54b7ff660c0cf99c1cbdb74
2016-03-22 11:45:49 +00:00
Dmitry Frank 5060640408 Docs: images are in the same dir as index.html
This simplifies writing markdown docs (no need to specify relative path
to images)

PUBLISHED_FROM=039a563b2f7e6a2fbb2a9424ac5315b2496ca184
2016-03-22 11:45:48 +00:00
Deomid Ryabkov f1cc8379e7 ESP8266_RTOS example tweaks
PUBLISHED_FROM=11096f272afc0716e0677c68d58ebf4d4e001a47
2016-03-21 22:45:54 +00:00
Deomid Ryabkov 4f9627c612 CC3200 FS refactoring and basic Mongoose example
Moved filesystem-related code out of SJS and into common.
Made it possible to have one, both or no filesystems enabled.
FailFS is now SimpleLinkFS, SLFS (ahem).

Example just serves a "Hello, world!" index page for now.

PUBLISHED_FROM=0e98ee4b8d95782c10791522c42eae5a7ba314f9
2016-03-21 22:45:53 +00:00
Deomid Ryabkov 012f241005 Fix the ESP8266_RTOS example, add it to CI
PUBLISHED_FROM=3d58ec06fe3108a81d1c35f8261783690bb12c4d
2016-03-21 22:45:53 +00:00
Marko Mikulicic ccf67dbf05 Add smart.js repo to srcfs
PUBLISHED_FROM=ebcd95607742a327cc0f453681f576982a8f027d
2016-03-21 22:45:51 +00:00
Marko Mikulicic a43709b4a8 Fix MQTT parsing of nullary commands
Closes cesanta/smart.js#619
Also http://forum.cesanta.com/index.php?p=/discussion/35/mixing-up-http-and-mqtt&#

PUBLISHED_FROM=ee040880b75048192c111c602610460071f33066
2016-03-21 13:29:39 +01:00
Alexander Alashkin e95c074965 Replace strnlen with c_strnlen
PUBLISHED_FROM=815cfaea77171761c952966e98466b87b719de06
2016-03-21 13:29:35 +01:00
Alexander Alashkin 4ca73566b6 Reamalgamate mongoose.h
PUBLISHED_FROM=441c74c182ef15f3eaeedd19add3411d7e121170
2016-03-21 13:29:34 +01:00
Dmitry Frank d0b347517c Fix comment for mg_event_handler_t
PUBLISHED_FROM=cd50a664039b4a74cb7d4d08990f415912585f7d
2016-03-21 13:29:31 +01:00
Dmitry Frank 7bed7ff482 Docs are generated for Mongoose
Comments in headers are changed a bit: removed adoc-specific stuff,
markdown is used instead

PUBLISHED_FROM=9242cce85cc52a47a197d377e7e23804721a6bb5
2016-03-21 13:29:29 +01:00
Marko Mikulicic d38b0dbf5b Add command to extract build info from metadata
This will allow to recreate the metadata after patching the FS.

PUBLISHED_FROM=dae228bbf49d71f383e4dc52316cf98aba3914f5
2016-03-21 13:29:24 +01:00
Marko Mikulicic 29d6c4ac04 Fix url path parsing
The url parser had two bugs:
- `http://example.com` -> `GET // HTTP/1.1`
- `foo://bar/baz` -> path is `"baz"` instead of `"/baz"`

Now the path returned by  `mg_http_common_url_parse` always
starts with `/`.

Closes cesanta/mongoose#631

PUBLISHED_FROM=f56ed97361ca14ee31d6ed26cf7afe5cd11e0dc5
2016-03-17 13:57:11 +01:00
Deomid Ryabkov 8148b6d037 SJ timer API cleanup; added setInterval and clear*
Timers/intervals are now implemented on top of Mongoose.
Got rid of all the platform-specific code (yay!)

Added interval support and ability to clear previously added timeouts.

PUBLISHED_FROM=93866dd80b95b0fa6e137d87f86138330e720154
2016-03-17 10:43:20 +01:00
Deomid Ryabkov 3327e0e871 Make it legal to have a conn with INVALID_SOCKET
E.g. a timer-only connection

PUBLISHED_FROM=e8d4d2b6e5e0dfa8e8f987b2ded6b973c39e2919
2016-03-17 10:43:19 +01:00
Alexander Alashkin 0456f0f59b Fix boundary problem
PUBLISHED_FROM=b78c97a337208007e1f622fde072cd59664ef76f
2016-03-17 10:43:18 +01:00
Deomid Ryabkov 72cf78de2c CC3200 fixes
Increase heap size to 44K (13K free after init)
Add File.list() support
Fix a bunch of bugs in file support
Disable sys_init.js, there just isn't enough RAM...

PUBLISHED_FROM=2121b8758f0596da39c3eafcfff36337a1b90b74
2016-03-17 10:43:17 +01:00
Deomid Ryabkov 1d0a89879c Include Winsock2 headers
Contributed by @f4bsch in https://github.com/cesanta/mongoose/pull/626
Submitting here with a minor change: MSDN says that ws2ipdef.h should
not be included directly and users should include ws2tcpip.h

PUBLISHED_FROM=1ebe7eac0cf87b0554432b94049b3d58bf7640f7
2016-03-15 13:35:07 +01:00
Deomid Ryabkov d1cc952859 Add a tool to fix header guards, apply globally
Identifiers starting with _ are reserved, fix those.
Wrote a tool to do it and applied it globally, why not.

PUBLISHED_FROM=db0fa27c90cbfb06ed06469406f9867c5a5bd3c4
2016-03-14 17:42:20 +01:00
Deomid Ryabkov f56c5b201d Do not set cipher list if PFS is disabled
Remove Krypton TODO: SSL{,_CTX}_set_cipher_list have been added
(but these ciphers are not supported).

Fixes cesanta/dev#2975

PUBLISHED_FROM=25bf330b785f0a61e18ba409069ebccbd50dcf65
2016-03-14 17:36:58 +01:00
Alexander Alashkin 077b9eb7a4 Fix var initialization
PUBLISHED_FROM=87ce6442efb2c725025942381c01ae2a2de738c7
2016-03-14 14:32:36 +01:00
Deomid Ryabkov 15c333feb0 Increase buffer size for the range header
This should cover 2^64-2^64/2^64

H/T @julee

PUBLISHED_FROM=bcc9f0193ab52375ece00a34c5758ddfe3b628c6
2016-03-14 14:32:35 +01:00
Alexander Alashkin 31c20ab32c Replace m-part&endpoints mbufs with plain structs
PUBLISHED_FROM=b30cf26077b7c6374f0d588e5ef5ba504f979bb3
2016-03-14 14:32:35 +01:00
Deomid Ryabkov 69215cf9eb Adjust poll timeout if there are timers enabled
PUBLISHED_FROM=bbdc998ab4170d55d40d067bab027ae52c9304ec
2016-03-13 15:49:08 +01:00
Marko Mikulicic f89b51eace Amalgamation fix
PUBLISHED_FROM=b92c75e2fc56d1243187b8516bec54b03a7b1043
2016-03-13 15:49:07 +01:00
Alexander Alashkin c581b5e532 Add mg/examples-wine to OurCI
PUBLISHED_FROM=2781248e982719cda495370a373f66d6e4213d83
2016-03-10 13:11:23 +01:00
Alexander Alashkin df311203dc Fix mongoose/examples compilation with mingw
PUBLISHED_FROM=46800f43ba03082cc589d70e6118d754f4cdc9d0
2016-03-10 13:11:22 +01:00
Alexander Alashkin 4927195ee4 Use mongoose event to free updater resources
PUBLISHED_FROM=3044287fe2623b591ddbf5c619398c21d6753411
2016-03-10 13:11:22 +01:00
Alexander Alashkin 63be1ebd38 Mongoose MSVC2015 warnings cleanup, part1
PUBLISHED_FROM=9e173215ed69464d1aa421d43a8fda814f36f96d
2016-03-08 08:44:23 +01:00
Alexander Alashkin 796dc18cfb Move http endpoints away from mg_conn and more
PUBLISHED_FROM=abd5bcf168194f9d38fbcbf3725eaae209e42fc4
2016-03-08 08:44:23 +01:00
Marko Mikulicic 14e116553f Add mg_connect_ws helper
PUBLISHED_FROM=0ff1c9becea2f0842dcf020d2d2ad64a8c5d95ae
2016-03-08 08:44:23 +01:00
Marko Mikulicic c82ccd6cf7 Simplify http client example
PUBLISHED_FROM=64a91c5d261338c7c224340943d63d4b753ee303
2016-03-08 08:44:21 +01:00
Evelyn 0adb080319 Update mongoose README.md
PUBLISHED_FROM=fa91aef8133ce514b799c07dcb842fe8ea999d55
2016-03-04 16:09:42 +01:00
Alexander Alashkin dbb38fffae Make (http) proto_data persistent
PUBLISHED_FROM=8210f4730a3411b3298274d792fc33da79f47b8a
2016-03-04 16:09:42 +01:00
Marko Mikulicic 672a68219a Fix a few build issues on OSX
PUBLISHED_FROM=d6e7ab0b45c960a4ca0bcb56cbc26bc05d641374
2016-03-04 16:09:41 +01:00
Alexander Alashkin 22cb0efd00 Implement FW upload via POST
PUBLISHED_FROM=6167cc57df932f6c113d03096eba0af0b456c3c3
2016-03-04 16:09:41 +01:00
Deomid Ryabkov a68d3d63b2 Make mg_mk_str take NULL, rename MG_STR MG_MK_STR
PUBLISHED_FROM=77f24c29667ca2aed3ad8a5102d7e1264f84228b
2016-03-04 16:09:39 +01:00
Evelyn cf48c7280a Update README.md 2016-03-03 10:27:45 +00:00
Evelyn 1295973028 Update README.md 2016-03-01 10:41:24 +00:00
Evelyn d5b9eda0f2 Update README.md 2016-03-01 10:40:14 +00:00
Evelyn 41c078d25c Update README.md 2016-03-01 10:36:33 +00:00
Evelyn 5614224e7d Update README.md 2016-03-01 10:04:57 +00:00
Evelyn 9ba44cb0d5 Update README.md 2016-03-01 10:04:10 +00:00
Deomid Ryabkov c18828af7b Digest auth fixes
PUBLISHED_FROM=dda24a5bdb42848a74460865dd23794941b46bd4
2016-03-01 09:53:50 +00:00
Marko Mikulicic 8a5f8439b4 Make sure iobuf is renamed to mbuf everywhere
PUBLISHED_FROM=b1049c57352286abda168df521002cfc87136fd6
2016-03-01 09:53:49 +00:00
Deomid Ryabkov 8f0374569e Increase buffer size for cnonce
PUBLISHED_FROM=0dcb2aba0c00da6803227c775e2178230c195f5f
2016-02-29 19:14:53 +00:00
Deomid Ryabkov 09dde636d2 Fix image
PUBLISHED_FROM=1dc0b60738c763dc0d9a939c255c7fbd431e96e5
2016-02-29 14:56:25 +01:00
Deomid Ryabkov d347247bf3 Add POST file upload to SJ web interface
PUBLISHED_FROM=b9575b2dd1da21b40bbfbf98d7c0cf835442c46a
2016-02-29 14:56:25 +01:00
Alexander Alashkin a6c66fb669 Implement multipart streaming in MG (edition 2)
PUBLISHED_FROM=de89316ca3b53b8eb46ea69e88b5fbd277c80dc2
2016-02-29 14:56:24 +01:00
Deomid Ryabkov b4dbc825b1 Minor fixes to Mongoose
PUBLISHED_FROM=8a8692e5cfaab63723fc9e241a50e8f229a26438
2016-02-29 14:56:23 +01:00
Deomid Ryabkov 4a0cc8223e Add SSL options to mg_{bind,connect}_opt
PUBLISHED_FROM=7e28eb43742b76c073c9c2c879c64d7b4d3e9a7e
2016-02-25 12:53:04 +00:00
Marko Mikulicic 7db10857b3 Fix build with clang
PUBLISHED_FROM=0cec0e6db4f46a76130fa7b6ec955d4151b28aae
2016-02-25 12:53:03 +00:00
Deomid Ryabkov 7e927b43ad Initial support for SSL in TCPUART 2
PUBLISHED_FROM=93cb3cf49ce9173a7361af17c1bd47858bb2602e
2016-02-25 12:53:03 +00:00
Deomid Ryabkov 9eea072f2a Add optional log of timestamp difference
PUBLISHED_FROM=046ac695f1c771ab156bdd950a8d5cbecbf65bfa
2016-02-25 12:53:02 +00:00
Deomid Ryabkov aa2ff674db Call recved when data is consumed from recv_mbuf
PUBLISHED_FROM=5fb212ed3114c57182781d441b6886cf83100a76
2016-02-25 12:53:01 +00:00
Deomid Ryabkov de24bfdf2f Include limits.h
PUBLISHED_FROM=7d50ad891fa2b24e119dd1f34037134effbc8d9f
2016-02-25 12:53:01 +00:00
Sergey Lyubka 2a084c3d98 Add GA hooks to mongoose & smartjs repos
PUBLISHED_FROM=3725cf834eb1d2bf12f8d03d7a590de8b1af63d4
2016-02-25 12:53:01 +00:00
Alexander Alashkin db8df41396 Implement mg_register_http_endpoint
PUBLISHED_FROM=357e722e80a2597aa3959756e69db03dc1057ded
2016-02-19 10:14:51 +00:00
Marko Mikulicic bda05d9372 Import frozen
PUBLISHED_FROM=9f6f38e92b5952b9571d73569c2752b6805f15c5
2016-02-15 15:48:12 +01:00
Marko Mikulicic 59bc2af4d6 Add contribution files
PUBLISHED_FROM=596d1e99df9c282aa8a0daa65346d8dfd7c583de
2016-02-15 15:48:11 +01:00
rojer 00a23ee330 Good bye osdep.h, you won't be missed
PUBLISHED_FROM=f08a8324dfde5f9e22eee0e5e4dbae0e3d45cb3f
2016-02-13 13:59:16 +00:00
Deomid Ryabkov 51ad50a641 Rewrite URI -> path mapping, Windows fixes
PUBLISHED_FROM=6088958e92af2b028646816435892828ce9f7625
2016-02-13 13:59:16 +00:00
Alexander Alashkin 148e1926e8 Fix crash in c_vsnprintf
PUBLISHED_FROM=020d1b9ea66862f71b08232b827cdd6e97528765
2016-02-13 13:59:15 +00:00
Alexander Alashkin 96c023df41 Add zx/zd/zu support to c_vsnprintf
PUBLISHED_FROM=83bf0e541a8541e484a83390108ca73d3af95c38
2016-02-13 13:59:15 +00:00
Deomid Ryabkov 44f37f49a1 Fix line numbering in amalgamated files
PUBLISHED_FROM=318aa2504072cc4a480fc92791d13847c2b10e30
2016-02-13 13:59:13 +00:00
Marko Mikulicic a8a30f6d3f Add short copyright notice in every source file
PUBLISHED_FROM=e3f3ffcd3715811d4bb7b3d0bd48184fbd371b26
2016-02-13 13:59:08 +00:00
Deomid Ryabkov ba80b1cd55 Add LICENSE file to F&C, update dates
PUBLISHED_FROM=497f03d8f49dd383e48f919715126d3d22ada7bc
2016-02-13 13:59:04 +00:00
Alexander Alashkin b56e985ccc Use mg_parse_uri in ws, add mg_mk_str function
PUBLISHED_FROM=650ce03aaf53f4c501fbb77a3ae0b584278e299a
2016-02-13 13:59:02 +00:00
Marko Mikulicic 67521fd9f6 Fix parse uri
PUBLISHED_FROM=9bc251ed259e909a8438f95a82d0a229b5a834cf
2016-02-13 13:59:02 +00:00
Marko Mikulicic 8c394f44b8 Implement mg_parse_uri
PUBLISHED_FROM=43d7e3f56cd5d45c8070ab55acdc091e61839681
2016-02-13 13:59:02 +00:00
Marko Mikulicic 77b4fff268 Fix mongoose doc formatting
PUBLISHED_FROM=b7b7dd5f9f4b86a9698add4484b948b4088a99c4
2016-02-13 13:59:01 +00:00
Dmitry Frank f56a0c6075 v7_is_true() -> v7_is_truthy()
PUBLISHED_FROM=73acce1507eb41f264f117b0775efea16db42ec1
2016-02-13 13:59:01 +00:00
Dmitry Frank 9ce8486059 Rename v7_create_ -> v7_mk_
PUBLISHED_FROM=58f7275b4b250b5bfccaf6539a2915c2c253e95c
2016-02-13 13:58:59 +00:00
Dmitry Frank 04a321150a Refactor in setting properties
PUBLISHED_FROM=d40355050f1a11ca26274c33e48f5175d7b76cb0
2016-02-13 13:58:58 +00:00
Alexander Alashkin d333c3c09e Implement fake DAV LOCK
PUBLISHED_FROM=0ea0d8623ab3f59de8996f6b18712d1b3fb120f8
2016-02-13 13:58:58 +00:00
2911 changed files with 1704222 additions and 165764 deletions

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
BasedOnStyle: Google
AllowShortFunctionsOnASingleLine: false
SpaceAfterCStyleCast: true
PointerBindsToType: false
DerivePointerBinding: false
IncludeBlocks: Preserve
+13
View File
@@ -0,0 +1,13 @@
- 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): _?_
+35
View File
@@ -0,0 +1,35 @@
name: CIFuzz
on:
pull_request:
paths:
- "mongoose.c"
- "mongoose.h"
jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^src/' ; then echo GO=1 >> $GITHUB_ENV ; fi
- name: Build Fuzzers
id: build
if: ${{ env.GO == 1 }}
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'mongoose'
dry-run: false
language: c++
- name: Run Fuzzers
if: ${{ env.GO == 1 }}
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'mongoose'
fuzz-seconds: 600
dry-run: false
language: c++
- name: Upload Crash
uses: actions/upload-artifact@v1
if: env.GO == 1 && failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts
+35
View File
@@ -0,0 +1,35 @@
name: "CodeQL Scanning"
# https://github.com/github/codeql-action
on:
push:
paths:
- "Makefile"
- "mongoose.c"
- "mongoose.h"
- test/unit-test
- test/mip-test
env:
IPV6: 0
jobs:
CodeQL-Build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
permissions:
security-events: write
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
- run: |
make test CC=gcc ASAN= ASAN_OPTIONS=
./test/setup_ga_network.sh && make mip_test CC=gcc ASAN= ASAN_OPTIONS=
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
+385
View File
@@ -0,0 +1,385 @@
name: build
on:
push:
paths:
- "**Makefile"
- "**.c"
- "**.h"
env:
IPV6: 0
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [gcc, clang, g++, clang++]
target: [test, mip_test]
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"]
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:
CC: ${{ matrix.cc }}
SSL: ${{ matrix.ssl }}
TFLAGS: ${{ matrix.select }}
steps:
- uses: actions/checkout@v3
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_ga_network.sh && sudo apt -y update ; sudo apt -y install libmbedtls-dev && make ${{ matrix.target }}
s390:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make s390
armhf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update ; sudo apt -y install qemu binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make armhf
linux2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
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 libmbedtls-dev valgrind
- if: ${{ env.GO == 1 }}
run: make unamalgamated && make valgrind && make mg_prefix
macos:
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
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- uses: actions/checkout@v3
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 jq mbedtls openssl
- 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:
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:
- uses: actions/checkout@v3
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 ${{ matrix.target }}
arm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make arm
riscv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make riscv
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
test_f7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-f7.*-make-" ; 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/stm32/nucleo-f746zg-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- if: ${{ env.GO == 1 }}
run: make -C examples/stm32/nucleo-f746zg-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- if: ${{ env.GO == 1 }}
run: make -C examples/stm32/nucleo-f746zg-make-freertos-tcp test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- 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 ; fi
- if: ${{ env.GO == 1 }}
run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
- if: ${{ env.GO == 1 }}
run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f746zg-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=5
- if: ${{ env.GO == 1 }}
run: make -C test/cube test PROJECTS=../../examples/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@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-f4.*-make-" ; 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/stm32/nucleo-f429zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- if: ${{ env.GO == 1 }}
run: make -C examples/stm32/nucleo-f429zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- 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 ; fi
- if: ${{ env.GO == 1 }}
run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
- if: ${{ env.GO == 1 }}
run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
- if: ${{ env.GO == 1 }}
run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-f429zi-cube-freertos-lwip VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=2
test_h7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h7.*-make-" ; 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/stm32/nucleo-h743zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- if: ${{ env.GO == 1 }}
run: make -C examples/stm32/nucleo-h743zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- run: echo GO=0 >> $GITHUB_ENV ; if ./test/match_changed_files.sh '^src|examples/device-dashboard|examples/stm32/nucleo-h7.*-cube-'; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-h743zi-cube-baremetal-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
- if: ${{ env.GO == 1 }}
run: make -C test/cube test PROJECTS=../../examples/stm32/nucleo-h743zi-cube-freertos-builtin VCON_API_KEY=${{secrets.VCON_API_KEY}} DEVICE=6
test_h5:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h5.*-make-" ; 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/stm32/nucleo-h563zi-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
# - if: ${{ env.GO == 1 }}
# WIP run: make -C examples/stm32/nucleo-h563zi-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_rt1020:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- run: if ./test/match_changed_files.sh "^src|examples/nxp/rt1020.*-make-" ; 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/nxp/rt1020-evk-make-baremetal-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- if: ${{ env.GO == 1 }}
run: make -C examples/nxp/rt1020-evk-make-freertos-builtin test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_tm4c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/ti/ek-tm4c" ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
- if: ${{ env.GO == 1 }}
run: make -C examples/ti/ek-tm4c1294xl-baremetal test VCON_API_KEY=${{secrets.VCON_API_KEY}}
- if: ${{ env.GO == 1 }}
run: make -C examples/ti/ek-tm4c1294xl-freertos test VCON_API_KEY=${{secrets.VCON_API_KEY}}
test_same54:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/microchip/same54-xpro" ; 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/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
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/rp2040/pico-w5500" ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
- if: ${{ env.GO == 1 }}
run: make -C examples/rp2040/pico-w5500 test VCON_API_KEY=${{secrets.VCON_API_KEY}}
arduino:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^examples/arduino|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: make -C examples/arduino arduino-xiao
# - if: ${{ env.GO == 1 }}
# run: make -C examples/arduino arduino-nano
- if: ${{ env.GO == 1 }}
run: make -C examples/arduino clean
matrix_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- path: esp32/device-dashboard
- path: esp32/uart-bridge
- path: esp8266/http-client-server
- path: microchip/same54-xpro/device-dashboard
- path: microchip/same54-xpro/mqtt-client
- path: infineon/infineon-xmc4700_4800-lwip-rtx-rtos
- path: nxp/nxp-mimxrt1020-azurertos
- 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/rt1020-evk-make-baremetal-builtin
- path: nxp/rt1020-evk-make-freertos-builtin
- path: nxp/nxp-twrk65f180m-lwip-freertos
- path: nxp/nxp-twrkv58f220m-lwip-freertos
- path: rp2040/pico-rmii
- path: rp2040/pico-rndis-dashboard
- path: rp2040/pico-w
- path: rp2040/pico-w5500
- path: stm32/nucleo-f429zi-make-baremetal-builtin
- path: stm32/nucleo-f429zi-make-freertos-builtin
- path: stm32/nucleo-f429zi-make-baremetal-builtin-rndis
- 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-rndis
- path: stm32/nucleo-g031-make-baremetal-builtin
- path: stm32/nucleo-h563zi-make-baremetal-builtin
- path: stm32/nucleo-h563zi-make-freertos-builtin
- path: stm32/nucleo-h743zi-make-baremetal-builtin
- path: stm32/nucleo-h743zi-make-freertos-builtin
- path: ti/ti-ek-tm4c1294xl-http-server
- path: ti/ek-tm4c1294xl-baremetal
- path: ti/ek-tm4c1294xl-freertos
name: ${{ matrix.example.path }}
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
cube_examples:
runs-on: ubuntu-latest
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 ; fi
- if: ${{ env.GO == 1 }}
run: cd test/cube && make
zephyr_examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh '^src/.*.[ch]|^examples/zephyr'; then 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
if: ${{ env.GO == 1 }}
uses: mikefarah/yq@master
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
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr update
- if: ${{ env.GO == 1 }}
run: make -C examples/zephyr/device-dashboard build
- if: ${{ env.GO == 1 }}
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
+3 -3
View File
@@ -1,5 +1,5 @@
Copyright (c) 2004-2013 Sergey Lyubka <valenok@gmail.com> Copyright (c) 2004-2013 Sergey Lyubka
Copyright (c) 2013-2015 Cesanta Software Limited Copyright (c) 2013-2023 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
@@ -13,4 +13,4 @@ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. See the GNU General Public License for more details.
Alternatively, you can license this software under a commercial Alternatively, you can license this software under a commercial
license, as set out in <https://www.cesanta.com/license>. license, as set out in <https://mongoose.ws/licensing/>.
+188
View File
@@ -0,0 +1,188 @@
SRCS = mongoose.c test/unit_test.c test/packed_fs.c
HDRS = $(wildcard src/*.h) $(wildcard src/drivers/*.h)
DEFS ?= -DMG_MAX_HTTP_HEADERS=7 -DMG_ENABLE_LINES -DMG_ENABLE_PACKED_FS=1 -DMG_ENABLE_SSI=1 -DMG_ENABLE_ASSERT=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_BIN ?= docker
DOCKER ?= $(DOCKER_BIN) 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))
EXAMPLES_MAC := $(filter-out examples/mip-pcap/ examples/mip-tap/, $(EXAMPLES))
EXAMPLES_WIN := $(dir $(wildcard examples/device-dashboard/Makefile) $(wildcard examples/file-*/Makefile) $(wildcard examples/http-*/Makefile) $(wildcard examples/mqtt-*/Makefile) $(wildcard examples/websocket-*/Makefile) $(wildcard examples/webui-*/Makefile))
EXAMPLES_EMBEDDED := $(filter-out $(wildcard examples/zephyr/*/), $(dir $(wildcard examples/*/*/Makefile)))
PREFIX ?= /usr/local
LIBDIR ?= $(PREFIX)/lib
INCLUDEDIR ?= $(PREFIX)/include
VERSION ?= $(shell cut -d'"' -f2 src/version.h)
COMMON_CFLAGS ?= $(C_WARN) $(WARN) $(INCS) $(DEFS) -DMG_ENABLE_IPV6=$(IPV6) $(TFLAGS) -pthread
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 --fair-sched=yes
.PHONY: clean_examples examples mip_test test valgrind
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_TLS=MG_TLS_MBED -I$(MBEDTLS)/include -I/usr/include
LDFLAGS += -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509
endif
ifeq "$(SSL)" "OPENSSL"
OPENSSL ?= /usr/local
CFLAGS += -DMG_TLS=MG_TLS_OPENSSL -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
clean_examples:
for X in $(EXAMPLES); do test -f $$X/Makefile || continue; $(MAKE) -C $$X clean || exit 1; done
examples_mac:
for X in $(EXAMPLES_MAC); do test -f $$X/Makefile || continue; $(MAKE) -C $$X example || exit 1; done
clean_examples_mac:
for X in $(EXAMPLES_MAC); do test -f $$X/Makefile || continue; $(MAKE) -C $$X clean || exit 1; done
examples_win:
$(foreach X, $(EXAMPLES_WIN), $(MAKE) -C $(X) example &)
clean_examples_win:
$(foreach X, $(EXAMPLES_WIN), $(MAKE) -C $(X) clean &)
test/packed_fs.c: Makefile src/ssi.h test/fuzz.c test/data/a.txt test/data/ca.pem
$(CC) $(CFLAGS) test/pack.c -o pack
$(RUN) ./pack Makefile src/ssi.h test/fuzz.c test/data/a.txt test/data/range.txt test/data/ca.pem > $@
# 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 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_TCPIP=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_TCPIP=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
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: LDFLAGS += -Wl,-soname,libmongoose.so.$(VERSION)
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)$(LIBDIR)
ln -s libmongoose.so.$(VERSION) $(DESTDIR)$(LIBDIR)/libmongoose.so
install -Dm644 mongoose.h $(DESTDIR)$(INCLUDEDIR)/mongoose.h
uninstall:
rm -rf $(DESTDIR)$(LIBDIR)/libmongoose.a $(DESTDIR)$(LIBDIR)/libmongoose.so.$(VERSION) $(DESTDIR)$(INCLUDEDIR)/mongoose.h $(DESTDIR)$(LIBDIR)/libmongoose.so
mongoose.c: Makefile $(wildcard src/*.c) $(wildcard src/drivers/*.c)
(cat src/license.h; echo; echo '#include "mongoose.h"' ; (for F in src/*.c src/drivers/*.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_ft.h src/net_lwip.h src/net_rl.h src/config.h src/str.h src/queue.h src/fmt.h src/printf.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 src/ota.h src/device.h src/net_builtin.h src/drivers/*.h | sed -e '/keep/! s,#include ".*,,' -e 's,^#pragma once,,'; echo; echo '#ifdef __cplusplus'; echo '}'; echo '#endif'; echo '#endif // MONGOOSE_H')> $@
clean: clean_examples clean_embedded
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
#find examples -maxdepth 3 -name zephyr -prune -o -name Makefile -print | xargs dirname | xargs -n1 make clean -C
clean_embedded:
for X in $(EXAMPLES_EMBEDDED); do test -f $$X/Makefile || continue; $(MAKE) -C $$X clean || exit 1; done
+70 -91
View File
@@ -1,104 +1,83 @@
# <img src="http://www.cesanta.com/hubfs/www.cesanta.com/Images/mongoose_library.png" width="64" height="64"> Mongoose - Embedded Web Server # Mongoose - Embedded Web Server / Embedded Networking Library
![](https://img.shields.io/badge/license-GPL_2-green.svg "License") [![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)
[![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)
Mongoose is ideal for embedded environments. It has been designed Mongoose is a network library for C/C++.
for connecting devices and bringing them online. It implements event-driven
[Mongoose](https://www.cesanta.com/products) non-blocking APIs for TCP, UDP, HTTP, WebSocket, MQTT. It is designed for
has been on the market since 2004 and attracted connecting devices and bringing them online. On the market since 2004, used by
over 1 million cumulative downloads. vast number of open source and commercial products - it even runs on the
International Space Station! Mongoose makes embedded network programming fast,
robust, and easy. Features include:
It provides easy to use event-driven interface that allows to implement - Cross-platform:
network protocols or scalable network applications with little effort. - works on Linux/UNIX, MacOS, Windows, Android
Mongoose helps developers to manage the complexity of network programming - works on STM32, NXP, ESP32, NRF52, TI, Microchip, and other
and let them concentrate on the logic, saving time and money. - write code once - and it'll work everywhere
- ideal for the unification of the network infrastructure code across company
- [Download Mongoose Source Code here](http://hubs.ly/H01bWvx0) - Built-in protocols: plain TCP/UDP, SNTP, HTTP, MQTT, Websocket
- [Ask questions on support forum](http://forum.cesanta.com/index.php?p=/categories/mongoose) - SSL/TLS support: mbedTLS, OpenSSL or custom (via API)
- [Read User Guide and API reference](https://docs.cesanta.com/mongoose) - Asynchronous DNS resolver
- [Study mongoose example code](https://github.com/cesanta/mongoose/tree/master/examples) - Tiny static and run-time footprint
- Source code is both ISO C and ISO C++ compliant
> Nothing overdone. Nothing less. So unbelievably easy to use. - Very easy to integrate: just copy `mongoose.c` and `mongoose.h` files to your source tree. See
> Just how good software should be! -- Pritin Tyagaraj, SAP [exact steps](https://mongoose.ws/documentation/#2-minute-integration-guide)
- Works with any network stack with socket API, like LwIP or FreeRTOS-Plus-TCP
- Built-in TCP/IP stack with drivers for bare metal or RTOS systems
- Available drivers: STM32 F4, F7, H5, H7; NXP RT1020; TI TM4C; Microchip SAME54; Wiznet W5500
- A complete Web device dashboard on bare metal
[Nucleo-F429ZI](examples/stm32/nucleo-f429zi-baremetal) is only 6 files
- For comparison, a CubeIDE generated HTTP example is 400+ files
- Built-in firmware updates for STM32H5, STM32H7, and more coming
- Detailed [user guide, API reference and tons of tutorials](https://mongoose.ws/documentation/) available
# Features # Commercial use
- Mongoose is used by hundreds of businesses, from Fortune500 giants like
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
interface on devices, RESTful API services, telemetry data exchange, remote
control for a product, remote software updates, remote monitoring, and others
- Deployed to hundreds of millions devices in production environment worldwide
- 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
- 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
services](https://mongoose.ws/integration/) - don't hesitate to [contact us](https://mongoose.ws/contact/)
* Cross-platform: works on Linux/UNIX, MacOS, QNX, eCos, Windows, Android,
iPhone, FreeRTOS (TI CC3200, ESP8266), etc
* Single-threaded, asynchronous, non-blocking core with simple event-based API
* Native support for [PicoTCP embedded TCP/IP stack](http://www.picotcp.com),
[LWIP embedded TCP/IP stack](https://en.wikipedia.org/wiki/LwIP)
* Builtin protocols:
- plain TCP, plain UDP, SSL/TLS (over TCP, one-way or two-way)
- HTTP client, HTTP server
- Websocket client, Websocket server
- JSON-RPC client, JSON-RPC server
- MQTT client, MQTT broker
- CoAP client, CoAP server
- DNS client, DNS server, async DNS resolver
* Tiny static and run-time footprint
* Source code is both ISO C and ISO C++ compliant
* Very easy to integrate: just copy
[mongoose.c](https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.c) and
[mongoose.h](https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.h)
files to your build tree
* Extensively tested and production-ready, trusted by many blue chip businesses
# Dashboard Example # Security
Mongoose is often used to implement device dashboards and real-time We take security seriously:
data exchange over Websocket. Here is a dashboard example that illustrates 1. Mongoose repository runs a
the functionality: [continuous integration test powered by GitHub](https://github.com/cesanta/mongoose/actions),
which runs through hundreds of unit tests on every commit to the repository.
Our [unit tests](https://github.com/cesanta/mongoose/tree/master/test)
are built with modern address sanitizer technologies, which help to find
security vulnerabilities early
2. Mongoose repository is integrated into Google's
[oss-fuzz continuous fuzzer](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:mongoose)
which scans for potential vulnerabilities continuously
3. We receive periodic vulnerability reports from the independent security
groups like
[Cisco Talos](https://www.cisco.com/c/en/us/products/security/talos.html),
[Microsoft Security Response Center](https://www.microsoft.com/en-us/msrc),
[MITRE Corporation](https://www.mitre.org/),
[Compass Security](https://www.compass-security.com/en/) and others.
In case of the vulnerability found, we act according to the industry best
practice: hold on to the publication, fix the software and notify all our
customers that have an appropriate subscription
4. Some of our customers (for example NASA)
have specific security requirements and run independent security audits,
of which we get notified and in case of any issue, act similar to (3).
![](http://www.cesanta.com/hubfs/www.cesanta.com/diagrams/dash_mongoose_diagram.png)
[Developing a new product? Contact us today to discuss how Mongoose can help
](https://www.cesanta.com/contact)
# Contributions # Contributions
People who have agreed to the Contributions are welcome! Please follow the guidelines below:
[Cesanta CLA](https://docs.cesanta.com/contributors_la.shtml)
can make contributions. Note that the CLA isn't a copyright
_assigment_ but rather a copyright _license_.
You retain the copyright on your contributions.
# Licensing - Sign [Cesanta CLA](https://cesanta.com/cla.html) and send GitHub pull request
- Make sure that PRs have only one commit, and deal with one issue only
You are using Mongoose under
[GPLv2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
and until you commercialize your
application, can continue to use Mongoose free of charge.
Once you commercialize your product, in order to comply with GPLv2
you need to either open the source code of your product fully or
alternatively purchase a commercial license.
We offer [three levels of commercial licensing](https://www.cesanta.com/products):
- Mongoose Lite: cross platform integration, SSL/TLS, HTTP support
- Mongoose: Mongoose Lite + HTTP CGI, HTTP SSI, HTTP Digest Auth,
WebSocket support
- Mongoose Premium: Mongoose + Plain TCP, UDP, JSON-RPC, MQTT, DNS,
CoAP support
[Enquire about commercial licensing here](https://www.cesanta.com/contact)
# Mongoose Binary
This is our easy to use web server for web developers (PHP, Ruby, Python, etc)
and web designers. Available in three editions to suit your needs: free, pro
(USD 5) and dev edition (from USD 8). To install, simply download, double-click
to start and run browser - that's all!
[Download Mongoose Binary here](https://www.cesanta.com/products#binary)
# Other products by Cesanta
- [Smart.js](https://github.com/cesanta/smart.js) -
Generic, hardware independent, full-stack IoT software platform
- [V7](https://github.com/cesanta/v7) - Embedded JavaScript engine
- [Frozen](https://github.com/cesanta/frozen) - JSON parser and generator
- [SLRE](https://github.com/cesanta/slre) - Super Light Regular Expression
library
-1
View File
@@ -1 +0,0 @@
*.exe
-118
View File
@@ -1,118 +0,0 @@
#############################################################
# Required variables for each makefile
# Discard this section from all parent makefiles
# Expected variables (with automatic defaults):
# CSRCS (all "C" files in the dir)
# SUBDIRS (all subdirs with a Makefile)
# GEN_LIBS - list of libs to be generated ()
# GEN_IMAGES - list of object file images to be generated ()
# GEN_BINS - list of binaries to be generated ()
# COMPONENTS_xxx - a list of libs/objs in the form
# subdir/lib to be extracted and rolled up into
# a generated lib/image xxx.a ()
#
TARGET = eagle
#FLAVOR = release
FLAVOR = debug
EXTRA_CCFLAGS += -Wall -Werror
ifndef PDIR # {
GEN_IMAGES= eagle.app.v6.out
GEN_BINS= eagle.app.v6.bin
SPECIAL_MKTARGETS=$(APP_MKTARGETS)
SUBDIRS=user
endif # } PDIR
LDDIR = $(SDK_PATH)/ld
CCFLAGS += -Os
TARGET_LDFLAGS = \
-nostdlib \
-Wl,-EL \
--longcalls \
--text-section-literals
ifeq ($(FLAVOR),debug)
TARGET_LDFLAGS += -g -O2
endif
ifeq ($(FLAVOR),release)
TARGET_LDFLAGS += -g -O0
endif
COMPONENTS_eagle.app.v6 = \
user/libuser.a
LINKFLAGS_eagle.app.v6 = \
-L$(SDK_PATH)/lib \
-Wl,--gc-sections \
-nostdlib \
-T$(LD_FILE) \
-Wl,--no-check-sections \
-u call_user_start \
-Wl,-static \
-Wl,--start-group \
-lcirom \
-lgcc \
-lhal \
-lphy \
-lpp \
-lnet80211 \
-lwpa \
-lcrypto \
-lmain \
-lfreertos \
-llwip \
$(DEP_LIBS_eagle.app.v6) \
-Wl,--end-group
DEPENDS_eagle.app.v6 = \
$(LD_FILE) \
$(LDDIR)/eagle.rom.addr.v6.ld
#############################################################
# Configuration i.e. compile options etc.
# Target specific stuff (defines etc.) goes in here!
# Generally values applying to a tree are captured in the
# makefile at its root level - these are then overridden
# for a subtree within the makefile rooted therein
#
#UNIVERSAL_TARGET_DEFINES = \
# Other potential configuration flags include:
# -DTXRX_TXBUF_DEBUG
# -DTXRX_RXBUF_DEBUG
# -DWLAN_CONFIG_CCX
CONFIGURATION_DEFINES = -DICACHE_FLASH
DEFINES += \
$(UNIVERSAL_TARGET_DEFINES) \
$(CONFIGURATION_DEFINES)
DDEFINES += \
$(UNIVERSAL_TARGET_DEFINES) \
$(CONFIGURATION_DEFINES)
#############################################################
# Recursion Magic - Don't touch this!!
#
# Each subtree potentially has an include directory
# corresponding to the common APIs applicable to modules
# rooted at that subtree. Accordingly, the INCLUDE PATH
# of a module can only contain the include directories up
# its parent path, and not its siblings
#
# Required for each makefile to inherit from the parent
#
INCLUDES := $(INCLUDES) -I $(PDIR)include
sinclude $(SDK_PATH)/Makefile
.PHONY: FORCE
FORCE:
-36
View File
@@ -1,36 +0,0 @@
This is a Mongoose "Hello, world" that can be compiled under ESP8266 RTOS SDK.
It sets up an AP (SSID `Mongoose`) and serves a "hello world" page on http://192.168.4.1/
Most of the the boilerplate comes from [project_template](https://github.com/espressif/ESP8266_RTOS_SDK/tree/master/examples/project_template) (@ [3ca6af5](https://github.com/espressif/ESP8266_RTOS_SDK/tree/3ca6af5da68678d809b34c7cd98bee71e0235039/examples/project_template)) with minimal changes.
To build with no changes to the SDK, you will need a module with 1MB (8Mb) flash or more.
Compile (for NodeMCU 1.0):
```
$ export SDK_PATH=/path/to/ESP8266_RTOS_SDK
$ export BIN_PATH=./bin
$ make clean; make BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=dio SPI_SIZE_MAP=6
```
Flash (using [esptool](https://github.com/themadinventor/esptool)):
```
$ esptool.py --port /dev/ttyUSB0 --baud 230400 \
write_flash --flash_mode=dio --flash_size=32m \
0x00000 ${SDK_PATH}/bin/boot_v1.4\(b1\).bin \
0x01000 ${BIN_PATH}/upgrade/user1.4096.new.6.bin
```
The output can be made to fit in 512KB (4Mb), but stock linker scripts do not reserve enough space for code.
Custom linker script is provided for that, so you can use it for smaller devices like so (example that will work with ESP-01):
```
$ make clean; make BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=qio SPI_SIZE_MAP=0 LD_FILE=ld/eagle.app.v6.512.compact.ld
$ esptool.py --port /dev/ttyUSB0 --baud 230400 \
write_flash --flash_mode=qio --flash_size=4m \
0x00000 ${BIN_PATH}/eagle.flash.bin \
0x10000 ${BIN_PATH}/eagle.irom0text.bin
```
-173
View File
@@ -1,173 +0,0 @@
#!/bin/bash
:<<!
******NOTICE******
MUST set SDK_PATH & BIN_PATH firstly!!!
example:
export SDK_PATH=~/ESP8266_RTOS_SDK
export BIN_PATH=~/esp8266_bin
!
echo "gen_misc.sh version 20150911"
echo ""
if [ $SDK_PATH ]; then
echo "SDK_PATH:"
echo "$SDK_PATH"
echo ""
else
echo "ERROR: Please export SDK_PATH in gen_misc.sh firstly, exit!!!"
exit
fi
if [ $BIN_PATH ]; then
echo "BIN_PATH:"
echo "$BIN_PATH"
echo ""
else
echo "ERROR: Please export BIN_PATH in gen_misc.sh firstly, exit!!!"
exit
fi
echo "Please check SDK_PATH & BIN_PATH, enter (Y/y) to continue:"
read input
if [[ $input != Y ]] && [[ $input != y ]]; then
exit
fi
echo ""
echo "Please follow below steps(1-5) to generate specific bin(s):"
echo "STEP 1: use boot_v1.2+ by default"
boot=new
echo "boot mode: $boot"
echo ""
echo "STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)"
echo "enter (0/1/2, default 0):"
read input
if [ -z "$input" ]; then
if [ $boot != none ]; then
boot=none
echo "ignore boot"
fi
app=0
echo "generate bin: eagle.flash.bin+eagle.irom0text.bin"
elif [ $input == 1 ]; then
if [ $boot == none ]; then
app=0
echo "choose no boot before"
echo "generate bin: eagle.flash.bin+eagle.irom0text.bin"
else
app=1
echo "generate bin: user1.bin"
fi
elif [ $input == 2 ]; then
if [ $boot == none ]; then
app=0
echo "choose no boot before"
echo "generate bin: eagle.flash.bin+eagle.irom0text.bin"
else
app=2
echo "generate bin: user2.bin"
fi
else
if [ $boot != none ]; then
boot=none
echo "ignore boot"
fi
app=0
echo "generate bin: eagle.flash.bin+eagle.irom0text.bin"
fi
echo ""
echo "STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)"
echo "enter (0/1/2/3, default 2):"
read input
if [ -z "$input" ]; then
spi_speed=40
elif [ $input == 0 ]; then
spi_speed=20
elif [ $input == 1 ]; then
spi_speed=26.7
elif [ $input == 3 ]; then
spi_speed=80
else
spi_speed=40
fi
echo "spi speed: $spi_speed MHz"
echo ""
echo "STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)"
echo "enter (0/1/2/3, default 0):"
read input
if [ -z "$input" ]; then
spi_mode=QIO
elif [ $input == 1 ]; then
spi_mode=QOUT
elif [ $input == 2 ]; then
spi_mode=DIO
elif [ $input == 3 ]; then
spi_mode=DOUT
else
spi_mode=QIO
fi
echo "spi mode: $spi_mode"
echo ""
echo "STEP 5: choose spi size and map"
echo " 0= 512KB( 256KB+ 256KB)"
echo " 2=1024KB( 512KB+ 512KB)"
echo " 3=2048KB( 512KB+ 512KB)"
echo " 4=4096KB( 512KB+ 512KB)"
echo " 5=2048KB(1024KB+1024KB)"
echo " 6=4096KB(1024KB+1024KB)"
echo "enter (0/2/3/4/5/6, default 0):"
read input
if [ -z "$input" ]; then
spi_size_map=0
echo "spi size: 512KB"
echo "spi ota map: 256KB + 256KB"
elif [ $input == 2 ]; then
spi_size_map=2
echo "spi size: 1024KB"
echo "spi ota map: 512KB + 512KB"
elif [ $input == 3 ]; then
spi_size_map=3
echo "spi size: 2048KB"
echo "spi ota map: 512KB + 512KB"
elif [ $input == 4 ]; then
spi_size_map=4
echo "spi size: 4096KB"
echo "spi ota map: 512KB + 512KB"
elif [ $input == 5 ]; then
spi_size_map=5
echo "spi size: 2048KB"
echo "spi ota map: 1024KB + 1024KB"
elif [ $input == 6 ]; then
spi_size_map=6
echo "spi size: 4096KB"
echo "spi ota map: 1024KB + 1024KB"
else
spi_size_map=0
echo "spi size: 512KB"
echo "spi ota map: 256KB + 256KB"
fi
echo ""
echo "start..."
echo ""
make clean
make BOOT=$boot APP=$app SPI_SPEED=$spi_speed SPI_MODE=$spi_mode SPI_SIZE_MAP=$spi_size_map
@@ -1,20 +0,0 @@
/* eagle.flash.bin @ 0x00000 */
/* eagle.irom0text.bin @ 0x10000 */
/*
* Flash map for 512KB flash.
*
* There is 0x8000 (32KB) available between 0x8000 and 0x10000.
*
* Note: IROM images starts at 0x10000 (ignore Makefile output which says 0x40000.
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x18000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40210000, len = 0x6C000
}
INCLUDE "../ld/eagle.app.v6.common.ld"
-56
View File
@@ -1,56 +0,0 @@
This is a simple project template.
sample_lib is an example for multi-level folder Makefile, notice the folder structure and each Makefile, you can get the clue.
HOWTO:
1. Copy this folder to anywhere.
Example:
Copy to ~/workspace/project_template
You can rename this folder as you like.
2. Export SDK_PATH and BIN_PATH.
Example:
Your SDK path is ~/esp_iot_rtos_sdk, and want generate bin at ~/esp8266_bin.
Do follow steps:
1>. export SDK_PATH=~/esp_iot_rtos_sdk
2>. export BIN_PATH=~/esp8266_bin
SDK and project are seperate, you can update SDK without change your project.
3. Enter project_template folder, run ./gen_misc.sh, and follow the tips and steps.
Compile Options:
(1) COMPILE
Possible value: xcc
Default value:
If not set, use gcc by default.
(2) BOOT
Possible value: none/old/new
none: no need boot
old: use boot_v1.1
new: use boot_v1.2
Default value: new
(3) APP
Possible value: 0/1/2
0: original mode, generate eagle.app.v6.flash.bin and eagle.app.v6.irom0text.bin
1: generate user1
2: generate user2
Default value: 0
(3) SPI_SPEED
Possible value: 20/26.7/40/80
Default value: 40
(4) SPI_MODE
Possible value: QIO/QOUT/DIO/DOUT
Default value: QIO
(4) SPI_SIZE_MAP
Possible value: 0/2/3/4/5/6
Default value: 0
For example:
make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=0
-47
View File
@@ -1,47 +0,0 @@
#############################################################
# Required variables for each makefile
# Discard this section from all parent makefiles
# Expected variables (with automatic defaults):
# CSRCS (all "C" files in the dir)
# SUBDIRS (all subdirs with a Makefile)
# GEN_LIBS - list of libs to be generated ()
# GEN_IMAGES - list of images to be generated ()
# COMPONENTS_xxx - a list of libs/objs in the form
# subdir/lib to be extracted and rolled up into
# a generated lib/image xxx.a ()
#
ifndef PDIR
GEN_LIBS = libuser.a
endif
#############################################################
# Configuration i.e. compile options etc.
# Target specific stuff (defines etc.) goes in here!
# Generally values applying to a tree are captured in the
# makefile at its root level - these are then overridden
# for a subtree within the makefile rooted therein
#
DEFINES += -DMG_DISABLE_DAV -DMG_DISABLE_SYNC_RESOLVER -DMG_DISABLE_CGI \
-DMG_DISABLE_SOCKETPAIR -DMG_DISABLE_DIRECTORY_LISTING \
-DMG_MAX_HTTP_HEADERS=20 -DMG_MAX_HTTP_REQUEST_SIZE=1024 \
-DMG_MAX_PATH=40 -DMG_MAX_HTTP_SEND_IOBUF=1024 \
-DMG_ESP8266 -DRTOS_SDK -DMG_LWIP
#############################################################
# Recursion Magic - Don't touch this!!
#
# Each subtree potentially has an include directory
# corresponding to the common APIs applicable to modules
# rooted at that subtree. Accordingly, the INCLUDE PATH
# of a module can only contain the include directories up
# its parent path, and not its siblings
#
# Required for each makefile to inherit from the parent
#
INCLUDES += -I ./
PDIR := ../$(PDIR)
sinclude $(PDIR)Makefile
-54
View File
@@ -1,54 +0,0 @@
/*
* Copyright (c) 2015 Cesanta Software Limited
* All rights reserved
*/
#include <ctype.h>
#include <sys/time.h>
#include <stdint.h>
#include <math.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "esp_common.h"
/* Makes fprintf(stdout) and stderr work. */
_ssize_t _write_r(struct _reent *r, int fd, void *buf, size_t len) {
if (fd == 1 || fd == 2) {
size_t i;
for (i = 0; i < len; i++) {
os_putc(((char *) buf)[i]);
}
return len;
}
return -1;
}
/*
* You'll need to implement _open_r and friends if you want file operations. See
* https://github.com/cesanta/smart.js/blob/master/platforms/esp8266/user/esp_fs.c
* for SPIFFS-based implementation.
*/
void abort(void) __attribute__((no_instrument_function));
void abort(void) {
/* cause an unaligned access exception, that will drop you into gdb */
*(int *) 1 = 1;
while (1)
; /* avoid gcc warning because stdlib abort() has noreturn attribute */
}
void _exit(int status) {
printf("_exit(%d)\n", status);
abort();
}
int _gettimeofday_r(struct _reent *r, struct timeval *tp, void *tzp) {
uint32_t time = system_get_time();
tp->tv_sec = time / 1000000;
tp->tv_usec = time % 1000000;
return 0;
}
-108
View File
@@ -1,108 +0,0 @@
/*
* Copyright (c) 2015 Cesanta Software Limited
* All rights reserved
*/
#include "esp_common.h"
#include "mongoose.h"
#define AP_SSID "Mongoose"
#define AP_PASS "Mongoose"
#define AP_CHAN 9
#define MG_LISTEN_ADDR "80"
#define MG_TASK_STACK_SIZE 2048
#define MG_TASK_PRIORITY 1
void uart_div_modify(int uart_no, unsigned int freq);
void ev_handler(struct mg_connection *nc, int ev, void *p) {
static const char *reply_fmt =
"HTTP/1.0 200 OK\r\n"
"Connection: close\r\n"
"Content-Type: text/plain\r\n"
"\r\n"
"Hello %s\n";
LOG(LL_DEBUG, ("conn %p ev %d", nc, ev));
switch (ev) {
case MG_EV_ACCEPT: {
char addr[32];
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
LOG(LL_INFO, ("Connection %p from %s", nc, addr));
break;
}
case MG_EV_HTTP_REQUEST: {
char addr[32];
struct http_message *hm = (struct http_message *) p;
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
LOG(LL_INFO,
("HTTP request from %s: %.*s %.*s", addr, (int) hm->method.len,
hm->method.p, (int) hm->uri.len, hm->uri.p));
mg_printf(nc, reply_fmt, addr);
nc->flags |= MG_F_SEND_AND_CLOSE;
break;
}
case MG_EV_CLOSE: {
LOG(LL_INFO, ("Connection %p closed", nc));
break;
}
}
}
void setup_ap() {
struct softap_config cfg;
wifi_set_opmode_current(SOFTAP_MODE);
memset(&cfg, 0, sizeof(cfg));
strcpy((char *) cfg.ssid, AP_SSID);
strcpy((char *) cfg.password, AP_PASS);
cfg.ssid_len = strlen((const char *) cfg.ssid);
cfg.authmode =
strlen((const char *) cfg.password) ? AUTH_WPA2_PSK : AUTH_OPEN;
cfg.channel = AP_CHAN;
cfg.ssid_hidden = 0;
cfg.max_connection = 10;
cfg.beacon_interval = 100; /* ms */
LOG(LL_INFO, ("Setting up AP '%s' on channel %d", cfg.ssid, cfg.channel));
wifi_softap_set_config_current(&cfg);
}
static void mg_task(void *arg) {
struct mg_mgr mgr;
struct mg_connection *nc;
cs_log_set_level(LL_INFO);
LOG(LL_INFO, ("SDK version: %s", system_get_sdk_version()));
setup_ap();
mg_mgr_init(&mgr, NULL);
nc = mg_bind(&mgr, MG_LISTEN_ADDR, ev_handler);
if (nc == NULL) {
LOG(LL_ERROR, ("Error setting up listener!"));
return;
}
mg_set_protocol_http_websocket(nc);
while (1) {
mg_mgr_poll(&mgr, 1000);
}
}
xTaskHandle s_mg_task_handle;
void user_init(void) {
uart_div_modify(0, UART_CLK_FREQ / 115200);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
xTaskCreate(mg_task, (const signed char *) "mongoose", MG_TASK_STACK_SIZE,
NULL, MG_TASK_PRIORITY, &s_mg_task_handle);
}
-15
View File
@@ -1,15 +0,0 @@
# Copyright (c) 2014 Cesanta Software
# All rights reserved
SUBDIRS = $(sort $(dir $(wildcard */)))
X = $(SUBDIRS)
.PHONY: $(SUBDIRS)
all: $(SUBDIRS)
$(SUBDIRS):
@$(MAKE) -C $@
clean:
for d in $(SUBDIRS) ; do $(MAKE) -C $$d clean ; done
+24
View File
@@ -0,0 +1,24 @@
# Mongoose Network Library Examples
In order to build and run any of the existing examples, please follow:
https://mongoose.ws/documentation/#how-to-build-and-run-examples
## Contributing
Rules for creating a new example:
- Makefile golden reference for desktop/server example: [http-server](http-server)
- Makefile golden reference for the embedded example:
[stm32/nucleo-f746zg-baremetal](stm32/nucleo-f746zg-baremetal)
- An example must build on Windows, Mac and Ubuntu Linux systems
- Assume that user installed tools according to https://mongoose.ws/tutorials/tools/
- Makefile must not include any other make files
- Use `CFLAGS` for system-specific compilation options
- Use `CFLAGS_MONGOOSE` for mongoose-specific compilation options
- Use `$(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA)` to compile
- If external repository is required, download it on demand using git
shallow clone. See embedded example golden reference
- Keep Makefile as short as possible, but verbose to understand it easily
- Symlink files when required, like `mongoose.c`, `ca.pem`, etc. Make no copies
- Example's README.md should contain only the title and the link to mongoose.ws
tutorial page
-25
View File
@@ -1,25 +0,0 @@
PROG = api_server
SOURCES = $(PROG).c sqlite3.c db_plugin_sqlite.c ../../mongoose.c
CFLAGS = -W -Wall -pthread $(CFLAGS_EXTRA)
ifeq ($(OS), Windows_NT)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
CFLAGS += -ldl -lm
endif
endif
all: $(PROG)
$(PROG): $(SOURCES)
$(CC) $(SOURCES) -o $@ $(CFLAGS)
$(PROG).exe: $(SOURCES)
cl $(SOURCES) /I.. /MD /Fe$@
test: $(PROG)
sh unit_test.sh $$(pwd)/$(PROG)
clean:
rm -rf *.gc* *.dSYM *.exe *.obj *.o a.out $(PROG)
-104
View File
@@ -1,104 +0,0 @@
/*
* Copyright (c) 2014 Cesanta Software Limited
* All rights reserved
*/
#include "db_plugin.h"
static const char *s_http_port = "8000";
static struct mg_serve_http_opts s_http_server_opts;
static int s_sig_num = 0;
static void *s_db_handle = NULL;
static const char *s_db_path = "api_server.db";
static const struct mg_str s_get_method = MG_STR("GET");
static const struct mg_str s_put_method = MG_STR("PUT");
static const struct mg_str s_delele_method = MG_STR("DELETE");
static void signal_handler(int sig_num) {
signal(sig_num, signal_handler);
s_sig_num = sig_num;
}
static int has_prefix(const struct mg_str *uri, const struct mg_str *prefix) {
return uri->len > prefix->len && memcmp(uri->p, prefix->p, prefix->len) == 0;
}
static int is_equal(const struct mg_str *s1, const struct mg_str *s2) {
return s1->len == s2->len && memcmp(s1->p, s2->p, s2->len) == 0;
}
static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
static const struct mg_str api_prefix = MG_STR("/api/v1");
struct http_message *hm = (struct http_message *) ev_data;
struct mg_str key;
switch (ev) {
case MG_EV_HTTP_REQUEST:
if (has_prefix(&hm->uri, &api_prefix)) {
key.p = hm->uri.p + api_prefix.len;
key.len = hm->uri.len - api_prefix.len;
if (is_equal(&hm->method, &s_get_method)) {
db_op(nc, hm, &key, s_db_handle, API_OP_GET);
} else if (is_equal(&hm->method, &s_put_method)) {
db_op(nc, hm, &key, s_db_handle, API_OP_SET);
} else if (is_equal(&hm->method, &s_delele_method)) {
db_op(nc, hm, &key, s_db_handle, API_OP_DEL);
} else {
mg_printf(nc, "%s",
"HTTP/1.0 501 Not Implemented\r\n"
"Content-Length: 0\r\n\r\n");
}
} else {
mg_serve_http(nc, hm, s_http_server_opts); /* Serve static content */
}
break;
default:
break;
}
}
int main(int argc, char *argv[]) {
struct mg_mgr mgr;
struct mg_connection *nc;
int i;
/* Open listening socket */
mg_mgr_init(&mgr, NULL);
nc = mg_bind(&mgr, s_http_port, ev_handler);
mg_set_protocol_http_websocket(nc);
s_http_server_opts.document_root = "web_root";
/* Parse command line arguments */
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-D") == 0) {
mgr.hexdump_file = argv[++i];
} else if (strcmp(argv[i], "-f") == 0) {
s_db_path = argv[++i];
} else if (strcmp(argv[i], "-r") == 0) {
s_http_server_opts.document_root = argv[++i];
}
}
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
/* Open database */
if ((s_db_handle = db_open(s_db_path)) == NULL) {
fprintf(stderr, "Cannot open DB [%s]\n", s_db_path);
exit(EXIT_FAILURE);
}
/* Run event loop until signal is received */
printf("Starting RESTful server on port %s\n", s_http_port);
while (s_sig_num == 0) {
mg_mgr_poll(&mgr, 1000);
}
/* Cleanup */
mg_mgr_free(&mgr);
db_close(&s_db_handle);
printf("Exiting on signal %d\n", s_sig_num);
return 0;
}
-19
View File
@@ -1,19 +0,0 @@
/*
* Copyright (c) 2014 Cesanta Software Limited
* All rights reserved
*/
#ifndef DB_PLUGIN_HEADER_DEFINED
#define DB_PLUGIN_HEADER_DEFINED
#include "../../mongoose.h"
void *db_open(const char *db_path);
void db_close(void **db_handle);
enum { API_OP_GET, API_OP_SET, API_OP_DEL };
void db_op(struct mg_connection *nc, const struct http_message *hm,
const struct mg_str *key, void *db, int op);
#endif /* DB_PLUGIN_HEADER_DEFINED */
-107
View File
@@ -1,107 +0,0 @@
/*
* Copyright (c) 2014 Cesanta Software Limited
* All rights reserved
*/
#include "db_plugin.h"
#include "sqlite3.h"
void *db_open(const char *db_path) {
sqlite3 *db = NULL;
if (sqlite3_open_v2(db_path, &db, SQLITE_OPEN_READWRITE |
SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX, NULL) == SQLITE_OK) {
sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS kv(key PRIMARY KEY, val);",
0, 0, 0);
}
return db;
}
void db_close(void **db_handle) {
if (db_handle != NULL && *db_handle != NULL) {
sqlite3_close(*db_handle);
*db_handle = NULL;
}
}
static void op_set(struct mg_connection *nc, const struct http_message *hm,
const struct mg_str *key, void *db) {
sqlite3_stmt *stmt = NULL;
char value[200];
const struct mg_str *body = hm->query_string.len > 0 ?
&hm->query_string : &hm->body;
mg_get_http_var(body, "value", value, sizeof(value));
if (sqlite3_prepare_v2(db, "INSERT OR REPLACE INTO kv VALUES (?, ?);",
-1, &stmt, NULL) == SQLITE_OK) {
sqlite3_bind_text(stmt, 1, key->p, key->len, SQLITE_STATIC);
sqlite3_bind_text(stmt, 2, value, strlen(value), SQLITE_STATIC);
sqlite3_step(stmt);
sqlite3_finalize(stmt);
}
mg_printf(nc, "%s", "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
}
static void op_get(struct mg_connection *nc, const struct http_message *hm,
const struct mg_str *key, void *db) {
sqlite3_stmt *stmt = NULL;
const char *data = NULL;
int result;
(void) hm;
if (sqlite3_prepare_v2(db, "SELECT val FROM kv WHERE key = ?;",
-1, &stmt, NULL) == SQLITE_OK) {
sqlite3_bind_text(stmt, 1, key->p, key->len, SQLITE_STATIC);
result = sqlite3_step(stmt);
data = (char *) sqlite3_column_text(stmt, 0);
if ((result == SQLITE_OK || result == SQLITE_ROW) && data != NULL) {
mg_printf(nc, "HTTP/1.1 200 OK\r\n"
"Content-Type: text/plain\r\n"
"Content-Length: %d\r\n\r\n%s",
(int) strlen(data), data);
} else {
mg_printf(nc, "%s", "HTTP/1.1 404 Not Found\r\n"
"Content-Length: 0\r\n\r\n");
}
sqlite3_finalize(stmt);
} else {
mg_printf(nc, "%s", "HTTP/1.1 500 Server Error\r\n"
"Content-Length: 0\r\n\r\n");
}
}
static void op_del(struct mg_connection *nc, const struct http_message *hm,
const struct mg_str *key, void *db) {
sqlite3_stmt *stmt = NULL;
int result;
(void) hm;
if (sqlite3_prepare_v2(db, "DELETE FROM kv WHERE key = ?;",
-1, &stmt, NULL) == SQLITE_OK) {
sqlite3_bind_text(stmt, 1, key->p, key->len, SQLITE_STATIC);
result = sqlite3_step(stmt);
if (result == SQLITE_OK || result == SQLITE_ROW) {
mg_printf(nc, "%s", "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
} else {
mg_printf(nc, "%s", "HTTP/1.1 404 Not Found\r\n"
"Content-Length: 0\r\n\r\n");
}
sqlite3_finalize(stmt);
} else {
mg_printf(nc, "%s", "HTTP/1.1 500 Server Error\r\n"
"Content-Length: 0\r\n\r\n");
}
}
void db_op(struct mg_connection *nc, const struct http_message *hm,
const struct mg_str *key, void *db, int op) {
switch (op) {
case API_OP_GET: op_get(nc, hm, key, db); break;
case API_OP_SET: op_set(nc, hm, key, db); break;
case API_OP_DEL: op_del(nc, hm, key, db); break;
default:
mg_printf(nc, "%s", "HTTP/1.0 501 Not Implemented\r\n"
"Content-Length: 0\r\n\r\n");
break;
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-35
View File
@@ -1,35 +0,0 @@
#!/bin/sh
PROG=$1
PORT=${2:-8000} # If second param is given, this is load balancer port
DB_FILE=/tmp/_$$.db
URL=http://127.0.0.1:$PORT/api/v1
cleanup() {
rm -rf $DB_FILE
kill -9 $PID >/dev/null 2>&1
}
#set -x
trap cleanup EXIT
cleanup
$PROG -f $DB_FILE &
PID=$!
#sleep 1
curl -s -X PUT -d 'value=123' $URL/foo
curl -s -X PUT -d 'value=success' $URL/bar/baz
# Fetch existing key
RESULT=$(curl -s $URL/bar/baz)
test "$RESULT" = "success" || exit 1
# Delete it
curl -s -X DELETE $URL/bar/baz
# Make sure it's deleted - GET must result in 404
RESULT=$(curl -s -i $URL/bar/baz | head -1 | tr -d '\r')
test "$RESULT" = "HTTP/1.1 404 Not Found" || exit 1
exit 0
-38
View File
@@ -1,38 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>RESTful API demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
* { outline: none; }
body {
background-color: #789; margin: 0;
padding: 0; font: 16px/1.4 Helvetica, Arial, sans-serif;
font: 16px/1.4 Helvetica, Arial, sans-serif;
}
div.content {
width: 800px; margin: 2em auto; padding: 20px 50px;
background-color: #fff; border-radius: 1em;
}
label { display: inline-block; min-width: 7em; }
input { border: 1px solid #ccc; padding: 0.2em; }
a:link, a:visited { color: #69c; text-decoration: none; }
@media (max-width: 700px) {
body { background-color: #fff; }
div.content { width: auto; margin: 0 auto; padding: 1em; }
}
</style>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script language="javascript" type="text/javascript">
jQuery(function() {
});
</script>
</head>
<body>
<div class="content">
<h1>API server</h1>
</div>
</body>
</html>
+28
View File
@@ -0,0 +1,28 @@
all:
example:
true
arduino: ENV = -v $(CWD):/root
arduino:
curl -sL http://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz | unxz | tar -xf -
mv arduino-* $@
arduino-xiao-board:
./arduino/arduino --pref "boardsmanager.additional.urls=https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json" --save-prefs
./arduino/arduino --pref "compiler.warning_level=all" --save-prefs
./arduino/arduino --install-boards Seeeduino:samd
arduino-xiao: arduino arduino-xiao-board
cd w5500-http && ../arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-http.ino
cd w5500-mqtt && ../arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-mqtt.ino
arduino-nano: arduino
cd w5500-http && ../arduino/arduino --pref compiler.cpp.extra_flags=-DMG_ENABLE_LOG=0 --verbose --verify --board arduino:avr:nano w5500-http.ino
cd w5500-mqtt && ../arduino/arduino --pref compiler.cpp.extra_flags=-DMG_ENABLE_LOG=0 --verbose --verify --board arduino:avr:nano w5500-mqtt.ino
clean:
rm -rf arduino
cleanall: clean #otherwise some parts of xiao-board installation will fail as already installed
rm -rf ~/.arduino15 ~/.oracle_jre_usage
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,15 @@
#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_TCPIP 1
#define mkdir(a, b) (-1)
#define MG_IO_SIZE 128
//#define MG_ENABLE_LOG 0
@@ -0,0 +1,49 @@
#include <SPI.h>
#include "mongoose.h"
#define SS_PIN 3 // Slave select pin
struct mg_mgr mgr; // Mongoose event manager
struct mg_tcpip_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 mg_tcpip_if mif = {.mac = {2, 0, 1, 2, 3, 5}}; // 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 = &mg_tcpip_driver_w5500;
mif.driver_data = &spi;
mg_tcpip_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", mg_tcpip_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);
}
+1
View File
@@ -0,0 +1 @@
../../../mongoose.c
+1
View File
@@ -0,0 +1 @@
../../../mongoose.h
@@ -0,0 +1,15 @@
#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_TCPIP 1
#define mkdir(a, b) (-1)
#define MG_IO_SIZE 512
//#define MG_ENABLE_LOG 0
+58
View File
@@ -0,0 +1,58 @@
#include "net.h"
#define MQTT_SERVER "mqtt://broker.hivemq.com:1883"
struct mg_connection *mqtt_connection;
const char *mqtt_subscribe_topic = "mg/rx";
const char *mqtt_publish_topic = "mg/tx";
struct mg_mgr mgr; // Mongoose event manager
struct mg_tcpip_if mif = {.mac = {2, 0, 1, 2, 3, 5}}; // network interface
void mqtt_publish(const char *message) {
struct mg_mqtt_opts opts = {};
opts.topic = mg_str(mqtt_publish_topic);
opts.message = mg_str(message);
if (mqtt_connection) mg_mqtt_pub(mqtt_connection, &opts);
}
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_MQTT_OPEN) {
MG_INFO(("%lu CONNECTED to %s", c->id, MQTT_SERVER));
struct mg_mqtt_opts opts = {};
opts.topic = mg_str(mqtt_subscribe_topic);
mg_mqtt_sub(c, &opts);
MG_INFO(("%lu SUBSCRIBED to %s", c->id, mqtt_subscribe_topic));
} else if (ev == MG_EV_MQTT_MSG) {
// Received MQTT message
struct mg_mqtt_message *mm = (struct mg_mqtt_message *) ev_data;
MG_INFO(("%lu RECEIVED %.*s <- %.*s", c->id, (int) mm->data.len,
mm->data.ptr, (int) mm->topic.len, mm->topic.ptr));
exec_command(mm->data.ptr, mm->data.len);
} else if (ev == MG_EV_CLOSE) {
MG_INFO(("%lu CLOSED", c->id));
mqtt_connection = NULL;
}
}
static void timer_fn(void *arg) {
struct mg_mgr *mgr = (struct mg_mgr *) arg;
struct mg_mqtt_opts opts;
memset(&opts, 0, sizeof(opts));
opts.clean = true;
if (mif.state == MG_TCPIP_STATE_READY && mqtt_connection == NULL) {
mqtt_connection = mg_mqtt_connect(mgr, MQTT_SERVER, &opts, fn, NULL);
}
// MG_INFO(("Eth: %d, MQTT: %p", mif.state, mqtt_connection));
}
void net_init(void) {
// Set Mongoose logging function to a serial print
mg_mgr_init(&mgr);
mif.driver = &mg_tcpip_driver_w5500;
mif.driver_data = &spi;
mg_tcpip_init(&mgr, &mif);
// Start a timer that keeps MQTT connection alive
mg_timer_add(&mgr, 3000, MG_TIMER_REPEAT, timer_fn, &mgr);
}
+16
View File
@@ -0,0 +1,16 @@
#pragma once
#include "mongoose.h"
#ifdef __cplusplus
extern "C" {
#endif
extern struct mg_tcpip_spi spi;
extern struct mg_mgr mgr;
void mqtt_publish(const char *message);
void net_init(void);
void exec_command(const char *req, size_t req_len);
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,51 @@
#include <SPI.h>
#include "net.h"
#define SS_PIN 17 // Slave select pin
struct mg_tcpip_spi spi = {
NULL, // SPI data
[](void *) { digitalWrite(SS_PIN, LOW); }, // Begin transaction
[](void *) { digitalWrite(SS_PIN, HIGH); }, // End transaction
[](void *, uint8_t c) { return SPI.transfer(c); }, // Execute transaction
};
void exec_command(const char *req, size_t req_len) {
char res[100];
if (req_len == 2 && strncmp(req, "on", req_len) == 0) {
digitalWrite(LED_BUILTIN, true);
snprintf(res, sizeof(res), "LED on");
} else if (req_len == 3 && strncmp(req, "off", req_len) == 0) {
digitalWrite(LED_BUILTIN, false);
snprintf(res, sizeof(res), "LED off");
} else {
snprintf(res, sizeof(res), "Unknown command: [%.*s]", (int) req_len, req);
}
Serial.println(res);
mqtt_publish(res);
}
static void process_input(char c) {
static char buf[100];
static size_t len = 0;
char response[100];
if (c != '\n' && c != '\0') buf[len++] = c; // Append to the buffer
if (len >= sizeof(buf)) len = 0; // On overflow, reset
if (c == '\n' && len > 0) {
exec_command(buf, len);
len = 0;
}
}
void setup() {
Serial.begin(115200);
SPI.begin();
pinMode(SS_PIN, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
mg_log_set_fn([](char ch, void *) { Serial.print(ch); }, NULL);
net_init();
}
void loop() {
if (Serial.available()) process_input(Serial.read());
mg_mgr_poll(&mgr, 1);
}
-2
View File
@@ -1,2 +0,0 @@
# This "makefile" is only intended to prevent errors during main makefile execution
all:
-46
View File
@@ -1,46 +0,0 @@
# Arduino Restful Client
This example demonstrates how to use [Mongoose](https://www.cesanta.com/mongoose) to send HTTP commands from Arduino.
Example sends free memory size and current board uptime, but it can be modified to send any user-specific data.
At the moment this example supports [Arduino Mega 2560](http://arduino.cc/en/Main/ArduinoBoardMega2560) board (and compatible) with either W5100-based
network shield (like [Arduino Ethernet Shield](http://arduino.cc/en/Main/ArduinoEthernetShield)) or [CC3000](http://www.ti.com/product/cc3000)-based WIFI Shield.
## Build and run instructions:
###To run with Arduino Ethernet (W5100) shield:
1. Add (Sketch->Add file...) the following files to sketch:
- /mongoose/mongoose.h
- /mongoose/mongoose.c
- /mongoose/platforms/arduino_ethernet_W5100/avrsupport.h
- /mongoose/platforms/arduino_ethernet_W5100/avrsupport.cpp
3. Buils and start (in console) /Users/alex/Projects/mongoose/examples/restful_server example
4. Make `board_ip` and `board_mac` variables suitable for your network and board
5. Change IP address in `s_target_address` variable to IP address of host running restful_server
6. Uncomment line `#include <Ethernet.h>`
7. Compile and flash sketch
8. restful_server will start to show current uptime and free memory size (with 5 seconds interval)
###To run with Adafruit WiFi (CC3000) shield:
1. Add (Sketch->Add files...) the following files to sketch:
- /mongoose/mongoose.h
- /mongoose/mongoose.c
- /mongoose/platforms/arduino_ethernet_W5100/avrsupport.h
- /mongoose/platforms/arduino_ethernet_W5100/avrsupport.cpp
2. Import Adafruit CC3000 library for mongoose
(select Sketch->Import Library...->Add library... and point
/mongoose/platforms/arduino_wifi_CC3000/adafruit_CC3000_lib_mongoose folder)
3. Buils and start (in console) /Users/alex/Projects/mongoose/examples/restful_server example
4. Make the following variables suitable for your network
- `board_ip`
- `subnet_mask`
- `gateway`
- `dns`
- `wlan_ssid`
- `wlan_pwd`
- `wlan_security`
5. Change IP address in `s_target_address` variable to IP address of host running restful_server
6. Uncomment line `#include <Adafruit_CC3000.h>`
8. Compile and flash sketch
9. restful_server will start to show current uptime and free memory size (with 5 seconds interval)
@@ -1,141 +0,0 @@
/*
* Copyright (c) 2015 Cesanta Software Limited
* All rights reserved
*
* Build and run instructions:
* To run with Arduino Ethernet (W5100) shield:
* -----------------------------------------------------------
* 1. Add (Sketch->Add file...) the following files to sketch:
* - /mongoose/mongoose.h
* - /mongoose/mongoose.c
* - /mongoose/platforms/arduino_ethernet_W5100/avrsupport.h
* - /mongoose/platforms/arduino_ethernet_W5100/avrsupport.cpp
* 2. Buils and run in console /Users/alex/Projects/mongoose/examples/restful_server example
* 3. Make board_ip and board_mac variables suitable for your network and board
* 4. Uncomment line #include <Ethernet.h>
* 5. Change IP address in s_target_address variable to IP address of host running restful_server
* 6. Compile & flash sketch
* 7. restful_server server will start to show current uptime and free memory size (with 5 second interval)
*
* To run with Adafruit WiFi (CC3000) shield:
* -----------------------------------------------------------
* 1. Add (Sketch->Add files...) the following files to sketch:
* - /mongoose/mongoose.h
* - /mongoose/mongoose.c
* - /mongoose/platforms/arduino_ethernet_W5100/avrsupport.h
* - /mongoose/platforms/arduino_ethernet_W5100/avrsupport.cpp
* 2. Import Adafruit CC3000 library for mongoose (select Sketch->Import Library...->Add library... and point
* /mongoose/platforms/arduino_wifi_CC3000/adafruit_CC3000_lib_mongoose folder
* 3. Buils and run in console /Users/alex/Projects/mongoose/examples/restful_server example
* 4. Make the following variables suitable for your network
* - board_ip
* - subnet_mask
* - gateway
* - dns
* - wlan_ssid
* - wlan_pwd
* - wlan_security
* 5. Uncomment line #include <Adafruit_CC3000.h>
* 6. Compile & flash sketch
* 7. restful_server server will start to show current uptime and free memory size (with 5 second interval) *
*
*/
//#include <Ethernet.h>
//#include <Adafruit_CC3000.h>
#include <SPI.h>
#include "mongoose.h"
// CHANGE THESE VARIABLES
// NB: Devices with the same address must not end up on the same network.
// Use MAC address provided by device manufacturer (e.g. on a sticker).
// If there isn't one, use a random one from the locally administered range.
// See http://en.wikipedia.org/wiki/MAC_address for details.
static uint8_t board_mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
static uint8_t board_ip[] = {192, 168, 10, 177};
#ifdef WIFI_CC3000
static uint8_t subnet_mask[] = {255, 255, 255, 0};
static uint8_t gateway[] = {192, 168, 10, 254};
static uint8_t dns_ip[] = {192, 168, 10, 254};
static const char *wlan_ssid = "mynetwork";
static const char *wlan_pwd = "mypassword";
static int wlan_security = WLAN_SEC_WPA2;
#endif
static const char *s_target_address = "192.168.10.3:8000";
/////////////////////////////////////////////
static const char *s_request = "/printcontent";
static uint32_t IP2U32(uint8_t* iparr) {
return ((uint32_t)iparr[0] << 24) | ((uint32_t)iparr[1] << 16) | (iparr[2] << 8) | (iparr[3]);
}
static int get_data_to_send(char* buf, int buf_size) {
// Adding data to send
// It could be any sensor data, now just put uptime & free memory size here
return snprintf(buf, buf_size, "Uptime: %lus Free memory: %db",
millis()/1000, get_freememsize());
}
static void rfc_ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
int connect_status;
switch (ev) {
case NS_CONNECT:
connect_status = * (int *) ev_data;
if (connect_status == 0) {
char buf[100];
int len = get_data_to_send(buf, sizeof(buf));
mg_printf(nc, "POST %s HTTP/1.0\r\nHost: %s\r\nContent-Lenght: %d"
"\r\n\r\n%s", s_request, s_target_address, len, buf);
nc->flags |= MG_F_SEND_AND_CLOSE;
} else {
nc->flags |= MG_F_CLOSE_IMMEDIATELY;
}
break;
default:
break;
}
}
static struct mg_mgr mgr;
static struct mg_connection *nc;
void setup()
{
Serial.begin(9600);
Serial.println("Initialization...");
#if defined(ETHERNET_W5100)
avr_netinit(board_mac, board_ip);
#elif defined(WIFI_CC3000)
if (avr_netinit(wlan_ssid, wlan_pwd, wlan_security, IP2U32(board_ip),
IP2U32(subnet_mask), IP2U32(gateway), IP2U32(dns_ip)) != 0) {
Serial.println("Initialization error, check network settings");
return;
};
#endif
mg_mgr_init(&mgr, NULL);
Serial.println("Initialization done");
}
void loop() {
nc = mg_connect(&mgr, s_target_address, rfc_ev_handler);
if (nc != NULL) {
mg_set_protocol_http_websocket(nc);
}
uint32_t time_to_finish = millis() + 5000;
while (millis() < time_to_finish) {
mg_mgr_poll(&mgr, 1000);
}
}
-2
View File
@@ -1,2 +0,0 @@
# This "makefile" is only intended to prevent errors during main makefile execution
all:
-45
View File
@@ -1,45 +0,0 @@
# Arduino Restful Server
This example demonstrates how to use [Mongoose](https://www.cesanta.com/mongoose) to control Arduino
using HTTP requests.
Example just blinks by LED when Mongoose receives HTTP command, but it can be modified to execute any user-specific code.
At the moment this example supports [Arduino Mega 2560](http://arduino.cc/en/Main/ArduinoBoardMega2560) board (and compatible) with either W5100-based
network shield (like [Arduino Ethernet Shield](http://arduino.cc/en/Main/ArduinoEthernetShield)) or [CC3000](http://www.ti.com/product/cc3000)-based WIFI Shield.
## Build and run instructions:
###To run with Arduino Ethernet (W5100) shield:
1. Add (Sketch->Add file...) the following files to sketch:
- /mongoose/mongoose.h
- /mongoose/mongoose.c
- /mongoose/platforms/arduino_ethernet_W5100/avrsupport.h
- /mongoose/platforms/arduino_ethernet_W5100/avrsupport.cpp
2. Make `board_ip` and `board_mac` variables suitable for your network and board
3. Uncomment line `#include <Ethernet.h>`
4. Compile and flash sketch
5. Run `curl http://<board_ip/blink`
LED attached to PIN 13 will blink and board free memory size and board uptime will be displayed.
###To run with Adafruit WiFi (CC3000) shield:
1. Add (Sketch->Add files...) the following files to sketch:
- /mongoose/mongoose.h
- /mongoose/mongoose.c
- /mongoose/platforms/arduino_ethernet_W5100/avrsupport.h
- /mongoose/platforms/arduino_ethernet_W5100/avrsupport.cpp
2. Import Adafruit CC3000 library for mongoose
(select Sketch->Import Library...->Add library... and point
/mongoose/platforms/arduino_wifi_CC3000/adafruit_CC3000_lib_mongoose folder)
3. Make the following variables suitable for your network
- `board_ip`
- `subnet_mask`
- `gateway`
- `dns`
- `wlan_ssid`
- `wlan_pwd`
- `wlan_security`
5. Uncomment line `#include <Adafruit_CC3000.h>`
4. Compile and flash sketch
5. Run curl `http://<board_ip/blink`
LED attached to PIN 13 will blink and board free memory size and board uptime will be displayed.
@@ -1,133 +0,0 @@
/*
* Copyright (c) 2015 Cesanta Software Limited
* All rights reserved
*
* Build and run instructions:
* To run with Arduino Ethernet (W5100) shield:
* -----------------------------------------------------------
* 1. Add (Sketch->Add file...) the following files to sketch:
* - /mongoose/mongoose.h
* - /mongoose/mongoose.c
* - /mongoose/platforms/arduino_ethernet_W5100/avrsupport.h
* - /mongoose/platforms/arduino_ethernet_W5100/avrsupport.cpp
* 2. Make board_ip and board_mac variables suitable for your network and board
* 3. Uncomment line #include <Ethernet.h>
* 4. Compile & flash sketch
* 5. Run curl http://<board_ip/blink
* LED attached to PIN 13 will blink and board free memory size and uptime will responsed
*
* To run with Adafruit WiFi (CC3000) shield:
* -----------------------------------------------------------
* 1. Add (Sketch->Add files...) the following files to sketch:
* - /mongoose/mongoose.h
* - /mongoose/mongoose.c
* - /mongoose/platforms/arduino_ethernet_W5100/avrsupport.h
* - /mongoose/platforms/arduino_ethernet_W5100/avrsupport.cpp
* 2. Import Adafruit CC3000 library for mongoose (select Sketch->Import Library...->Add library... and point
* /mongoose/platforms/arduino_wifi_CC3000/adafruit_CC3000_lib_mongoose folder
* 3. Make the following variables suitable for your network
* - board_ip
* - subnet_mask
* - gateway
* - dns
* - wlan_ssid
* - wlan_pwd
* - wlan_security
* 5. Uncomment line #include <Adafruit_CC3000.h>
* 4. Compile & flash sketch
* 5. Run curl http://<board_ip/blink
* LED attached to PIN 13 will blink and board free memory size and uptime will responsed
*
*/
//#include <Ethernet.h>
//#include <Adafruit_CC3000.h>
#include <SPI.h>
#include "mongoose.h"
// CHANGE THESE VARIABLES
// NB: Devices with the same address must not end up on the same network.
// Use MAC address provided by device manufacturer (e.g. on a sticker).
// If there isn't one, use a random one from the locally administered range.
// See http://en.wikipedia.org/wiki/MAC_address for details.
static uint8_t board_mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
static uint8_t board_ip[] = {192, 168, 10, 8};
#ifdef WIFI_CC3000
static uint8_t subnet_mask[] = {255, 255, 255, 0};
static uint8_t gateway[] = {192, 168, 10, 254};
static uint8_t dns_ip[] = {192, 168, 10, 254};
static const char *wlan_ssid = "mynetwork";
static const char *wlan_pwd = "mypassword";
static int wlan_security = WLAN_SEC_WPA2;
#endif
///////////////////////////////////////////////
static const char *s_http_port = "60000";
static uint32_t IP2U32(uint8_t* iparr) {
return ((uint32_t)iparr[0] << 24) | ((uint32_t)iparr[1] << 16) | (iparr[2] << 8) | (iparr[3]);
}
static void rfs_ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
struct http_message *hm = (struct http_message *) ev_data;
char buf[100];
int clen;
switch (ev) {
case NS_HTTP_REQUEST:
if (mg_vcmp(&hm->uri, "/blink") == 0) {
blink(1, 500);
}
clen = snprintf(buf, sizeof(buf),
"Free memory size: %d Uptime: %d",
(int)get_freememsize(), (int)time(NULL));
mg_printf_http_chunk(nc, "HTTP/1.1 200 OK\r\n"
"Content-Length: %d\r\n"
"Transfer-Encoding: chunked\r\n\r\n"
"%s",
clen, buf);
mg_send_http_chunk(nc, "", 0);
break;
case NS_SEND:
nc->flags |= MG_F_CLOSE_IMMEDIATELY;
break;
default:
break;
}
}
static struct mg_connection *nc;
static struct mg_mgr mgr;
void setup() {
Serial.begin(9600);
Serial.println("Initialization...");
#if defined(ETHERNET_W5100)
avr_netinit(board_mac, board_ip);
#elif defined(WIFI_CC3000)
if (avr_netinit(wlan_ssid, wlan_pwd, wlan_security, IP2U32(board_ip),
IP2U32(subnet_mask), IP2U32(gateway), IP2U32(dns_ip)) != 0) {
Serial.println("Initialization error, check network settings");
return;
};
#endif
mg_mgr_init(&mgr, NULL);
nc = mg_bind(&mgr, s_http_port, rfs_ev_handler);
mg_set_protocol_http_websocket(nc);
Serial.println("Initialization done");
}
void loop() {
mg_mgr_poll(&mgr, 1000);
}
-2
View File
@@ -1,2 +0,0 @@
PROG = big_upload
include ../examples.mk
-153
View File
@@ -1,153 +0,0 @@
// Copyright (c) 2015 Cesanta Software Limited
// All rights reserved
//
// This example demonstrates how to handle very large requests without keeping
// them in memory.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "mongoose.h"
static const char *s_http_port = "8000";
struct file_writer_data {
FILE *fp;
size_t bytes_left;
};
static void handle_request(struct mg_connection *nc) {
// This handler gets called only when we don't reset proto_handler in
// handle_recv, so we just return a page unconditionally.
mg_printf(nc, "%s",
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/html\r\n"
"Connection: close\r\n"
"\r\n"
"<html><body>Upload example."
"<form method=\"POST\" action=\"/upload\" "
" enctype=\"multipart/form-data\">"
"<input type=\"file\" name=\"file\" /> <br/>"
"<input type=\"submit\" value=\"Upload\" />"
"</form></body></html>");
nc->flags |= MG_F_SEND_AND_CLOSE;
}
static void handle_recv(struct mg_connection *nc) {
struct file_writer_data *data = (struct file_writer_data *) nc->user_data;
if (data == NULL) {
// This is a new connection, try to parse HTTP request.
struct http_message hm;
int req_len = mg_parse_http(nc->recv_mbuf.buf, nc->recv_mbuf.len, &hm,
1 /* is_req */);
if (req_len < 0 ||
(req_len == 0 && nc->recv_mbuf.len >= MG_MAX_HTTP_REQUEST_SIZE)) {
nc->flags |= MG_F_CLOSE_IMMEDIATELY;
} else if (req_len == 0) {
// Request is not complete yet, do nothing.
} else if (mg_vcasecmp(&hm.method, "POST") == 0 &&
mg_vcmp(&hm.uri, "/upload") == 0) {
// This is the request that we don't want to buffer in memory.
if (hm.body.len == (size_t) ~0 || hm.body.len == 0) {
mg_printf(nc, "%s",
"HTTP/1.1 411 Content-Length required\r\n"
"Content-Length: 0\r\n\r\n");
nc->flags |= MG_F_SEND_AND_CLOSE;
return;
}
// Reset proto_handler so Mongoose's http_handler() won't get confused
// once we start removing data from the buffer.
nc->proto_handler = NULL;
// Headers will be inaccessible later, so put everything we need into
// user_data.
data = calloc(1, sizeof(struct file_writer_data));
data->bytes_left = hm.body.len;
data->fp = tmpfile();
if (data->fp == NULL) {
mg_printf(nc, "%s",
"HTTP/1.1 500 Failed to open a file\r\n"
"Content-Length: 0\r\n\r\n");
nc->flags |= MG_F_SEND_AND_CLOSE;
return;
}
nc->user_data = (void *) data;
// Remove the headers from the buffer.
mbuf_remove(&nc->recv_mbuf, hm.body.p - nc->recv_mbuf.buf);
// Invoke itself again to write the piece of the body that is already in
// the buffer.
handle_recv(nc);
}
} else { // data != NULL
size_t to_write = data->bytes_left, written = 0;
if (nc->recv_mbuf.len < to_write) to_write = nc->recv_mbuf.len;
written = fwrite(nc->recv_mbuf.buf, 1, to_write, data->fp);
mbuf_remove(&nc->recv_mbuf, written);
data->bytes_left -= written;
if (data->bytes_left <= 0) {
// Request is complete, do something meaningful here.
mg_printf(nc,
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/plain\r\n"
"Connection: close\r\n\r\n"
"Written %ld of POST data to a temp file\n\n",
(long) ftell(data->fp));
nc->flags |= MG_F_SEND_AND_CLOSE;
// handle_close will free the resources.
}
}
}
// Make sure we free all allocated resources
static void handle_close(struct mg_connection *nc) {
struct file_writer_data *data = (struct file_writer_data *) nc->user_data;
if (data != NULL) {
fclose(data->fp);
free(data);
nc->user_data = NULL;
}
}
static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
(void) ev_data;
switch (ev) {
case MG_EV_HTTP_REQUEST:
// Invoked when the full HTTP request is in the buffer (including body).
handle_request(nc);
break;
case MG_EV_RECV:
// Invoked every time new data arrives.
handle_recv(nc);
break;
case MG_EV_CLOSE:
handle_close(nc);
break;
}
}
int main(void) {
struct mg_mgr mgr;
struct mg_connection *nc;
mg_mgr_init(&mgr, NULL);
nc = mg_bind(&mgr, s_http_port, ev_handler);
// Set up HTTP server parameters
mg_set_protocol_http_websocket(nc);
printf("Starting web server on port %s\n", s_http_port);
for (;;) {
mg_mgr_poll(&mgr, 1000);
}
mg_mgr_free(&mgr);
return 0;
}
+25
View File
@@ -0,0 +1,25 @@
PROG ?= example # Program we are building
DELETE = rm -rf # Command to remove files
OUT ?= -o $(PROG) # Compiler argument for output file
SOURCES = main.c mongoose.c # Source code files
CFLAGS = -W -Wall -Wextra -g -I. # Build options
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
CFLAGS_MONGOOSE += -DMG_IO_SIZE=8192 -DMG_ENABLE_LINES
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
PROG ?= example.exe # Use .exe suffix for the binary
CC = gcc # Use MinGW gcc compiler
CFLAGS += -lws2_32 # Link against Winsock library
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
OUT ?= -o $(PROG) # Build output
endif
all: $(PROG) # Default target. Build and run program
$(RUN) ./$(PROG) $(ARGS)
$(PROG): $(SOURCES) # Build program from sources
$(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT)
clean: # Cleanup. Delete built program and all build artifacts
$(DELETE) $(PROG) *.o *.obj *.exe *.dSYM
+1
View File
@@ -0,0 +1 @@
See detailed tutorial at https://mongoose.ws/tutorials/captive-dns-server/
+58
View File
@@ -0,0 +1,58 @@
// 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;
}
+1
View File
@@ -0,0 +1 @@
../../mongoose.c
+1
View File
@@ -0,0 +1 @@
../../mongoose.h
-4
View File
@@ -1,4 +0,0 @@
PROG = captive_dns_server
MODULE_CFLAGS=-DMG_ENABLE_DNS_SERVER
include ../rules.mk
@@ -1,83 +0,0 @@
/*
* Copyright (c) 2014 Cesanta Software Limited
* All rights reserved
*/
/*
* Try it out with:
* $ dig -t A www.google.com -4 @localhost -p 5533
*/
#include "../../mongoose.h"
#include <stdio.h>
static int s_exit_flag = 0;
static in_addr_t s_our_ip_addr;
static const char *s_listening_addr = "udp://:5533";
static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
struct mg_dns_message *msg;
struct mg_dns_resource_record *rr;
struct mg_dns_reply reply;
int i;
switch (ev) {
case MG_DNS_MESSAGE:
msg = (struct mg_dns_message *) ev_data;
reply = mg_dns_create_reply(&nc->send_mbuf, msg);
for (i = 0; i < msg->num_questions; i++) {
rr = &msg->questions[i];
if (rr->rtype == MG_DNS_A_RECORD) {
mg_dns_reply_record(&reply, rr, NULL, rr->rtype, 3600,
&s_our_ip_addr, 4);
}
}
/*
* We don't set the error flag even if there were no answers
* maching the MG_DNS_A_RECORD query type.
* This indicates that we have (syntetic) answers for MG_DNS_A_RECORD.
* See http://goo.gl/QWvufr for a distinction between NXDOMAIN and NODATA.
*/
mg_dns_send_reply(nc, &reply);
nc->flags |= MG_F_SEND_AND_CLOSE;
break;
}
}
int main(int argc, char *argv[]) {
struct mg_mgr mgr;
struct mg_connection *nc;
int i;
mg_mgr_init(&mgr, NULL);
s_our_ip_addr = inet_addr("127.0.0.1");
/* Parse command line arguments */
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-D") == 0) {
mgr.hexdump_file = argv[++i];
} else if (strcmp(argv[i], "-l") == 0 && i + 1 < argc) {
s_listening_addr = argv[++i];
} else {
s_our_ip_addr = inet_addr(argv[i]);
}
}
fprintf(stderr, "Listening on '%s'\n", s_listening_addr);
if ((nc = mg_bind(&mgr, s_listening_addr, ev_handler)) == NULL) {
fprintf(stderr, "cannot bind to socket\n");
exit(1);
}
mg_set_protocol_dns(nc);
while (s_exit_flag == 0) {
mg_mgr_poll(&mgr, 1000);
}
mg_mgr_free(&mgr);
return 0;
}
-14
View File
@@ -1,14 +0,0 @@
PROG = coap_client
SOURCES = $(PROG).c ../../mongoose.c
CFLAGS = -W -Wall -I../.. $(CFLAGS_EXTRA) -DMG_ENABLE_COAP
all: $(PROG)
$(PROG): $(SOURCES)
$(CC) $(SOURCES) -o $@ $(CFLAGS)
$(PROG).exe: $(SOURCES)
cl $(SOURCES) /I../.. /MD /Fe$@
clean:
rm -rf *.gc* *.dSYM *.exe *.obj *.o a.out $(PROG)
-71
View File
@@ -1,71 +0,0 @@
/*
* Copyright (c) 2015 Cesanta Software Limited
* All rights reserved
*
* This program sends CoAP CON-message to server (coap.me by default)
* and waits for answer.
*/
#include "mongoose.h"
static int s_time_to_exit = 0;
static char *s_default_address = "udp://coap.me:5683";
static void coap_handler(struct mg_connection *nc, int ev, void *p) {
switch (ev) {
case MG_EV_CONNECT: {
struct mg_coap_message cm;
uint32_t res;
memset(&cm, 0, sizeof(cm));
cm.msg_id = 1;
cm.msg_type = MG_COAP_MSG_CON;
printf("Sending CON...\n");
res = mg_coap_send_message(nc, &cm);
if (res == 0) {
printf("Sent CON with msg_id = %d\n", cm.msg_id);
} else {
printf("Error: %d\n", res);
s_time_to_exit = 1;
}
break;
}
case MG_EV_COAP_ACK:
case MG_EV_COAP_RST: {
struct mg_coap_message *cm = (struct mg_coap_message *) p;
printf("ACK/RST for message with msg_id = %d received\n", cm->msg_id);
s_time_to_exit = 1;
break;
}
}
}
int main(int argc, char *argv[]) {
struct mg_mgr mgr;
struct mg_connection *nc;
char *address = s_default_address;
if (argc > 1) {
address = argv[1];
}
printf("Using %s as CoAP server\n", address);
mg_mgr_init(&mgr, 0);
nc = mg_connect(&mgr, address, coap_handler);
if (nc == NULL) {
printf("Unable to connect to %s\n", address);
return -1;
}
mg_set_protocol_coap(nc);
while (!s_time_to_exit) {
mg_mgr_poll(&mgr, 1000000);
}
mg_mgr_free(&mgr);
return 0;
}
-14
View File
@@ -1,14 +0,0 @@
PROG = coap_server
SOURCES = $(PROG).c ../../mongoose.c
CFLAGS = -W -Wall -I../.. $(CFLAGS_EXTRA) -DMG_ENABLE_COAP
all: $(PROG)
$(PROG): $(SOURCES)
$(CC) $(SOURCES) -o $@ $(CFLAGS)
$(PROG).exe: $(SOURCES)
cl $(SOURCES) /I../.. /MD /Fe$@
clean:
rm -rf *.gc* *.dSYM *.exe *.obj *.o a.out $(PROG)
-72
View File
@@ -1,72 +0,0 @@
/*
* Copyright (c) 2015 Cesanta Software Limited
* All rights reserved
*
* This program listens on 5683 for CoAP messages,
* sends ACK is nessesary and dump everything received.
* It is possible to use ../coap_client to send message.
*/
#include "mongoose.h"
static char *s_default_address = "udp://:5683";
static int s_sig_received = 0;
static void signal_handler(int sig_num) {
signal(sig_num, signal_handler);
s_sig_received = sig_num;
}
static void coap_handler(struct mg_connection *nc, int ev, void *p) {
switch (ev) {
case MG_EV_COAP_CON: {
uint32_t res;
struct mg_coap_message *cm = (struct mg_coap_message *) p;
printf("CON with msg_id = %d received\n", cm->msg_id);
res = mg_coap_send_ack(nc, cm->msg_id);
if (res == 0) {
printf("Successfully sent ACK for message with msg_id = %d\n",
cm->msg_id);
} else {
printf("Error: %d\n", res);
}
break;
}
case MG_EV_COAP_NOC:
case MG_EV_COAP_ACK:
case MG_EV_COAP_RST: {
struct mg_coap_message *cm = (struct mg_coap_message *) p;
printf("ACK/RST/NOC with msg_id = %d received\n", cm->msg_id);
break;
}
}
}
int main() {
struct mg_mgr mgr;
struct mg_connection *nc;
signal(SIGTERM, signal_handler);
signal(SIGINT, signal_handler);
mg_mgr_init(&mgr, 0);
nc = mg_bind(&mgr, s_default_address, coap_handler);
if (nc == NULL) {
printf("Unable to start listener at %s\n", s_default_address);
return -1;
}
printf("Listening for CoAP messages at %s\n", s_default_address);
mg_set_protocol_coap(nc);
while (!s_sig_received) {
mg_mgr_poll(&mgr, 1000000);
}
printf("Exiting on signal %d\n", s_sig_received);
mg_mgr_free(&mgr);
return 0;
}
-2
View File
@@ -1,2 +0,0 @@
PROG = server
include ../examples.mk
-43
View File
@@ -1,43 +0,0 @@
// Copyright (c) 2015 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
static const char *s_http_port = "8000";
static struct mg_serve_http_opts s_http_server_opts;
static void ev_handler(struct mg_connection *nc, int ev, void *p) {
if (ev == MG_EV_HTTP_REQUEST) {
mg_serve_http(nc, p, s_http_server_opts); // Serves static content
}
}
int main(void) {
struct mg_mgr mgr;
struct mg_connection *nc;
cs_stat_t st;
mg_mgr_init(&mgr, NULL);
nc = mg_bind(&mgr, s_http_port, ev_handler);
if (nc == NULL) {
fprintf(stderr, "Cannot bind to %s\n", s_http_port);
exit(1);
}
// Set up HTTP server parameters
mg_set_protocol_http_websocket(nc);
s_http_server_opts.document_root = "web_root"; // Set up web root directory
if (mg_stat(s_http_server_opts.document_root, &st) != 0) {
fprintf(stderr, "%s", "Cannot find web_root directory, exiting\n");
exit(1);
}
printf("Starting web server on port %s\n", s_http_port);
for (;;) {
mg_mgr_poll(&mgr, 1000);
}
mg_mgr_free(&mgr);
return 0;
}
@@ -1,39 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Connected device demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="content">
<img src="logo.png" style="float:right; height: 50px; border-radius: 3px;">
<h1>Connected device demo - static content only</h1>
<p>
This page shows initial steps on how to make a device connected.
Mongoose serves static content from the <code>web_root</code>
directory. Images, CSS, HTML, JavaScript files could be dropped into the
<code>web_root</code> directory - and they'll be served happily
by Mongoose.
</p>
<p>
Below is a placeholder for the
settings section, and a real-time dashboard, which will be
implemented in the following examples.
Both settings section, and a dashboard section, could be organised
differently on this UI - for example, in different tabs. But, to
make the demonstration clearer, we show everything on one page.
</p>
<h1>Settings section</h1>
<p>Nothing here yet</p>
<h1>Dashboard section</h1>
<p>Nothing here yet</p>
</div>
</body>
</html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

@@ -1,31 +0,0 @@
* {
outline: none;
}
body {
background-color: #36c;
margin: 0;
padding: 0;
font: 16px/1.4 Helvetica, Arial, sans-serif;
}
div.content {
width: 800px;
margin: 1em auto;
padding: 2em;
background-color: #fff;
border-radius: 1em;
}
code {
background: #f0f0f0;
padding: 0 0.3em;
color: #396;
border-radius: 0.3em;
}
a:link, a:visited {
color: #69c;
text-decoration: none;
}
-2
View File
@@ -1,2 +0,0 @@
PROG = server
include ../examples.mk
-81
View File
@@ -1,81 +0,0 @@
// Copyright (c) 2015 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
struct device_settings {
char setting1[100];
char setting2[100];
};
static const char *s_http_port = "8000";
static struct mg_serve_http_opts s_http_server_opts;
static struct device_settings s_settings = { "value1", "value2" };
static void handle_save(struct mg_connection *nc, struct http_message *hm) {
// Get form variables and store settings values
mg_get_http_var(&hm->body, "setting1", s_settings.setting1,
sizeof(s_settings.setting1));
mg_get_http_var(&hm->body, "setting2", s_settings.setting2,
sizeof(s_settings.setting2));
// Send response
mg_printf(nc, "%s", "HTTP/1.1 302 OK\r\nLocation: /\r\n\r\n");
}
static void handle_ssi_call(struct mg_connection *nc, const char *param) {
if (strcmp(param, "setting1") == 0) {
mg_printf_html_escape(nc, "%s", s_settings.setting1);
} else if (strcmp(param, "setting2") == 0) {
mg_printf_html_escape(nc, "%s", s_settings.setting2);
}
}
static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
struct http_message *hm = (struct http_message *) ev_data;
switch (ev) {
case MG_EV_HTTP_REQUEST:
if (mg_vcmp(&hm->uri, "/save") == 0) {
handle_save(nc, hm);
} else {
mg_serve_http(nc, hm, s_http_server_opts); // Serve static content
}
break;
case MG_EV_SSI_CALL:
handle_ssi_call(nc, ev_data);
break;
default:
break;
}
}
int main(void) {
struct mg_mgr mgr;
struct mg_connection *nc;
cs_stat_t st;
mg_mgr_init(&mgr, NULL);
nc = mg_bind(&mgr, s_http_port, ev_handler);
if (nc == NULL) {
fprintf(stderr, "Cannot bind to %s\n", s_http_port);
exit(1);
}
// Set up HTTP server parameters
mg_set_protocol_http_websocket(nc);
s_http_server_opts.document_root = "web_root"; // Set up web root directory
if (mg_stat(s_http_server_opts.document_root, &st) != 0) {
fprintf(stderr, "%s", "Cannot find web_root directory, exiting\n");
exit(1);
}
printf("Starting web server on port %s\n", s_http_port);
for (;;) {
mg_mgr_poll(&mgr, 1000);
}
mg_mgr_free(&mgr);
return 0;
}
@@ -1,46 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Connected device demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="content">
<img src="logo.png" style="float:right; height: 50px; border-radius: 3px;">
<h1>Connected device demo - settings section</h1>
<p>
This page is one of the series of examples that show how to make
devices connected with Mongoose. Here, we create a settings section
that expose some internal device variables, and allow user to change
them. They could be some stored in a database, in a file, or in
firmware RAM. In this example, we store them in RAM, and use two
variables, one integer and one string. We use SSI
<code>&lt;!--#call parameter_name --&gt;</code> directive to fetch
variable values from Mongoose.
</p>
<h1>Settings section</h1>
<form method="POST" action="/save">
<fieldset>
<legend>Device settings</legend>
<label>Setting 1:</label> <input type="text"
name="setting1" value="<!--#call setting1 -->" >
<label>Setting 2:</label> <input type="text"
name="setting2" value="<!--#call setting2 -->" >
<div>
<button type="submit">Save Settings</button>
</div>
</fieldset>
</form>
<h1>Dashboard section</h1>
<p>Nothing here yet</p>
</div>
</body>
</html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

@@ -1,67 +0,0 @@
* {
outline: none;
}
body {
background: #36c;
color: #555;
margin: 0;
padding: 0;
font: 16px/1.4 Helvetica, Arial, sans-serif;
}
div.content {
width: 800px;
margin: 1em auto;
padding: 2em;
background-color: #fff;
border-radius: 1em;
}
fieldset {
border: 1px solid #ccc;
padding: 1em;
}
fieldset legend {
font-style: italic;
color: silver;
}
fieldset label {
text-align: right;
padding: 0 1em;
}
input[type=text] {
font-size: 100%;
padding: 0.2em;
border: 1px solid #ccc;
}
button {
color: #666;
background: #eee;
border: 1px solid #ccc;
padding: 0.2em 2em;
font-size: 100%;
cursor: pointer;
margin-top: 1em;
}
button:hover {
background: #ccc;
}
code {
background: #f0f0f0;
padding: 0 0.3em;
color: #396;
border-radius: 0.3em;
}
a:link, a:visited {
color: #69c;
text-decoration: none;
}
-2
View File
@@ -1,2 +0,0 @@
PROG = server
include ../examples.mk
-98
View File
@@ -1,98 +0,0 @@
// Copyright (c) 2015 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
struct device_settings {
char setting1[100];
char setting2[100];
};
static const char *s_http_port = "8000";
static struct mg_serve_http_opts s_http_server_opts;
static struct device_settings s_settings = { "value1", "value2" };
static void handle_save(struct mg_connection *nc, struct http_message *hm) {
// Get form variables and store settings values
mg_get_http_var(&hm->body, "setting1", s_settings.setting1,
sizeof(s_settings.setting1));
mg_get_http_var(&hm->body, "setting2", s_settings.setting2,
sizeof(s_settings.setting2));
// Send response
mg_printf(nc, "%s", "HTTP/1.1 302 OK\r\nLocation: /\r\n\r\n");
}
static void handle_get_cpu_usage(struct mg_connection *nc) {
// Generate random value, as an example of changing CPU usage
// Getting real CPU usage depends on the OS.
int cpu_usage = (double) rand() / RAND_MAX * 100.0;
// Use chunked encoding in order to avoid calculating Content-Length
mg_printf(nc, "%s", "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n");
// Output JSON object which holds CPU usage data
mg_printf_http_chunk(nc, "{ \"result\": %d }", cpu_usage);
// Send empty chunk, the end of response
mg_send_http_chunk(nc, "", 0);
}
static void handle_ssi_call(struct mg_connection *nc, const char *param) {
if (strcmp(param, "setting1") == 0) {
mg_printf_html_escape(nc, "%s", s_settings.setting1);
} else if (strcmp(param, "setting2") == 0) {
mg_printf_html_escape(nc, "%s", s_settings.setting2);
}
}
static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
struct http_message *hm = (struct http_message *) ev_data;
switch (ev) {
case MG_EV_HTTP_REQUEST:
if (mg_vcmp(&hm->uri, "/save") == 0) {
handle_save(nc, hm);
} else if (mg_vcmp(&hm->uri, "/get_cpu_usage") == 0) {
handle_get_cpu_usage(nc);
} else {
mg_serve_http(nc, hm, s_http_server_opts); // Serve static content
}
break;
case MG_EV_SSI_CALL:
handle_ssi_call(nc, ev_data);
break;
default:
break;
}
}
int main(void) {
struct mg_mgr mgr;
struct mg_connection *nc;
cs_stat_t st;
mg_mgr_init(&mgr, NULL);
nc = mg_bind(&mgr, s_http_port, ev_handler);
if (nc == NULL) {
fprintf(stderr, "Cannot bind to %s\n", s_http_port);
exit(1);
}
// Set up HTTP server parameters
mg_set_protocol_http_websocket(nc);
s_http_server_opts.document_root = "web_root"; // Set up web root directory
if (mg_stat(s_http_server_opts.document_root, &st) != 0) {
fprintf(stderr, "%s", "Cannot find web_root directory, exiting\n");
exit(1);
}
printf("Starting web server on port %s\n", s_http_port);
for (;;) {
mg_mgr_poll(&mgr, 1000);
}
mg_mgr_free(&mgr);
return 0;
}
@@ -1,44 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Connected device demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="main.js"></script>
</head>
<body>
<div class="content">
<img src="logo.png" style="float:right; height: 50px; border-radius: 3px;">
<h1>Connected device demo - RESTful call</h1>
<p>
This page is one of the series of examples that show how to make
devices connected with Mongoose. Here we add a RESTful call
to the Mongoose to show CPU usage stats on a dashboard.
RESTful call is done using Jquery's <code>ajax</code> call.
</p>
<h1>Settings section</h1>
<form method="POST" action="/save">
<fieldset>
<legend>Device settings</legend>
<label>Setting 1:</label> <input type="text"
name="setting1" value="<!--#call setting1 -->" >
<label>Setting 2:</label> <input type="text"
name="setting2" value="<!--#call setting2 -->" >
<div>
<button type="submit">Save Settings</button>
</div>
</fieldset>
</form>
<h1>Dashboard section</h1>
<label>CPU usage:</label> <span id="cpu_usage">&nbsp;</span>
</div>
</body>
</html>
@@ -1,5 +0,0 @@
/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^Line truncated
return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var Line truncated
return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[cLine truncated
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

@@ -1,12 +0,0 @@
$(document).ready(function() {
// Start 1-second timer to call RESTful endpoint
setInterval(function() {
$.ajax({
url: '/get_cpu_usage',
dataType: 'json',
success: function(json) {
$('#cpu_usage').text(json.result + '% ');
}
});
}, 1000);
});
@@ -1,66 +0,0 @@
* {
outline: none;
}
body {
background: #36c;
color: #555;
margin: 0;
padding: 0;
font: 16px/1.4 Helvetica, Arial, sans-serif;
}
div.content {
width: 800px;
margin: 1em auto;
padding: 2em;
background-color: #fff;
border-radius: 1em;
}
fieldset {
border: 1px solid #ccc;
padding: 1em;
}
fieldset legend {
font-style: italic;
color: silver;
}
fieldset label {
text-align: right;
padding: 0 1em;
}
input[type=text] {
font-size: 100%;
padding: 0.2em;
border: 1px solid #ccc;
}
button {
color: #666;
background: #eee;
border: 1px solid #ccc;
padding: 0.2em 2em;
font-size: 100%;
cursor: pointer;
margin-top: 1em;
}
button:hover {
background: #ccc;
}
code {
background: #f0f0f0;
padding: 0 0.3em;
color: #396;
border-radius: 0.3em;
}
a:link, a:visited {
color: #69c;
text-decoration: none;
}
-2
View File
@@ -1,2 +0,0 @@
PROG = server
include ../examples.mk
-115
View File
@@ -1,115 +0,0 @@
// Copyright (c) 2015 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
struct device_settings {
char setting1[100];
char setting2[100];
};
static const char *s_http_port = "8000";
static struct mg_serve_http_opts s_http_server_opts;
static struct device_settings s_settings = { "value1", "value2" };
static void handle_save(struct mg_connection *nc, struct http_message *hm) {
// Get form variables and store settings values
mg_get_http_var(&hm->body, "setting1", s_settings.setting1,
sizeof(s_settings.setting1));
mg_get_http_var(&hm->body, "setting2", s_settings.setting2,
sizeof(s_settings.setting2));
// Send response
mg_printf(nc, "%s", "HTTP/1.1 302 OK\r\nLocation: /\r\n\r\n");
}
static void handle_get_cpu_usage(struct mg_connection *nc) {
// Generate random value, as an example of changing CPU usage
// Getting real CPU usage depends on the OS.
int cpu_usage = (double) rand() / RAND_MAX * 100.0;
// Use chunked encoding in order to avoid calculating Content-Length
mg_printf(nc, "%s", "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n");
// Output JSON object which holds CPU usage data
mg_printf_http_chunk(nc, "{ \"result\": %d }", cpu_usage);
// Send empty chunk, the end of response
mg_send_http_chunk(nc, "", 0);
}
static void handle_ssi_call(struct mg_connection *nc, const char *param) {
if (strcmp(param, "setting1") == 0) {
mg_printf_html_escape(nc, "%s", s_settings.setting1);
} else if (strcmp(param, "setting2") == 0) {
mg_printf_html_escape(nc, "%s", s_settings.setting2);
}
}
static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
struct http_message *hm = (struct http_message *) ev_data;
switch (ev) {
case MG_EV_HTTP_REQUEST:
if (mg_vcmp(&hm->uri, "/save") == 0) {
handle_save(nc, hm);
} else if (mg_vcmp(&hm->uri, "/get_cpu_usage") == 0) {
handle_get_cpu_usage(nc);
} else {
mg_serve_http(nc, hm, s_http_server_opts); // Serve static content
}
break;
case MG_EV_SSI_CALL:
handle_ssi_call(nc, ev_data);
break;
default:
break;
}
}
static void push_data_to_all_websocket_connections(struct mg_mgr *m) {
struct mg_connection *c;
int memory_usage = (double) rand() / RAND_MAX * 100.0;
for (c = mg_next(m, NULL); c != NULL; c = mg_next(m, c)) {
if (c->flags & MG_F_IS_WEBSOCKET) {
mg_printf_websocket_frame(c, WEBSOCKET_OP_TEXT, "%d", memory_usage);
}
}
}
int main(void) {
struct mg_mgr mgr;
struct mg_connection *nc;
cs_stat_t st;
mg_mgr_init(&mgr, NULL);
nc = mg_bind(&mgr, s_http_port, ev_handler);
if (nc == NULL) {
fprintf(stderr, "Cannot bind to %s\n", s_http_port);
exit(1);
}
// Set up HTTP server parameters
mg_set_protocol_http_websocket(nc);
s_http_server_opts.document_root = "web_root"; // Set up web root directory
if (mg_stat(s_http_server_opts.document_root, &st) != 0) {
fprintf(stderr, "%s", "Cannot find web_root directory, exiting\n");
exit(1);
}
printf("Starting web server on port %s\n", s_http_port);
for (;;) {
static time_t last_time;
time_t now = time(NULL);
mg_mgr_poll(&mgr, 1000);
if (now - last_time > 0) {
push_data_to_all_websocket_connections(&mgr);
last_time = now;
}
}
mg_mgr_free(&mgr);
return 0;
}
@@ -1,46 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Connected device demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script src="jquery.flot.min.js"></script>
<script src="jquery.flot.time.js"></script>
<script type="text/javascript" src="main.js"></script>
</head>
<body>
<div class="content">
<img src="logo.png" style="float:right; height: 50px; border-radius: 3px;">
<h1>Connected device demo - Websocket push</h1>
<p>
This page is one of the series of examples that show how to make
devices connected with Mongoose. Here we add a real-time Websocket
server push, and update dashboard graph as data arrives.
</p>
<h1>Settings section</h1>
<form method="POST" action="/save">
<fieldset>
<legend>Device settings</legend>
<label>Setting 1:</label> <input type="text"
name="setting1" value="<!--#call setting1 -->" >
<label>Setting 2:</label> <input type="text"
name="setting2" value="<!--#call setting2 -->" >
<div>
<button type="submit">Save Settings</button>
</div>
</fieldset>
</form>
<h1>Dashboard section</h1>
<label>CPU usage:</label> <span id="cpu_usage">&nbsp;</span>
<div id="graphs"></div>
</div>
</body>
</html>
@@ -1,5 +0,0 @@
/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^Line truncated
return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var Line truncated
return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[cLine truncated
@@ -1,8 +0,0 @@
/* Javascript plotting library for jQuery, version 0.8.3.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
*/
(function($){$.color={};$.color.make=function(r,g,b,a){var o={};o.r=r||0;o.g=g||0;o.b=b||0;o.a=a!=null?a:1;o.add=function(c,d){for(var i=0;i<c.length;++i)o[c.charAt(i)]+=d;return o.normalize()};o.scale=function(c,f){for(var i=0;i<c.length;++i)o[c.charAt(i)]*=f;return o.normalize()};o.toString=function(){if(o.a>=1){return"rgb("+[o.r,o.g,o.b].join(",")+")"}else{return"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"}};o.normalize=function(){function clamp(min,value,max){return value<min?min:value>max?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=""&&c!="transparent")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),"body"));if(c=="rgba(0, 0, 0, 0)")c="transparent";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function($){var hasOwnProperty=Object.prototype.hasOwnProperty;if(!$.fn.detach){$.fn.detach=function(){return this.each(function(){if(this.parentNode){this.parentNode.removeChild(this)}})}}function Canvas(cls,container){var element=container.children("."+cls)[0];if(element==null){element=document.createElement("canvas");element.className=cls;$(element).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(container);if(!element.getContext){if(window.G_vmlCanvasManager){element=window.G_vmlCanvasManager.initElement(element)}else{throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.")}}}this.element=element;var context=this.context=element.getContext("2d");var devicePixelRatio=window.devicePixelRatio||1,backingStoreRatio=context.webkitBackingStorePixelRatio||context.mozBackingStorePixelRatio||context.msBackingStorePixelRatio||context.oBackingStorePixelRatio||context.backingStorePixelRatio||1;this.pixelRatio=devicePixelRatio/backingStoreRatio;this.resize(container.width(),container.height());this.textContainer=null;this.text={};this._textCache={}}Canvas.prototype.resize=function(width,height){if(width<=0||height<=0){throw new Error("Invalid dimensions for plot, width = "+width+", height = "+height)}var element=this.element,context=this.context,pixelRatio=this.pixelRatio;if(this.width!=width){element.width=width*pixelRatio;element.style.width=width+"px";this.width=width}if(this.height!=height){element.height=height*pixelRatio;element.style.height=height+"px";this.height=height}context.restore();context.save();context.scale(pixelRatio,pixelRatio)};Canvas.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)};Canvas.prototype.render=function(){vaLine truncated
if(yrange.from==null)yrange.from=yrange.axis.min;if(yrange.to==null)yrange.to=yrange.axis.max;if(xrange.to<xrange.axis.min||xrange.from>xrange.axis.max||yrange.to<yrange.axis.min||yrange.from>yrange.axis.max)continue;xrange.from=Math.max(xrange.from,xrange.axis.min);xrange.to=Math.min(xrange.to,xrange.axis.max);yrange.from=Math.max(yrange.from,yrange.axis.min);yrange.to=Math.min(yrange.to,yrange.axis.max);var xequal=xrange.from===xrange.to,yequal=yrange.from===yrange.to;if(xequal&&yequal){continue}xrange.from=Math.floor(xrange.axis.p2c(xrange.from));xrange.to=Math.floor(xrange.axis.p2c(xrange.to));yrange.from=Math.floor(yrange.axis.p2c(yrange.from));yrange.to=Math.floor(yrange.axis.p2c(yrange.to));if(xequal||yequal){var lineWidth=m.lineWidth||options.grid.markingsLineWidth,subPixel=lineWidth%2?.5:0;ctx.beginPath();ctx.strokeStyle=m.color||options.grid.markingsColor;ctx.lineWidth=lineWidth;if(xequal){ctx.moveTo(xrange.to+subPixel,yrange.from);ctx.lineTo(xrange.to+subPixel,yrange.to)}else{ctx.moveTo(xrange.from,yrange.to+subPixel);ctx.lineTo(xrange.to,yrange.to+subPixel)}ctx.stroke()}else{ctx.fillStyle=m.color||options.grid.markingsColor;ctx.fillRect(xrange.from,yrange.to,xrange.to-xrange.from,yrange.from-yrange.to)}}}axes=allAxes();bw=options.grid.borderWidth;for(var j=0;j<axes.length;++j){var axis=axes[j],box=axis.box,t=axis.tickLength,x,y,xoff,yoff;if(!axis.show||axis.ticks.length==0)continue;ctx.lineWidth=1;if(axis.direction=="x"){x=0;if(t=="full")y=axis.position=="top"?0:plotHeight;else y=box.top-plotOffset.top+(axis.position=="top"?box.height:0)}else{y=0;if(t=="full")x=axis.position=="left"?0:plotWidth;else x=box.left-plotOffset.left+(axis.position=="left"?box.width:0)}if(!axis.innermost){ctx.strokeStyle=axis.options.color;ctx.beginPath();xoff=yoff=0;if(axis.direction=="x")xoff=plotWidth+1;else yoff=plotHeight+1;if(ctx.lineWidth==1){if(axis.direction=="x"){y=Math.floor(y)+.5}else{x=Math.floor(x)+.5}}ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff);ctx.stroke()}ctx.strokeStyle=axis.options.tickColor;ctx.beginPath();for(i=0;i<axis.ticks.length;++i){var v=axis.ticks[i].v;xoff=yoff=0;if(isNaN(v)||v<axis.min||v>axis.max||t=="full"&&(typeof bw=="object"&&bw[axis.position]>0||bw>0)&&(v==axis.min||v==axis.max))continue;if(axis.direction=="x"){x=axis.p2c(v);yoff=t=="full"?-plotHeight:t;if(axis.position=="top")yoff=-yoff}else{y=axis.p2c(v);xoff=t=="full"?-plotWidth:t;if(axis.position=="left")xoff=-xoff}if(ctx.lineWidth==1){if(axis.direction=="x")x=Math.floor(x)+.5;else y=Math.floor(y)+.5}ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff)}ctx.stroke()}if(bw){bc=options.grid.borderColor;if(typeof bw=="object"||typeof bc=="object"){if(typeof bw!=="object"){bw={top:bw,right:bw,bottom:bw,left:bw}}if(typeof bc!=="object"){bc={top:bc,right:bc,bottom:bc,left:bc}}if(bw.top>0){ctx.strokeStyle=bc.top;ctx.lineWidth=bw.top;ctx.beginPath();ctx.moveTo(0-bw.left,0-bw.top/2);ctx.lineTo(plotWidth,0-bw.top/2);ctx.stroke()}if(bw.right>0){ctx.strokeStyle=bc.right;ctx.lineWidth=bw.right;ctx.beginPath();ctx.moveTo(plotWidth+bw.right/2,0-bw.top);ctx.lineTo(plotWidth+bw.right/2,plotHeight);ctx.stroke()}if(bw.bottom>0){ctx.strokeStyle=bc.bottom;ctx.lineWidth=bw.bottom;ctx.beginPath();ctx.moveTo(plotWidth+bw.right,plotHeight+bw.bottom/2);ctx.lineTo(0,plotHeight+bw.bottom/2);ctx.stroke()}if(bw.left>0){ctx.strokeStyle=bc.left;ctx.lineWidth=bw.left;ctx.beginPath();ctx.moveTo(0-bw.left/2,plotHeight+bw.bottom);ctx.lineTo(0-bw.left/2,0);ctx.stroke()}}else{ctx.lineWidth=bw;ctx.strokeStyle=options.grid.borderColor;ctx.strokeRect(-bw/2,-bw/2,plotWidth+bw,plotHeight+bw)}}ctx.restore()}function drawAxisLabels(){$.each(allAxes(),function(_,axis){var box=axis.box,legacyStyles=axis.direction+"Axis "+axis.direction+axis.n+"Axis",layer="flot-"+axis.direction+"-axis flot-"+axis.direction+axis.n+"-axis "+legacyStyles,font=axis.options.font||"flot-tick-label tickLabel",tick,x,y,halign,valign;surface.removeText(layer);if(!axis.show||axis.ticks.length==0)return;for(var i=0;i<axis.ticks.length;++i){tick=axis.ticks[i];if(!tick.label||tick.v<axis.min||tick.v>axis.max)continue;if(axis.direction=="x"){halign="center";x=plotOffset.left+axis.p2c(tick.v);if(axis.position=="bottom"){y=box.top+box.padding}else{y=box.top+box.height-box.padding;valign="bottom"}}else{valign="middle";y=plotOffset.top+axis.p2c(tick.v);if(axis.position=="left"){x=box.left+box.width-box.padding;halign="right"}else{x=box.left+box.padding}}surface.addText(layer,x,y,tick.label,font,null,null,halign,valign)}})}function drawSeries(series){if(series.lines.show)drawSeriesLines(series);if(series.bars.show)drawSeriesBars(series);if(series.points.show)drawSeriesPoints(series)}function drawSeriesLines(series){function plotLine(datapoints,xoffset,yoffset,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,prevx=null,prevy=null;ctx.beginPath();for(var i=ps;i<points.length;i+=ps){var x1=points[i-ps],y1=points[i-ps+1],x2=points[i],y2=points[i+1];if(x1==null||x2==null)continue;if(y1<=y2&&y1<axisy.min){if(y2<axLine truncated
@@ -1,432 +0,0 @@
/* Pretty handling of time axes.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
Set axis.mode to "time" to enable. See the section "Time series data" in
API.txt for details.
*/
(function($) {
var options = {
xaxis: {
timezone: null, // "browser" for local to the client or timezone for timezone-js
timeformat: null, // format string to use
twelveHourClock: false, // 12 or 24 time in time mode
monthNames: null // list of names of months
}
};
// round to nearby lower multiple of base
function floorInBase(n, base) {
return base * Math.floor(n / base);
}
// Returns a string with the date d formatted according to fmt.
// A subset of the Open Group's strftime format is supported.
function formatDate(d, fmt, monthNames, dayNames) {
if (typeof d.strftime == "function") {
return d.strftime(fmt);
}
var leftPad = function(n, pad) {
n = "" + n;
pad = "" + (pad == null ? "0" : pad);
return n.length == 1 ? pad + n : n;
};
var r = [];
var escape = false;
var hours = d.getHours();
var isAM = hours < 12;
if (monthNames == null) {
monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
}
if (dayNames == null) {
dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
}
var hours12;
if (hours > 12) {
hours12 = hours - 12;
} else if (hours == 0) {
hours12 = 12;
} else {
hours12 = hours;
}
for (var i = 0; i < fmt.length; ++i) {
var c = fmt.charAt(i);
if (escape) {
switch (c) {
case 'a': c = "" + dayNames[d.getDay()]; break;
case 'b': c = "" + monthNames[d.getMonth()]; break;
case 'd': c = leftPad(d.getDate()); break;
case 'e': c = leftPad(d.getDate(), " "); break;
case 'h': // For back-compat with 0.7; remove in 1.0
case 'H': c = leftPad(hours); break;
case 'I': c = leftPad(hours12); break;
case 'l': c = leftPad(hours12, " "); break;
case 'm': c = leftPad(d.getMonth() + 1); break;
case 'M': c = leftPad(d.getMinutes()); break;
// quarters not in Open Group's strftime specification
case 'q':
c = "" + (Math.floor(d.getMonth() / 3) + 1); break;
case 'S': c = leftPad(d.getSeconds()); break;
case 'y': c = leftPad(d.getFullYear() % 100); break;
case 'Y': c = "" + d.getFullYear(); break;
case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break;
case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break;
case 'w': c = "" + d.getDay(); break;
}
r.push(c);
escape = false;
} else {
if (c == "%") {
escape = true;
} else {
r.push(c);
}
}
}
return r.join("");
}
// To have a consistent view of time-based data independent of which time
// zone the client happens to be in we need a date-like object independent
// of time zones. This is done through a wrapper that only calls the UTC
// versions of the accessor methods.
function makeUtcWrapper(d) {
function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {
sourceObj[sourceMethod] = function() {
return targetObj[targetMethod].apply(targetObj, arguments);
};
};
var utc = {
date: d
};
// support strftime, if found
if (d.strftime != undefined) {
addProxyMethod(utc, "strftime", d, "strftime");
}
addProxyMethod(utc, "getTime", d, "getTime");
addProxyMethod(utc, "setTime", d, "setTime");
var props = ["Date", "Day", "FullYear", "Hours", "Milliseconds", "Minutes", "Month", "Seconds"];
for (var p = 0; p < props.length; p++) {
addProxyMethod(utc, "get" + props[p], d, "getUTC" + props[p]);
addProxyMethod(utc, "set" + props[p], d, "setUTC" + props[p]);
}
return utc;
};
// select time zone strategy. This returns a date-like object tied to the
// desired timezone
function dateGenerator(ts, opts) {
if (opts.timezone == "browser") {
return new Date(ts);
} else if (!opts.timezone || opts.timezone == "utc") {
return makeUtcWrapper(new Date(ts));
} else if (typeof timezoneJS != "undefined" && typeof timezoneJS.Date != "undefined") {
var d = new timezoneJS.Date();
// timezone-js is fickle, so be sure to set the time zone before
// setting the time.
d.setTimezone(opts.timezone);
d.setTime(ts);
return d;
} else {
return makeUtcWrapper(new Date(ts));
}
}
// map of app. size of time units in milliseconds
var timeUnitSize = {
"second": 1000,
"minute": 60 * 1000,
"hour": 60 * 60 * 1000,
"day": 24 * 60 * 60 * 1000,
"month": 30 * 24 * 60 * 60 * 1000,
"quarter": 3 * 30 * 24 * 60 * 60 * 1000,
"year": 365.2425 * 24 * 60 * 60 * 1000
};
// the allowed tick sizes, after 1 year we use
// an integer algorithm
var baseSpec = [
[1, "second"], [2, "second"], [5, "second"], [10, "second"],
[30, "second"],
[1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"],
[30, "minute"],
[1, "hour"], [2, "hour"], [4, "hour"],
[8, "hour"], [12, "hour"],
[1, "day"], [2, "day"], [3, "day"],
[0.25, "month"], [0.5, "month"], [1, "month"],
[2, "month"]
];
// we don't know which variant(s) we'll need yet, but generating both is
// cheap
var specMonths = baseSpec.concat([[3, "month"], [6, "month"],
[1, "year"]]);
var specQuarters = baseSpec.concat([[1, "quarter"], [2, "quarter"],
[1, "year"]]);
function init(plot) {
plot.hooks.processOptions.push(function (plot, options) {
$.each(plot.getAxes(), function(axisName, axis) {
var opts = axis.options;
if (opts.mode == "time") {
axis.tickGenerator = function(axis) {
var ticks = [];
var d = dateGenerator(axis.min, opts);
var minSize = 0;
// make quarter use a possibility if quarters are
// mentioned in either of these options
var spec = (opts.tickSize && opts.tickSize[1] ===
"quarter") ||
(opts.minTickSize && opts.minTickSize[1] ===
"quarter") ? specQuarters : specMonths;
if (opts.minTickSize != null) {
if (typeof opts.tickSize == "number") {
minSize = opts.tickSize;
} else {
minSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]];
}
}
for (var i = 0; i < spec.length - 1; ++i) {
if (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]]
+ spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2
&& spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) {
break;
}
}
var size = spec[i][0];
var unit = spec[i][1];
// special-case the possibility of several years
if (unit == "year") {
// if given a minTickSize in years, just use it,
// ensuring that it's an integer
if (opts.minTickSize != null && opts.minTickSize[1] == "year") {
size = Math.floor(opts.minTickSize[0]);
} else {
var magn = Math.pow(10, Math.floor(Math.log(axis.delta / timeUnitSize.year) / Math.LN10));
var norm = (axis.delta / timeUnitSize.year) / magn;
if (norm < 1.5) {
size = 1;
} else if (norm < 3) {
size = 2;
} else if (norm < 7.5) {
size = 5;
} else {
size = 10;
}
size *= magn;
}
// minimum size for years is 1
if (size < 1) {
size = 1;
}
}
axis.tickSize = opts.tickSize || [size, unit];
var tickSize = axis.tickSize[0];
unit = axis.tickSize[1];
var step = tickSize * timeUnitSize[unit];
if (unit == "second") {
d.setSeconds(floorInBase(d.getSeconds(), tickSize));
} else if (unit == "minute") {
d.setMinutes(floorInBase(d.getMinutes(), tickSize));
} else if (unit == "hour") {
d.setHours(floorInBase(d.getHours(), tickSize));
} else if (unit == "month") {
d.setMonth(floorInBase(d.getMonth(), tickSize));
} else if (unit == "quarter") {
d.setMonth(3 * floorInBase(d.getMonth() / 3,
tickSize));
} else if (unit == "year") {
d.setFullYear(floorInBase(d.getFullYear(), tickSize));
}
// reset smaller components
d.setMilliseconds(0);
if (step >= timeUnitSize.minute) {
d.setSeconds(0);
}
if (step >= timeUnitSize.hour) {
d.setMinutes(0);
}
if (step >= timeUnitSize.day) {
d.setHours(0);
}
if (step >= timeUnitSize.day * 4) {
d.setDate(1);
}
if (step >= timeUnitSize.month * 2) {
d.setMonth(floorInBase(d.getMonth(), 3));
}
if (step >= timeUnitSize.quarter * 2) {
d.setMonth(floorInBase(d.getMonth(), 6));
}
if (step >= timeUnitSize.year) {
d.setMonth(0);
}
var carry = 0;
var v = Number.NaN;
var prev;
do {
prev = v;
v = d.getTime();
ticks.push(v);
if (unit == "month" || unit == "quarter") {
if (tickSize < 1) {
// a bit complicated - we'll divide the
// month/quarter up but we need to take
// care of fractions so we don't end up in
// the middle of a day
d.setDate(1);
var start = d.getTime();
d.setMonth(d.getMonth() +
(unit == "quarter" ? 3 : 1));
var end = d.getTime();
d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize);
carry = d.getHours();
d.setHours(0);
} else {
d.setMonth(d.getMonth() +
tickSize * (unit == "quarter" ? 3 : 1));
}
} else if (unit == "year") {
d.setFullYear(d.getFullYear() + tickSize);
} else {
d.setTime(v + step);
}
} while (v < axis.max && v != prev);
return ticks;
};
axis.tickFormatter = function (v, axis) {
var d = dateGenerator(v, axis.options);
// first check global format
if (opts.timeformat != null) {
return formatDate(d, opts.timeformat, opts.monthNames, opts.dayNames);
}
// possibly use quarters if quarters are mentioned in
// any of these places
var useQuarters = (axis.options.tickSize &&
axis.options.tickSize[1] == "quarter") ||
(axis.options.minTickSize &&
axis.options.minTickSize[1] == "quarter");
var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]];
var span = axis.max - axis.min;
var suffix = (opts.twelveHourClock) ? " %p" : "";
var hourCode = (opts.twelveHourClock) ? "%I" : "%H";
var fmt;
if (t < timeUnitSize.minute) {
fmt = hourCode + ":%M:%S" + suffix;
} else if (t < timeUnitSize.day) {
if (span < 2 * timeUnitSize.day) {
fmt = hourCode + ":%M" + suffix;
} else {
fmt = "%b %d " + hourCode + ":%M" + suffix;
}
} else if (t < timeUnitSize.month) {
fmt = "%b %d";
} else if ((useQuarters && t < timeUnitSize.quarter) ||
(!useQuarters && t < timeUnitSize.year)) {
if (span < timeUnitSize.year) {
fmt = "%b";
} else {
fmt = "%b %Y";
}
} else if (useQuarters && t < timeUnitSize.year) {
if (span < timeUnitSize.year) {
fmt = "Q%q";
} else {
fmt = "Q%q %Y";
}
} else {
fmt = "%Y";
}
var rt = formatDate(d, fmt, opts.monthNames, opts.dayNames);
return rt;
};
}
});
});
}
$.plot.plugins.push({
init: init,
options: options,
name: 'time',
version: '1.0'
});
// Time-axis support used to be in Flot core, which exposed the
// formatDate function on the plot object. Various plugins depend
// on the function, so we need to re-expose it here.
$.plot.formatDate = formatDate;
$.plot.dateGenerator = dateGenerator;
})(jQuery);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

@@ -1,75 +0,0 @@
$(document).ready(function() {
// Start 1-second timer to call RESTful endpoint
setInterval(function() {
$.ajax({
url: '/get_cpu_usage',
dataType: 'json',
success: function(json) {
$('#cpu_usage').text(json.result + '% ');
}
});
}, 1000);
// Initialize graph
var $c = $('<div class="graph"/>').appendTo('#graphs');
var dur = 120;
var past = Date.now() - dur * 1000;
var options = {
lines: {
fill: true,
lineWidth: 0,
fillColor: {colors: [ { opacity: 0 }, { opacity: 1 } ] }
},
grid: { borderWidth: 1, borderColor: '#ccc'},
xaxis: { mode: 'time', ticks: 5 },
legend: { labelBoxBorderColor: '#fff' },
colors: [ '#fec', '#396', '#e39', '9e2' ],
hooks: {
draw: [function(plot, canvas) {
canvas.font = '13px sans-serif';
canvas.fillStyle = '#aaa';
canvas.fillText('Resource Usage', 35, 25);
}]
}
};
var plot = $.plot($c, [], options);
var updateGraph = function(counter) {
var data = plot.getData();
var now = Date.now();
var oldest = now - dur * 1000;
data[0] = {
show: false,
data: [[oldest, null], [now, null]]
};
console.log(data);
// Remove old points
$.each(data, function(di, d) {
while (d.data.length > 0 && d.data[0][0] < oldest) {
d.data.shift();
}
});
// Add new points
var new_datapoint = [now, counter];
if (data[1]) {
data[1].label = 'memory';
data[1].data.push(new_datapoint);
} else {
data[1] = [{ data: [new_datapoint] }];
}
// Redraw the graph
plot.setData(data);
plot.setupGrid();
plot.draw();
};
// Create Websocket connection. For simplicity, no reconnect logic is here.
var ws = new WebSocket('ws://' + location.host);
ws.onmessage = function(ev) {
updateGraph(ev.data);
};
});
@@ -1,87 +0,0 @@
* {
outline: none;
}
body {
background: #36c;
color: #555;
margin: 0;
padding: 0;
font: 16px/1.4 Helvetica, Arial, sans-serif;
}
div.content {
width: 800px;
margin: 1em auto;
padding: 2em;
background-color: #fff;
border-radius: 1em;
}
fieldset {
border: 1px solid #ccc;
padding: 1em;
}
fieldset legend {
font-style: italic;
color: silver;
}
fieldset label {
text-align: right;
padding: 0 1em;
}
input[type=text] {
font-size: 100%;
padding: 0.2em;
border: 1px solid #ccc;
}
button {
color: #666;
background: #eee;
border: 1px solid #ccc;
padding: 0.2em 2em;
font-size: 100%;
cursor: pointer;
margin-top: 1em;
}
button:hover {
background: #ccc;
}
code {
background: #f0f0f0;
padding: 0 0.3em;
color: #396;
border-radius: 0.3em;
}
a:link, a:visited {
color: #69c;
text-decoration: none;
}
#graphs {
margin-top: 1em;
}
.graph {
min-height: 12em;
border: 0px solid #ccc;
position: relative;
margin: 0 1em 1em 0;
width: 36em;
display: inline-block;
}
.graph_title {
position: absolute;
top: 0.5em; left: 1em;
color: #ccc;
font-weight: bold;
z-index: 999;
}
+55
View File
@@ -0,0 +1,55 @@
PROG ?= ./example # Program we are building
PACK ?= ./pack # Packing executable
DELETE = rm -rf # Command to remove files
GZIP ?= gzip # For compressing files in web_root/
OUT ?= -o $(PROG) # Compiler argument for output file
SOURCES = main.c mongoose.c net.c packed_fs.c # Source code files
CFLAGS = -W -Wall -Wextra -g -I. # Build options
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
CFLAGS_MONGOOSE += -DMG_ENABLE_PACKED_FS=1
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
PROG = example.exe # Use .exe suffix for the binary
PACK = pack.exe # Packing executable
CC = gcc # Use MinGW gcc compiler
CFLAGS += -lws2_32 # Link against Winsock library
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
GZIP = echo # No gzip on Windows
endif
# Default target. Build and run program
all: $(PROG)
$(RUN) $(PROG) $(ARGS)
# Build program from sources
$(PROG): $(SOURCES)
$(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT)
# Bundle JS libraries (preact, preact-router, ...) into a single file
web_root/bundle.js:
curl -s https://npm.reversehttp.com/preact,preact/hooks,htm/preact,preact-router -o $@
# Create optimised CSS. Prerequisite: npm -g i tailwindcss tailwindcss-font-inter
web_root/main.css: web_root/index.html $(wildcard web_root/*.js)
npx tailwindcss -o $@ --minify
# Generate packed filesystem for serving Web UI
packed_fs.c: $(wildcard web_root/*) $(wildcard certs/*) Makefile web_root/main.css web_root/bundle.js
$(GZIP) web_root/*
$(CC) ../../test/pack.c -o $(PACK)
$(PACK) web_root/* certs/* > $@
$(GZIP) -d web_root/*
mbedtls:
git clone --depth 1 -b v2.28.2 https://github.com/mbed-tls/mbedtls $@
ifeq ($(TLS), mbedtls)
CFLAGS += -DMG_TLS=MG_TLS_MBED -Wno-conversion -Imbedtls/include
CFLAGS += -DMBEDTLS_CONFIG_FILE=\"mbedtls_config.h\" mbedtls/library/*.c
$(PROG): mbedtls
endif
# Cleanup. Delete built program and all build artifacts
clean:
$(DELETE) $(PROG) $(PACK) *.o *.obj *.exe *.dSYM mbedtls
+26
View File
@@ -0,0 +1,26 @@
# 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 possibly different permissions)
- The Web UI can be fully embedded into the firmware binary, then not
needing a filesystem to serve it; so being resilient to FS problems
- All changes are propagated to all connected clients
## Screenshots
This is a login screen that prompts for user/password
![](screenshots/login.webp)
## Main dashboard
The main dashboard page shows the interactive console
![](screenshots/dashboard.webp)
<!-- See a detailed tutorial at https://mongoose.ws/tutorials/device-dashboard/ -->
@@ -0,0 +1,8 @@
-----BEGIN CERTIFICATE-----
MIIBCTCBsAIJAK9wbIDkHnAoMAoGCCqGSM49BAMCMA0xCzAJBgNVBAYTAklFMB4X
DTIzMDEyOTIxMjEzOFoXDTMzMDEyNjIxMjEzOFowDTELMAkGA1UEBhMCSUUwWTAT
BgcqhkjOPQIBBggqhkjOPQMBBwNCAARzSQS5OHd17lUeNI+6kp9WYu0cxuEIi/JT
jphbCmdJD1cUvhmzM9/phvJT9ka10Z9toZhgnBq0o0xfTQ4jC1vwMAoGCCqGSM49
BAMCA0gAMEUCIQCe0T2E0GOiVe9KwvIEPeX1J1J0T7TNacgR0Ya33HV9VgIgNvdn
aEWiBp1xshs4iz6WbpxrS1IHucrqkZuJLfNZGZI=
-----END CERTIFICATE-----
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEICBz3HOkQLPBDtdknqC7k1PNsWj6HfhyNB5MenfjmqiooAoGCCqGSM49
AwEHoUQDQgAEc0kEuTh3de5VHjSPupKfVmLtHMbhCIvyU46YWwpnSQ9XFL4ZszPf
6YbyU/ZGtdGfbaGYYJwatKNMX00OIwtb8A==
-----END EC PRIVATE KEY-----
+32
View File
@@ -0,0 +1,32 @@
// Copyright (c) 2020-2023 Cesanta Software Limited
// All rights reserved
#include "mongoose.h"
#include "net.h"
static int s_sig_num;
static void signal_handler(int sig_num) {
signal(sig_num, signal_handler);
s_sig_num = sig_num;
}
int main(void) {
struct mg_mgr mgr;
signal(SIGPIPE, SIG_IGN);
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
mg_log_set(MG_LL_DEBUG); // Set debug log level
mg_mgr_init(&mgr);
web_init(&mgr);
while (s_sig_num == 0) {
mg_mgr_poll(&mgr, 50);
}
mg_mgr_free(&mgr);
MG_INFO(("Exiting on signal %d", s_sig_num));
return 0;
}
@@ -0,0 +1,64 @@
/* Workaround for some mbedtls source files using INT_MAX without including limits.h */
#include <limits.h>
#define MBEDTLS_NO_PLATFORM_ENTROPY
//#define MBEDTLS_ENTROPY_HARDWARE_ALT
#define MBEDTLS_SSL_OUT_CONTENT_LEN 2048
#define MBEDTLS_ALLOW_PRIVATE_ACCESS
#define MBEDTLS_HAVE_TIME
#define MBEDTLS_SSL_SESSION_TICKETS
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
#define MBEDTLS_ECP_DP_SECP224R1_ENABLED
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
#define MBEDTLS_ECP_DP_SECP521R1_ENABLED
#define MBEDTLS_ECP_DP_SECP192K1_ENABLED
#define MBEDTLS_ECP_DP_SECP224K1_ENABLED
#define MBEDTLS_ECP_DP_SECP256K1_ENABLED
#define MBEDTLS_ECP_DP_BP256R1_ENABLED
#define MBEDTLS_ECP_DP_BP384R1_ENABLED
#define MBEDTLS_ECP_DP_BP512R1_ENABLED
#define MBEDTLS_ECP_DP_CURVE25519_ENABLED
#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
#define MBEDTLS_PKCS1_V15
#define MBEDTLS_SHA256_SMALLER
#define MBEDTLS_SSL_SERVER_NAME_INDICATION
#define MBEDTLS_AES_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_BIGNUM_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_ENTROPY_C
#define MBEDTLS_ERROR_C
#define MBEDTLS_MD_C
#define MBEDTLS_MD5_C
#define MBEDTLS_OID_C
#define MBEDTLS_PKCS5_C
#define MBEDTLS_PK_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA1_C
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA512_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_SRV_C
#define MBEDTLS_SSL_TLS_C
#define MBEDTLS_X509_CRT_PARSE_C
#define MBEDTLS_X509_USE_C
#define MBEDTLS_AES_FEWER_TABLES
#define MBEDTLS_PEM_PARSE_C
#define MBEDTLS_BASE64_C
#define MBEDTLS_SSL_TICKET_C
#define MBEDTLS_SSL_PROTO_TLS1_3
#define MBEDTLS_SSL_PROTO_TLS1_2
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
#define MBEDTLS_GCM_C
#define MBEDTLS_ECDH_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ASN1_WRITE_C
+1
View File
@@ -0,0 +1 @@
../../mongoose.c
+1
View File
@@ -0,0 +1 @@
../../mongoose.h
+320
View File
@@ -0,0 +1,320 @@
// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
#include "net.h"
// Authenticated user.
// A user can be authenticated by:
// - a name:pass pair, passed in a header Authorization: Basic .....
// - an access_token, passed in a header Cookie: access_token=....
// When a user is shown a login screen, she enters a user:pass. If successful,
// a server responds with a http-only access_token cookie set.
struct user {
const char *name, *pass, *access_token;
};
// Settings
struct settings {
bool log_enabled;
int log_level;
long brightness;
char *device_name;
};
static struct settings s_settings = {true, 1, 57, NULL};
static const char *s_json_header =
"Content-Type: application/json\r\n"
"Cache-Control: no-cache\r\n";
static uint64_t s_boot_timestamp = 0; // Updated by SNTP
// This is for newlib and TLS (mbedTLS)
uint64_t mg_now(void) {
return mg_millis() + s_boot_timestamp;
}
int ui_event_next(int no, struct ui_event *e) {
if (no < 0 || no >= MAX_EVENTS_NO) return 0;
srand((unsigned) no);
e->type = (uint8_t) rand() % 4;
e->prio = (uint8_t) rand() % 3;
e->timestamp =
(unsigned long) ((int64_t) mg_now() - 86400 * 1000 /* one day back */ +
no * 300 * 1000 /* 5 mins between alerts */ +
1000 * (rand() % 300) /* randomize event time */) /
1000UL;
mg_snprintf(e->text, MAX_EVENT_TEXT_SIZE, "event#%d", no);
return no + 1;
}
// 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) {
uint64_t *expiration_time = (uint64_t *) c->data;
if (ev == MG_EV_OPEN) {
*expiration_time = mg_millis() + 3000; // Store expiration time in 3s
} else if (ev == MG_EV_SNTP_TIME) {
uint64_t t = *(uint64_t *) ev_data;
s_boot_timestamp = t - mg_millis();
c->is_closing = 1;
} else if (ev == MG_EV_POLL) {
if (mg_millis() > *expiration_time) c->is_closing = 1;
}
(void) fn_data;
}
static void timer_sntp_fn(void *param) { // SNTP timer function. Sync up time
mg_sntp_connect(param, "udp://time.google.com:123", sfn, NULL);
}
// Parse HTTP requests, return authenticated user or NULL
static struct user *authenticate(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", "admin", "admin_token"},
{"user1", "user1", "user1_token"},
{"user2", "user2", "user2_token"},
{NULL, NULL, NULL},
};
char user[64], pass[64];
struct user *u, *result = NULL;
mg_http_creds(hm, user, sizeof(user), pass, sizeof(pass));
MG_VERBOSE(("user [%s] pass [%s]", user, pass));
if (user[0] != '\0' && pass[0] != '\0') {
// Both user and password is set, search by user/password
for (u = users; result == NULL && u->name != NULL; u++)
if (strcmp(user, u->name) == 0 && strcmp(pass, u->pass) == 0) result = u;
} else if (user[0] == '\0') {
// Only password is set, search by token
for (u = users; result == NULL && u->name != NULL; u++)
if (strcmp(pass, u->access_token) == 0) result = u;
}
return result;
}
static void handle_login(struct mg_connection *c, struct user *u) {
char cookie[256];
mg_snprintf(cookie, sizeof(cookie),
"Set-Cookie: access_token=%s; Path=/; "
"%sHttpOnly; SameSite=Lax; Max-Age=%d\r\n",
u->access_token, c->is_tls ? "Secure; " : "", 3600 * 24);
mg_http_reply(c, 200, cookie, "{%m:%m}", MG_ESC("user"), MG_ESC(u->name));
}
static void handle_logout(struct mg_connection *c) {
char cookie[256];
mg_snprintf(cookie, sizeof(cookie),
"Set-Cookie: access_token=; Path=/; "
"Expires=Thu, 01 Jan 1970 00:00:00 UTC; "
"%sHttpOnly; Max-Age=0; \r\n",
c->is_tls ? "Secure; " : "");
mg_http_reply(c, 200, cookie, "true\n");
}
static void handle_debug(struct mg_connection *c, struct mg_http_message *hm) {
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);
}
static size_t print_int_arr(void (*out)(char, void *), void *ptr, va_list *ap) {
size_t len = 0, num = va_arg(*ap, size_t); // Number of items in the array
int *arr = va_arg(*ap, int *); // Array ptr
for (size_t i = 0; i < num; i++) {
len += mg_xprintf(out, ptr, "%s%d", i == 0 ? "" : ",", arr[i]);
}
return len;
}
static void handle_stats_get(struct mg_connection *c) {
int points[] = {21, 22, 22, 19, 18, 20, 23, 23, 22, 22, 22, 23, 22};
mg_http_reply(c, 200, s_json_header, "{%m:%d,%m:%d,%m:[%M]}",
MG_ESC("temperature"), 21, //
MG_ESC("humidity"), 67, //
MG_ESC("points"), print_int_arr,
sizeof(points) / sizeof(points[0]), points);
}
static size_t print_events(void (*out)(char, void *), void *ptr, va_list *ap) {
size_t len = 0;
struct ui_event ev;
int pageno = va_arg(*ap, int);
int no = (pageno - 1) * EVENTS_PER_PAGE;
int end = no + EVENTS_PER_PAGE;
while ((no = ui_event_next(no, &ev)) != 0 && no <= end) {
len += mg_xprintf(out, ptr, "%s{%m:%lu,%m:%d,%m:%d,%m:%m}", //
len == 0 ? "" : ",", //
MG_ESC("time"), ev.timestamp, //
MG_ESC("type"), ev.type, //
MG_ESC("prio"), ev.prio, //
MG_ESC("text"), MG_ESC(ev.text));
}
return len;
}
static void handle_events_get(struct mg_connection *c,
struct mg_http_message *hm) {
int pageno = mg_json_get_long(hm->body, "$.page", 1);
mg_http_reply(c, 200, s_json_header, "{%m:[%M], %m:%d}", MG_ESC("arr"),
print_events, pageno, MG_ESC("totalCount"), MAX_EVENTS_NO);
}
static void handle_settings_set(struct mg_connection *c, struct mg_str body) {
struct settings settings;
memset(&settings, 0, sizeof(settings));
mg_json_get_bool(body, "$.log_enabled", &settings.log_enabled);
settings.log_level = mg_json_get_long(body, "$.log_level", 0);
settings.brightness = mg_json_get_long(body, "$.brightness", 0);
char *s = mg_json_get_str(body, "$.device_name");
if (s && strlen(s) < MAX_DEVICE_NAME) {
free(settings.device_name);
settings.device_name = s;
} else {
free(s);
}
// Save to the device flash
s_settings = settings;
bool ok = true;
mg_http_reply(c, 200, s_json_header,
"{%m:%s,%m:%m}", //
MG_ESC("status"), ok ? "true" : "false", //
MG_ESC("message"), MG_ESC(ok ? "Success" : "Failed"));
}
static void handle_settings_get(struct mg_connection *c) {
mg_http_reply(c, 200, s_json_header, "{%m:%s,%m:%hhu,%m:%hhu,%m:%m}", //
MG_ESC("log_enabled"),
s_settings.log_enabled ? "true" : "false", //
MG_ESC("log_level"), s_settings.log_level, //
MG_ESC("brightness"), s_settings.brightness, //
MG_ESC("device_name"), MG_ESC(s_settings.device_name));
}
static void handle_firmware_upload(struct mg_connection *c,
struct mg_http_message *hm) {
char name[64], offset[20], total[20];
struct mg_str data = hm->body;
long ofs = -1, tot = -1;
name[0] = offset[0] = '\0';
mg_http_get_var(&hm->query, "name", name, sizeof(name));
mg_http_get_var(&hm->query, "offset", offset, sizeof(offset));
mg_http_get_var(&hm->query, "total", total, sizeof(total));
MG_INFO(("File %s, offset %s, len %lu", name, offset, data.len));
if ((ofs = mg_json_get_long(mg_str(offset), "$", -1)) < 0 ||
(tot = mg_json_get_long(mg_str(total), "$", -1)) < 0) {
mg_http_reply(c, 500, "", "offset and total not set\n");
} else if (ofs == 0 && mg_ota_begin((size_t) tot) == false) {
mg_http_reply(c, 500, "", "mg_ota_begin(%ld) failed\n", tot);
} else if (data.len > 0 && mg_ota_write(data.ptr, data.len) == false) {
mg_http_reply(c, 500, "", "mg_ota_write(%lu) @%ld failed\n", data.len, ofs);
mg_ota_end();
} else if (data.len == 0 && mg_ota_end() == false) {
mg_http_reply(c, 500, "", "mg_ota_end() failed\n", tot);
} else {
mg_http_reply(c, 200, s_json_header, "true\n");
if (data.len == 0) {
// Successful mg_ota_end() called, schedule device reboot
mg_timer_add(c->mgr, 500, 0, (void (*)(void *)) mg_device_reset, NULL);
}
}
}
static void handle_firmware_commit(struct mg_connection *c) {
mg_http_reply(c, 200, s_json_header, "%s\n",
mg_ota_commit() ? "true" : "false");
}
static void handle_firmware_rollback(struct mg_connection *c) {
mg_http_reply(c, 200, s_json_header, "%s\n",
mg_ota_rollback() ? "true" : "false");
}
static size_t print_status(void (*out)(char, void *), void *ptr, va_list *ap) {
int fw = va_arg(*ap, int);
return mg_xprintf(out, ptr, "{%m:%d,%m:%c%lx%c,%m:%u,%m:%u}",
MG_ESC("status"), mg_ota_status(fw), MG_ESC("crc32"), '"',
mg_ota_crc32(fw), '"', MG_ESC("size"), mg_ota_size(fw),
MG_ESC("timestamp"), mg_ota_timestamp(fw));
}
static void handle_firmware_status(struct mg_connection *c) {
mg_http_reply(c, 200, s_json_header, "[%M,%M]\n", print_status,
MG_FIRMWARE_CURRENT, print_status, MG_FIRMWARE_PREVIOUS);
}
static void handle_device_reset(struct mg_connection *c) {
mg_http_reply(c, 200, s_json_header, "true\n");
mg_timer_add(c->mgr, 500, 0, (void (*)(void *)) mg_device_reset, NULL);
}
// HTTP request handler function
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_ACCEPT) {
if (fn_data != NULL) { // TLS listener!
struct mg_tls_opts opts = {0};
opts.cert = mg_unpacked("/certs/server_cert.pem");
opts.key = mg_unpacked("/certs/server_key.pem");
mg_tls_init(c, &opts);
}
} else if (ev == MG_EV_HTTP_MSG) {
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
struct user *u = authenticate(hm);
if (mg_http_match_uri(hm, "/api/#") && u == NULL) {
mg_http_reply(c, 403, "", "Not Authorised\n");
} else if (mg_http_match_uri(hm, "/api/login")) {
handle_login(c, u);
} else if (mg_http_match_uri(hm, "/api/logout")) {
handle_logout(c);
} else if (mg_http_match_uri(hm, "/api/debug")) {
handle_debug(c, hm);
} else if (mg_http_match_uri(hm, "/api/stats/get")) {
handle_stats_get(c);
} else if (mg_http_match_uri(hm, "/api/events/get")) {
handle_events_get(c, hm);
} else if (mg_http_match_uri(hm, "/api/settings/get")) {
handle_settings_get(c);
} else if (mg_http_match_uri(hm, "/api/settings/set")) {
handle_settings_set(c, hm->body);
} else if (mg_http_match_uri(hm, "/api/firmware/upload")) {
handle_firmware_upload(c, hm);
} else if (mg_http_match_uri(hm, "/api/firmware/commit")) {
handle_firmware_commit(c);
} else if (mg_http_match_uri(hm, "/api/firmware/rollback")) {
handle_firmware_rollback(c);
} else if (mg_http_match_uri(hm, "/api/firmware/status")) {
handle_firmware_status(c);
} else if (mg_http_match_uri(hm, "/api/device/reset")) {
handle_device_reset(c);
} else {
struct mg_http_serve_opts opts;
memset(&opts, 0, sizeof(opts));
#if MG_ARCH == MG_ARCH_UNIX || MG_ARCH == MG_ARCH_WIN32
opts.root_dir = "web_root"; // On workstations, use filesystem
#else
opts.root_dir = "/web_root"; // On embedded, use packed files
opts.fs = &mg_fs_packed;
#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]));
}
}
void web_init(struct mg_mgr *mgr) {
s_settings.device_name = strdup("My Device");
mg_http_listen(mgr, HTTP_URL, fn, NULL);
mg_http_listen(mgr, HTTPS_URL, fn, (void *) 1);
mg_timer_add(mgr, 3600 * 1000, MG_TIMER_RUN_NOW | MG_TIMER_REPEAT,
timer_sntp_fn, mgr);
}
+27
View File
@@ -0,0 +1,27 @@
// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
#pragma once
#include "mongoose.h"
#if !defined(HTTP_URL)
#define HTTP_URL "http://0.0.0.0:8000"
#endif
#if !defined(HTTPS_URL)
#define HTTPS_URL "https://0.0.0.0:8443"
#endif
#define MAX_DEVICE_NAME 40
#define MAX_EVENTS_NO 400
#define MAX_EVENT_TEXT_SIZE 10
#define EVENTS_PER_PAGE 20
// Event log entry
struct ui_event {
uint8_t type, prio;
unsigned long timestamp;
char text[10];
};
void web_init(struct mg_mgr *mgr);
File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@@ -0,0 +1,17 @@
module.exports = {
content: ['./web_root/*.{html,js}'],
xplugins: [ 'tailwindcss', 'xautoprefixer' ],
corePlugins: {outline: false},
theme: {
extend: {},
fontFamily: {
sans:
[
"Inter var, Helvetica, sans-serif", {
fontFeatureSettings: '"cv11", "ss01"',
fontVariationSettings: '"opsz" 32',
}
]
}
}
}
@@ -0,0 +1 @@
var n,t,e,_,r,o,i,u,l,c={},a=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(n,t){for(var e in t)n[e]=t[e];return n}function p(n){var t=n.parentNode;t&&t.removeChild(n)}function h(t,e,_){var r,o,i,u={};for(i in e)"key"==i?r=e[i]:"ref"==i?o=e[i]:u[i]=e[i];if(arguments.length>2&&(u.children=arguments.length>3?n.call(arguments,2):_),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===u[i]&&(u[i]=t.defaultProps[i]);return d(t,u,r,o,null)}function d(n,_,r,o,i){var u={type:n,props:_,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++e:i};return null==i&&null!=t.vnode&&t.vnode(u),u}function v(){return{current:null}}function m(n){return n.children}function y(n,t){this.props=n,this.context=t}function g(n,t){if(null==t)return n.__?g(n.__,n.__.__k.indexOf(n)+1):null;for(var e;t<n.__k.length;t++)if(null!=(e=n.__k[t])&&null!=e.__e)return e.__e;return"function"==typeof n.type?g(n):null}function b(n){var t,e;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,t=0;t<n.__k.length;t++)if(null!=(e=n.__k[t])&&null!=e.__e){n.__e=n.__c.base=e.__e;break}return b(n)}}function k(n){(!n.__d&&(n.__d=!0)&&r.push(n)&&!C.__r++||o!==t.debounceRendering)&&((o=t.debounceRendering)||i)(C)}function C(){var n,t,e,_,o,i,l,c;for(r.sort(u);n=r.shift();)n.__d&&(t=r.length,_=void 0,o=void 0,l=(i=(e=n).__v).__e,(c=e.__P)&&(_=[],(o=f({},i)).__v=i.__v+1,T(c,i,o,e.__n,void 0!==c.ownerSVGElement,null!=i.__h?[l]:null,_,null==l?g(i):l,i.__h),R(_,i),i.__e!=l&&b(i)),r.length>t&&r.sort(u));C.__r=0}function x(n,t,e,_,r,o,i,u,l,s){var f,p,h,v,y,b,k,C=_&&_.__k||a,x=C.length;for(e.__k=[],f=0;f<t.length;f++)if(null!=(v=e.__k[f]=null==(v=t[f])||"boolean"==typeof v||"function"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?d(null,v,null,null,v):Array.isArray(v)?d(m,{children:v},null,null,null):v.__b>0?d(v.type,v.props,v.key,v.ref?v.ref:null,v.__v):v)){if(v.__=e,v.__b=e.__b+1,null===(h=C[f])||h&&v.key==h.key&&v.type===h.type)C[f]=void 0;else for(p=0;p<x;p++){if((h=C[p])&&v.key==h.key&&v.type===h.type){C[p]=void 0;break}h=null}T(n,v,h=h||c,r,o,i,u,l,s),y=v.__e,(p=v.ref)&&h.ref!=p&&(k||(k=[]),h.ref&&k.push(h.ref,null,v),k.push(p,v.__c||y,v)),null!=y?(null==b&&(b=y),"function"==typeof v.type&&v.__k===h.__k?v.__d=l=E(v,l,n):l=U(n,v,h,C,y,l),"function"==typeof e.type&&(e.__d=l)):l&&h.__e==l&&l.parentNode!=n&&(l=g(h))}for(e.__e=b,f=x;f--;)null!=C[f]&&("function"==typeof e.type&&null!=C[f].__e&&C[f].__e==e.__d&&(e.__d=A(_).nextSibling),W(C[f],C[f]));if(k)for(f=0;f<k.length;f++)M(k[f],k[++f],k[++f])}function E(n,t,e){for(var _,r=n.__k,o=0;r&&o<r.length;o++)(_=r[o])&&(_.__=n,t="function"==typeof _.type?E(_,t,e):U(e,_,_,r,_.__e,t));return t}function H(n,t){return t=t||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some((function(n){H(n,t)})):t.push(n)),t}function U(n,t,e,_,r,o){var i,u,l;if(void 0!==t.__d)i=t.__d,t.__d=void 0;else if(null==e||r!=o||null==r.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(r),i=null;else{for(u=o,l=0;(u=u.nextSibling)&&l<_.length;l+=1)if(u==r)break n;n.insertBefore(r,o),i=o}return void 0!==i?i:r.nextSibling}function A(n){var t,e,_;if(null==n.type||"string"==typeof n.type)return n.__e;if(n.__k)for(t=n.__k.length-1;t>=0;t--)if((e=n.__k[t])&&(_=A(e)))return _;return null}function P(n,t,e,_,r){var o;for(o in e)"children"===o||"key"===o||o in t||N(n,o,null,e[o],_);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||e[o]===t[o]||N(n,o,t[o],e[o],_)}function S(n,t,e){"-"===t[0]?n.setProperty(t,null==e?"":e):n[t]=null==e?"":"number"!=typeof e||s.test(t)?e:e+"px"}function N(n,t,e,_,r){var o;n:if("style"===t)if("string"==typeof e)n.style.cssText=e;else{if("string"==typeof _&&(n.style.cssText=_=""),_)for(t in _)e&&t in e||S(n.style,t,"");if(e)for(t in e)_&&e[t]===_[t]||S(n.style,t,e[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in n?t.toLowerCase().slice(2):t.slice(2),n.l||(n.l={}),n.l[t+o]=e,e?_||n.addEventListener(t,o?D:w,o):n.removeEventListener(t,o?D:w,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in n)try{n[t]=null==e?"":e;break n}catch(n){}"function"==typeof e||(null==e||!1===e&&"-"!==t[4]?n.removeAttribute(t):n.setAttribute(t,e))}}function w(n){return this.l[n.type+!1](t.event?t.event(n):n)}function D(n){return this.l[n.type+!0](t.event?t.event(n):n)}function T(n,e,_,r,o,i,u,l,c){var a,s,p,h,d,v,g,b,k,C,E,H,U,A,P,S=e.type;if(void 0!==e.constructor)return null;null!=_.__h&&(c=_.__h,l=e.__e=_.__e,e.__h=null,i=[l]),(a=t.__b)&&a(e);try{n:if("function"==typeof S){if(b=e.props,k=(a=S.contextType)&&r[a.__c],C=a?k?k.props.value:a.__:r,_.__c?g=(s=e.__c=_.__c).__=s.__E:("prototype"in S&&S.prototype.render?e.__c=s=new S(b,C):(e.__c=s=new y(b,C),s.constructor=S,s.rLine truncated
@@ -0,0 +1,349 @@
'use strict';
import { h, render, useState, useEffect, useRef, html, Router } from './bundle.js';
// Helper function that returns a promise that resolves after delay
const Delay = (ms, val) => new Promise(resolve => setTimeout(resolve, ms, val));
export const Icons = {
heart: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"></path></svg>`,
downArrowBox: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25" /> </svg>`,
upArrowBox: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15m0-3l-3-3m0 0l-3 3m3-3V15" /> </svg>`,
cog: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z" /> <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /> </svg>`,
settingsH: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M10.5 6h9.75M10.5 6a1.5 1.5 0 11-3 0m3 0a1.5 1.5 0 10-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-9.75 0h9.75" /> </svg>`,
settingsV: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M6 13.5V3.75m0 9.75a1.5 1.5 0 010 3m0-3a1.5 1.5 0 000 3m0 3.75V16.5m12-3V3.75m0 9.75a1.5 1.5 0 010 3m0-3a1.5 1.5 0 000 3m0 3.75V16.5m-6-9V3.75m0 3.75a1.5 1.5 0 010 3m0-3a1.5 1.5 0 000 3m0 9.75V10.5" /> </svg>`,
scan: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5m0 9V18A2.25 2.25 0 0118 20.25h-1.5m-9 0H6A2.25 2.25 0 013.75 18v-1.5M15 12a3 3 0 11-6 0 3 3 0 016 0z" /> </svg> `,
desktop: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25" /> </svg>`,
alert: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0M3.124 7.5A8.969 8.969 0 015.292 3m13.416 0a8.969 8.969 0 012.168 4.5" /> </svg>`,
bell: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0M3.124 7.5A8.969 8.969 0 015.292 3m13.416 0a8.969 8.969 0 012.168 4.5" /> </svg>`,
refresh: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /> </svg> `,
bars4: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 5.25h16.5m-16.5 4.5h16.5m-16.5 4.5h16.5m-16.5 4.5h16.5" /> </svg>`,
bars3: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" /> </svg>`,
logout: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12.75 15l3-3m0 0l-3-3m3 3h-7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg>`,
save: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M16.5 3.75V16.5L12 14.25 7.5 16.5V3.75m9 0H18A2.25 2.25 0 0120.25 6v12A2.25 2.25 0 0118 20.25H6A2.25 2.25 0 013.75 18V6A2.25 2.25 0 016 3.75h1.5m9 0h-9" /> </svg>`,
email: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75" /> </svg>`,
expand: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15" /> </svg>`,
shrink: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25" /> </svg>`,
ok: props => html`<svg class=${props.class} fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg>`,
fail: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg>`,
upload: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5" /> </svg> `,
download: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" /> </svg> `,
bolt: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z" /> </svg>`,
home: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" /> </svg> `,
link: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" /> </svg> `,
shield: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z" /> </svg> `,
barsdown: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /> </svg> `,
arrowdown: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m0 0l6.75-6.75M12 19.5l-6.75-6.75" /> </svg> `,
arrowup: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 19.5v-15m0 0l-6.75 6.75M12 4.5l6.75 6.75" /> </svg>`,
warn: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" /> </svg>`,
info: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /> </svg>`,
exclamationTriangle: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" /> </svg>`,
thumbUp: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 01-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 10.203 4.167 9.75 5 9.75h1.053c.472 0 .745.556.5.96a8.958 8.958 0 00-1.302 4.665c0 1.194.232 2.333.654 3.375z" /> </svg>`,
backward: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M21 16.811c0 .864-.933 1.405-1.683.977l-7.108-4.062a1.125 1.125 0 010-1.953l7.108-4.062A1.125 1.125 0 0121 8.688v8.123zM11.25 16.811c0 .864-.933 1.405-1.683.977l-7.108-4.062a1.125 1.125 0 010-1.953L9.567 7.71a1.125 1.125 0 011.683.977v8.123z" /> </svg>`,
chip: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 002.25-2.25V6.75a2.25 2.25 0 00-2.25-2.25H6.75A2.25 2.25 0 004.5 6.75v10.5a2.25 2.25 0 002.25 2.25zm.75-12h9v9h-9v-9z" /> </svg>`,
camera: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M6.827 6.175A2.31 2.31 0 015.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 00-1.134-.175 2.31 2.31 0 01-1.64-1.055l-.822-1.316a2.192 2.192 0 00-1.736-1.039 48.774 48.774 0 00-5.232 0 2.192 2.192 0 00-1.736 1.039l-.821 1.316z" /> <path stroke-linecap="round" stroke-linejoin="round" d="M16.5 12.75a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0zM18.75 10.5h.008v.008h-.008V10.5z" /> </svg>`,
arrows: props => html`<svg class=${props.class} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5" /> </svg>`,
};
export const tipColors = {
green: 'bg-green-100 text-green-900 ring-green-300',
yellow: 'bg-yellow-100 text-yellow-900 ring-yellow-300',
red: 'bg-red-100 text-red-900 ring-red-300',
};
export function Button({title, onclick, disabled, cls, icon, ref, colors, hovercolor, disabledcolor}) {
const [spin, setSpin] = useState(false);
const cb = function(ev) {
const res = onclick ? onclick() : null;
if (res && typeof (res.catch) === 'function') {
setSpin(true);
res.catch(() => false).then(() => setSpin(false));
}
};
if (!colors) colors = 'bg-blue-600 hover:bg-blue-500 disabled:bg-blue-400';
return html`
<button type="button" class="inline-flex justify-center items-center gap-2 rounded px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm ${colors} ${cls}"
ref=${ref} onclick=${cb} disabled=${disabled || spin} >
${title}
<${spin ? Icons.refresh : icon} class="w-4 ${spin ? 'animate-spin' : ''}" />
<//>`
};
export function Notification({ok, text, close}) {
const closebtn = useRef(null);
const from = 'translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2';
const to = 'translate-y-0 opacity-100 sm:translate-x-0';
const [tr, setTr] = useState(from);
useEffect(function() {
setTr(to);
setTimeout(ev => closebtn && closebtn.current.click && closebtn.current.click(), 1500);
}, []);
const onclose = ev => { setTr(from); setTimeout(close, 300); };
return html`
<div aria-live="assertive" class="z-10 pointer-events-none absolute inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6">
<div class="flex w-full flex-col items-center space-y-4 sm:items-end">
<div class="pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 transform ease-out duration-300 transition ${tr}">
<div class="p-4">
<div class="flex items-start">
<div class="flex-shrink-0">
<${ok ? Icons.ok : Icons.failed} class="h-6 w-6 ${ok ? 'text-green-400' : 'text-red-400'}" />
<//>
<div class="ml-3 w-0 flex-1 pt-0.5">
<p class="text-sm font-medium text-gray-900">${text}</p>
<p class="hidden mt-1 text-sm text-gray-500">Anyone with a link can now view this file.</p>
<//>
<div class="ml-4 flex flex-shrink-0">
<button type="button" ref=${closebtn} onclick=${onclose} class="inline-flex rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none">
<span class="sr-only">Close</span>
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" />
<//>
<//>
<//>
<//>
<//>
<//>
<//>
<//>`;
};
export function Login({loginFn, logoIcon, title, tipText}) {
const [user, setUser] = useState('');
const [pass, setPass] = useState('');
const onsubmit = function(ev) {
const authhdr = 'Basic ' + btoa(user + ':' + pass);
const headers = {Authorization: authhdr};
return fetch('api/login', {headers}).then(loginFn).finally(r => setPass(''));
};
return html`
<div class="h-full flex items-center justify-center bg-slate-200">
<div class="border rounded bg-white w-96 p-5">
<div class="my-5 py-2 flex items-center justify-center gap-x-4">
<${logoIcon} class="h-12 stroke-cyan-600 stroke-1" />
<h1 class="font-bold text-xl">${title || 'Login'}<//>
<//>
<div class="my-3">
<label class="block text-sm mb-1 dark:text-white">Username</label>
<input type="text" autocomplete="current-user" required
class="font-normal bg-white rounded border border-gray-300 w-full
flex-1 py-0.5 px-2 text-gray-900 placeholder:text-gray-400
focus:outline-none sm:text-sm sm:leading-6 disabled:cursor-not-allowed
disabled:bg-gray-100 disabled:text-gray-500"
oninput=${ev => setUser(ev.target.value)} value=${user} />
<//>
<div class="my-3">
<label class="block text-sm mb-1 dark:text-white">Password</label>
<input type="password" autocomplete="current-password" required
class="font-normal bg-white rounded border border-gray-300 w-full flex-1 py-0.5 px-2 text-gray-900 placeholder:text-gray-400 focus:outline-none sm:text-sm sm:leading-6 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-500"
oninput=${ev => setPass(ev.target.value)}
value=${pass} onchange=${onsubmit} />
<//>
<div class="mt-7">
<${Button} title="Sign In" icon=${Icons.logout} onclick=${onsubmit} cls="flex w-full justify-center" />
<//>
<div class="mt-5 text-slate-400 text-xs">${tipText}<//>
<//>
<//>`;
};
export function Colored({icon, text, colors}) {
colors ||= 'bg-slate-100 text-slate-900';
return html`
<span class="inline-flex items-center gap-1.5 py-0.5">
${icon && html`<${icon} class="w-5 h-5" />`}
<span class="inline-block font-medium rounded-md px-2 py-1 text-xs ring-1 ring-inset ${colors}">${text}<//>
<//>`;
};
export function Stat({title, text, tipText, tipIcon, tipColors, colors}) {
return html`
<div class="flex flex-col bg-white border shadow-sm rounded-xl dark:bg-slate-900 dark:border-gray-800">
<div class="overflow-auto rounded-lg bg-white px-4 py-2 shadow">
<div class="flex items-center gap-x-2">
<p class="text-sm truncate text-gray-500 font-medium"> ${title} </p>
<//>
<div class="mt-1 flex items-center gap-x-2">
<h3 class="text-xl truncate font-semibold tracking-tight ${colors || 'text-gray-800 dark:text-gray-200'}">
${text}
<//>
<span class="flex items-center ${tipText || 'hidden'}">
<${Colored} text=${tipText} icon=${tipIcon} colors=${tipColors} />
<//>
<//>
<//>
<//>`;
};
export function TextValue({value, setfn, disabled, placeholder, type, addonRight, addonLeft, attr, min, max, step}) {
const [bg, setBg] = useState('bg-white');
useEffect(() => { checkval(value); }, []);
const checkval = function(v) {
setBg('bg-white');
if (min && v < min) setBg('bg-red-100 border-red-200');
if (max && v > max) setBg('bg-red-100 border-red-200');
};
const oninput = ev => {
let v = ev.target.value;
if (type == 'number') v = parseInt(v);
setfn(v);
checkval(v);
};
return html`
<div class="flex w-full items-center rounded border shadow-sm ${bg}">
${ addonLeft && html`<span class="inline-flex font-normal truncate py-1 border-r bg-slate-100 items-center border-gray-300 px-2 text-gray-500 text-xs">${addonLeft}<//>` }
<input type=${type || 'text'} disabled=${disabled}
oninput=${oninput} ...${attr}
class="${bg} font-normal text-sm rounded w-full flex-1 py-0.5 px-2 text-gray-700 placeholder:text-gray-400 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-500" placeholder=${placeholder} value=${value} />
${ addonRight && html`<span class="inline-flex font-normal truncate py-1 border-l bg-slate-100 items-center border-gray-300 px-2 text-gray-500 text-xs overflow-scroll" style="min-width: 50%;">${addonRight}<//>` }
<//>`;
};
export function SelectValue({value, setfn, options, disabled}) {
const toInt = x => x == parseInt(x) ? parseInt(x) : x;
const onchange = ev => setfn(toInt(ev.target.value));
return html`
<select onchange=${onchange} class="w-full rounded font-normal border py-0.5 px-1 text-gray-600 focus:outline-none text-sm disabled:cursor-not-allowed" disabled=${disabled}>
${options.map(v => html`<option value=${v[0]} selected=${v[0] == value}>${v[1]}<//>`) }
<//>`;
};
export function SwitchValue({value, setfn}) {
const onclick = ev => setfn(!value);
const bg = !!value ? 'bg-blue-600' : 'bg-gray-200';
const tr = !!value ? 'translate-x-5' : 'translate-x-0';
return html`
<button type="button" onclick=${onclick} class="${bg} inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-0 ring-0" role="switch" aria-checked=${!!value}>
<span aria-hidden="true" class="${tr} pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 focus:ring-0 transition duration-200 ease-in-out"></span>
</button>`;
};
export function Setting(props) {
let input = TextValue;
if (props.type == 'switch') input = SwitchValue;
if (props.type == 'select') input = SelectValue;
return html`
<div class=${props.cls || 'grid grid-cols-2 gap-2 my-1'}>
<label class="flex items-center text-sm text-gray-700 mr-2 font-medium">${props.title}<//>
<div class="flex items-center">${h(input, props)}<//>
<//>`;
};
export function Pagination({ totalItems, itemsPerPage, currentPage, setPageFn, colors }) {
const totalPages = Math.ceil(totalItems / itemsPerPage);
const maxPageRange = 2;
const lessThanSymbol = "<";
const greaterThanSymbol = ">";
const whiteSpace = " ";
const itemcls = 'relative inline-flex items-center px-3 py-1 text-sm focus:z-20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-blue-600';
colors ||= 'bg-blue-600';
const PageItem = ({ page, isActive }) => (
html`<a
onClick=${() => setPageFn(page)}
class="${itemcls} ${isActive ? `${colors} text-white` : 'cursor-pointer text-gray-700 ring-1 ring-inset ring-gray-300 hover:bg-gray-50'}"
>
${page}
</a>`
);
return html`
<div class="flex items-center justify-between bg-white px-3 py-2">
<div class="sm:flex sm:flex-1 sm:items-center sm:justify-between space-x-4 whitespace-nowrap select-none">
<p class="text-sm text-slate-500 font-medium">
showing <span class="font-bold text-slate-700">${(currentPage - 1) * itemsPerPage + 1}</span> - <span class="font-medium">${Math.min(currentPage * itemsPerPage, totalItems)}</span> of ${whiteSpace}
<span class="font-bold text-slate-700">${totalItems}</span> results
</p>
<div>
<nav class="isolate inline-flex -space-x-px rounded-md" aria-label="Pagination">
<a
onClick=${() => setPageFn(Math.max(currentPage - 1, 1))}
class="relative inline-flex px-3 items-center text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 ${currentPage != 1 ? 'cursor-pointer' : ''} focus:z-20 focus:outline-offset-0">
${lessThanSymbol}
</a>
<${PageItem} page=${1} isActive=${currentPage === 1} />
${currentPage > maxPageRange + 2 ? html`<span class="${itemcls} ring-1 ring-inset ring-gray-300 text-slate-300">...</span>` : ''}
${Array.from({length: Math.min(totalPages, maxPageRange * 2 + 1)}, (_, i) => Math.max(2, currentPage - maxPageRange) + i).map(page => page > 1 && page < totalPages && html`<${PageItem} page=${page} isActive=${currentPage === page} />`)}
${currentPage < totalPages - (maxPageRange + 1) ? html`<span class="${itemcls} ring-1 ring-inset ring-gray-300 text-slate-300">...</span>` : ''}
${totalPages > 1 ? html`<${PageItem} page=${totalPages} isActive=${currentPage === totalPages} />` : ''}
<a
onClick=${() => setPageFn(Math.min(currentPage + 1, totalPages))}
class="relative inline-flex px-3 items-center text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 ${currentPage != totalPages ? 'cursor-pointer' : ''} focus:z-20 focus:outline-offset-0">
${greaterThanSymbol}
</a>
</nav>
</div>
</div>
</div>`;
};
export function UploadFileButton(props) {
const [upload, setUpload] = useState(null); // Upload promise
const [status, setStatus] = useState(''); // Current upload status
const btn = useRef(null);
const input = useRef(null);
// Send a large file chunk by chunk
const sendFileData = function(url, fileName, fileData, chunkSize) {
return new Promise(function(resolve, reject) {
const finish = ok => {
setUpload(null);
const res = props.onupload ? props.onupload(ok, fileName, fileData.length) : null;
if (res && typeof (res.catch) === 'function') {
res.catch(() => false).then(() => ok ? resolve() : reject());
} else {
ok ? resolve() : reject();
}
};
const sendChunk = function(offset) {
var chunk = fileData.subarray(offset, offset + chunkSize) || '';
var opts = {method: 'POST', body: chunk};
var fullUrl = url + '?offset=' + offset +
'&total=' + fileData.length +
'&name=' + encodeURIComponent(fileName);
var ok;
setStatus('Uploading ' + fileName + ', bytes ' + offset + '..' +
(offset + chunk.length) + ' of ' + fileData.length);
fetch(fullUrl, opts)
.then(function(res) {
if (res.ok && chunk.length > 0) sendChunk(offset + chunk.length);
ok = res.ok;
return res.text();
})
.then(function(text) {
if (!ok) setStatus('Error: ' + text), finish(ok); // Fail
if (chunk.length > 0) return; // More chunks to send
setStatus(x => x + '. Done, resetting device...');
finish(ok); // All chunks sent
});
};
//setFailed(false);
sendChunk(0);
});
};
const onchange = function(ev) {
if (!ev.target.files[0]) return;
let r = new FileReader(), f = ev.target.files[0];
r.readAsArrayBuffer(f);
r.onload = function() {
setUpload(sendFileData(props.url, f.name, new Uint8Array(r.result), 2048));
ev.target.value = '';
ev.preventDefault();
btn && btn.current.base.click();
};
};
const onclick = function(ev) {
let fn; setUpload(x => fn = x);
if (!fn) input.current.click(); // No upload in progress, show file dialog
return fn;
};
return html`
<div class="inline-flex flex-col ${props.class}">
<input class="hidden" type="file" ref=${input} onchange=${onchange} accept=${props.accept} />
<${Button} title=${props.title} icon=${Icons.download} onclick=${onclick} ref=${btn} colors=${props.colors} />
<div class="py-2 text-sm text-slate-400 ${status || 'hidden'}">${status}<//>
<//>`;
};
+1
View File
@@ -0,0 +1 @@
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.History=n():t.History=n()}(this,function(){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0,n.createPath=n.parsePath=n.locationsAreEqual=n.createLocation=n.createMemoryHistory=n.createHashHistory=n.createBrowserHistory=void 0;var r=e(2);Object.defineProperty(n,"createLocation",{enumerable:!0,get:function(){return r.createLocation}}),Object.defineProperty(n,"locationsAreEqual",{enumerable:!0,get:function(){return r.locationsAreEqual}});var i=e(1);Object.defineProperty(n,"parsePath",{enumerable:!0,get:function(){return i.parsePath}}),Object.defineProperty(n,"createPath",{enumerable:!0,get:function(){return i.createPath}});var a=e(7),c=o(a),u=e(8),s=o(u),f=e(9),l=o(f);n.createBrowserHistory=c.default,n.createHashHistory=s.default,n.createMemoryHistory=l.default},function(t,n){"use strict";n.__esModule=!0;n.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},n.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t},n.stripPrefix=function(t,n){return 0===t.indexOf(n)?t.substr(n.length):t},n.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},n.parsePath=function(t){var n=t||"/",e="",o="",r=n.indexOf("#");r!==-1&&(o=n.substr(r),n=n.substr(0,r));var i=n.indexOf("?");return i!==-1&&(e=n.substr(i),n=n.substr(0,i)),n=decodeURI(n),{pathname:n,search:"?"===e?"":e,hash:"#"===o?"":o}},n.createPath=function(t){var n=t.pathname,e=t.search,o=t.hash,r=encodeURI(n||"/");return e&&"?"!==e&&(r+="?"===e.charAt(0)?e:"?"+e),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0,n.locationsAreEqual=n.createLocation=void 0;var r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},i=e(10),a=o(i),c=e(11),u=o(c),s=e(1);n.createLocation=function(t,n,e,o){var i=void 0;return"string"==typeof t?(i=(0,s.parsePath)(t),i.state=n):(i=r({},t),void 0===i.pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==n&&void 0===i.state&&(i.state=n)),i.key=e,o&&(i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=(0,a.default)(i.pathname,o.pathname)):i.pathname=o.pathname),i},n.locationsAreEqual=function(t,n){return t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash&&t.key===n.key&&(0,u.default)(t.state,n.state)}},function(t,n,e){"use strict";var o=function(){};t.exports=o},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var r=e(3),i=(o(r),function(){var t=null,n=function(n){return t=n,function(){t===n&&(t=null)}},e=function(n,e,o,r){if(null!=t){var i="function"==typeof t?t(n,e):t;"string"==typeof i?"function"==typeof o?o(i,r):r(!0):r(i!==!1)}else r(!0)},o=[],r=function(t){var n=!0,e=function(){n&&t.apply(void 0,arguments)};return o.push(e),function(){n=!1,o=o.filter(function(t){return t!==e})}},i=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];o.forEach(function(t){return t.apply(void 0,n)})};return{setPrompt:n,confirmTransitionTo:e,appendListener:r,notifyListeners:i}});n.default=i},function(t,n){"use strict";n.__esModule=!0;n.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),n.addEventListener=function(t,n,e){return t.addEventListener?t.addEventListener(n,e,!1):t.attachEvent("on"+n,e)},n.removeEventListener=function(t,n,e){return t.removeEventListener?t.removeEventListener(n,e,!1):t.detachEvent("on"+n,e)},n.getConfirmation=function(t,n){return n(window.confirm(t))},n.supportsHistory=function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},n.supportsPopStateOnHashChange=function(){return window.navigator.userAgent.indexOf("Trident")===-1},n.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1},n.isExtraneousPopstateEvent=function(t){return void 0===t.state&&navigator.userAgent.indexOf("CriOS")===-1}},function(t,n,e){"use strict";var o=function(t,n,e,o,r,i,a,c){if(!t){var u;if(void 0===n)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[e,o,r,i,a,c],f=0;u=new Error(n.replace(/%s/g,function(){return s[f++]})),u.name="InLine truncated
Loaded 100 of 2911 files, more files were not shown because too many files have changed in this diff. Show more