1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-05-28 03:41:25 +03:00

73 Commits

Author SHA1 Message Date
Ivan Grokhotkov
c83e17b31e WiFiUpd: fix warning 2017-10-15 14:41:50 +08:00
Ivan Grokhotkov
5116a46f09 WiFiClient,WiFiServer: update to match new err_t definition 2017-10-15 01:40:10 -05:00
Ivan Grokhotkov
526f4fbb6c WiFiClientSecure: add option to allow self-signed certificates
Mainly useful for testing WiFiClientSecure in local environments.

If allowSelfSignedCerts is called before verifyCertChain, then the
certificate chain will be verified, but the final certificate may be
self-signed.
2017-10-08 07:08:51 +08:00
Matthew Blythe
13c1e8b293 UdpContext: check that pbuf_alloc doesn't return nullptr (#3354) 2017-09-22 03:56:27 -05:00
Ivan Grokhotkov
d6f1f0d5d7 WiFiClient: apply write timeout to single chunk (#3273)
WiFiClient write timeouts introduced in #3257 applied to the whole write
operation, which could take long time if data size was large. This
change makes the timeout happen per chunk. Timeout now happens if no
data has been delivered within a given interval.
2017-05-22 20:08:16 +08:00
Ivan Grokhotkov
eebcc656ed WiFiClient: add support for connect timeout 2017-05-19 09:35:01 -05:00
Ivan Grokhotkov
7de81270a3 ClientContext: don’t read DataSource in TCP callback
Previously, _write_some function would be called each time TCP stack
notifies the application that some data was delivered (via the `sent`
callback). In turn, _write_some would obtain more data to be sent from
the DataSource. In case of a DataSource backed by a Stream, this would
read from a stream. Some libraries (such as SD) may call `yield` and
other blocking operations from Stream read function, which can not be
used in TCP stack callbacks.

This change moves the data sending loop back into the Arduino task, with
a negligible loss of performance. TCP callback now wakes the main task
via `esp_schedule`, which performs stream read and provides more data
to the TCP stack.

Possible future optimization would be to buffer Stream data ahead of
time. That way, buffered data could be sent immediately from the TCP
callback. On the other hand, this optimization would need extra TCP_MSS
of temporary storage, per connection.

Fixes #2399.
2017-05-09 06:17:32 -05:00
Ivan Grokhotkov
c5c138ec5a axtls: update to bddda2a0
- update ssl_client_new signature
- add max fragment length negotiation support (hardcoded to 4096 bytes)
- build axtls with -f{function,data}-sections, ~1k less DRAM usage,
  ~3k less flash
- strip prefix from build paths in debug symbols
2017-04-29 22:58:19 +08:00
david gauchard
a41f55c469 prepare lwip2 (#3129)
* minimum changes for libraries to compile with lwip2

* add WiFiClient::availableForWrite() (similar to Serial::) which indicates how much data can be sent without buffering
2017-04-25 08:55:01 -05:00
joelucid
61787b23af ClientConnection uses too much heap when streaming files #2871 (#2874)
* ClientConnection uses too much heap when streaming files #2871

* make write_chunk_size a member variable

* untabify
2017-01-31 11:04:45 +03:00
Rodion Kvashnin
2126146e20 Fix warnings (#2881)
* Suppressed -Wunused-parameter and -Wunused-function by casting to void unused identifiers.

* Explicit initialization of all fields to suppress -Wmissing-field-initializers.

* Fixed signed/unsigned integer comparison.

* memset initialization of structs.

* More -Wunused-parameter fixes.
2017-01-31 10:07:59 +03:00
Me No Dev
07f4d4c241 Lwip addons (#2260)
* Add multicast TTL to UDP and rework UdpContext

* Add limit for TCP TIME_WAIT pcbs

* Add liblwip_gcc.a

* Make the changes be backward compatible with the current xcc version
2016-07-11 21:07:45 +08:00
Ivan Grokhotkov
8db4dcea42 WifiClient::write refactoring (second attempt) (#2177)
* WiFiClient: use DataSource for writes

* ESP8266WebServer: delegate writing to WiFiClient

* ESP8266WebServer: set write timeout before sending content
2016-06-23 17:47:18 +08:00
Ivan Grokhotkov
e8b8a606e4 Update axTLS to 139914f
- Fix occasional software WDT due to lengthy bigint operations
- Implement truly blocking reads as a workaround for half-duplex nature of axTLS
2016-05-10 23:34:33 +08:00
Ivan Grokhotkov
a2b82ed6b6 Use gcc-built LwIP by default (#1926)
It is still possible to use xcc-built LwIP by selecting "Core Development" board from tools menu.
2016-05-06 20:09:15 +08:00
Ivan Grokhotkov
33723a9b52 Fix UdpContext::peek to return int (#1946) 2016-04-26 16:02:07 +08:00
Ivan Grokhotkov
8c65f2fcd0 Update axTLS to fe4518d, SNI support in WiFiClientSecure (#1285)
Fixes #1933
2016-04-19 08:29:13 +03:00
Me No Dev
bfe9f7be69 Update and move lwIP headers, add options to use different lwIP build for generic device
Makefile added to lwip source folder to build and install liblwip_gcc.a
2016-04-10 21:55:22 +03:00
Ivan Grokhotkov
19e97bfe15 Fix WiFiUDP::peek return value when buffer is empty (#1796) 2016-03-24 01:21:29 +03:00
Ivan Grokhotkov
aa67d1c492 Pass errors from udp_sendto to WiFiUDP::endPacket (#1696) 2016-03-02 19:58:35 +03:00
Ivan Grokhotkov
33e5ca44df WiFiClient: fix write behaviour when connection is closed by remote side
Don't wait for data to be ACKed if we have just called abort().
2016-03-02 17:53:42 +03:00
Ivan Grokhotkov
efc8dda160 Workaround for LwIP not handling ERR_ABRT
Described in detail here: https://github.com/esp8266/Arduino/wiki/LwIP-issue,-or-how-a-simple-%22if%22-can-go-wrong
2016-01-26 15:57:37 +03:00
Ivan Grokhotkov
ee2d4495fd Additional check in wl_definitions.h to guard against duplicate definitions 2015-12-22 14:08:17 +03:00
Markus Sattler
5333ebfed7 add function peekBytes to WiFiClient/WiFiClientSecure to allow to peek multiple bytes if possible 2015-12-19 14:37:36 +01:00
Ivan Grokhotkov
3d1fbc60ab Replace chain of UDP pbufs with a single pbuf before sending (#1009)
Packets up to 1492 bytes may be sent this way.
Also reduced pbuf_unit_size to 128 bytes.
2015-12-06 20:22:54 +03:00
Me No Dev
a44632b8cf make compiler happier 2015-11-25 18:11:16 +02:00
Markus Sattler
c8aac83c47 add :del message to unref 2015-11-22 22:39:58 +01:00
Ivan Grokhotkov
6b7b802706 Fix a crash due to abort() called from TCP error callback (#428) 2015-09-28 16:05:23 +03:00
Juppit
6d6a26aea0 Remove unused include time.h from ssl.h
This include is not used by ssl.h but can be annoying.
If there is need for time.h it should be located in the esp8266 tree.
2015-09-15 23:46:15 +02:00
Ivan Grokhotkov
f73d414f38 WiFiClientSecure: add certificate fingerprint verification (#43) 2015-09-14 10:22:54 +03:00
Ivan Grokhotkov
9a2f2f2849 Add axTLS, first draft of WiFiClientSecure (#43) 2015-09-01 15:45:12 +03:00
aalku
acc34e2914 LocalIP/LocalPort support 2015-08-19 13:18:43 +03:00
Markus Sattler
3a34aa61e0 Merge remote-tracking branch 'remotes/esp8266/esp8266' into esp8266
Conflicts:
	hardware/esp8266com/esp8266/cores/esp8266/Esp.cpp
2015-06-25 20:02:37 +02:00
Ivan Grokhotkov
565c7aeac0 Less debug output from slist 2015-06-25 00:13:55 +03:00
Markus Sattler
fdb723cbad Merge remote-tracking branch 'remotes/esp8266/esp8266' into esp8266
Conflicts:
	hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_main.cpp
2015-06-23 13:08:05 +02:00
Ivan Grokhotkov
b029e78a67 Fix for wifi disconnect handling (#431) 2015-06-22 13:59:12 +03:00
Markus Sattler
874cf0ef98 fix exception 28 in AP + STA mode and STA disconnect
UDP triggers exception 28
2015-06-20 18:36:19 +02:00
Ivan Grokhotkov
c51acf2a32 Fix tcp error handler 2015-06-11 18:11:26 +03:00
Ivan Grokhotkov
e6e57a8b81 Better handling of wifi disconnect (#231)
When network interface is down, some nasty things happen, for instance tcp_connect returns without ever calling error callback.
This change adds some workarounds for that: before doing a tcp connect and DNS resolve we check if there is a route available.
Also added a listener for wifi events which stops (aborts) all the WiFiClients and WiFiUDPs when wifi is disconnected. This should
help libraries detect disconnect properly.
2015-06-11 18:01:33 +03:00
Markus Sattler
108a40acfd add support for list of AP connections
- auto select ssid with best signal
 - for debugging enable DEBUG_WIFI_MULTI macro and call Serial.setDebugOutput(true);

change ESP8266WiFiClass::status() return type to wl_status_t
2015-05-16 22:40:53 +02:00
Ivan Grokhotkov
371320bc45 Merge branch 'esp8266' of https://github.com/ficeto/Arduino into ficeto-esp8266 2015-05-12 20:46:57 +03:00
ficeto
f2f1fad298 add TCP_NODELAY control 2015-05-12 19:25:37 +03:00
Ivan Grokhotkov
720142ef24 Merge branch 'esp8266' of https://github.com/jwatte/Arduino into jwatte-esp8266 2015-05-12 19:11:22 +03:00
Ivan Grokhotkov
89248032d6 Merge branch 'esp8266' of https://github.com/ficeto/Arduino into esp8266
Conflicts:
	hardware/esp8266com/esp8266/libraries/ESP8266WebServer/examples/SDWebServer/SDWebServer.ino
2015-05-12 18:58:10 +03:00
Ivan Grokhotkov
25d814bdfb some UdpContext fixes, add rx callback support
Set udp destination address, port, and multicast TTL only on send.
Fix read method to return -1 if buffer is empty.
2015-05-12 17:52:22 +03:00
ficeto
1707d3d036 move discard_cb to unref 2015-05-12 14:22:16 +03:00
ficeto
88c6ee418d add close and abort methods and enable disconnect callback 2015-05-12 13:58:05 +03:00
Jon Watte
3049d48d56 Fix UDP send to not temporarily use connect() 2015-05-10 14:00:50 -07:00
ficeto
8819c1e91c fix write taking too long 2015-05-07 13:38:32 +03:00
Ivan Grokhotkov
5354464a01 Add destinationIP method to WiFiUDP
Might be useful to distinguish between normal and multicast packets arriving at the same port (#105)
2015-04-29 07:01:54 +08:00