Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
345f2cec
...
345f2cec351cd21b8d708a8895a8c75c02e60ad4
authored
2007-02-25 18:13:55 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Indentation fixes
1 parent
7fa065e5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
libproto/mbox/mbox.c
libproto/mbox/mbox.c
View file @
345f2ce
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2003,
2004, 2005, 2006 Free Software Foundation, Inc.
2004, 2005, 2006
, 2007
Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
...
...
@@ -248,7 +248,7 @@ mbox_open (mu_mailbox_t mailbox, int flags)
mu_stream_destroy
(
&
mailbox
->
stream
,
NULL
);
return
status
;
}
/* Even on top
,
of normal FILE *, lets agressively cache. But this
/* Even on top of normal FILE *, lets agressively cache. But this
may not be suitable for system tight on memory. */
mu_stream_setbufsiz
(
mailbox
->
stream
,
BUFSIZ
);
}
...
...
@@ -834,7 +834,8 @@ mbox_message_uid (mu_message_t msg, size_t *puid)
}
static
int
mbox_get_body_transport
(
mu_stream_t
is
,
mu_transport_t
*
pin
,
mu_transport_t
*
pout
)
mbox_get_body_transport
(
mu_stream_t
is
,
mu_transport_t
*
pin
,
mu_transport_t
*
pout
)
{
mu_body_t
body
=
mu_stream_get_owner
(
is
);
mu_message_t
msg
=
mu_body_get_owner
(
body
);
...
...
@@ -843,7 +844,8 @@ mbox_get_body_transport (mu_stream_t is, mu_transport_t *pin, mu_transport_t *po
}
static
int
mbox_get_transport2
(
mbox_message_t
mum
,
mu_transport_t
*
pin
,
mu_transport_t
*
pout
)
mbox_get_transport2
(
mbox_message_t
mum
,
mu_transport_t
*
pin
,
mu_transport_t
*
pout
)
{
if
(
mum
==
NULL
)
return
EINVAL
;
...
...
@@ -938,7 +940,8 @@ mbox_readstream (mbox_message_t mum, char *buffer, size_t buflen,
/* Position the file pointer and the buffer. */
nread
=
((
size_t
)
ln
<
buflen
)
?
(
size_t
)
ln
:
buflen
;
if
(
isreadline
)
status
=
mu_stream_readline
(
mum
->
mud
->
mailbox
->
stream
,
buffer
,
buflen
,
status
=
mu_stream_readline
(
mum
->
mud
->
mailbox
->
stream
,
buffer
,
buflen
,
start
+
off
,
&
nread
);
else
status
=
mu_stream_read
(
mum
->
mud
->
mailbox
->
stream
,
buffer
,
nread
,
...
...
@@ -1081,7 +1084,8 @@ mbox_envelope_date (mu_envelope_t envelope, char *buf, size_t len,
if
(
mum
==
NULL
)
return
EINVAL
;
status
=
mu_stream_readline
(
mum
->
mud
->
mailbox
->
stream
,
buffer
,
sizeof
(
buffer
),
status
=
mu_stream_readline
(
mum
->
mud
->
mailbox
->
stream
,
buffer
,
sizeof
(
buffer
),
mum
->
header_from
,
&
n
);
if
(
status
!=
0
)
{
...
...
@@ -1125,7 +1129,8 @@ mbox_envelope_sender (mu_envelope_t envelope, char *buf, size_t len,
if
(
mum
==
NULL
)
return
EINVAL
;
status
=
mu_stream_readline
(
mum
->
mud
->
mailbox
->
stream
,
buffer
,
sizeof
(
buffer
),
status
=
mu_stream_readline
(
mum
->
mud
->
mailbox
->
stream
,
buffer
,
sizeof
(
buffer
),
mum
->
header_from
,
&
n
);
if
(
status
!=
0
)
{
...
...
@@ -1311,7 +1316,8 @@ mbox_append_message (mu_mailbox_t mailbox, mu_message_t msg)
mu_off_t
size
;
/* Move to the end of the file, not necesary if _APPEND mode. */
if
((
status
=
mu_stream_size
(
mailbox
->
stream
,
&
size
))
!=
0
||
(
status
=
mbox_append_message0
(
mailbox
,
msg
,
&
size
,
0
,
0
))
!=
0
)
||
(
status
=
mbox_append_message0
(
mailbox
,
msg
,
&
size
,
0
,
0
))
!=
0
)
{
if
(
status
!=
EAGAIN
)
mu_locker_unlock
(
mailbox
->
locker
);
...
...
@@ -1388,10 +1394,9 @@ restore_date (mu_message_t msg, mbox_data_t mud)
date
=
strdup
(
ctime
(
&
t
));
}
mud
->
date
=
strdup
(
date
)
;
mud
->
date
=
date
;
if
(
!
mud
->
date
)
rc
=
ENOMEM
;
free
(
date
);
return
rc
;
}
...
...
@@ -1668,7 +1673,8 @@ mbox_append_message0 (mu_mailbox_t mailbox, mu_message_t msg, mu_off_t *psize,
return
status
;
}
mud
->
off
+=
nread
;
status
=
mu_stream_write
(
mailbox
->
stream
,
buffer
,
nread
,
*
psize
,
&
n
);
status
=
mu_stream_write
(
mailbox
->
stream
,
buffer
,
nread
,
*
psize
,
&
n
);
if
(
status
)
break
;
*
psize
+=
n
;
...
...
Please
register
or
sign in
to post a comment