Damien Riegel [Wed, 8 Nov 2017 21:08:23 +0000 (16:08 -0500)]
conn: add parameter to mutt_socket_new to specify socket type
It's currently the responsibility of mutt_conn_find to setup the
Connection, but this should really be done by mutt_socket_new, as it's
part of the socket initialization. To let it know which kind of
Connection it should create, add a parameter to allow callers to
specify the type.
Damien Riegel [Wed, 8 Nov 2017 20:25:42 +0000 (15:25 -0500)]
move Connections declaration to conn/socket.c
Functions responsible for adding and removing entries to Connections
(the Connection list) are in conn/socket.c, so it makes sense to move
it there too.
Also change mutt_conn_find to use the accessor instead of the global
variable, so it can be made static again.
Damien Riegel [Wed, 8 Nov 2017 20:48:44 +0000 (15:48 -0500)]
conn: let mutt_socket_new add Connection to the list
mutt_socket_new is followed by a call to TAILQ_INSERT_HEAD; and
mutt_socket_free takes care of removing the Connection from the
Connection list. Make these two more in pair by making mutt_socket_new
adds the newly created Connection to the connection list.
Damien Riegel [Wed, 8 Nov 2017 20:47:35 +0000 (15:47 -0500)]
move mutt_socket_free to conn/socket.c
mutt_socket_new is in conn/socket.c, mutt_socket_free is in
mutt_socket.c. Let's move these two together. "Connections" is made
global during the transition to keep the diffs more straightforward.
Damien Riegel [Wed, 8 Nov 2017 20:26:39 +0000 (15:26 -0500)]
conn: define mutt_ssl_socket_setup even when building without SSL
Error conditions were duplicated for builds with and without SSL. This
can be factorized by letting mutt_ssl_socket_setup be defined even when
SSL is not enabled.
Damien Riegel [Wed, 8 Nov 2017 15:29:23 +0000 (10:29 -0500)]
conn: rename mutt_socket_write to mutt_socket_send
For consistency, and as the buffer size is not passed to this function,
rename it to use "send" instead of "write". This frees
"mutt_socket_write" symbol, so we will be able to reuse it as a wrapper
over conn->conn_write.
Damien Riegel [Wed, 8 Nov 2017 15:44:19 +0000 (10:44 -0500)]
conn: replace mutt_socket_write_d by mutt_socket_send_d
Every occurrence of mutt_socket_write_d used -1 as buffer size. Wrap
these calls in a new macro mutt_socket_send_d. Keep "write" for
functions where the size is passed as parameter.
Pietro Cerutti [Wed, 11 Apr 2018 14:01:57 +0000 (15:01 +0100)]
Let mutt_ch_choose report conversion failure (#1137)
* Let mutt_ch_choose report conversion failure
Issue #1136
* Let mutt_ch_convert_string return errno if iconv(..) fails
Previously, mutt_ch_convert_string returned error only if any arguments
failed the sanity check or iconv_open() failed.
With this change, an error value is returned even if the iconv()
conversion fails, such as when the input string contains an invalid
character in the source character set (EILSEQ).
I have looked at each caller and it seems to me that this change won't
introduce any misbehaviour, but I'm far from being 100% confident.
Reis Radomil [Fri, 6 Apr 2018 01:55:51 +0000 (01:55 +0000)]
doc: Describe logging capabilities of NeoMutt
Describe the logging capabilities of NeoMutt in the User Guide. The
section currently covers the different log message types (perror, error,
warning, informational debug), where they are shown and how to enable
debug log messages.
Reis Radomil [Sun, 1 Apr 2018 13:31:16 +0000 (13:31 +0000)]
Describe <show-messages> more precisely
The term 'message' is used for log-messages as well as for ordinary
mails. In the help 'message' usually means an email. Adjust the
description of <show-message>/OP_SHOW_MESSAGE to clarify that log and
debug messages are meant.
Richard Russon [Tue, 27 Mar 2018 22:43:52 +0000 (23:43 +0100)]
sort switch cases
There are no code changes here.
The 'case' statements have been sorted where:
- There's a clear order, e.g. alphabetical
- Where they all have break/return statements
Richard Russon [Sun, 25 Mar 2018 23:05:56 +0000 (00:05 +0100)]
merge: upstream fixes
* sync to upstream abort_noattach
* Improve the error message when a signature is missing.
* Change mutt_error call in mutt_gpgme_set_sender() to dprint.
* Fix comparison of flags with multiple bits set.
* Increase account.user/login size to 128.
Kevin McCarthy [Sat, 24 Mar 2018 22:10:13 +0000 (15:10 -0700)]
Increase account.user/login size to 128.
Like the pass field in commit 52949004, the existing size was
insufficient for the reporter of issue #18. For now, just bump up the
size, but I'll move up looking into making these dynamically sized.
Kevin McCarthy [Fri, 23 Mar 2018 03:04:46 +0000 (20:04 -0700)]
Fix comparison of flags with multiple bits set.
PGPENCRYPT, PGPKEY, SMIMEENCRYPT, and SMIMEOPAQUE are all combination
flags, with multiple bits set. In a few places these flags were
bitwise-and'ed incorrectly: expecting a non-zero result to indicate
all the bits in the flag were set. Change those to explicitly compare
the result against the original flag.