This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check_illegal_utf_8 [244, 65, 48] // Low continuation bytes. | |
check_illegal_utf_8 [244, 244, 48] // High continuation bytes. | |
check_illegal_utf_8 [48, 244] // Missing continuation bytes. | |
check_illegal_utf_8 [0xc0, 0xdc] // Overlong encoding of backslash. | |
check_illegal_utf_8 [0xc1, 0xdf] // Overlong encoding of DEL. | |
check_illegal_utf_8 [0xe0, 0x9f, 0xbf] // Overlong encoding of character 0x7ff. | |
check_illegal_utf_8 [0xe0, 0x9f, 0xb9] // Overlong encoding of N'Ko exclamation mark. | |
check_illegal_utf_8 [0xf0, 0x82, 0x98, 0x83] // Overlong encoding of Unicode snowman. | |
check_illegal_utf_8 [0xed, 0xa0, 0x80] // 0xd800: First surrogate. | |
check_illegal_utf_8 [0xed, 0xbf, 0xbf] // 0xdfff: Last surrogate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func main() { | |
// Two new vars, with :=. | |
x, y := returns_one_and_two() | |
print("x = ", x, "\n") // 1 | |
print("y = ", y, "\n") // 2 | |
// One of the vars is new, use := for both. | |
y, z := returns_one_and_two() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bitmap show blit | |
import expect show * | |
/** | |
Takes a byte array of little endian 16 bit values. | |
Returns a new byte array of little endian 32 bit values, sign extended. | |
For each input 16 bit value there are two (copied) 32 bit output values. | |
*/ | |
expand input/ByteArray -> ByteArray: | |
output := ByteArray input.size * 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (C) 2021 Toitware ApS. | |
// Use of this source code is governed by a Zero-Clause BSD license that can | |
// be found in the EXAMPLES_LICENSE file. | |
import http | |
import net | |
import net.x509 | |
import certificate_roots | |
main: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/CMakeLists.txt b/CMakeLists.txt | |
index 058e61b..c16551d 100644 | |
--- a/CMakeLists.txt | |
+++ b/CMakeLists.txt | |
@@ -127,7 +127,7 @@ if ("${TOIT_SYSTEM_NAME}" MATCHES "esp32") | |
set(MBEDTLS_C_FLAGS "-DMBEDTLS_CONFIG_FILE=\\\"mbedtls/esp_config.h\\\"") | |
else() | |
# These constants should stay in sync with the ones in the sdkconfig file of the ESP32 toolchain. | |
- set(MBEDTLS_C_FLAGS "-DMBEDTLS_SSL_IN_CONTENT_LEN=8100 -DMBEDTLS_SSL_OUT_CONTENT_LEN=3700 -DMBEDTLS_PLATFORM_MEMORY=1") | |
+ set(MBEDTLS_C_FLAGS "-DMBEDTLS_SSL_IN_CONTENT_LEN=8100 -DMBEDTLS_SSL_RECORD_SIZE_LIMIT=1 -DMBEDTLS_SSL_DEBUG_ALL=1 -DDEBUG_TLS=1 -DMBEDTLS_SSL_OUT_CONTENT_LEN=3700 -DMBEDTLS_PLATFORM_MEMORY=1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/include/mbedtls/compat-1.3.h b/include/mbedtls/compat-1.3.h | |
index 40177512c..efa1f78bb 100644 | |
--- a/include/mbedtls/compat-1.3.h | |
+++ b/include/mbedtls/compat-1.3.h | |
@@ -2390,6 +2390,7 @@ | |
#define ssl_set_sni mbedtls_ssl_conf_sni | |
#define ssl_set_transport mbedtls_ssl_conf_transport | |
#define ssl_set_truncated_hmac mbedtls_ssl_conf_truncated_hmac | |
+#define ssl_set_record_size_limit mbedtls_ssl_conf_record_size_limit | |
#define ssl_set_verify mbedtls_ssl_conf_verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/examples/bubble_sort.toit b/examples/bubble_sort.toit | |
index 0ceee960..d28172d0 100644 | |
--- a/examples/bubble_sort.toit | |
+++ b/examples/bubble_sort.toit | |
@@ -11,8 +11,8 @@ main: | |
bubble_sort a: | |
size := a.size | |
- for i := 0; i < size; i++: | |
+ for i := ..size: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Author: Kasper Lund <[email protected]> | |
Date: Mon Jun 12 13:14:22 2023 +0200 | |
Store TLS session data in RTC memory (#715) | |
diff --git a/src/service/brokers/http/connection.toit b/src/service/brokers/http/connection.toit | |
index 35ad787..e5b9888 100644 | |
--- a/src/service/brokers/http/connection.toit | |
+++ b/src/service/brokers/http/connection.toit | |
@@ -6,9 +6,9 @@ import http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- rolled-sizes.txt 2023-08-16 16:23:09.982969715 +0200 | |
+++ unrolled-sizes.txt 2023-08-16 16:22:34.159637286 +0200 | |
@@ -1,33 +1,33 @@ | |
Total sizes: | |
-Used static DRAM: 49824 bytes ( 74756 remain, 40.0% used) | |
- .data size: 22008 bytes | |
- .bss size: 27816 bytes | |
-Used static IRAM: 132298 bytes ( -1226 remain, 100.9% used) Overflow detected! | |
- .text size: 131271 bytes | |
+Used static DRAM: 50092 bytes ( 74488 remain, 40.2% used) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Automatically generated file. DO NOT EDIT. | |
# Espressif IoT Development Framework (ESP-IDF) Project Configuration | |
# | |
CONFIG_SOC_BROWNOUT_RESET_SUPPORTED="Not determined" | |
CONFIG_SOC_TWAI_BRP_DIV_SUPPORTED="Not determined" | |
CONFIG_SOC_DPORT_WORKAROUND="Not determined" | |
CONFIG_SOC_CAPS_ECO_VER_MAX=301 | |
CONFIG_SOC_ADC_SUPPORTED=y | |
CONFIG_SOC_DAC_SUPPORTED=y |