Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
be263dac
Commit
be263dac
authored
Sep 04, 2016
by
Yury Popov
Committed by
Marcel Stör
Sep 04, 2016
Browse files
Set espconn's secure buffer size once at initialization (#1466)
Fixes #1457
parent
eddda24a
Changes
6
Hide whitespace changes
Inline
Side-by-side
app/http/httpclient.c
View file @
be263dac
...
...
@@ -477,7 +477,6 @@ static void ICACHE_FLASH_ATTR http_dns_callback( const char * hostname, ip_addr_
if
(
req
->
secure
)
{
espconn_secure_set_size
(
ESPCONN_CLIENT
,
5120
);
/* set SSL buffer size */
espconn_secure_connect
(
conn
);
}
else
...
...
app/include/user_config.h
View file @
be263dac
...
...
@@ -60,6 +60,10 @@ extern void luaL_assertfail(const char *file, int line, const char *message);
#define NO_INTR_CODE inline
#endif
// SSL buffer size used only for espconn-layer secure connections.
// See https://github.com/nodemcu/nodemcu-firmware/issues/1457 for conversation details.
#define SSL_BUFFER_SIZE 5120
//#define CLIENT_SSL_ENABLE
//#define MD2_ENABLE
#define SHA2_ENABLE
...
...
app/modules/mqtt.c
View file @
be263dac
...
...
@@ -1618,9 +1618,6 @@ static const LUA_REG_TYPE mqtt_map[] = {
int
luaopen_mqtt
(
lua_State
*
L
)
{
luaL_rometatable
(
L
,
"mqtt.socket"
,
(
void
*
)
mqtt_socket_map
);
// create metatable for mqtt.socket
#ifdef CLIENT_SSL_ENABLE
espconn_secure_set_size
(
ESPCONN_CLIENT
,
4096
);
#endif
return
0
;
}
...
...
app/modules/net.c
View file @
be263dac
...
...
@@ -577,7 +577,6 @@ static void socket_connect(struct espconn *pesp_conn)
{
#ifdef CLIENT_SSL_ENABLE
if
(
nud
->
secure
){
espconn_secure_set_size
(
ESPCONN_CLIENT
,
5120
);
/* set SSL buffer size */
espconn_secure_connect
(
pesp_conn
);
}
else
...
...
app/user/user_main.c
View file @
be263dac
...
...
@@ -22,6 +22,7 @@
#include "driver/uart.h"
#include "task/task.h"
#include "mem.h"
#include "espconn.h"
#ifdef LUA_USE_MODULES_RTCTIME
#include "rtc/rtctime.h"
...
...
@@ -98,6 +99,10 @@ void nodemcu_init(void)
}
#endif // defined(FLASH_SAFE_API)
#if defined ( CLIENT_SSL_ENABLE ) && defined ( SSL_BUFFER_SIZE )
espconn_secure_set_size
(
ESPCONN_CLIENT
,
SSL_BUFFER_SIZE
);
#endif
#if defined ( BUILD_SPIFFS )
if
(
!
fs_mount
())
{
// Failed to mount -- try reformat
...
...
app/websocket/websocketclient.c
View file @
be263dac
...
...
@@ -47,8 +47,6 @@
#define PORT_INSECURE 80
#define PORT_MAX_VALUE 65535
#define SSL_BUFFER_SIZE 5120
// TODO: user agent configurable
#define WS_INIT_HEADERS "GET %s HTTP/1.1\r\n"\
"Host: %s:%d\r\n"\
...
...
@@ -656,7 +654,6 @@ static void dns_callback(const char *hostname, ip_addr_t *addr, void *arg) {
if
(
ws
->
isSecure
)
{
NODE_DBG
(
"secure connecting
\n
"
);
espconn_secure_set_size
(
ESPCONN_CLIENT
,
SSL_BUFFER_SIZE
);
espconn_secure_connect
(
conn
);
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment