Commit Graph

1347 Commits

Author SHA1 Message Date
VayuDev
d4d5adf88b
Added additional formats for getHttpDate function and fixed undefined behavior upon error (#453) (#456)
This patch adds support for the RFC 850 and asctime format. If an error
occurs, we now return a date with the epoch value of -1 and warn instead of
triggering undefined behavior. This is checked by a new set of tests.

Co-authored-by: VayuDev <vayudev@protonmail.com>
Co-authored-by: antao <antao2002@gmail.com>
2020-06-05 20:57:36 +08:00
An Tao
5faab6b414
Modify the WebSocketConnection class (#452)
* Add getContextRef method to the WebSocketConnection class

* Expose some functions on Windows

* Send a close message when closing a web socket connection
2020-06-04 19:11:07 +08:00
An Tao
adab48e187
Fix a Mysql connection error on Windows (#449) 2020-06-02 22:05:03 +08:00
antao
c2f6aa0109 Update the trantor library 2020-05-31 18:33:23 +08:00
Rafał Bugajewski
598d8c15b3
Added Initial Contribution Recommendations (#445)
Co-authored-by: antao <antao2002@gmail.com>
2020-05-25 21:05:05 +08:00
Vedran Miletić
e286fe869a
Fix building of ORM on FreeBSD (#444) 2020-05-25 00:00:00 +08:00
antao
49472a3cc4 Create a class template for publish subscribe pattern (#443) 2020-05-24 20:42:00 +08:00
antao
84e503a948 Bump version to 1.0.0-beta17 2020-05-23 10:47:24 +08:00
Erez Oxman
d43c2976ff
Changed link in readme.md from doxiz to docsforge (#442) 2020-05-22 00:00:07 +08:00
An Tao
7b1712003d
Modify drogon_ctl to show more compilation information (#441) 2020-05-21 21:14:40 +08:00
Vedran Miletić
375498a5a6
Fixes for FreeBSD (#440)
* Use uuid(3) to generate UUIDs on FreeBSD

FreeBSD is now handled like Windows so additional UUID libraries are
not required.

* Modify build.sh script to work on FreeBSD

- /bin/bash -> /usr/bin/env bash
- nproc -> sysctl -n hw.ncpu
2020-05-20 22:29:37 +08:00
Zach Hilman
c754d65cf0
Add additional HttpStatusCodes and implement a custom error handler (#439)
This adds:

Various lesser-used HTTP status codes to the HttpStatusCode enumeration.
Getter and setter for customErrorHandler, which is a function that generates a HttpResponsePtr given an HttpStatusCode. This is intended to be similar to the custom404 functionality, allowing a user to override the layout of the error page.
The custom404 functions were kept even though this supersedes that to avoid breaking current code.

Finally, all of the Routers were updated to use the error handler for their 405/403 responses.

If no custom error handler is set, a default is used. The default behavior is identical to what exists now, an empty body with the status code set.
2020-05-19 11:50:44 +08:00
An Tao
4423d836f4
Add methods to get DbClient connection status (#436) 2020-05-18 08:31:18 +08:00
An Tao
26dca0a910
Fix a connection bug of mariadb clients (#438) 2020-05-17 21:08:12 +08:00
An Tao
cddd17eb55
Fix some compilation warnings (#432) 2020-05-16 10:11:50 +08:00
antao
84eb05ce38 Update trantor 2020-05-10 18:41:42 +08:00
Rafał Bugajewski
398b028046
Pass Data From View to Its Layout Container (#429) 2020-05-09 14:13:20 +08:00
Rafał Bugajewski
91e7ead628
Merge pull request #427 from an-tao/drogon_ctl
Fix a bug in drogon_ctl that would skip lines longer than 8092 characters.
2020-05-08 13:35:23 +02:00
antao
8ecfe9ef84 Fix a bug in drogon_ctl 2020-05-07 18:57:03 +08:00
An Tao
490def6742
Add filters on static file locations (#422) 2020-05-03 08:21:34 +08:00
interfector18
eafdc5d357
Add causal profiling with coz (#414) 2020-04-30 13:30:37 +08:00
antao
6d6a7acd09 Bump version to 1.0.0-beta16 2020-04-27 21:49:06 +08:00
ihmc3jn09hk
a7f49d893e
Support url safe base64 codec (#417)
Co-authored-by: antao <antao2002@gmail.com>
2020-04-26 23:23:03 +08:00
An Tao
4f8290b589
Remove non standard macros (#415) 2020-04-25 02:12:44 +08:00
ihmc3jn09hk
269acbc477
Use splitString in trantor (#413)
Co-authored-by: antao <antao2002@gmail.com>
2020-04-18 11:13:53 +08:00
interfector18
17b8c337f9
Standardize Row and Result api (#409)
* Standardize Row and Result api, throw specific exceptions

* Fix drogon_ctl for sqlite3 models

* Add mysql and sqlite3 tests, add exception throwing tests

* configure mysql in travis-ci

Co-authored-by: antao <antao2002@gmail.com>
2020-04-11 11:46:47 +08:00
An Tao
7d6be171c5
Parse content-type (#408) 2020-04-07 23:30:59 +08:00
An Tao
c43ba9e514
Add support for brotli compression (#406) 2020-04-04 18:15:15 +08:00
An Tao
2fb0f845f6
Update trantor (#405) 2020-04-03 10:20:58 +08:00
antao
3a2c472694 Update drogon version to v1.0.0-beta15 2020-03-28 16:11:14 +08:00
An Tao
d7cb5b715a
Exit the listen loop first when closing (#404) 2020-03-27 20:54:57 +08:00
An Tao
c46c7f3570
Fix DrogonConfig.cmake for Windows (#403) 2020-03-24 22:08:12 +08:00
An Tao
1969effd29
Return a 404 page when requesting a directory as a static file (#401) 2020-03-24 09:26:41 +08:00
An Tao
45d2969dcb
Graceful shutdown (#393)
Call app().quit() to gracefully stop a drogon application.
2020-03-21 21:29:33 +08:00
An Tao
f5e87acd9b
Remove dependency on pkg-config (#398)
Considering that on FreeBSD, pkg-config has been replaced by pkgconfig, we should remove the dependency on pkg-config.
2020-03-21 12:41:15 +08:00
ihmc3jn09hk
98ab826cfc
Fix drogon_ctl runtime error when compiling drogon to shared library (#397)
Fix for #395
2020-03-21 08:40:25 +08:00
An Tao
06bf158676
Fix issues in the MysqlConnection class (#394) 2020-03-20 23:12:05 +08:00
antao
8551106d8f Modify Dockerfile 2020-03-18 20:08:08 +08:00
An Tao
7af67dc4da
Make CMake install files relocatable (#387) 2020-03-18 19:54:48 +08:00
interfector18
4c8dbdbb85
Ninja (#391)
Use ninja to build if found on system (in /bin/ninja)
Make make simulate ninja's default parallelism

Should help with travis_ci as default build environments have 2 cores.
2020-03-17 00:54:30 +08:00
interfector18
d0dfa242b2
Add getHomePage to HttpAppFramework (#390)
Add getHomePage to HttpAppFramework to help with SPA in scenarios a controller must take a certain action on passed parameters but redirect to homepage
2020-03-17 00:53:31 +08:00
An Tao
6c850ea886
Modify the Attributes interface of the HttpRequest class (#389) 2020-03-15 16:11:40 +08:00
ihmc3jn09hk
2401c6a88a
Fix null jsonObject from newHttpJsonRequest (#388)
* Fix null jsonObject from newHttpJsonRequest 

Refer to #372 for the response case as well
2020-03-15 00:11:46 +08:00
An Tao
9ee00da431
Fix crash with partial matched url (#386) 2020-03-14 11:36:21 +08:00
An Tao
2d87434bfb
Use a separate thread to load views dynamically (#382) 2020-03-12 14:35:46 +08:00
An Tao
dd8fbe04cd
Addressed an issue when loading layout views dynamically (#378) 2020-03-12 10:26:07 +08:00
Rafał Bugajewski
3c7ac585a6
Dynamic View Loading: Only Compile Modified “csp” Layouts (#380)
This change greatly reduces the time between multiple Drogon runs
while developing an application with the framework. Previously on a
relaunch the framework naively compiled all *.csp files if dynamic
view loading was turned on. Now there will be a check for modification
time and the compilation phase will only run if the
corresponding *.csp file is newer than the dynamic library.

Co-authored-by: Rafał Bugajewski <rb@cocobit.software>
2020-03-12 09:44:51 +08:00
An Tao
bb8b5ded79
Fix a fatal bug in the MysqlConnection class (#379) 2020-03-11 12:41:20 +08:00
An Tao
77063e28d0
Optimize the rendering of HTTP responses (#371) 2020-03-07 20:49:05 +08:00
An Tao
ebb8b7b70a
Add ENABLE_EXPORTS property in cmake configuration files (#375) 2020-03-05 22:03:41 +08:00