Skip to content

Commit

Permalink
fix crash which happens when too many http sockets are opened
Browse files Browse the repository at this point in the history
added lowsys.setSystemTime
  • Loading branch information
Thomas Rogg committed Mar 12, 2019
1 parent c0ecb23 commit 55c6cb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion lib_js_esp32/lowsys.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ module.exports = {
* @param {HimemTransferCallback} callback the callback to call when the data is read
*/
himemRead: native.himemRead

/**
* The user program can use a RTC or GPS module to get the current time
* and pass it to this method to set the system time to it
* @function setSystemTime
* @param {Date} time the new system time
*/
setSystemTime: (time) => {
native.setSystemTime(time.getTime());
}
};

/**
Expand Down Expand Up @@ -108,4 +118,4 @@ Object.defineProperty(module.exports.partitions, 'sdcard', {
return native.statPartition(1);
}
});
module.exports.partitions.himem = {size: config.himemLength};
module.exports.partitions.himem = {size: config.himemLength};
2 changes: 1 addition & 1 deletion src/LowHTTPDirect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// -----------------------------------------------------------------------------

LowHTTPDirect::LowHTTPDirect(low_main_t *low, bool isServer) :
LowLoopCallback(low), mLow(low), mIsServer(isServer), mRequestCallID(0),
LowLoopCallback(low), mLow(low), mIsServer(isServer), mSocket(NULL), mRequestCallID(0),
mReadCallID(0), mWriteCallID(0), mBytesRead(0), mBytesWritten(0),
mParamFirst(NULL), mParamLast(NULL), mWriteBufferCount(0), mWriteBufferStashInvalidCount(0),
mShutdown(false),
Expand Down

0 comments on commit 55c6cb0

Please sign in to comment.