holger krekel
8089559958
Squashed commit of the following:
...
commit 6bc5d1b90e
Author: holger krekel <holger@merlinux.eu >
Date: Sun Jul 21 22:56:37 2019 +0200
fix fmt
commit 197d94ad9d
Merge: 7ce337c 686678c
Author: holger krekel <holger@merlinux.eu >
Date: Sun Jul 21 22:51:16 2019 +0200
Merge remote-tracking branch 'origin/master' into eventlogging
commit 7ce337c6d0
Author: holger krekel <holger@merlinux.eu >
Date: Sun Jul 21 22:44:27 2019 +0200
left-over error logging
commit 10148d2e43
Author: holger krekel <holger@merlinux.eu >
Date: Sun Jul 21 22:03:17 2019 +0200
ignore non-utf8 parts of header fields (add comment why it shouldn't happen)
don't throw error if no sql rows are returned
commit 69dc237ee3
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Sun Jul 21 12:56:04 2019 +0200
fix(receive_imf): remove recursive sql call
commit df5464ea80
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Sat Jul 20 17:05:24 2019 +0200
fix: blocked is an optional value
commit e4bf9956a5
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Sat Jul 20 16:50:56 2019 +0200
fix(msg): handle optional in_reply_to
commit d353d9d9d8
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Sat Jul 20 16:17:25 2019 +0200
fix(chat): remove recursive sql usage
commit 1ad45ed4d6
Author: holger krekel <holger@merlinux.eu >
Date: Sat Jul 20 15:14:11 2019 +0200
fix rust fmt
commit 496e980a17
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Sat Jul 20 14:34:20 2019 +0200
use forked rusqlite
commit fa09e46ed9
Author: holger krekel <holger@merlinux.eu >
Date: Sat Jul 20 12:37:51 2019 +0200
another pace where we might (and in my case did) get invalid utf8
commit d6de420b9a
Author: holger krekel <holger@merlinux.eu >
Date: Sat Jul 20 12:30:48 2019 +0200
fix some string issues, introduce to_string_lossy such that to_string() continues to panic on non-utf8
commit 38eb708db8
Author: holger krekel <holger@merlinux.eu >
Date: Sat Jul 20 01:17:53 2019 +0200
for now make to_string() less strict as we often don't want to crash the whole app just because some non-proper utf8 came in (through a message we can't neccesarily congtrol)
commit 7a59da5f8f
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 22:48:39 2019 +0200
fix linting
commit f13a1d4a2f
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 22:46:58 2019 +0200
fix some test flakyness
commit 7b3a450918
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 22:35:07 2019 +0200
- fix saved_mime test which broke to improper conversion of
imf_raw_not_terminated
- some cargo.toml updates no clue where they come from
- log Message-ID for received messages
commit 169923b102
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 12:31:22 2019 +0200
formatting
commit 42688a0622
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 12:24:56 2019 +0200
remove some print statements
commit 35f3c0edd1
Merge: e7a2362 f58b1d6
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 10:25:21 2019 +0200
Merge branch 'master' into eventlogging
commit e7a236264a
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 23:20:20 2019 +0200
print invalid strings
commit aaa5b820d9
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 23:12:35 2019 +0200
cleanup
commit e7f0745010
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 23:03:57 2019 +0200
reduce direc usage of CString
commit c68e7ae14e
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 22:47:47 2019 +0200
audit use of to_cstring and fix ub
commit 618087e5a7
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 21:38:52 2019 +0200
fix(imap): body ptr lifetime
commit 245abb8384
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 19:44:10 2019 +0200
remove debug
commit a3e1042001
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 18:30:54 2019 +0200
fix some things, add more debugging statements
commit 7b7ce9348f
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 15:11:57 2019 +0200
fix python lint issues
commit 7a4808ba0d
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 14:35:54 2019 +0200
cargofmt
commit 8f240f7153
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 14:03:57 2019 +0200
(dig,hpk) pull out job collection from sql query/lock logic
commit 7d0b5d8abb
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 12:52:02 2019 +0200
remove print statements and fix a crash
commit ee317cb1b5
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 11:38:10 2019 +0200
fix some merge issues
commit 7b736fe635
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 11:16:38 2019 +0200
(dig,hpk) add test and fix for wrong dbs
commit c7db15352a
Merge: 0b37167 0c5015d
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 09:59:44 2019 +0200
Merge branch 'master' into eventlogging
commit 0b37167be8
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 00:06:05 2019 +0200
address @dignifiedquire comments
commit 5cac4b5076
Author: holger krekel <holger@merlinux.eu >
Date: Wed Jul 17 12:47:22 2019 +0200
remove spurious print
commit 475a41beb3
Author: holger krekel <holger@merlinux.eu >
Date: Wed Jul 17 12:31:12 2019 +0200
address @dignifiedquire rustyness comment and fix changelog
commit ad4be80b4e
Author: holger krekel <holger@merlinux.eu >
Date: Wed Jul 17 10:25:25 2019 +0200
make smtp/imap connect() return bool instead of c-int
commit 8737c1d142
Author: holger krekel <holger@merlinux.eu >
Date: Wed Jul 17 09:26:33 2019 +0200
cleanup some parts, add comments
commit 964fe466cc
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 20:05:41 2019 +0200
wip-commit which passes all tests with proper finalization
commit 43936e7db7
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 16:17:42 2019 +0200
snapshot of my current debugging state
commit 0e80ce9c39
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 12:57:19 2019 +0200
more aggressively skip perform API when threads are closing
commit c652bae68a
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 12:06:05 2019 +0200
intermediate wip commit
commit bc904a495d
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 11:18:56 2019 +0200
add some logging, and a more precise teardown for online python tests
commit 8d99444c6a
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 00:22:12 2019 +0200
fix std
commit 9dab53e0af
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 00:20:54 2019 +0200
rustfmt
commit 360089ac74
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 00:03:49 2019 +0200
remove some debugging
commit e892c5cf4d
Author: holger krekel <holger@merlinux.eu >
Date: Mon Jul 15 23:31:30 2019 +0200
fix test for events
commit 9ad4c9a6fe
Author: holger krekel <holger@merlinux.eu >
Date: Mon Jul 15 22:51:57 2019 +0200
wip try test that we see INFO events from the core
2019-07-21 23:31:14 +02:00
Friedel Ziegelmayer
8a0fc609e6
The big sqlite refactor
...
* refactor: safe sql access
* Clean up the worst rebase mistakes
* Some more progress on the rebase fallout and this branch
* upgrade and compile again
* cleanup from rebase
* example of how to prepare now
* rebase fixes
* add sql.query_map
* less preparation
* more improvements in sql code
* fix string truncation
* more prepare conversions
* most prep done
* fix tests
* fix ffi
* fix last prepares
* fix segfaults and some queries
* use r2d2 pool
* fix dc_job sql call, to reduce contention
* try newer rust
* No more vararg printing (drop dc_log_)
* ignore expected errors
* fix: uses exists instead of execute where needed
* fix: get_contacts logic was broken
* fix: contact creation
* test on 32bit linux
* ci: try running 32bit without cross
* undo 32bit tests
* refactor: rename dc_sqlite3 to sql
* fix: safer string conversions
* more string fixes
* try fixing appveyor build to 64bit
* chore(ci): hardcode target
* chore(ci): appveyor
* some cleanup work
* try fix darwin
* fix and improve sql escaping
* fix various bugs
* fix chat deletion
* refactor: cleanup config values and move to their own file
* refactor: move more methods onto the sql struct
* dont panic on failed state loading
* first round of cr
* one more cr fix
* stop using strange defaults
* remove unused escapes
2019-07-18 00:24:45 +02:00
Floris Bruynooghe
816fa1df9b
test: ignore expensive tests by default
...
This makes interactively running the tests a much more pleasant
experience rather than something one dreads. These tests will still
be run on the CI. To run these manually run:
cargo test [TESTNAME] -- --ignored
2019-07-09 13:36:16 +02:00
Floris Bruynooghe
a6102d1039
Refactor the internal sql interface somewhat
...
Experiment with refactoring the internal sql interface a bit. My
original goal was to modify the schema and thus refactor to a state
where it would be sane to write tests for dc_sqlite_open() (and/or
however it ends up refactored) to assert schame changes before/after.
2019-06-17 22:31:36 +02:00
Floris Bruynooghe
db9bc15d3e
Make the callback optional again
...
The C API allows passing a NULL pointer is for the callback function.
However when calling the callback nothing checks for this null pointer
and thus things fail badly. Even worse since the C API is defined
using an "fn pointer" rather than a "*-ptr" or raw pointer to the
function rust does not realise this can be invalid and therefore the
typechecker does not catch this even though there are no unsafe casts.
Fix this by making the callback an Option in rust, this can be easily
checked when calling. Also add a Context.call_cb() function which
simplifies calling the callback, hides the weird syntax due to the
function pointer and makes the call a little easier. Finally it also
means the option checking is only needed in one place.
For the C API this needs to check if this is a NULL pointer or not,
this is implicitly done by rust using the "nullable pointer
optimisation":
https://doc.rust-lang.org/nomicon/ffi.html#the-nullable-pointer-optimization
2019-06-17 20:06:15 +02:00
Friedel Ziegelmayer
af8d056206
refactor: remove dc-strbuilder
2019-06-08 17:13:25 +02:00
dignifiedquire
8154781a0d
refactor: replace assert_rtn with assert macros
2019-05-30 00:34:10 +02:00
Lars-Magnus Skog
3142ff22fd
test: move to dc_param
2019-05-29 23:43:08 +02:00
Lars-Magnus Skog
0ffdaf254f
test: move dc_array tests
2019-05-29 23:43:08 +02:00
Lars-Magnus Skog
51071fb09d
test: move tests for dc_utf8_strlen()
2019-05-29 23:43:08 +02:00
Lars-Magnus Skog
4175ce56eb
test: remove redundant c macro tests :burn:
2019-05-29 23:43:08 +02:00
Lars-Magnus Skog
424ada818b
test: move stress tests to dc_strencode and dc_tools
2019-05-29 23:43:08 +02:00
dignifiedquire
21341b7a51
refactor: remove sprintf
2019-05-29 02:03:55 +02:00
Friedel Ziegelmayer
d033667433
Fix bugs ( #93 )
...
* fix(repl): pass null pointer instead of empty string
* fix(peerstate): ensure load and store to the db works
2019-05-28 17:59:41 +02:00
dignifiedquire
2d3eae4e1e
refactor: remove dc prefix from keyring and keyhistory
2019-05-27 09:35:03 +02:00
dignifiedquire
22868abe0e
refactor: rename dc_context to context
2019-05-27 09:32:50 +02:00
dignifiedquire
5237c19f4e
refactor: remove dc prefix from cleaned up modules
2019-05-27 09:21:42 +02:00
dignifiedquire
66d8421a90
refactor: remove dc_hash in favor of HashMap and HashSet
...
Closes #49
2019-05-26 23:01:17 +02:00
Friedel Ziegelmayer
a247e5b143
refactor(oauth): safe oauth2 and remove custom json parser ( #80 )
...
* refactor(oauth): safe oauth2 and remove custom json parser
Closes #46,#53
2019-05-26 22:49:52 +02:00
Friedel Ziegelmayer
379fc72094
perf: reduce verification load ( #75 )
...
- assume valid keys in the db
- verify keys on import from headers + disk
- use references in keyring when possible
2019-05-17 10:19:43 +02:00
Friedel Ziegelmayer
342e416b4e
Ci updates & closer to windows builds
...
* chore: update some ci
* feat: no more libiconv
* refactor: updates for updated mmime api
* fixup: correct mmime path
* cleanup
* use newer visual studio
* Update appveyor.yml
* unify libc imports and improve windows situation
* refactor: use rust based sleep
* improve cross platform state of types
* docs: update readme badges
2019-05-16 17:16:07 +02:00
dignifiedquire
dfb989e0d0
finish it
2019-05-14 00:44:59 +02:00
dignifiedquire
a95d6f85cc
start save implementation of save keys
2019-05-14 00:44:59 +02:00
Lars-Magnus Skog
0408695c1d
test: move tests to dc_strencode.rs
2019-05-13 23:10:34 +02:00
Lars-Magnus Skog
0ad4a71897
test: remove tests testing c pre processor code 💥
2019-05-13 17:55:18 +02:00
Lars-Magnus Skog
4fb5bc63be
test: move tests to dc_tools.rs
2019-05-13 17:33:34 +02:00
Lars-Magnus Skog
5c9dc3a334
test: move dc_msg_guess_msgtype_from_suffix tests to dc_msg.rs
2019-05-13 16:23:47 +02:00
Lars-Magnus Skog
986c092801
test: move dc_mimeparser_parse() tests to separate test
2019-05-13 16:06:32 +02:00
Lars-Magnus Skog
ab96264c1a
test: move dc_atof/dc_ftoa tests to dc_tools.rs
2019-05-13 15:48:03 +02:00
Lars-Magnus Skog
4183141424
test: move ato{l,i} tests to x.rs
2019-05-13 15:48:03 +02:00
Lars-Magnus Skog
26d6e41c7d
test: move dc_may_be_valid_addr tests to dc_contact.rs
2019-05-13 15:48:03 +02:00
Lars-Magnus Skog
5ccc68bbfa
test: move mime parsing unit tests to dc_mimeparser.rs
2019-05-13 15:48:02 +02:00
Lars-Magnus Skog
ec570ead35
test: move dc_kml_parse() to separate test
2019-05-13 15:46:17 +02:00
Lars-Magnus Skog
a95544c5c0
test: move simplify tests to unit tests for dc_simplify.rs
2019-05-13 15:46:17 +02:00
Lars-Magnus Skog
3813a219e0
Wrap dc_context_t and TempDir in a struct
2019-05-13 15:46:16 +02:00
Lars-Magnus Skog
e3e56d9f7e
Skip #[cfg(test)] and mod tests, not needed
2019-05-13 15:46:16 +02:00
Lars-Magnus Skog
c9b6bb6a9b
add create_context() function
2019-05-13 15:46:16 +02:00
Lars-Magnus Skog
dc92166ca2
chore: remove blobdir member from dc_mimeparser_t struct 🔥
...
dc_mimeparser_new() constructor takes both blobdir and context, but only
uses the blobdir from the context and doesn't care about parser.blobdir,
this can be removed safely since only used internally.
2019-05-13 15:32:53 +02:00
dignifiedquire
fdd870286e
refactor: move aheader to safe rust
2019-05-12 23:11:13 +02:00
Hocuri
569c924a0c
Replace types that use only 0 and 1 with bool ( #18 ) ( #58 )
...
* Start replacing int with bool where possible (#18 )
* Continue replacing int with bool where possible (#18 )
* Continue replacing int with bool where possible (#18 )
* Run fmt
2019-05-11 12:07:09 +02:00
dignifiedquire
2bead0aa6c
fix missing imports for mmime
2019-05-07 13:48:13 +01:00
dignifiedquire
e43ddf0359
refactor: reorg code and drop usage of libetpans base64 encoder
2019-05-07 10:51:41 +01:00
Lars-Magnus Skog
2cf6cde5d1
chore: fix compiler warnings (mut + unused assignments) ( #40 )
...
* Stop allowing unused assignments
* test: remove unused assignments in cmdline
* chore: fix compiler warnings in dc_tools.rs
* chore: fix compiler warnings in dc_token.rs
* chore: fix compiler warnings in dc_strencode.rs
* chore: fix compiler warnings in dc_stock.rs
* chore: fix compiler warnings in dc_sqlite3.rs
* chore: fix compiler warnings in dc_simplify.rs
* chore: fix compiler warnings in dc_securejoin.rs
* chore: fix compiler warnings in dc_saxparser.rs
* chore: fix compiler warnings in dc_pgp.rs
* chore: fix compiler warnings in dc_param.rs
* chore: fix compiler warnings in dc_oauth2.rs
* chore: fix compiler warnings in dc_msg.rs
* chore: fix compiler warnings in dc_mimeparser.rs
* chore: fix compiler warnings in dc_mimefactory.rs
* chore: fix compiler warnings in dc_lot.rs
* chore: fix compiler warnings in dc_loginparams.rs
* chore: fix compiler warnings in dc_log.rs
* chore: fix compiler warnings in dc_location.rs
* chore: fix compiler warnings in dc_keyring.rs
* chore: fix compiler warnings in dc_key.rs
* chore: fix compiler warnings in dc_jsmn.rs
* chore: fix compiler warnings in dc_jobthread.rs
* chore: fix compiler warnings in dc_imex.rs
* chore: fix compiler warnings in dc_hash.rs
* chore: fix compiler warnings in dc_e2ee.rs
* chore: fix compiler warnings in dc_context.rs
* chore: fix compiler warnings in dc_contact.rs
* chore: fix compiler warnings in dc_chatlist.rs
* chore: fix compiler warnings in dc_chat.rs
* chore: fix compiler warnings in dc_array.rs
* chore: fix compiler warnings in dc_apeerstate.rs
* chore: fix compiler warnings in dc_aheader.rs
* chore: fix compiler warnings in dc_array.rs
* test: remove compiler warnings in test/stress.rs
* test: reduce compiler warnings in examples/repl/main.rs
* test: std:🧵 :sleep_ms() is deprecated
* chore: remove unused variable in dc_sqlite3.rs
* chore: fix compiler warnings in dc_receive_imf.rs
* chore: fix compiler warnings in dc_job.rs
* chore: fix compiler warnings in dc_configure.rs
* Fix formatting
2019-05-05 21:58:59 +02:00
dignifiedquire
e7d72dfdd4
fix some locking issues, start rust-imap impl
2019-05-05 00:15:45 +02:00
Lars-Magnus Skog
95e1cc67b9
Fix FIXMEs in stress.rs ( #35 )
...
* Start by comparing strings instead of result of strcmp()
* Add failing tests for dc_trim, dc_ltrim and dc_rtrim
* Fix failing tests (use libc:isspace() which counts \r, \n etc)
* Remove FIXME for first dc_simplify_simplify()
* Fix formatting
* Fix tests for dc_param_set()
* Fix remaining FIXMEs in stress.rs
* Don't wrap libc::isspace()
* Wrap unit tests with mod tests
* Fix format
2019-05-03 11:13:06 +02:00
Lars-Magnus Skog
2e4bc048fb
test: run stress tests in the regular test setup
...
Closes #13
2019-05-02 20:48:31 +02:00