bcb4e51a409d94ae670de96afb8483a4f7855294 |
|
01-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2018. |
6c30d94bfa753a01e765a5e9713cbd33901dfb32 |
|
07-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm: Remove dead code
ret can never be >0 at this point. If there are any unexpected JSON
elements, doveadm_http_server_json_parse_v1() returns -1. |
ad9afb64630511d5e25bc5bc11c5304986156928 |
|
30-Oct-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Replace o_stream_nfinish() with o_stream_finish() whenever possible |
6fc40674e5a33787ae7fcd47a77a77ea20977994 |
|
28-Oct-2017 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
global: Rename client_connection_type to doveadm_connection_type |
cf6131bdaa0883f8e2c39843e301eae70cedb8de |
|
27-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Properly implemented error handling for requests. |
456e3b9c77f1a1bfc459bedfb8877684bac8f382 |
|
27-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Mark the HTTP request for connection closure right away.
This means that the connection is closed once the request finishes.
Before, each response did that individually.
Once connection reuse is implemented/needed this can now be turned off at one place. |
556a2028041de473e0c1380d0aef89dc3673f045 |
|
27-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Restructured JSON parsing to improve code clarity.
Made state machine more explicit and easier to understand.
Also added more comments. |
2511999c9323ca053291a785554c1f2236971b1d |
|
27-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Wrapped long code lines. |
2341eb700e9ec6309c7353c8e225c58c8e67b257 |
|
27-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Joined JSON parsing and handling in one function. |
39e011148a37f8baa6a78f0957e850d4faac8d02 |
|
27-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Split JSON handling into several sub-functions. |
e97a359e4f5aeb7fffe6f128800d816aecc983b5 |
|
27-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Split JSON parsing into several sub-functions. |
2ccd63d6fc82558dd10c3bdc100653a16430f431 |
|
27-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Changed request parse error into an assertion.
The condition can never occur when json-parser and the request parsing state machine are behaving correctly.
At that point only an object key can be returned; the client cannot cause it to return anything else. |
664503c588de5db6ca138f90b3c7fa56352adcad |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Moved doveadm_http_server_command_execute(). |
ce916cf4c7f29ffc8cc61205f1ee17b22e08c0cc |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Renamed parse state enum. |
457869440af910388110dc5a58c4ab86b0f5a359 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Split off request handling in separate struct, so that the connection can be reused. |
14e38f2900e9f49da471f9a4f1b4ab8908906fda |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Added structural comments. |
5927e94f41a54ceb2edf9f791f06db55fae6864b |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Moved doveadm_http_server_request_destroy(). |
8bbeec794781ff89a2c4f175219600965bab8a8d |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Moved doveadm_http_server_send_response(). |
437eb0a370b6b154c812d7d3d79ae36d9963d2f5 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Moved connection-related code to the bottom of the file. |
3dee11217f10afbe6f28e89e4317b04db571c7fa |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Make http_server_set a local variable of doveadm_http_server_init(). |
bcb83bf89c33304f98a0dcd1e7f6bfc420e69a9f |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Create the http_response once needed, not preemptively. |
8b24f7bd7be67dc54bbda16a41530d365c8fed59 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Split authentication into multiple functions. |
f607f622e93e5f570258205e79f9b0befc86dbd1 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Renamed conn->http_server_request to conn->http_request. |
1a7d36f613f8e62bd27172c85d94b0d38a3e6c1c |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Removed http_request field from struct client_connection_http.
Not useful to put it there. |
2045a5dff5368835a5c51c5cce93b5c5ad450949 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Renamed conn->http_client to conn->http_conn. |
80a225c0b1f4bf322a562cc7c21d5891fb6895ee |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: Restructured client-connection code so that TCP and HTTP connection types are properly separated. |
ee063d66134c3ad0cec5e3919f7a0efe007406c6 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Moved client_connection_destroy_http(). |
f300f927771a39549ce6cb7607129508e9041b4a |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Renamed client_connection_create_http() to client_connection_http_create(). |
4284e4925ad29c4a403bb7375c3cdb411ed56736 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Renamed conn->client to conn->conn. |
e79e121745d3e75aa5f449f50d6439d6b1671763 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Changed index variables from size_t to unsigned int where size_t makes no sense. |
9cc49c886f0ad142735f0f1b47da8f19bd42e01b |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Changed initialization of parameters in doveadm_http_handle_json_v1().
Use normal assignment, rather than memcpy().
This way, type checking is not skipped unnecessarily. |
5381c92d04d810b063dc65324525c1f08115db08 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Use `ret' rather than `rc' as name for the local variable used for return values. |
df45032f2f7149c8254beb1a818e6c32acc1270d |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Cleaned up code formatting. |
a602aa85c991baaa2a89da5783b33373c66306ef |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Created local variable for conn->cmd_param->value.v_istream as an abbreviation.
This is a preparation for subsequent commits. |
4b2c68685ac8bd7615c3bf57306e9c5d2ac59185 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Created local variable for conn->client.output as an abbreviation.
This is a preparation for subsequent commits. |
f17ff90e32712b2de1bb919560f673a56c2727bb |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Created local variable for conn->http_request as an abbreviation.
This is a preparation for subsequent commits. |
28d5207fb7de5bc51f7367932341c467a4ed2dc4 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Created local variable for conn->http_response as an abbreviation.
This also makes sure it is named consistently everywhere.
This is a preparation for subsequent commits. |
bf5c0995173a9e5ff0dcbd727c46b1051f36c88d |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Created local variable for conn->http_server_request as an abbreviation.
This also makes sure it is named consistently everywhere.
This is a preparation for subsequent commits. |
db4c6cc025e699aeecad87bf7cff08d12d4aff67 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Moved loop body in doveadm_http_server_read_request_v1() to separate function. |
1b58508a918279d773ef32518f5d5d933023c252 |
|
24-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm: Changed command contexts to contain the input, output, and connection type values directly.
Before, it used a direct pointer to the connection.
It used also flags to indicate the connection type, which is now consolidated in the connection type enum. |
20939b554cc042df3bac67b88356c04e7a4803ab |
|
17-Oct-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Fixed lingering connections after the request is sent.
Turns out conn->http_client is already NULL while doveadm_http_server_connection_destroy() is called.
This is because http_server_connection_unref() sets it to NULL;
Fixed by removing useless HTTP connection reference. |
0043fea12a75cf8fcf2892673106844376da8e76 |
|
07-Sep-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib: lib-signals: Removed explicit notification of ioloop change through lib_signals_reset_ioloop() in favor of implicit method.
Before, if the ioloop changed, the application had to explicitly notify lib-signals using lib_signals_reset_ioloop().
This is error-prone and requires doing this all over the Dovecot code base.
Now, lib-signals registers an ioloop switch callback that deals with this implicitly.
The application can detach lib-signals from the ioloop explicitly if delayed signal handling is not required/desired in the new ioloop.
Specific delayed signal handlers can be exempt from this automated behavior using a flag, meaning that such signal handlers need to be moved between ioloops explicitly. |
57c65763f4195f1c87af083ee3424939ad38dc03 |
|
06-Sep-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Fixed crash occurring when disconnecting a client at server deinit. |
211c638d81d382517d196ad47565e0d85012c927 |
|
19-Feb-2017 |
klemens <ka7@github.com> |
spelling fixes |
5433e85aeb5b5ce34b6932506831573edd732f68 |
|
29-Jan-2017 |
Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi> |
doveadm: add doveadm_http_rawlog_dir setting |
5a6d4adbdc10734f9e7abe90690609ffaa30199b |
|
24-Jan-2017 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
global: Update http_server_request_set_destroy_callback usage |
2454dfa32c93c20a8522c6ed42fe057baaac9f9a |
|
01-Jan-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2017. |
efe78d3ba24fc866af1c79b9223dc0809ba26cad |
|
24-Dec-2016 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
global: Replaced all instances of memset(p, 0, sizeof(*p)) with the new i_zero() macro.
Used the following script:
C_FILES=`git ls-files *.c`
H_FILES=`git ls-files *.h`
for F in "$C_FILES $H_FILES"; do
echo "$F"
perl -p -i -e 's/safe_memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero_safe(&$1)/g' $F
perl -p -i -e 's/safe_memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero_safe($1)/g' $F
perl -p -i -e 's/memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero(&$1)/g' $F
perl -p -i -e 's/memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero($1)/g' $F
done |
5ee3c7784cd954ef4d1e8ad43f7d155fbb8f5c14 |
|
09-Dec-2016 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
doveadm-server: http: Fixed temp_path_prefix for iostream-temp.
The temp_path_prefix was "/tmp", which is extended to "/tmp<hostname>.<pid>.<random>" by safe_mkstemp.
Obviously, mortal users cannot create a file like that, causing this error:
doveadm: Error: safe_mkstemp(/tmp) failed: Permission denied
The temp_path_prefix should have been "/tmp/doveadm.", as it is elsewhere as well. |
5e327e031d1591f8bff17b67eba7139afbd36cdd |
|
20-Oct-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm-server: Show incoming connection's IP and running command is process title. |
7f74811b78f8915e73dffc88bb49009e98b6846d |
|
09-Oct-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Make sure i_stream_read() calls handle 0 and -2 return values correctly. |
3a429da1eca6b6513df1769dfb112d0febe2a33b |
|
29-Jun-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-server: Do not crash if empty data in authorization |
bd13998cde153abdb189593ad4229bf73bc2dd34 |
|
29-Jun-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-server: Skip doveadm_print_init
Some commands need to do output that is not doable with
doveadm_print, so we need to have a flag to indicate this. |
8266226f9ab75508cc4568db09d0fc89c79a451f |
|
07-Jun-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-server: Disable idle timeout for now |
6f187ae85911f63cb87271246c68f3c13a0adb7b |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Use o_stream_nsend_istream() where useful
We can skip all of the io error handling and just leave it to
o_stream_nfinish(). |
3cd59a62afec77f8ab6b844905f73cffa965142f |
|
29-Apr-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-server: Handle istream send error. |
b0b699954289898ffbbf855d2da9248cd6b5592d |
|
06-Apr-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-http: Fix mismatch in authorization
The code advertizes X-Dovecot-API in WWW-Authenticate header, but
expects X-Doveadm-API in Authorization header. This change makes
it expect X-Dovecot-API. |
20ad75b42db33d8f03d4188be0a4b447d38acb29 |
|
17-Mar-2016 |
Michael M Slusarz <michael.slusarz@dovecot.fi> |
doveadm: Fix typos in error messages |
ab00b5d88b45846cbbef2e475e625d05db755e6a |
|
03-Mar-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-http: Fixed crash when no authentication was configured. |
6e15d56df69d5b8e80768779c3c769e429aaa530 |
|
02-Mar-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm: Don't treat doveadm_api_key differently when it's unset vs set to empty. |
6a879801eb4b00e2f7517a12b6704d5024a242c8 |
|
02-Mar-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-http: Minor logging improvement - indicate error source |
25df2d3b182a3d5aafb9db4349798565c717fa88 |
|
02-Mar-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-http: Drop surplus log prefix |
51338d9d63b71585aef4a01c6e4f1a09fa6a9597 |
|
02-Mar-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-http: Set HTTP client's max idletime to 5 seconds |
b7c4fe8a43c16fce1312aa4d39515ec1b4637e2a |
|
02-Mar-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-http: For each executed command, log the command name and the user parameter if given. |
2642aad18ae201b898f8a0dfc022ad87667a2cc2 |
|
02-Mar-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-http: Improve authentication related code |
0b36cf19e453ce4010c8454b7b5ff418fb2e2ee8 |
|
02-Mar-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-http: Code cleanup - Move authorize to its own function |
48283371557ae090382ac165c67a7de1336ba00a |
|
02-Mar-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-http: Add API calls and versioning for v1 |
2029c2cb37d7308e74329c9a15b6cf07a3468314 |
|
01-Mar-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm: A bit nicer way to implement doveadm_cmd_param_array() returning C-string array
So replacement of 4afc67eb9, which I accidentally pushed before remembering
about this other way. |
4afc67eb96f8d6b7dc94d63d3c7fe4f556c4fcee |
|
01-Mar-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm: Changed doveadm_cmd_param_array() to return C-string array instead of ARRAY()
We could support both with separate functions, but perhaps this one is enough. |
ec862f5c8c37c8d75ddfb1cab1f7f5ac5988c6c0 |
|
28-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm-http: Fixed crash on unknown commands.
Also if command had already failed, don't override the existing method_err with 403. |
aaa1b6bb4cd2d7f8f4e7977d61176ea1c8f7e32b |
|
28-Feb-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm: Changed v2 command APIs to be easier to use. |
50e4970035d1278597d13cac6c5ae26e7af93025 |
|
26-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm: Pass through mail_storage_service_input fields in doveadm_cmd_attributes |
79ec87ea6861e2dd447f69ab44a7cc4e4fce3fdd |
|
26-Feb-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-cmd: Add CMD_PARAM_IP |
cd75585e26420cef09cc699c6e02ab46e21937d1 |
|
26-Feb-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm: Remove return value from ver2 cmd() - doveadm_exit_code is enough |
17bfcf534dc30994a3940c2727d8b3691e85610b |
|
22-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm: Code cleanup - remove duplicate code |
1e8a6a8708b612eee65f83ef6874aab94b15eb50 |
|
22-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm: Free istream parameters everywhere
Based on patch by Aki Tuomi |
3d27e1102558215203b73c58a2cba84dccf0dd1a |
|
22-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm: Code cleanup - remove unnecessary NULL sets and checks |
331d2de16c64fc40d7df16c2f955e8a381415673 |
|
22-Feb-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-http: Close client input correctly |
346ce9e82d31012b8640cad6369e66417ca8c782 |
|
22-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm-http: Return HTTP failure on unexpected JSON input |
9cd71e2cb9e8bb6de26d2cec99f7c6804dce4e40 |
|
22-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm-http: Handle invalid input better for arrays. |
394a8734060604a6389affe6fd2d456640341fa4 |
|
22-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm-http: Handle istreams correctly
Based on patch by Aki Tuomi |
b4a7ea605ca300fa4ae7fbed0f30dac315f5f305 |
|
21-Feb-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm-http: Correctly initialize parameters |
05128fda80748e107bccdece0a3d23551e99e8f3 |
|
19-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm: Remove CMD_PARAM_NONE type, since it already defaulted to same as CMD_PARAM_BOOL |
721e0f8b2a80d3492e30be81049007cbc7da6ac6 |
|
19-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
doveadm: Use correct uoff_t type for printf |
1e11a94ec50fc9b57eb2c859771c6a326ccaf86f |
|
19-Feb-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
doveadm: Implement HTTP server API, slightly based on JMAP API |