Commit Graph

67 Commits

Author SHA1 Message Date
superfunc
bca3bedc47 Handle failed uri parsing in asynchttpserver (#6374) 2017-09-15 10:41:12 +02:00
Artem Labazin
bcdc5ddd37 Add more suitable error code and reason phrase for required Content-Length request. 2017-07-26 02:02:24 +03:00
wt
622b4a7b47 Update asynchttpserver.nim 2017-06-06 08:52:19 +08:00
wt
7e7699a856 Fix bad tail for status response 2017-06-05 10:52:23 +08:00
Andreas Rumpf
159643824b fixes #3847 (#5609) 2017-03-27 09:39:46 +02:00
Dominik Picheta
37abcf18f8 Merge pull request #5466 from yglukhov/asynchttpserver-bad-content-length
Dont assert on malformed requests
2017-03-01 19:14:02 +00:00
Yuriy Glukhov
f842f9d6aa Dont assert on malformed requests 2017-03-01 17:11:39 +02:00
Yuriy Glukhov
28a7c874b7 Revert "Listen on ipv6" (#5461) 2017-03-01 15:03:10 +01:00
Yuriy Glukhov
d878c4c1b4 Listen on ipv6 2017-02-25 02:20:16 +02:00
Luke Diamand
de7f42a741 asynchttpserver: import json in the example code
The example code won't compile unless json is imported, because
of the use of the %* operator. This can trip-up inexperienced
Nim developers.
2017-01-10 20:39:29 +00:00
Dmitry Polienko
4753149227 Implement suggestions from @dom96 2016-11-02 09:19:20 +07:00
Dmitry Polienko
860264a382 Skip empty lines before status line
As recommended here: https://tools.ietf.org/html/rfc7230#section-3.5
2016-10-31 09:42:45 +07:00
Araq
8a0b945170 asynchttpserver: cleanup example code 2016-10-24 20:28:27 +02:00
honewatson
065210e6a3 Add respond proc example
Add an example for the respond proc demonstration JSON response.
2016-10-03 20:22:32 +11:00
Dominik Picheta
8a6343b5b6 Fixes #3847. 2016-09-25 13:02:10 +02:00
Dominik Picheta
26c7a76c8a asynchttpserver's Response object's req method uses HttpMethod now.
Fixes #4423.
2016-09-25 00:39:57 +02:00
Dominik Picheta
ca7dd345da Fixes #3847. 2016-06-02 19:51:16 +01:00
Dominik Picheta
9df1704aa1 Let asynchttpserver pass control of socket to cb for upgrades. 2016-06-02 19:19:47 +01:00
Dominik Picheta
3074973f54 The asynchttpserver module now uses a HttpHeaders object. 2016-06-02 18:31:22 +01:00
Andreas Rumpf
7f09d6bf1f attempt to fix serious asynchttpserver regression 2016-06-01 17:59:58 +02:00
Andreas Rumpf
b3a3f01d19 fixes #4221 2016-05-30 16:28:20 +02:00
Federico Ceratto
e174aa1dbc Add SO_REUSEPORT support 2015-12-16 00:42:22 +00:00
Araq
8be9e46403 udpated the compiler and tester to use getOrDefault 2015-10-13 14:10:33 +02:00
Rostyslav Dzinko
bfe84d9c8b Added missing 412 - 417 http codes which are standard according to rfc2616 which is HTTP/1.1 standard. 2015-09-17 16:01:11 +03:00
Dominik Picheta
28e3ad945a Reintroduce FutureVar[T] from commit 72b4912c84. 2015-09-11 13:03:59 +01:00
Dominik Picheta
eb4263a0fc Fixes dom96/jester#45. 2015-09-06 23:50:42 +01:00
tulayang
930e90a730 Modify proc parseHeader 2015-08-09 20:35:23 +08:00
Dominik Picheta
a385b6736c Fix incorrect 400 reply in asynchttpserver
Without the ``continue`` the user's callback will be called but the client would have already been replied to.
2015-06-03 18:48:55 +01:00
def
84315c6a9c Revert "Introduce FutureVar[T] to make recvLineInto safer."
This reverts commit 72b4912c84.
2015-04-26 17:01:04 +02:00
Dominik Picheta
72b4912c84 Introduce FutureVar[T] to make recvLineInto safer.
FutureVar[T] is a new distinct Future type which is designed to be used
for situations where the highest performance is needed. It reduces the
number of Future allocations needed. It acts as a replacement for
'var' params in async procs.

This commit modifies @def-'s PR in order to make it safer. The recvLineInto
procedure has been modified to take a ``FutureVar[string]`` param instead of a
``ptr string`` param.
2015-04-24 17:56:04 +01:00
Dominik Picheta
62e1b3e2e3 Some small cleanup. 2015-04-23 21:57:33 +01:00
Dominik Picheta
03cbf689a1 Merge branch 'clean-speedup-2' of https://github.com/def-/Nim into def--clean-speedup-2 2015-04-23 15:26:39 +01:00
Oleh Prypin
32109a7867 Don't run non-test code when defined(testing) 2015-04-21 14:37:29 +03:00
def
6523d80211 Rename clearStringTable to clear 2015-03-17 22:48:34 +01:00
def
2410e667bc Make respond a template again 2015-03-17 22:05:10 +01:00
def
e127ed77b1 Make recvLineInto a proc instead of template 2015-03-17 19:40:22 +01:00
def
43ed83384c Rename resetStringTable to clearStringTable 2015-03-17 19:40:22 +01:00
def
58c29c29ae Remove unused newRequest proc 2015-03-17 19:40:22 +01:00
def
6830c65560 Document asynchttpserver's respond template 2015-03-17 19:40:22 +01:00
def
477b3594eb Speed up asynchttpserver significantly using all the previous changes
- Export socket field of AsyncHttpServer and addHeaders proc for templates

- Make respond a template instead of proc because of how often it's called.
  This means no more "await" when invoking it.

- Optimize respond template with special case for empty headers and
  Content-Length entry

- newRequest doesn't allocate a hostname and body anymore because they're
  copied in later

- Major changes to processClient to prevent allocations and copies
2015-03-17 19:39:02 +01:00
Guillaume Gelin
3119fe087d Happy new year! 2015-01-06 15:26:33 +01:00
def
2d20feb8f1 Add imports to asynchttpserver example 2014-12-29 22:27:31 +01:00
Dominik Picheta
32db6798a3 Fixes asynchttpsever. 2014-12-26 19:47:25 +00:00
Dominik Picheta
9471f585c2 Fixes deprecation warnings in asynchttpserver. 2014-12-26 16:53:19 +00:00
Dominik Picheta
e4a5b1af6c Added more HTTP status codes to asynchttpserver. 2014-12-26 16:48:53 +00:00
Dominik Picheta
8f89c30fdd Ensure Request.body is initialised. 2014-11-17 19:53:44 +00:00
Dominik Picheta
13e3c0d5bb Implement SO_REUSEADDR for asyncnet and asynchttpserver. 2014-11-07 14:48:11 +00:00
Dominik Picheta
efca06c71c Add bool to determine if socket has been closed. 2014-09-16 16:37:53 +01:00
Dominik Picheta
6f155af802 Lots of documentation improvements for asyncdispatch.
Ref #1487.
2014-09-12 22:54:02 +01:00
Dominik Picheta
00b6a14489 More empty stmt fixes. 2014-09-09 15:58:44 +01:00