1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-10 14:42:08 +03:00
Commit Graph

3604 Commits

Author SHA1 Message Date
bb90e12ea0 Fix double-free in ESP8266WebServer (#4365)
In issue #4350, @mongozmaki found that the web server was accessing a
deleted variable in the destructor.  Implement his suggested change
and move the close() before any freeing.  Could also have simply
NULL'd out the _currentHeaders member after freeing as well.

Fixes issue #4350
2018-02-14 07:50:26 -08:00
11c83e1687 Merge pull request #4363 from ivankravets/master
Remove @PlatformIO library.json from GDBStub; fix pattern in LD
2018-02-14 13:30:48 +02:00
eb58a31b89 Remove @PlatformIO library.json from GDBStub; fix pattern in LD // Resolve #4355 2018-02-14 00:23:12 +02:00
291bc6bca5 Wrap mimetype strings in FSPTR()s (#4338)
Mimetype is now in progmem, so any accesses to it need to be using FPSTR()
wrapped Strings.

Fixes #4329
2018-02-10 08:12:38 -08:00
bf5a0f24dc Fix mem leak in SSL server, allow for concurrent client and server connections w/o interference (#4305)
* Fix leak on multiple SSL server connections

Fixes #4302

The refcnt setup for the WiFiClientSecure's SSLContext and ClientContext
had issues in certain conditions, causing a massive memory leak on each
SSL server connection.  Depending on the state of the machine, after two or
three connections it would OOM and crash.

This patch replaces most of the refcnt operations with C++11 shared_ptr
operations, cleaning up the code substantially and removing the leakage.

Also fixes a race condition where ClientContext was free'd before the SSLContext
was stopped/shutdown.  When the SSLContext tried to do ssl_free, axtls would
attempt to send out the real SSL disconnect bits over the wire, however by
this time the ClientContext is invalid and it would fault.

* Separate client and server SSL_CTX, support both

Refactor to use a separate client SSL_CTX and server SSL_CTX.  This
allows for separate certificates to be installed on each, and means
that you can now have both a *single* client and a *single* server
running in parallel at the same time, as they'll have separate memory
areas.

Tested using mqtt_esp8266 SSL client with a client certificate and a
WebServerSecure with its own custom certificate and key in parallel.

* Add brackets around a couple if-else clauses
2018-02-08 15:25:24 -03:00
cda72a07e0 Changed TIM_DIV265 for deprecation (#4326) 2018-02-08 14:07:47 -03:00
f6f977fb03 fix links for read the docs (#4293)
* fix links for read the docs

* fix typo

fix typo in link
2018-02-08 01:17:36 -03:00
bb5787a1cd Fix mdns buffer overrun by 1 (#4317)
* fix mdns buffer overflow, minor indent/prettify
2018-02-07 14:39:27 -03:00
85fb3d9b44 boards: Wemos D1 R1 needs a separate defined identifier (#4304) 2018-02-07 15:36:26 +01:00
4caf4878c7 LED_BUILTIN should be a #define (#4276)
* LED_BUILTIN should be a #define
deduplicate and hide BUILTIN_LED as a deprecated constant

* test for LED_BUILTIN existence

* board:espino:variant: rename button macro (naming coherence)
2018-02-07 10:42:57 -03:00
b15102ad28 doc/faq: tcpCleanup (#4314) 2018-02-07 09:09:25 -03:00
bcbd5961c0 add begin(port) to esp8266webserver, move some strings to flash, some refactoring (#4148)
* add begin(port) to esp8266webserver, move some strings to flash, some refactoring

* Moved more strings to flash, unified some strings

* move mimetable strings into a standalone file

* more string moves to flash, remove duplicates, refactor of template method, minor styling

* Reverted moving small string to flash (no heap advantage, reduces bin size)
2018-02-07 00:30:07 -03:00
0339bbb11c lwip2: use only wifi_station_get_hostname() to set netif hostname (#4299)
* lwip2: use only wifi_station_get_hostname() to set netif hostname
fix #3970

* lwip2 comments on hostname
2018-02-06 23:23:27 -03:00
64885fd5cf minor cosmetics (dead code, -Wallextra) (#4274) 2018-02-07 01:34:46 +01:00
83f6d83db0 Fix RTCmem example buffer access past end (#4288) 2018-02-06 20:54:03 -03:00
9694b3e688 Fix spiffs lseek typo for seek_end (#4287) 2018-02-06 19:59:16 -03:00
4c23e66bba SSL server DEBUG, code cleanup fixes (#4280)
The server needs to load an X509 and RSA key, but instead of using
the existing loadObject() calls implemented its own.  Remove them and
use the standard ones instead.

The DEBUG_OUTPUT macro was undefined in the SSL Web server.  Add it
in do that when you compile with DEBUG=HTTP_SERVER it actually compiles.
2018-02-06 07:33:26 -08:00
c8dbfb160b Refrech api.github.com x509 certificate (#4306)
The certificate fingerprint included with the HTTPSRequest example seems
to be for an expired api.github.com certificate.  Replace with the current
one to avoid reporting "certificate mismatch" errors when running.
2018-02-06 11:06:05 -03:00
c3bd91af28 Merge pull request #4294 from esp8266/ivankravets-patch-1
Update integration with @PlatformIO
2018-02-05 16:38:14 +02:00
e3074e9575 Update integration with @PlatformIO 2018-02-05 12:53:02 +02:00
e38f19e008 Remove warnings when NDEBUG build option used (#4196)
When building using the new NDEBUG option recently added, the assert()
macro is defined to nothing. This leaves a few variables unused in the
WiFi stack causing compiler warnings. Add in empty casts to remove
these warnings. Does not affect actual assert use when NDEBUG is not
defined.
2018-02-04 20:59:31 -08:00
4e115917ae fix dead link docs (#4221) 2018-02-05 00:57:58 -03:00
29c9ebea32 update lwip menu (#4286) 2018-02-03 22:02:29 +01:00
199fe0f16d ClientContext:_write_some: release buffer once data really accepted for sending (#4265)
may fix #1872
2018-02-01 11:49:04 +01:00
9ba8f77678 Check that pins needed by Wire are defined at compile-time (#4261) 2018-01-30 14:59:47 -03:00
4bafbe5514 WiFiTelnetToSerial Example - Minor Issues #2435 (#4255)
* WiFiTelnetToSerial Example - Minor Issues #2435

* WiFiTelnetToSerial Example - Minor Issues #2435

Patch to rectify issue #2435
2018-01-29 14:12:22 -03:00
84228b1c73 Nameoftherose patch for Issue #2435 (#4256)
* WiFiTelnetToSerial Example - Minor Issues #2435

* WiFiTelnetToSerial Example - Minor Issues #2435

Patch to rectify issue #2435
2018-01-29 13:28:28 -03:00
8da1d78cb4 Change argument to Esp.deepSleep from uint32 to uint64 to match SDK, add deepSleepMax based on the cali_proc function per SDK 2018-01-28 19:12:12 +08:00
8b87491700 new board generator option: --nofloat (#4232) 2018-01-27 11:10:59 +01:00
4e539b2618 Add a new resetmethod_menu_all macro (#4241)
* Add a new resetmethod_menu_extra macro to give the choice of all the reset options.  Then only offer all these options for the generic modules.
2018-01-27 02:04:22 +01:00
8a24598d5d Add missing esptool upload modes for none and dtrset (#4228)
* Add missing esptool upload modes for none and dtrset
2018-01-24 15:20:04 +01:00
575c45d1e7 Merge pull request #4222 from boneskull/oak-fix
add missing constants to variants/oak
2018-01-24 13:42:55 +01:00
87b9097399 add missing constants to variants/oak 2018-01-22 23:25:35 -08:00
589eb29eb3 Clear calloc block only if malloc succeeds
Calloc was calling memset(0) on NULL when its implicit malloc failed,
causing a crash in UMM.  Instead, only do the memset if the memory
allocation succeeds.

Fixes issue #4207
2018-01-21 13:54:53 +08:00
0fe725909e Update I2S base frequency and frequency dividers to real ones (#4031)
* Fix I2S base frequency
* Update frequency dividers for I2S
Reference: https://github.com/espressif/ESP8266_MP3_DECODER/blob/master/mp3/driver/i2s_freertos.c
* fixed i2s_set_rate, added i2s_get_real_rate() and i2s_set_dividers
* Minimise float calculations
2018-01-20 15:58:42 -08:00
38fe6fc488 Add timeout to WiFi connection loop in WiFiMulti (#4146) 2018-01-20 14:45:54 -03:00
dd00db1b8c check ClientContext's this and _pcb once out of the ::connect() delay (#4194)
fix #4078
2018-01-18 21:20:33 -03:00
d5c43f0102 Utilized UPDATE_ERROR_ERASE, added _setError function and refactored code (#4190)
* Added _setError function in the header file

_setError function wraps a few lines to eliminate repetitiveness when debugging for errors.

* Added _setError function

_setError function wraps a few lines to eliminate repetitiveness when debugging for errors.
2018-01-18 13:34:35 -03:00
b08ff10269 Rework of arduino compatibility in WiFiSTAClass::config (#4145) 2018-01-17 15:30:24 -03:00
bb794f9e02 Move C++ vtables into IRAM, out of HEAP (#4179)
GCC places vtables in .rodata, with a mangled name of "_ZTV*."  Because
these are simply address jump tables, there is no need to place them in
RAM.  Instead, have the linker place them in the .text (aka IRAM) section.
This will free up a variable amount of heap space, depending on the number
of classes with virtual functions used in any particular project.
2018-01-17 14:10:40 -03:00
074402e23b Merge pull request #4150 from d-a-v/lwip
restore zalloc() + lower lwip2 ram and flash footprint
2018-01-15 17:09:25 +01:00
de2a3821f6 lower lwip2 ram and flash footprint (by disabling old asserts) 2018-01-15 09:51:33 +01:00
23a7bc2939 restore zalloc() (lost with OOM debug commit, used by lwip/lwip2) 2018-01-15 09:51:33 +01:00
12f336fa5f Case change and and 'none' reset option for Digistump Oak (#4143)
* Case change and and 'none' reset option for Digistump Oak

The logo is 'digiStump', but is always written in text form as 'Digistump'. 

The generator fixed an issue with the release version of 2.4.0 not having a resetMethod for the Digistump Oak, and hence not being able to be uploaded to without modifying the boards.txt file. However, the Oak doesn't support auto-reset via serial - it was primarily designed to be a cloud-programmed board.

* Regenerated boards.txt
* Regeneration of doc/boards.rst
2018-01-15 04:19:52 +01:00
ca25068733 initialize io_ctx to nullptr 2018-01-12 18:39:10 +08:00
02259a412c fixed support for psk in WiFiSTA, added support for psk to WiFiMulti, minor code cleanups (#4076) 2018-01-10 23:15:24 -03:00
332e059724 ESP8266HTTPClient: add digest authentication example (#4112) 2018-01-10 16:27:25 +08:00
bd1c7ce1dc Add SSL enabled WiFiServer, Updater, WebServer
Adds SSL server mode for WiFiServerSecure, for plain SSL connections,
ESP8266WebServerSecure, for HTTPS web serving, and SecureHTTPSUpdater for
encrypted OTA updates.

Example code is provided for all new options, as well as a BASH script for
generating their own, self-signed certificates.

Both ESP8266WebServerSecure and SecureHTTPSUpdater are important for secure
password-based authentication.  HTTP Basic Authentication, the only supported
model presently, sends the username and password in *cleartext* and therefore
should *never* be used in any un-SSL encrypted channel unless you don't mind
sharing your login and password with anyone else on the internet.  Even if the
ESP8266 is not safety critical, this cleartext broadcast could expose you should
you reuse this password elsewhere on your network or the internet.
2018-01-10 11:56:32 +08:00
8765da258b Added WifiServer::begin(uint16_t port) method, listening port can be changed at runtime (#4123) 2018-01-09 22:10:43 -03:00
2c8b2b92ce tests: minor fixes, add README.md 2018-01-09 15:59:08 +08:00