Commit Graph

1108 Commits

Author SHA1 Message Date
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
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
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
d742b67878 Fix address stringification on CC3200 (SimpleLink)
PUBLISHED_FROM=b741acc999d0d2160528b4cb805f315b926ac65b
2016-03-25 17:11:01 +00:00
Deomid Ryabkov
3b345a81c4 Add debug info to websocket conns
PUBLISHED_FROM=7454716e089be5c54359113cc188215e2475ea29
2016-03-22 12:51:48 +00:00
Deomid Ryabkov
6f4c21c218 Do not bypass auth when handling CGI request
PUBLISHED_FROM=9faccf9fedd92d0fb54b7ff660c0cf99c1cbdb74
2016-03-22 11:45:49 +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
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
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
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
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
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
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
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
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
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
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
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
Deomid Ryabkov
81d977c720 Introduce mg_time() and use it internally
PUBLISHED_FROM=024a2d7849a800381d58460877eacccfc93b1cdd
2016-01-11 12:24:40 +03:00
Dmitry Frank
d9b9d71b2d v7_apply() and friends take res as last argument
PUBLISHED_FROM=4b064f5e4554c5a016481bf8104c0ba9dd244083
2016-01-11 12:24:38 +03:00
Dmitry Frank
643ee1df14 cfunctions API refactored to return enum v7_err
PUBLISHED_FROM=f96a4ab2016c0125c1e94b3c5c9ada2c365bd39d
2016-01-11 12:24:36 +03:00
Deomid Ryabkov
6c4d37ee68 Free previous ssl context in mg_set_ssl
PUBLISHED_FROM=9f595222bce1fe8d0917649e36ce3be40eee1775
2015-12-23 17:02:52 +01:00
Dmitry Frank
0fe2dd9b48 Added param names to mongoose headers
PUBLISHED_FROM=07bd8163c4e1df49ab3dc7a1640efa2adff34e33
2015-12-22 07:42:11 +00:00
Sergey Lyubka
910aee7f7b Re-enable mongosoe FS support on ESP
PUBLISHED_FROM=cfa1c79bb5429feddf38c68c25195b97deef9a62
2015-12-22 07:33:06 +00:00
Marko Mikulicic
4d41dff4fd Fix includes
PUBLISHED_FROM=58d764bb224968d5368b21a8eb572602055cb26b
2015-12-21 08:37:19 +00:00
Deomid Ryabkov
05082cec88 Use sub-second time for timers in MG
PUBLISHED_FROM=2b5bd1589465a5f43bc888c689842332cf7cdf98
2015-12-20 17:49:13 +00:00
Marko Mikulicic
3c53909e82 Foolproof Smartjs publishing
PUBLISHED_FROM=8ade849890746baa95fd8a5d92baf3dda656a719
2015-12-15 11:28:39 +01:00
Sergey Lyubka
17802735d7 Spiffy config for cc3200
PUBLISHED_FROM=34b3678cb2510adfd5f26183ae7c16aadb97e6c9
2015-12-14 00:12:12 +01:00
Marko Mikulicic
d2eb67a1ae Sanitize mongoose headers
PUBLISHED_FROM=d3790d175b8d714865c7eb5f12e82d31844a863f
2015-12-14 00:12:12 +01:00
Marko Mikulicic
3f254dd3fc Simplify include paths
PUBLISHED_FROM=4e38db207dc2634e410339c81c5a2a87e8b188b0
2015-12-14 00:12:12 +01:00
Deomid Ryabkov
e139bde6ae A couple SSL-related fixes for Mongoose
PUBLISHED_FROM=03297850f7a620588de851ef86be25e17a04ad28
2015-12-11 13:02:13 +00:00
Sergey Lyubka
5f62951143 Runtime DAV auth disable. Implement MOVE
PUBLISHED_FROM=aec49928891972ecd6af9999fe3e1cb5ef00f24c
2015-12-11 13:02:13 +00:00
Sergey Lyubka
2207e87c8f Fix DAV for non-existent files. Improve logging
PUBLISHED_FROM=39a2810ad9bebcf1676b982f7523aa9c2339cc4f
2015-12-11 13:02:12 +00:00
Sergey Lyubka
5bd59c7b70 Shut up spiffs. Proper DAV report
PUBLISHED_FROM=125379f6c624b4e938b5d543cb8ed5fe906de98f
2015-12-11 13:02:12 +00:00
Alexander Alashkin
02f6867a2f Implement %lld in c_vsnprintf. Closes cesanta/dev#2120
PUBLISHED_FROM=1f24878425356f625b4f5b2b0fe40ab5f17501ab
2015-12-11 13:02:11 +00:00
Deomid Ryabkov
b93fa3144a First cut of TLS support for LWIP event manager
PUBLISHED_FROM=98cf23ea090ffb4e83edd4d600bee57dfd7d94d4
2015-12-11 13:02:11 +00:00
Alexander Alashkin
a68e0d9a3f Add WebDAV move stub
PUBLISHED_FROM=b1f712862b81dfe8da6547338f77ff3bfefa5051
2015-12-11 13:02:10 +00:00
Alexander Alashkin
cfe80ba9b7 Add WebDAV support to sjs/esp8266
PUBLISHED_FROM=a68a2f205cb2f10809183d5160709981585538b7
2015-12-11 13:02:10 +00:00
Sergey Lyubka
e98b5a691e Implement Http_request.setTimeout()
PUBLISHED_FROM=7a72e485aad2be859b9452dc1687a922778959d1
2015-12-08 13:38:05 +00:00
Sergey Lyubka
ed24afd172 Connect timeouts for resolving connections
PUBLISHED_FROM=068b6f75550b10913d7f13106f9a7f7dce5babec
2015-12-08 12:35:29 +00:00
Deomid Ryabkov
714556de65 Added debug line to mg_mgr_handle_ctl_sock
PUBLISHED_FROM=a4c1d105cb4f18d982bd28190691b6ea65ee37fc
2015-12-08 12:35:29 +00:00
Deomid Ryabkov
547ec85b58 Properly disable socketpair-related stuff
PUBLISHED_FROM=f3a236470281af80848c8f78163980083190c081
2015-12-08 12:35:29 +00:00
Marko Mikulicic
845d751e87 Fix C String API confusion
PUBLISHED_FROM=af34acd81d877bfbd8441c14451d8c81f18c207d
2015-12-08 12:35:29 +00:00
Alexander Alashkin
518a7f8a71 Fix MG DAV
PUBLISHED_FROM=132db6ed9c9e1eb9ec19b4f9299448b901b92231
2015-12-08 12:35:29 +00:00
Sergey Lyubka
31323b01bc Introduce MG_EV_TIMER event
PUBLISHED_FROM=2e90ee87eda8bc742e427671bb9df1ce0cd8bc25
2015-12-08 12:35:28 +00:00
Deomid Ryabkov
3a138ecc83 Move more of SSL-specific code into net_if
PUBLISHED_FROM=47dc4712c0ea2012c0774ad260f0451371cfe8b7
2015-12-08 12:35:28 +00:00
Sergey Lyubka
423b978395 Report read-only vars to UI
PUBLISHED_FROM=2ca4b52e777a54d9bb05a177e57a8b73bb962fdb
2015-12-08 12:35:27 +00:00
Sergey Lyubka
c948a509fb Export mg_url_decode() to public
PUBLISHED_FROM=442534f52992be612a98a549e5ab2191081a9d52
2015-12-03 22:05:52 +00:00
Deomid Ryabkov
d665d9e90e Always Be Closing
PUBLISHED_FROM=29ca7cdd9024790bd75892f9f67b3f83a6bd00d1
2015-12-01 18:03:19 +00:00
Sergey Lyubka
e9d79b130d Add documentation for the mongoose binary
PUBLISHED_FROM=71a01298c9bbff9a748ea33e0d148d549e5e6437
2015-11-30 12:27:59 +00:00
Deomid Ryabkov
7951dac9d5 Put getting local/remote address behinf net_if
PUBLISHED_FROM=f88056e79b632d9eee288dacf61c2f87ff3ceca5
2015-11-30 12:27:58 +00:00
Sergey Lyubka
7c4cda622f Implement port based redirect
PUBLISHED_FROM=798a8bc38cb385027d3caae9b954002c1a10d39c
2015-11-30 12:27:57 +00:00
Deomid Ryabkov
3298030b8e Changes to make Mongoose compile on ESP RTOS SDK
PUBLISHED_FROM=863a47416ee5e30f20f6523374ebd510cc022d99
2015-11-24 00:42:27 +00:00
Sergey Lyubka
6cfc696439 Add helper function mg_send_head()
PUBLISHED_FROM=5c9d11d21d34fa72974a021f0342068d87159634
2015-11-24 00:42:26 +00:00
Deomid Ryabkov
79e8d77ea0 Shave the debug yak
PUBLISHED_FROM=402d26b6a2797bfe9fb70e48cbde97f3960ef5d4
2015-11-20 12:07:51 +00:00
Sergey Lyubka
bda470245e Support for multiple listeners
PUBLISHED_FROM=ad00f31ae8732be2d7fdc7f0968fd04edfd76bb6
2015-11-20 12:07:51 +00:00
Sergey Lyubka
0c95290f93 Add extra headers support (allows CORS)
PUBLISHED_FROM=2279e31315bba4d19e2ae568cba94ea5dea3ef6a
2015-11-18 07:44:23 +00:00
Deomid Ryabkov
8989739d32 Use mg_call to invoke user handler
PUBLISHED_FROM=cefd472946dfe77ec262c1980eab983a919b6220
2015-11-18 07:44:23 +00:00
Sergey Lyubka
1112981e6e Fix mg_if_not_modified() logic
PUBLISHED_FROM=3eb1455eacc66af83904f56397c0e24b1d4f13bf
2015-11-18 07:44:23 +00:00