Commit graph

87 commits

Author SHA1 Message Date
Timothee Cour
6e0c06f50e
fix #13218: avoid some irrelevant warnings for nim doc,rst2html,--app:lib, + other fixes (#13550)
* fix #13218: avoid some irrelevant warnings for nim doc,rst2html
* suppress warnRedefinitionOfLabel for nim doc
* lots of fixes for UnusedImport warnings
2020-03-13 20:42:41 +01:00
Dominik Picheta
ec8a17cc86 Revert broken asynchttpserver FutureStream additions.
As discussed in #13394, these changes cannot work. Reverted via

```
git revert --no-commit 5bf571f061
git revert --no-commit abd660c407
git revert --no-commit 955465e5f4
git commit
```
2020-03-06 11:52:30 +01:00
Henrique Dias
5bf571f061
Fix to asynchttpserver form data/body broken with #13147 (#13394)
* Fix to asynchttpserver form data/body broken with #13147
* New implementation that use a interator instance of future streams
* asynchttpserver now can handle chunks of data.
2020-02-14 21:59:37 +01:00
Henrique Dias
abd660c407
Added a basic example how to handle a Post request. (#13339)
* Added a basic example how to handle a Post request.

They were also made minor cosmetic changes.

* Minor fixes suggested by Yardanico

* Fixed a wrong value in chunkSize constant.

* Re-added the request.body for compatibility!
2020-02-07 03:59:28 -05:00
Henrique Dias
955465e5f4
Option to allow the request body to be processed outside the asynchttpserver library. (#13147)
Allow the request body to be processed outside the asynchttpserver library to break big files into chunks of data. This change does not break anything.
2020-02-04 21:13:25 +01:00
Andreas Rumpf
68ce808db1 minor optimization for asynchttpserver.nim 2019-10-04 09:48:45 +02:00
narimiran
aa513d78e7 [backport] run nimpretty on async 2019-09-30 13:57:58 +02:00
narimiran
f7a8fc46c0 Revert "improvements for httpcore (#12228)"
This reverts commit b865c2a54b.
2019-09-23 19:06:55 +02:00
Andreas Rumpf
b865c2a54b
improvements for httpcore (#12228)
* improvements for httpcore
* further improvements, now stable API but needs extensions later on
2019-09-23 12:38:35 +02:00
Araq
5abe880469 last stdlib cleanups 2019-09-21 06:43:37 +02:00
Zed
3b4952da94 Fix header inconsistencies in documentation (#11071) 2019-04-23 08:40:20 +02:00
Miran
bba3a20e7c documentation style tweaks (#10790)
* exports are the least important field in the docs:
  they are put in the last place (at the bottom)
* indent text after proc/type declaration for an easier navigation
  (noticeable difference between declarations and examples)
* quickfix invalid style in `asynchttpserver`
2019-03-08 13:55:26 +01:00
LemonBoy
bcb5995ddf Fix regression w/ keep-alive connections to AsyncHttpServer
We should keep listening if the connection is marked as keep-alive.

Fixes #10536
2019-02-04 22:16:55 +00:00
LemonBoy
59574b89a6 Clean up some code using a tuple unpack expression 2019-02-04 22:16:55 +00:00
Dominik Picheta
e3cee541bd Fixes long-standing asynchttpserver regression. (#10102) 2018-12-27 22:26:48 +01:00
hlaaf
c2aec1b6c1 Change parseEnum to something faster for method parsing in asynchttpserver (#7682)
* Add faster method parsing to asynchttpserver

* Make it readable

* Align case statement
2018-06-08 21:34:19 +01:00
Araq
bbb0fd4eb7 remove deprecated stuff from the stdlib; introduce better deprecation warnings 2018-05-05 21:45:07 +02:00
Dominik Picheta
a372363190 Don't catch-all in asynchttpserver. It hides bugs. 2017-11-26 16:40:24 +00:00
Andreas Rumpf
c474fdea16 further hardening of asynchttpserver 2017-11-19 03:05:55 +01:00
Dominik Picheta
fd350de580 Fixes #6386. (#6545) 2017-11-19 02:55:03 +01:00
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