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
7e34b968
...
7e34b96853495be724e1cd0379620ed87f6fef75
authored
2001-05-24 03:02:06 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixes in mime.c
1 parent
76ec9ddd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
ChangeLog
mailbox/mbx_default.c
mailbox/mime.c
ChangeLog
View file @
7e34b96
2001-05-23 Alain Magloire
* mailbox/mbx_default.c (mailbox_create_default): Check
for URL in the mailbox name.
* mailbox/mime.c (_mimepart_body_read): Use stream_is_seekable()
to detect if the stream is POP for example and read 'til the end.
(mime_get_part): Reuse the stream the original stream flags on the
newly created message.
Fix and patches provided by Dave Inglis.
2001-05-23 Sergey Poznyakoff
* pop3d/user.c: check for NULL return from getpwnam()
...
...
mailbox/mbx_default.c
View file @
7e34b96
...
...
@@ -273,6 +273,8 @@ mailbox_create_default (mailbox_t *pmbox, const char *mail)
mbox
=
get_full_path
(
mail2
);
free
(
mail2
);
}
else
if
(
mail
)
mbox
=
strdup
(
mail
);
/* Search the spooldir. */
if
(
mbox
==
NULL
)
...
...
mailbox/mime.c
View file @
7e34b96
...
...
@@ -339,14 +339,21 @@ _mimepart_body_read(stream_t stream, char *buf, size_t buflen, off_t off, size_t
message_t
msg
=
body_get_owner
(
body
);
struct
_mime_part
*
mime_part
=
message_get_owner
(
msg
);
size_t
read_len
;
int
ret
=
0
;
if
(
nbytes
==
NULL
)
return
(
EINVAL
);
*
nbytes
=
0
;
read_len
=
(
int
)
mime_part
->
len
-
(
int
)
off
;
if
(
read_len
<=
0
)
return
0
;
if
(
read_len
<=
0
)
{
if
(
!
stream_is_seekable
(
mime_part
->
mime
->
stream
)
)
{
while
(
(
ret
=
stream_read
(
mime_part
->
mime
->
stream
,
buf
,
buflen
,
mime_part
->
offset
+
off
,
nbytes
)
)
==
0
&&
*
nbytes
>
0
)
off
+=
*
nbytes
;
*
nbytes
=
0
;
}
return
ret
;
}
read_len
=
(
buflen
<=
read_len
)
?
buflen
:
read_len
;
return
stream_read
(
mime_part
->
mime
->
stream
,
buf
,
read_len
,
mime_part
->
offset
+
off
,
nbytes
);
...
...
@@ -665,7 +672,7 @@ int
mime_get_part
(
mime_t
mime
,
size_t
part
,
message_t
*
msg
)
{
size_t
nmtp_parts
;
int
ret
=
0
;
int
ret
=
0
,
flags
=
0
;
stream_t
stream
;
body_t
body
;
struct
_mime_part
*
mime_part
;
...
...
@@ -680,7 +687,8 @@ mime_get_part(mime_t mime, size_t part, message_t *msg)
if
(
!
mime_part
->
body_created
&&
(
ret
=
body_create
(
&
body
,
mime_part
->
msg
)
)
==
0
)
{
body_set_size
(
body
,
_mimepart_body_size
,
mime_part
->
msg
);
body_set_lines
(
body
,
_mimepart_body_lines
,
mime_part
->
msg
);
if
(
(
ret
=
stream_create
(
&
stream
,
MU_STREAM_READ
,
body
)
)
==
0
)
{
stream_get_flags
(
mime
->
stream
,
&
flags
);
if
(
(
ret
=
stream_create
(
&
stream
,
MU_STREAM_READ
|
(
flags
&
(
MU_STREAM_SEEKABLE
|
MU_STREAM_NONBLOCK
)),
body
)
)
==
0
)
{
stream_set_read
(
stream
,
_mimepart_body_read
,
body
);
stream_set_fd
(
stream
,
_mimepart_body_fd
,
body
);
body_set_stream
(
body
,
stream
,
mime_part
->
msg
);
...
...
Please
register
or
sign in
to post a comment