From: Kevin McCarthy Date: Mon, 21 Jan 2019 22:16:13 +0000 (-0800) Subject: Remove mutt_socket_read(). X-Git-Tag: mutt-1-12-rel~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=143ea851fa5ece5ba6eb89326377e1d358745048;p=mutt Remove mutt_socket_read(). It is not used anywhere in the code. Additionally, it does not interact correctly with mutt_socket_readchar() and mutt_socket_readln_d(), which use an internal input buffer: conn->inbuf. If reading a specific chunksize is needed in future, the function can be easily recreated to use the inbuf. --- diff --git a/mutt_socket.c b/mutt_socket.c index e69f92f9..7a7f03de 100644 --- a/mutt_socket.c +++ b/mutt_socket.c @@ -88,29 +88,6 @@ int mutt_socket_close (CONNECTION* conn) return rc; } -int mutt_socket_read (CONNECTION* conn, char* buf, size_t len) -{ - int rc; - - if (conn->fd < 0) - { - dprint (1, (debugfile, "mutt_socket_read: attempt to read from closed connection\n")); - return -1; - } - - rc = conn->conn_read (conn, buf, len); - /* EOF */ - if (rc == 0) - { - mutt_error (_("Connection to %s closed"), conn->account.host); - mutt_sleep (2); - } - if (rc <= 0) - mutt_socket_close (conn); - - return rc; -} - int mutt_socket_write_d (CONNECTION *conn, const char *buf, int len, int dbg) { int rc; diff --git a/mutt_socket.h b/mutt_socket.h index f00b4504..68f158e0 100644 --- a/mutt_socket.h +++ b/mutt_socket.h @@ -53,7 +53,6 @@ typedef struct _connection int mutt_socket_open (CONNECTION* conn); int mutt_socket_close (CONNECTION* conn); -int mutt_socket_read (CONNECTION* conn, char* buf, size_t len); int mutt_socket_poll (CONNECTION* conn, time_t wait_secs); int mutt_socket_readchar (CONNECTION *conn, char *c); #define mutt_socket_readln(A,B,C) mutt_socket_readln_d(A,B,C,MUTT_SOCK_LOG_CMD)