mutt_mem_realloc(&adata->overview_fmt, buflen);
}
- const int chunk =
- mutt_socket_readln(adata->overview_fmt + off, buflen - off, conn);
+ const int chunk = mutt_socket_readln_d(adata->overview_fmt + off,
+ buflen - off, conn, MUTT_SOCK_LOG_HDR);
if (chunk < 0)
{
FREE(&adata->overview_fmt);
mutt_message(_("Authenticating (%s)..."), method);
snprintf(buf, sizeof(buf), "AUTHINFO USER %s\r\n", conn->account.user);
if (mutt_socket_send(conn, buf) < 0 ||
- mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ mutt_socket_readln_d(buf, sizeof(buf), conn, MUTT_SOCK_LOG_FULL) < 0)
{
break;
}
/* username accepted, sending password */
if (mutt_str_startswith(buf, "381", CASE_MATCH))
{
- if (DebugLevel < MUTT_SOCK_LOG_FULL)
- mutt_debug(MUTT_SOCK_LOG_CMD, "%d> AUTHINFO PASS *\n", conn->fd);
+ mutt_debug(MUTT_SOCK_LOG_FULL, "%d> AUTHINFO PASS *\n", conn->fd);
snprintf(buf, sizeof(buf), "AUTHINFO PASS %s\r\n", conn->account.pass);
if (mutt_socket_send_d(conn, buf, MUTT_SOCK_LOG_FULL) < 0 ||
- mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ mutt_socket_readln_d(buf, sizeof(buf), conn, MUTT_SOCK_LOG_FULL) < 0)
{
break;
}
}
mutt_str_strcat(buf, sizeof(buf), "\r\n");
- if (DebugLevel < MUTT_SOCK_LOG_FULL)
+ if (strchr(buf, ' '))
{
- if (strchr(buf, ' '))
- {
- mutt_debug(MUTT_SOCK_LOG_CMD, "%d> AUTHINFO SASL %s%s\n",
- conn->fd, method, client_len ? " sasl_data" : "");
- }
- else
- mutt_debug(MUTT_SOCK_LOG_CMD, "%d> sasl_data\n", conn->fd);
+ mutt_debug(MUTT_SOCK_LOG_CMD, "%d> AUTHINFO SASL %s%s\n", conn->fd,
+ method, client_len ? " sasl_data" : "");
}
+ else
+ mutt_debug(MUTT_SOCK_LOG_CMD, "%d> sasl_data\n", conn->fd);
client_len = 0;
if (mutt_socket_send_d(conn, buf, MUTT_SOCK_LOG_FULL) < 0 ||
mutt_socket_readln_d(inbuf, sizeof(inbuf), conn, MUTT_SOCK_LOG_FULL) < 0)
if (!mutt_str_startswith(inbuf, "283 ", CASE_MATCH) &&
!mutt_str_startswith(inbuf, "383 ", CASE_MATCH))
{
- if (DebugLevel < MUTT_SOCK_LOG_FULL)
- mutt_debug(MUTT_SOCK_LOG_CMD, "%d< %s\n", conn->fd, inbuf);
+ mutt_debug(MUTT_SOCK_LOG_FULL, "%d< %s\n", conn->fd, inbuf);
break;
}
- if (DebugLevel < MUTT_SOCK_LOG_FULL)
- {
- inbuf[3] = '\0';
- mutt_debug(MUTT_SOCK_LOG_CMD, "%d< %s sasl_data\n", conn->fd, inbuf);
- }
+ inbuf[3] = '\0';
+ mutt_debug(MUTT_SOCK_LOG_FULL, "%d< %s sasl_data\n", conn->fd, inbuf);
if (strcmp("=", inbuf + 4) == 0)
len = 0;
while (true)
{
char *p = NULL;
- int chunk = mutt_socket_readln_d(buf, sizeof(buf), mdata->adata->conn, MUTT_SOCK_LOG_HDR);
+ int chunk = mutt_socket_readln_d(buf, sizeof(buf), mdata->adata->conn, MUTT_SOCK_LOG_FULL);
if (chunk < 0)
{
mdata->adata->status = NNTP_NONE;
buf[len] = '\0';
}
if (mutt_socket_send_d(mdata->adata->conn, buf[1] == '.' ? buf : buf + 1,
- MUTT_SOCK_LOG_HDR) < 0)
+ MUTT_SOCK_LOG_FULL) < 0)
{
mutt_file_fclose(&fp);
return nntp_connect_error(mdata->adata);
mutt_file_fclose(&fp);
if ((buf[strlen(buf) - 1] != '\n' &&
- mutt_socket_send_d(mdata->adata->conn, "\r\n", MUTT_SOCK_LOG_HDR) < 0) ||
- mutt_socket_send_d(mdata->adata->conn, ".\r\n", MUTT_SOCK_LOG_HDR) < 0 ||
+ mutt_socket_send_d(mdata->adata->conn, "\r\n", MUTT_SOCK_LOG_FULL) < 0) ||
+ mutt_socket_send_d(mdata->adata->conn, ".\r\n", MUTT_SOCK_LOG_FULL) < 0 ||
mutt_socket_readln(buf, sizeof(buf), mdata->adata->conn) < 0)
{
return nntp_connect_error(mdata->adata);
*/
int pop_query_d(struct PopAccountData *adata, char *buf, size_t buflen, char *msg)
{
- int dbg = MUTT_SOCK_LOG_CMD;
-
if (adata->status != POP_CONNECTED)
return -1;
/* print msg instead of real command */
if (msg)
{
- dbg = MUTT_SOCK_LOG_FULL;
mutt_debug(MUTT_SOCK_LOG_CMD, "> %s", msg);
}
- mutt_socket_send_d(adata->conn, buf, dbg);
+ mutt_socket_send_d(adata->conn, buf, MUTT_SOCK_LOG_FULL);
char *c = strpbrk(buf, " \r\n");
if (c)
*c = '\0';
snprintf(adata->err_msg, sizeof(adata->err_msg), "%s: ", buf);
- if (mutt_socket_readln(buf, buflen, adata->conn) < 0)
+ if (mutt_socket_readln_d(buf, buflen, adata->conn, MUTT_SOCK_LOG_FULL) < 0)
{
adata->status = POP_DISCONNECTED;
return -1;
while (true)
{
- const int chunk = mutt_socket_readln_d(buf, sizeof(buf), adata->conn, MUTT_SOCK_LOG_HDR);
+ const int chunk =
+ mutt_socket_readln_d(buf, sizeof(buf), adata->conn, MUTT_SOCK_LOG_FULL);
if (chunk < 0)
{
adata->status = POP_DISCONNECTED;