projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simplify charset and things in the sockets API.
[apps/madmutt.git]
/
pop
/
pop_lib.c
diff --git
a/pop/pop_lib.c
b/pop/pop_lib.c
index
a8dfe5c
..
b5aa605
100644
(file)
--- a/
pop/pop_lib.c
+++ b/
pop/pop_lib.c
@@
-19,38
+19,37
@@
#include <lib-lib/str.h>
#include <lib-lib/ascii.h>
#include <lib-lib/macros.h>
#include <lib-lib/str.h>
#include <lib-lib/ascii.h>
#include <lib-lib/macros.h>
-#include <lib-lib/
debug
.h>
+#include <lib-lib/
url
.h>
#include "mutt.h"
#include "mx.h"
#include "mutt.h"
#include "mx.h"
-#include "url.h"
#include "pop.h"
#if defined (USE_SSL) || defined (USE_GNUTLS)
#include "pop.h"
#if defined (USE_SSL) || defined (USE_GNUTLS)
-# include <lib-
network
/mutt_ssl.h>
+# include <lib-
sys
/mutt_ssl.h>
#endif
/* given an POP mailbox name, return host, port, username and password */
#endif
/* given an POP mailbox name, return host, port, username and password */
-int pop_parse_path (const char *path, ACCOUNT * ac
c
t)
+int pop_parse_path (const char *path, ACCOUNT * act)
{
ciss_url_t url;
char *c;
int ret = -1;
/* Defaults */
{
ciss_url_t url;
char *c;
int ret = -1;
/* Defaults */
- ac
c
t->flags = 0;
- ac
c
t->port = POP_PORT;
- ac
c
t->type = M_ACCT_TYPE_POP;
+ act->flags = 0;
+ act->port = POP_PORT;
+ act->type = M_ACCT_TYPE_POP;
c = m_strdup(path);
url_parse_ciss (&url, c);
if (url.scheme == U_POP || url.scheme == U_POPS) {
if (url.scheme == U_POPS) {
c = m_strdup(path);
url_parse_ciss (&url, c);
if (url.scheme == U_POP || url.scheme == U_POPS) {
if (url.scheme == U_POPS) {
- ac
c
t->flags |= M_ACCT_SSL;
- ac
c
t->port = POP_SSL_PORT;
+ act->flags |= M_ACCT_SSL;
+ act->port = POP_SSL_PORT;
}
}
- if ((!url.path || !*url.path) && mutt_account_fromurl (ac
c
t, &url) == 0)
+ if ((!url.path || !*url.path) && mutt_account_fromurl (act, &url) == 0)
ret = 0;
}
ret = 0;
}
@@
-383,21
+382,12
@@
void pop_logout (CONTEXT * ctx)
*/
pop_query_status pop_query_d (POP_DATA * pop_data, char *buf, size_t buflen, const char *msg)
{
*/
pop_query_status pop_query_d (POP_DATA * pop_data, char *buf, size_t buflen, const char *msg)
{
- int dbg = M_SOCK_LOG_CMD;
char *c;
if (pop_data->status != POP_CONNECTED)
return PQ_NOT_CONNECTED;
char *c;
if (pop_data->status != POP_CONNECTED)
return PQ_NOT_CONNECTED;
-#ifdef DEBUG
- /* print msg instaed of real command */
- if (msg) {
- dbg = M_SOCK_LOG_FULL;
- debug_print (M_SOCK_LOG_CMD, ("> %s", msg));
- }
-#endif
-
- mutt_socket_write_d (pop_data->conn, buf, dbg);
+ mutt_socket_write(pop_data->conn, buf);
c = strpbrk (buf, " \r\n");
*c = '\0';
c = strpbrk (buf, " \r\n");
*c = '\0';
@@
-443,8
+433,7
@@
pop_query_status pop_fetch_data (POP_DATA * pop_data, const char *query, progres
for (;;) {
chunk =
for (;;) {
chunk =
- mutt_socket_readln_d (buf, sizeof (buf), pop_data->conn,
- M_SOCK_LOG_HDR);
+ mutt_socket_readln(buf, sizeof (buf), pop_data->conn);
if (chunk < 0) {
pop_data->status = POP_DISCONNECTED;
ret = PQ_NOT_CONNECTED;
if (chunk < 0) {
pop_data->status = POP_DISCONNECTED;
ret = PQ_NOT_CONNECTED;
@@
-461,10
+450,9
@@
pop_query_status pop_fetch_data (POP_DATA * pop_data, const char *query, progres
m_strcpy(inbuf + lenbuf,sizeof(buf), p);
pos += chunk;
m_strcpy(inbuf + lenbuf,sizeof(buf), p);
pos += chunk;
- if (chunk >= s
izeof
(buf)) {
+ if (chunk >= s
sizeof
(buf)) {
lenbuf += strlen (p);
lenbuf += strlen (p);
- }
- else {
+ } else {
if (bar)
mutt_progress_bar (bar, pos);
if (ret == 0 && funct (inbuf, data) < 0)
if (bar)
mutt_progress_bar (bar, pos);
if (ret == 0 && funct (inbuf, data) < 0)
@@
-482,14
+470,13
@@
pop_query_status pop_fetch_data (POP_DATA * pop_data, const char *query, progres
/* find message with this UIDL and set refno */
static int check_uidl (char *line, void *data)
{
/* find message with this UIDL and set refno */
static int check_uidl (char *line, void *data)
{
- int i;
- unsigned int index;
- CONTEXT *ctx = (CONTEXT *) data;
+ int i, idx;
+ CONTEXT *ctx = (CONTEXT *)data;
- sscanf (line, "%u %s", &i
nde
x, line);
+ sscanf (line, "%u %s", &i
d
x, line);
for (i = 0; i < ctx->msgcount; i++) {
if (!m_strcmp(ctx->hdrs[i]->data, line)) {
for (i = 0; i < ctx->msgcount; i++) {
if (!m_strcmp(ctx->hdrs[i]->data, line)) {
- ctx->hdrs[i]->refno = i
nde
x;
+ ctx->hdrs[i]->refno = i
d
x;
break;
}
}
break;
}
}