Commit c4720131 c4720131db791a34cf550f66687c59a6bbd9c6fc by Alain Magloire

Remove some '//' C++ style of comments.

1 parent 180d9a5d
......@@ -59,7 +59,8 @@ struct _msg_info {
message_t msg;
int ioffset;
int ooffset;
stream_t ostream; // output file/decoding stream for saving attachment
stream_t stream; /* output file/decoding stream for saving attachment */
stream_t fstream; /* output file stream for saving attachment */
};
#define MSG_HDR "Content-Type: %s; name=%s\nContent-Transfer-Encoding: %s\nContent-Disposition: attachment; filename=%s\n\n"
......@@ -231,7 +232,7 @@ int message_attachment_filename(message_t msg, const char **filename)
int message_save_attachment(message_t msg, const char *filename, void **data)
{
stream_t istream, fstream;
stream_t istream;
struct _msg_info *info = NULL;
int ret;
size_t size;
......@@ -251,8 +252,8 @@ int message_save_attachment(message_t msg, const char *filename, void **data)
ret = message_attachment_filename(msg, &fname);
else
fname = filename;
if ( fname && ( ret = file_stream_create(&fstream) ) == 0 ) {
if ( ( ret = stream_open(fstream, fname, 0, MU_STREAM_WRITE|MU_STREAM_CREAT) ) == 0 ) {
if ( fname && ( ret = file_stream_create(&info->fstream) ) == 0 ) {
if ( ( ret = stream_open(info->fstream, fname, 0, MU_STREAM_WRITE|MU_STREAM_CREAT) ) == 0 ) {
header_get_value(hdr, "Content-Transfer-Encoding", NULL, 0, &size);
if ( size ) {
if ( ( content_encoding = alloca(size+1) ) == NULL )
......@@ -260,17 +261,17 @@ int message_save_attachment(message_t msg, const char *filename, void **data)
header_get_value(hdr, "Content-Transfer-Encoding", content_encoding, size+1, 0);
} else
content_encoding = (char *)"7bit";
ret = filter_create(&info->ostream, fstream, content_encoding, MU_FILTER_DECODE, MU_STREAM_READ);
ret = filter_create(&info->stream, istream, content_encoding, MU_FILTER_DECODE, MU_STREAM_READ);
}
}
}
if ( info->ostream && istream ) {
if ( info->stream && istream ) {
if ( info->nbytes )
memmove( info->buf, info->buf + (BUF_SIZE - info->nbytes), info->nbytes);
while ( (ret == 0 && info->nbytes) || ( ( ret = stream_read(istream, info->buf, BUF_SIZE, info->ioffset, &info->nbytes) ) == 0 && info->nbytes ) ) {
while ( (ret == 0 && info->nbytes) || ( ( ret = stream_read(info->stream, info->buf, BUF_SIZE, info->ioffset, &info->nbytes) ) == 0 && info->nbytes ) ) {
info->ioffset += info->nbytes;
while( info->nbytes ) {
if ( ( ret = stream_write(info->ostream, info->buf, info->nbytes, info->ooffset, &nbytes ) ) != 0 )
if ( ( ret = stream_write(info->fstream, info->buf, info->nbytes, info->ooffset, &nbytes ) ) != 0 )
break;
info->nbytes -= nbytes;
info->ooffset += nbytes;
......@@ -278,8 +279,9 @@ int message_save_attachment(message_t msg, const char *filename, void **data)
}
}
if ( ret != EAGAIN && info ) {
stream_close(info->ostream);
stream_destroy(&info->ostream, NULL);
stream_close(info->fstream);
stream_destroy(&info->stream, NULL);
stream_destroy(&info->fstream, NULL);
_attachment_free(info, ret);
}
return ret;
......
......@@ -599,7 +599,7 @@ folder_imap_list (folder_t folder, const char *ref, const char *name,
for (i = 0; i < num; i++)
{
struct list_response *lr = f_imap->callback.flist.element[i];
//printf ("%s --> %s\n", lr->name, name);
/* printf ("%s --> %s\n", lr->name, name); */
if (fnmatch (name, lr->name, 0) == 0)
{
plist[i] = calloc (1, sizeof (**plist));
......@@ -672,7 +672,7 @@ folder_imap_lsub (folder_t folder, const char *ref, const char *name,
for (i = 0; i < num; i++)
{
struct list_response *lr = f_imap->callback.flist.element[i];
//printf ("%s --> %s\n", lr->name, name);
/* printf ("%s --> %s\n", lr->name, name); */
plist[i] = calloc (1, sizeof (**plist));
if (plist[i] == NULL
|| (plist[i]->name = strdup (lr->name)) == NULL)
......
......@@ -1165,7 +1165,7 @@ imap_get_part (message_t msg, size_t partno, message_t *pmsg)
message_get_header (message, &header);
header_set_get_value (header, NULL, message);
message_set_stream (message, NULL, msg_imap->parts[partno - 1]);
//message_set_size (message, NULL, msg_imap->parts[partno - 1]);
/* message_set_size (message, NULL, msg_imap->parts[partno - 1]); */
msg_imap->parts[partno - 1]->message = message;
if (pmsg)
*pmsg = message;
......
......@@ -167,7 +167,7 @@ extern char *base_name __P ((char const *));
static int mbox_open __P ((mailbox_t, int));
static int mbox_close __P ((mailbox_t));
static int mbox_get_message __P ((mailbox_t, size_t, message_t *));
//static int mbox_get_message_by_uid __P ((mailbox_t, size_t, message_t *));
/* static int mbox_get_message_by_uid __P ((mailbox_t, size_t, message_t *)); */
static int mbox_append_message __P ((mailbox_t, message_t));
static int mbox_messages_count __P ((mailbox_t, size_t *));
static int mbox_messages_recent __P ((mailbox_t, size_t *));
......@@ -865,9 +865,11 @@ mbox_expunge (mailbox_t mailbox)
part of mum will be at the right position. */
memmove (mud->umessages + j, mud->umessages + j + 1,
(dlast - j) * sizeof (mum));
//mum->header_from = mum->header_from_end = 0;
//mum->body = mum->body_end = 0;
//mum->header_lines = mum->body_lines = 0;
#if 0
mum->header_from = mum->header_from_end = 0;
mum->body = mum->body_end = 0;
mum->header_lines = mum->body_lines = 0;
#endif
for (i = 0; i < HDRSIZE; i++)
if (mum->fhdr[i])
{
......
......@@ -416,13 +416,13 @@ pop_user (authority_t auth)
CHECK_ERROR_CLOSE (mbox, mpd, EINVAL);
}
status = pop_writeline (mpd, "PASS %s\r\n", mpd->passwd);
MAILBOX_DEBUG0 (mbox, MU_DEBUG_PROT, mpd->buffer);
/* MAILBOX_DEBUG0 (mbox, MU_DEBUG_PROT, mpd->buffer); */
/* We have to nuke the passwd. */
memset (mpd->passwd, '\0', strlen (mpd->passwd));
free (mpd->passwd);
mpd->passwd = NULL;
CHECK_ERROR_CLOSE (mbox, mpd, status);
//MAILBOX_DEBUG0 (mbox, MU_DEBUG_PROT, "PASS *\n");
MAILBOX_DEBUG0 (mbox, MU_DEBUG_PROT, "PASS *\n");
mpd->state = POP_AUTH_PASS;
case POP_AUTH_PASS:
......
......@@ -273,7 +273,7 @@ smtp_open (mailer_t mailer, int flags)
/* Don't flag it as an error some SMTP servers can get the FQDN
by themselves even if the client is lying, probably
with getpeername(). */
// return EINVAL;
/* return EINVAL; */
}
else
{
......