59 Commits

Author SHA1 Message Date
Standa Opichal
1e32a11e0a Align getting sendData with its jsvUnLock
Both the sendData jsvObjectGetChild() and jsvUnLock() are in the
same `if (!connectionCloseNow)` code block.
2017-06-30 14:10:41 +02:00
Standa Opichal
cb98cd8405 Dropped NetCreateFlags in favor of SocketType
* SocketType declaration moved to network.h
2017-06-23 22:50:21 +02:00
Gordon Williams
38cb9eab9f Add Array.indexOf fromIndex support (fix #162) 2017-05-05 13:46:58 +01:00
Gordon Williams
f00bd435c9 Fix regression causing multiple end/close callbacks when using standard TCP/IP socket client/server 2017-04-28 10:36:11 +01:00
Harry Morgan
cc56f3a80a change jsError() to jsExceptionHere(). Suppress jsiConsolePrintf() for HTTPS connections 2017-04-07 18:48:49 +03:00
Gordon Williams
2baa3f9cb3 Change name of socket close internal variable so it doesn't conflict with Pipe's close call 2017-04-06 08:20:56 +01:00
Gordon Williams
aeebfb1409 Started using jsvObjectRemoveChild to remove some internal object properties that are undefined (frees some variables) 2016-11-07 17:07:47 +00:00
Gordon Williams
1906b92750 Sockets now fire 'end' events (fix #886) 2016-09-12 14:49:35 +01:00
Gordon Williams
5dd5d901d1 replace NewWithFlags with jsvNewXXX - saves a few bytes by killing repetition 2016-03-04 12:54:18 +00:00
Gordon Williams (u36)
29ccca5d3a oops - left in debug print 2016-01-20 09:31:45 +00:00
Gordon Williams (u36)
2e8f64b280 Make HTTP server only close connection after Content-Length bytes received 2016-01-19 14:17:39 +00:00
Thorsten von Eicken
f35ac96f29 fix socket unsent data error; update esp8266 socket tests 2016-01-18 10:39:45 -08:00
Gordon Williams
f184b044ec Fix regression caused by merge error 2016-01-18 09:18:14 +00:00
Thorsten von Eicken
528630211c merge upstream in to esp8266 fork 2016-01-17 17:26:21 -08:00
Gordon Williams
34326d03b9 Allow different types of network to have different buffer sizes - enlarge JS, Linux and WIZnet buffers 2016-01-15 18:37:54 +00:00
Gordon Williams
a0703998f3 Fix potential issue parsing HTTP headers when more data is sent after the header (fix #783) 2016-01-14 09:06:18 +00:00
Thorsten von Eicken
2a7aef535a fix server socket end() method 2015-12-22 08:57:48 +00:00
Thorsten von Eicken
91e353d41f fix server socket end() method 2015-12-21 21:42:07 -08:00
Thorsten von Eicken
b603c8aebc Merge remote-tracking branch 'upstream/master' 2015-12-21 09:41:04 -08:00
Gordon Williams
59e9afcfac Fix HTTP server write (1v85) regression (fix #769)
When sending all data, put an empty string in the `dSnd` field
if all data is used. This shows that headers have already been
sent.

It's actually marginally faster/more efficient than the old
method, which used a separate var to flag whether headers had
been sent or not.
2015-12-21 12:28:10 +00:00
Gordon Williams
af8879c72c fixing recently regressed client socket code 2015-12-21 10:42:36 +00:00
Thorsten von Eicken
1547ee0a5c 1400 JSvars for esp8266; misc logging changes 2015-12-20 11:45:29 -08:00
Thorsten von Eicken
a4ec9fa2b8 small esp8266 and doc tweaks 2015-12-18 17:39:22 -08:00
Thorsten von Eicken
19f65b8df4 merge upstream into tve's esp8266 fork 2015-12-14 22:24:02 -08:00
Thorsten von Eicken
2adfab7a23 generate 'no response' error if http request gets no response 2015-12-14 22:08:23 -08:00
Thorsten von Eicken
a1847d2fcb fix socket error handling 2015-12-14 21:56:10 -08:00
Thorsten von Eicken
a95ff12049 single error event function in socketserver 2015-12-13 12:32:09 -08:00
Gordon Williams
04287caf65 1v85 : Ensure HttpServerResponse.writeHead actually sends the header right away
- enables WebSocket Server support from JS
2015-12-11 16:03:33 +00:00
Thorsten von Eicken
76b4772ebe remove some debug printfs 2015-12-10 22:53:07 -08:00
Thorsten von Eicken
9b0a00bc01 small os_printf fix 2015-12-10 21:47:52 -08:00
Thorsten von Eicken
1f562156ca fix server sockets; use patched lwip 2015-12-10 20:58:41 -08:00
Thorsten von Eicken
c115a78988 implement error events in socketserver 2015-12-10 00:13:48 -08:00
Thorsten von Eicken
ef0024c68a return error object for client socket errors 2015-12-09 00:03:23 -08:00
Thorsten von Eicken
1cacab0510 make callback in net.connect() optional as in node.js 2015-12-08 22:18:16 -08:00
Thorsten von Eicken
5bbe045945 optimize esp8266 sockets; fix #741, #720 #681 #595 2015-12-06 08:50:51 -08:00
Gordon Williams
0d77cb3bc8 Add optional for server public key when using HTTPS (see #736) 2015-11-27 13:03:19 +00:00
Gordon Williams
0f013eb927 HTTP requests (and sockets) can now emit 'error' event (fix #706) 2015-11-27 12:01:38 +00:00
Gordon Williams
afa0b9dc8e docs 2015-11-26 14:46:41 +00:00
Gordon Williams
4111ee167a Rename USE_HTTPS to USE_TLS, and enable by default for Pico + Linux
Add 'tls' module with 'connect' - for TLS Socket connections
2015-11-19 17:02:06 +00:00
Gordon Williams
8c8f84380a compile HTTPS support only if requested with USE_HTTPS 2015-11-17 12:46:18 +00:00
Gordon Williams
8cdc75fa28 first slightly hacky (but working) HTTPS implementation 2015-11-17 11:17:03 +00:00
Gordon Williams
dc784cf0fc abstract socket comms 2015-11-16 17:50:29 +00:00
Gordon Williams
1e90b57df6 oops - use hex encoding for chunks 2015-10-07 13:51:14 +01:00
Gordon Williams
1b8e61b139 Fix writes on HTTP requests after a timeout, and add chunked encoding if the header is set. 2015-10-07 13:05:56 +01:00
Gordon Williams
c4996a288c Make sure dump() and E.dumpStr() dump the contents of Serial as well as events for other objects 2015-10-01 12:10:12 +01:00
Gordon Williams
0163903329 Make sure a TCPIP connection closes even if no data sent 2015-09-21 09:56:37 +01:00
Gordon Williams
80ce11135a I love Eclipse global regex replace :)
Use jsvUnLock2/etc to really drop memory usage
2015-09-18 12:25:07 +01:00
Gordon Williams
976e48eab1 Ensure HTTP is closed even when no data handler (fix #535) 2015-05-11 12:09:01 +01:00
Gordon Williams
5ae24206fb Ensure res.on('close') is called for empty HTTP requests (fix #528) 2015-05-01 15:37:31 +01:00
Gordon Williams
986ac99148 Added http statusCode, statusMessage, and httpVersion 2015-03-11 10:57:37 +00:00