summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-09-03 09:39:13 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2010-09-03 09:39:13 +0300
commit64c8eabf83ec6f1a7b1050a1929b4387f78b7ccc (patch)
tree9ea0c7213d2e6c0406b8a8639c6d7a5a6bc0dbeb
parent96fb7b6c2142e6da7ea4c56923c6289b1bfd244e (diff)
downloadmailutils-64c8eabf83ec6f1a7b1050a1929b4387f78b7ccc.tar.gz
mailutils-64c8eabf83ec6f1a7b1050a1929b4387f78b7ccc.tar.bz2
Port the new I/O scheme from pop3d to imap4d.
* mailbox/fltstream.c (filter_wr_flush): Fix erroneous conditional. (filter_wait): New method. (mu_filter_stream_create): Set wait method. * imap4d/io.c: New source. * imap4d/Makefile.am: Add io.c * imap4d/*: Update I/O function calls.
-rw-r--r--imap4d/Makefile.am1
-rw-r--r--imap4d/append.c15
-rw-r--r--imap4d/auth_gsasl.c8
-rw-r--r--imap4d/auth_gss.c16
-rw-r--r--imap4d/authenticate.c25
-rw-r--r--imap4d/bye.c17
-rw-r--r--imap4d/capability.c10
-rw-r--r--imap4d/check.c4
-rw-r--r--imap4d/close.c6
-rw-r--r--imap4d/copy.c6
-rw-r--r--imap4d/create.c10
-rw-r--r--imap4d/delete.c10
-rw-r--r--imap4d/examine.c2
-rw-r--r--imap4d/expunge.c4
-rw-r--r--imap4d/fetch.c232
-rw-r--r--imap4d/id.c12
-rw-r--r--imap4d/idle.c19
-rw-r--r--imap4d/imap4d.c11
-rw-r--r--imap4d/imap4d.h39
-rw-r--r--imap4d/io.c594
-rw-r--r--imap4d/list.c35
-rw-r--r--imap4d/login.c15
-rw-r--r--imap4d/logout.c2
-rw-r--r--imap4d/lsub.c15
-rw-r--r--imap4d/namespace.c22
-rw-r--r--imap4d/noop.c4
-rw-r--r--imap4d/rename.c19
-rw-r--r--imap4d/search.c10
-rw-r--r--imap4d/select.c30
-rw-r--r--imap4d/starttls.c10
-rw-r--r--imap4d/status.c32
-rw-r--r--imap4d/store.c10
-rw-r--r--imap4d/subscribe.c6
-rw-r--r--imap4d/sync.c16
-rw-r--r--imap4d/uid.c4
-rw-r--r--imap4d/unsubscribe.c6
-rw-r--r--imap4d/util.c664
-rw-r--r--mailbox/fltstream.c11
38 files changed, 967 insertions, 985 deletions
diff --git a/imap4d/Makefile.am b/imap4d/Makefile.am
index 65a5b8cba..bb0c19bfb 100644
--- a/imap4d/Makefile.am
+++ b/imap4d/Makefile.am
@@ -41,6 +41,7 @@ imap4d_SOURCES = \
idle.c\
imap4d.c\
imap4d.h\
+ io.c\
list.c\
logout.c\
login.c\
diff --git a/imap4d/append.c b/imap4d/append.c
index e549b59a3..3a5c6cca3 100644
--- a/imap4d/append.c
+++ b/imap4d/append.c
@@ -140,11 +140,11 @@ imap4d_append (struct imap4d_command *command, imap4d_tokbuf_t tok)
char *err_text = "[TRYCREATE] failed";
if (argc < 4)
- return util_finish (command, RESP_BAD, "Too few arguments");
+ return io_completion_response (command, RESP_BAD, "Too few arguments");
mboxname = imap4d_tokbuf_getarg (tok, IMAP4_ARG_1);
if (!mboxname)
- return util_finish (command, RESP_BAD, "Too few arguments");
+ return io_completion_response (command, RESP_BAD, "Too few arguments");
i = IMAP4_ARG_2;
if (imap4d_tokbuf_getarg (tok, i)[0] == '(')
@@ -160,7 +160,8 @@ imap4d_append (struct imap4d_command *command, imap4d_tokbuf_t tok)
break;
}
if (i == argc)
- return util_finish (command, RESP_BAD, "Missing closing parenthesis");
+ return io_completion_response (command, RESP_BAD,
+ "Missing closing parenthesis");
i++;
}
@@ -177,14 +178,14 @@ imap4d_append (struct imap4d_command *command, imap4d_tokbuf_t tok)
break;
default:
- return util_finish (command, RESP_BAD, "Too many arguments");
+ return io_completion_response (command, RESP_BAD, "Too many arguments");
}
msg_text = imap4d_tokbuf_getarg (tok, i);
mboxname = namespace_getfullpath (mboxname, "/", NULL);
if (!mboxname)
- return util_finish (command, RESP_NO, "Couldn't open mailbox");
+ return io_completion_response (command, RESP_NO, "Couldn't open mailbox");
status = mu_mailbox_create_default (&dest_mbox, mboxname);
if (status == 0)
@@ -202,9 +203,9 @@ imap4d_append (struct imap4d_command *command, imap4d_tokbuf_t tok)
free (mboxname);
if (status == 0)
- return util_finish (command, RESP_OK, "Completed");
+ return io_completion_response (command, RESP_OK, "Completed");
- return util_finish (command, RESP_NO, err_text);
+ return io_completion_response (command, RESP_NO, err_text);
}
diff --git a/imap4d/auth_gsasl.c b/imap4d/auth_gsasl.c
index 15e55ce08..036063db4 100644
--- a/imap4d/auth_gsasl.c
+++ b/imap4d/auth_gsasl.c
@@ -95,8 +95,8 @@ auth_gsasl (struct imap4d_command *command, char *auth_type, char **username)
while ((rc = gsasl_step64 (sess_ctx, input_str, &output))
== GSASL_NEEDS_MORE)
{
- util_send ("+ %s\n", output);
- imap4d_getline (&input_str, &input_size, &input_len);
+ io_sendf ("+ %s\n", output);
+ io_getline (&input_str, &input_size, &input_len);
}
if (rc != GSASL_OK)
@@ -112,8 +112,8 @@ auth_gsasl (struct imap4d_command *command, char *auth_type, char **username)
returned, and clients must respond with an empty response. */
if (output[0])
{
- util_send ("+ %s\n", output);
- imap4d_getline (&input_str, &input_size, &input_len);
+ io_sendf ("+ %s\n", output);
+ io_getline (&input_str, &input_size, &input_len);
if (input_len != 0)
{
mu_diag_output (MU_DIAG_NOTICE, _("non-empty client response"));
diff --git a/imap4d/auth_gss.c b/imap4d/auth_gss.c
index 1a7fd9548..300936245 100644
--- a/imap4d/auth_gss.c
+++ b/imap4d/auth_gss.c
@@ -163,8 +163,8 @@ auth_gssapi (struct imap4d_command *command,
/* Start the dialogue */
- util_send ("+ \n");
- util_flush_output ();
+ io_sendf ("+ \n");
+ io_flush ();
context = GSS_C_NO_CONTEXT;
@@ -172,7 +172,7 @@ auth_gssapi (struct imap4d_command *command,
{
OM_uint32 ret_flags;
- imap4d_getline (&token_str, &token_size, &token_len);
+ io_getline (&token_str, &token_size, &token_len);
mu_base64_decode ((unsigned char*) token_str, token_len, &tmp, &size);
tokbuf.value = tmp;
tokbuf.length = size;
@@ -192,7 +192,7 @@ auth_gssapi (struct imap4d_command *command,
if (outbuf.length)
{
mu_base64_encode (outbuf.value, outbuf.length, &tmp, &size);
- util_send ("+ %s\n", tmp);
+ io_sendf ("+ %s\n", tmp);
free (tmp);
gss_release_buffer (&min_stat, &outbuf);
}
@@ -212,10 +212,10 @@ auth_gssapi (struct imap4d_command *command,
if (outbuf.length)
{
mu_base64_encode (outbuf.value, outbuf.length, &tmp, &size);
- util_send ("+ %s\n", tmp);
+ io_sendf ("+ %s\n", tmp);
free (tmp);
gss_release_buffer (&min_stat, &outbuf);
- imap4d_getline (&token_str, &token_size, &token_len);
+ io_getline (&token_str, &token_size, &token_len);
}
/* Construct security-level data */
@@ -232,10 +232,10 @@ auth_gssapi (struct imap4d_command *command,
}
mu_base64_encode (outbuf.value, outbuf.length, &tmp, &size);
- util_send ("+ %s\n", tmp);
+ io_sendf ("+ %s\n", tmp);
free (tmp);
- imap4d_getline (&token_str, &token_size, &token_len);
+ io_getline (&token_str, &token_size, &token_len);
mu_base64_decode ((unsigned char *) token_str, token_len,
(unsigned char **) &tokbuf.value, &tokbuf.length);
free (token_str);
diff --git a/imap4d/authenticate.c b/imap4d/authenticate.c
index 1354203d3..08ffa146c 100644
--- a/imap4d/authenticate.c
+++ b/imap4d/authenticate.c
@@ -62,7 +62,7 @@ static int
_auth_capa (void *item, void *usused)
{
struct imap_auth *p = item;
- util_send(" AUTH=%s", p->name);
+ io_sendf (" AUTH=%s", p->name);
return 0;
}
@@ -107,13 +107,13 @@ imap4d_authenticate (struct imap4d_command *command, imap4d_tokbuf_t tok)
struct auth_data adata;
if (imap4d_tokbuf_argc (tok) != 3)
- return util_finish (command, RESP_BAD, "Invalid arguments");
+ return io_completion_response (command, RESP_BAD, "Invalid arguments");
auth_type = imap4d_tokbuf_getarg (tok, IMAP4_ARG_1);
if (tls_required)
- return util_finish (command, RESP_NO,
- "Command disabled: Use STARTTLS first");
+ return io_completion_response (command, RESP_NO,
+ "Command disabled: Use STARTTLS first");
adata.command = command;
adata.auth_type = auth_type;
@@ -121,20 +121,21 @@ imap4d_authenticate (struct imap4d_command *command, imap4d_tokbuf_t tok)
adata.username = NULL;
if (mu_list_do (imap_auth_list, _auth_try, &adata) == 0)
- return util_finish (command, RESP_NO,
- "Authentication mechanism not supported");
+ return io_completion_response (command, RESP_NO,
+ "Authentication mechanism not supported");
if (adata.result == RESP_OK && adata.username)
{
if (imap4d_session_setup (adata.username))
- return util_finish (command, RESP_NO,
- "User name or passwd rejected");
+ return io_completion_response (command, RESP_NO,
+ "User name or passwd rejected");
else
- return util_finish (command, RESP_OK,
- "%s authentication successful", auth_type);
+ return io_completion_response (command, RESP_OK,
+ "%s authentication successful",
+ auth_type);
}
- return util_finish (command, adata.result,
- "%s authentication failed", auth_type);
+ return io_completion_response (command, adata.result,
+ "%s authentication failed", auth_type);
}
diff --git a/imap4d/bye.c b/imap4d/bye.c
index 832fc7cd2..16b67df57 100644
--- a/imap4d/bye.c
+++ b/imap4d/bye.c
@@ -40,13 +40,13 @@ imap4d_bye0 (int reason, struct imap4d_command *command)
switch (reason)
{
case ERR_NO_MEM:
- util_out (RESP_BYE, "Server terminating: no more resources.");
+ io_untagged_response (RESP_BYE, "Server terminating: no more resources.");
mu_diag_output (MU_DIAG_ERROR, _("not enough memory"));
break;
case ERR_TERMINATE:
status = EX_OK;
- util_out (RESP_BYE, "Server terminating on request.");
+ io_untagged_response (RESP_BYE, "Server terminating on request.");
mu_diag_output (MU_DIAG_NOTICE, _("terminating on request"));
break;
@@ -56,7 +56,7 @@ imap4d_bye0 (int reason, struct imap4d_command *command)
case ERR_TIMEOUT:
status = EX_TEMPFAIL;
- util_out (RESP_BYE, "Session timed out");
+ io_untagged_response (RESP_BYE, "Session timed out");
if (state == STATE_NONAUTH)
mu_diag_output (MU_DIAG_INFO, _("session timed out for no user"));
else
@@ -77,10 +77,15 @@ imap4d_bye0 (int reason, struct imap4d_command *command)
status = EX_OSERR;
mu_diag_output (MU_DIAG_ERROR, _("mailbox modified by third party"));
break;
+
+ case ERR_STREAM_CREATE:
+ status = EX_UNAVAILABLE;
+ mu_diag_output (MU_DIAG_ERROR, _("cannot create transport stream"));
+ break;
case OK:
status = EX_OK;
- util_out (RESP_BYE, "Session terminating.");
+ io_untagged_response (RESP_BYE, "Session terminating.");
if (state == STATE_NONAUTH)
mu_diag_output (MU_DIAG_INFO, _("session terminating"));
else
@@ -88,13 +93,13 @@ imap4d_bye0 (int reason, struct imap4d_command *command)
break;
default:
- util_out (RESP_BYE, "Quitting (reason unknown)");
+ io_untagged_response (RESP_BYE, "Quitting (reason unknown)");
mu_diag_output (MU_DIAG_ERROR, _("quitting (numeric reason %d)"), reason);
break;
}
if (status == EX_OK && command)
- util_finish (command, RESP_OK, "Completed");
+ io_completion_response (command, RESP_OK, "Completed");
util_bye ();
diff --git a/imap4d/capability.c b/imap4d/capability.c
index b52d92696..02b566438 100644
--- a/imap4d/capability.c
+++ b/imap4d/capability.c
@@ -65,7 +65,7 @@ imap4d_capability_init ()
static int
print_capa (void *item, void *data)
{
- util_send (" %s", (char *)item);
+ io_sendf (" %s", (char *)item);
return 0;
}
@@ -73,14 +73,14 @@ int
imap4d_capability (struct imap4d_command *command, imap4d_tokbuf_t tok)
{
if (imap4d_tokbuf_argc (tok) != 2)
- return util_finish (command, RESP_BAD, "Invalid arguments");
+ return io_completion_response (command, RESP_BAD, "Invalid arguments");
- util_send ("* CAPABILITY");
+ io_sendf ("* CAPABILITY");
mu_list_do (capa_list, print_capa, NULL);
imap4d_auth_capability ();
- util_send ("\n");
+ io_sendf ("\n");
- return util_finish (command, RESP_OK, "Completed");
+ return io_completion_response (command, RESP_OK, "Completed");
}
diff --git a/imap4d/check.c b/imap4d/check.c
index ee1897d1e..4713a9449 100644
--- a/imap4d/check.c
+++ b/imap4d/check.c
@@ -34,6 +34,6 @@ int
imap4d_check (struct imap4d_command *command, imap4d_tokbuf_t tok)
{
if (imap4d_tokbuf_argc (tok) != 2)
- return util_finish (command, RESP_BAD, "Invalid arguments");
- return util_finish (command, RESP_OK, "Completed");
+ return io_completion_response (command, RESP_BAD, "Invalid arguments");
+ return io_completion_response (command, RESP_OK, "Completed");
}
diff --git a/imap4d/close.c b/imap4d/close.c
index e730268c9..49ede1c40 100644
--- a/imap4d/close.c
+++ b/imap4d/close.c
@@ -27,7 +27,7 @@ imap4d_close0 (struct imap4d_command *command, imap4d_tokbuf_t tok,
int status, flags;
if (imap4d_tokbuf_argc (tok) != 2)
- return util_finish (command, RESP_BAD, "Invalid arguments");
+ return io_completion_response (command, RESP_BAD, "Invalid arguments");
mu_mailbox_get_flags (mbox, &flags);
if (flags & MU_STREAM_WRITE)
@@ -51,8 +51,8 @@ imap4d_close0 (struct imap4d_command *command, imap4d_tokbuf_t tok,
mu_mailbox_destroy (&mbox);
if (msg)
- return util_finish (command, RESP_NO, msg);
- return util_finish (command, RESP_OK, "Completed");
+ return io_completion_response (command, RESP_NO, msg);
+ return io_completion_response (command, RESP_OK, "Completed");
}
/*
diff --git a/imap4d/copy.c b/imap4d/copy.c
index 7f9acad08..ef7aea0d6 100644
--- a/imap4d/copy.c
+++ b/imap4d/copy.c
@@ -42,7 +42,7 @@ imap4d_copy (struct imap4d_command *command, imap4d_tokbuf_t tok)
char *text;
if (imap4d_tokbuf_argc (tok) != 4)
- return util_finish (command, RESP_BAD, "Invalid arguments");
+ return io_completion_response (command, RESP_BAD, "Invalid arguments");
rc = imap4d_copy0 (tok, 0, &text);
@@ -52,9 +52,9 @@ imap4d_copy (struct imap4d_command *command, imap4d_tokbuf_t tok)
int new_state = (rc == RESP_OK) ? command->success : command->failure;
if (new_state != STATE_NONE)
state = new_state;
- return util_send ("%s %s\n", command->tag, text);
+ return io_sendf ("%s %s\n", command->tag, text);
}
- return util_finish (command, rc, "%s", text);
+ return io_completion_response (command, rc, "%s", text);
}
int
diff --git a/imap4d/create.c b/imap4d/create.c
index 0768d9fee..918926a82 100644
--- a/imap4d/create.c
+++ b/imap4d/create.c
@@ -91,16 +91,16 @@ imap4d_create (struct imap4d_command *command, imap4d_tokbuf_t tok)
const char *msg = "Completed";
if (imap4d_tokbuf_argc (tok) != 3)
- return util_finish (command, RESP_BAD, "Invalid arguments");
+ return io_completion_response (command, RESP_BAD, "Invalid arguments");
name = imap4d_tokbuf_getarg (tok, IMAP4_ARG_1);
if (*name == '\0')
- return util_finish (command, RESP_BAD, "Too few arguments");
+ return io_completion_response (command, RESP_BAD, "Too few arguments");
/* Creating, "Inbox" should always fail. */
if (mu_c_strcasecmp (name, "INBOX") == 0)
- return util_finish (command, RESP_BAD, "Already exist");
+ return io_completion_response (command, RESP_BAD, "Already exist");
/* RFC 3501:
If the mailbox name is suffixed with the server's hierarchy
@@ -117,7 +117,7 @@ imap4d_create (struct imap4d_command *command, imap4d_tokbuf_t tok)
name = namespace_getfullpath (name, delim, &ns);
if (!name)
- return util_finish (command, RESP_NO, "Cannot create mailbox");
+ return io_completion_response (command, RESP_NO, "Cannot create mailbox");
/* It will fail if the mailbox already exists. */
if (access (name, F_OK) != 0)
@@ -165,5 +165,5 @@ imap4d_create (struct imap4d_command *command, imap4d_tokbuf_t tok)
msg = "already exists";
}
- return util_finish (command, rc, msg);
+ return io_completion_response (command, rc, msg);
}
diff --git a/imap4d/delete.c b/imap4d/delete.c
index b6f4f9045..b7d30ae61 100644
--- a/imap4d/delete.c
+++ b/imap4d/delete.c
@@ -39,25 +39,25 @@ imap4d_delete (struct imap4d_command *command, imap4d_tokbuf_t tok)
char *name;
if (imap4d_tokbuf_argc (tok) != 3)
- return util_finish (command, RESP_BAD, "Invalid arguments");
+ return io_completion_response (command, RESP_BAD, "Invalid arguments");
name = imap4d_tokbuf_getarg (tok, IMAP4_ARG_1);
if (!name || *name == '\0')
- return util_finish (command, RESP_BAD, "Too few arguments");
+ return io_completion_response (command, RESP_BAD, "Too few arguments");
/* It is an error to attempt to delele "INBOX or a mailbox
name that dos not exists. */
if (mu_c_strcasecmp (name, "INBOX") == 0)
- return util_finish (command, RESP_NO, "Already exist");
+ return io_completion_response (command, RESP_NO, "Already exist");
/* Allocates memory. */
name = namespace_getfullpath (name, delim, NULL);
if (!name)
- return util_finish (command, RESP_NO, "Cannot remove");
+ return io_completion_response (command, RESP_NO, "Cannot remove");
if (remove (name) != 0)
{
rc = RESP_NO;
msg = "Cannot remove";
}
- return util_finish (command, rc, msg);
+ return io_completion_response (command, rc, msg);
}
diff --git a/imap4d/examine.c b/imap4d/examine.c
index 6f5ed6ac6..cd4d6692b 100644
--- a/imap4d/examine.c
+++ b/imap4d/examine.c
@@ -36,7 +36,7 @@ int
imap4d_examine (struct imap4d_command *command, imap4d_tokbuf_t tok)
{
if (imap4d_tokbuf_argc (tok) != 3)
- return util_finish (command, RESP_BAD, "Invalid arguments");
+ return io_completion_response (command, RESP_BAD, "Invalid arguments");
return imap4d_select0 (command, imap4d_tokbuf_getarg (tok, IMAP4_ARG_1),
MU_STREAM_READ);
}
diff --git a/imap4d/expunge.c b/imap4d/expunge.c
index efea04f6b..46df9854c 100644
--- a/imap4d/expunge.c
+++ b/imap4d/expunge.c
@@ -36,11 +36,11 @@ int
imap4d_expunge (struct imap4d_command *command, imap4d_tokbuf_t tok)
{
if (imap4d_tokbuf_argc (tok) != 2)
- return util_finish (command, RESP_BAD, "Invalid arguments");
+ return io_completion_response (command, RESP_BAD, "Invalid arguments");
/* FIXME: check for errors. */
mu_mailbox_expunge (mbox);
imap4d_sync ();
- return util_finish (command, RESP_OK, "Completed");
+ return io_completion_response (command, RESP_OK, "Completed");
}
diff --git a/imap4d/fetch.c b/imap4d/fetch.c
index 958703cb3..618409b62 100644
--- a/imap4d/fetch.c
+++ b/imap4d/fetch.c
@@ -76,7 +76,7 @@ fetch_send_address (const char *addr)
/* Short circuit. */
if (addr == NULL || *addr == '\0')
{
- util_send ("NIL");
+ io_sendf ("NIL");
return RESP_OK;
}
@@ -86,26 +86,26 @@ fetch_send_address (const char *addr)
/* We failed: can't parse. */
if (count == 0)
{
- util_send ("NIL");
+ io_sendf ("NIL");
return RESP_OK;
}
- util_send ("(");
+ io_sendf ("(");
for (i = 1; i <= count; i++)
{
const char *str;
int is_group = 0;
- util_send ("(");
+ io_sendf ("(");
mu_address_sget_personal (address, i, &str);
- util_send_qstring (str);
- util_send (" ");
+ io_send_qstring (str);
+ io_sendf (" ");
mu_address_sget_route (address, i, &str);
- util_send_qstring (str);
+ io_send_qstring (str);
- util_send (" ");
+ io_sendf (" ");
mu_address_is_group (address, i, &is_group);
str = NULL;
@@ -114,16 +114,16 @@ fetch_send_address (const char *addr)
else
mu_address_sget_local_part (address, i, &str);
- util_send_qstring (str);
+ io_send_qstring (str);
- util_send (" ");
+ io_sendf (" ");
mu_address_sget_domain (address, i, &str);
- util_send_qstring (str);
+ io_send_qstring (str);
- util_send (")");
+ io_sendf (")");
}
- util_send (")");
+ io_sendf (")");
return RESP_OK;
}
@@ -134,16 +134,16 @@ fetch_send_header_value (mu_header_t header, const char *name,
char *buffer;
if (space)
- util_send (" ");
+ io_sendf (" ");
if (mu_header_aget_value (header, name, &buffer) == 0)
{
- util_send_qstring (buffer);
+ io_send_qstring (buffer);
free (buffer);
}
else if (defval)
- util_send_qstring (defval);
+ io_send_qstring (defval);
else
- util_send ("NIL");
+ io_sendf ("NIL");
}
static void
@@ -153,7 +153,7 @@ fetch_send_header_address (mu_header_t header, const char *name,
char *buffer;
if (space)
- util_send (" ");
+ io_sendf (" ");
if (mu_header_aget_value (header, name, &buffer) == 0)
{
fetch_send_address (buffer);
@@ -172,36 +172,36 @@ send_parameter_list (const char *buffer)
if (!buffer)
{
- util_send ("NIL");
+ io_sendf ("NIL");
return;
}
mu_argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv);
if (argc == 0)
- util_send ("NIL");
+ io_sendf ("NIL");
else
{
char *p;
- util_send ("(");
+ io_sendf ("(");
p = argv[0];
- util_send_qstring (p);
+ io_send_qstring (p);
if (argc > 1)
{
int i, space = 0;
char *lvalue = NULL;
- util_send ("(");
+ io_sendf ("(");
for (i = 1; i < argc; i++)
{
if (lvalue)
{
if (space)
- util_send (" ");
- util_send_qstring (lvalue);
+ io_sendf (" ");
+ io_send_qstring (lvalue);
lvalue = NULL;
space = 1;
}
@@ -215,8 +215,8 @@ send_parameter_list (const char *buffer)
if (++i < argc)
{
char *p = argv[i];
- util_send (" ");
- util_send_qstring (p);
+ io_sendf (" ");
+ io_send_qstring (p);
}
break;
@@ -227,14 +227,14 @@ send_parameter_list (const char *buffer)
if (lvalue)
{
if (space)
- util_send (" ");
- util_send_qstring (lvalue);
+ io_sendf (" ");
+ io_send_qstring (lvalue);
}
- util_send (")");
+ io_sendf (")");
}
else
- util_send (" NIL");
- util_send (")");
+ io_sendf (" NIL");
+ io_sendf (")");
}
mu_argcv_free (argc, argv);
}
@@ -246,7 +246,7 @@ fetch_send_header_list (mu_header_t header, const char *name,
char *buffer;
if (space)
- util_send (" ");
+ io_sendf (" ");
if (mu_header_aget_value (header, name, &buffer) == 0)
{
send_parameter_list (buffer);
@@ -255,7 +255,7 @@ fetch_send_header_list (mu_header_t header, const char *name,
else if (defval)
send_parameter_list (defval);
else
- util_send ("NIL");
+ io_sendf ("NIL");
}
/* ENVELOPE:
@@ -281,7 +281,7 @@ fetch_envelope0 (mu_message_t msg)
/* From: */
mu_header_aget_value (header, "From", &from);
- util_send (" ");
+ io_sendf (" ");
fetch_send_address (from);
fetch_send_header_address (header, "Sender", from, 1);
@@ -368,9 +368,9 @@ bodystructure (mu_message_t msg, int extension)
if (s)
*s++ = 0;
p = argv[0];
- util_send_qstring (p);
- util_send (" ");
- util_send_qstring (s);
+ io_send_qstring (p);
+ io_sendf (" ");
+ io_send_qstring (s);
/* body parameter parenthesized list: Content-type attributes */
if (argc > 1 || text_plain)
@@ -380,7 +380,7 @@ bodystructure (mu_message_t msg, int extension)
int have_charset = 0;
int i;
- util_send (" (");
+ io_sendf (" (");
for (i = 1; i < argc; i++)
{
/* body parameter parenthesized list:
@@ -388,8 +388,8 @@ bodystructure (mu_message_t msg, int extension)
if (lvalue)
{
if (space)
- util_send (" ");
- util_send_qstring (lvalue);
+ io_sendf (" ");
+ io_send_qstring (lvalue);
lvalue = NULL;
space = 1;
}
@@ -403,8 +403,8 @@ bodystructure (mu_message_t msg, int extension)
if (++i < argc)
{
char *p = argv[i];
- util_send (" ");
- util_send_qstring (p);
+ io_sendf (" ");
+ io_send_qstring (p);
}
break;
@@ -419,27 +419,27 @@ bodystructure (mu_message_t msg, int extension)
if (lvalue)
{
if (space)
- util_send (" ");
- util_send_qstring (lvalue);
+ io_sendf (" ");
+ io_send_qstring (lvalue);
}
if (!have_charset && text_plain)
{
if (space)
- util_send (" ");
- util_send ("\"CHARSET\" \"US-ASCII\"");
+ io_sendf (" ");
+ io_sendf ("\"CHARSET\" \"US-ASCII\"");
}
- util_send (")");
+ io_sendf (")");
}
else
- util_send (" NIL");
+ io_sendf (" NIL");
mu_argcv_free (argc, argv);
free (buffer);
}
else
{
/* Default? If Content-Type is not present