Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
56dc2469
Commit
56dc2469
authored
Jan 31, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetcomm: Read content encoding from MIME header.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dec243fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
mimeole.c
dlls/inetcomm/mimeole.c
+23
-1
mimeole.c
dlls/inetcomm/tests/mimeole.c
+2
-8
No files found.
dlls/inetcomm/mimeole.c
View file @
56dc2469
...
...
@@ -765,6 +765,22 @@ static void init_content_type(MimeBody *body, header_t *header)
body
->
content_sub_type
=
strdupA
(
slash
+
1
);
}
static
void
init_content_encoding
(
MimeBody
*
body
,
header_t
*
header
)
{
const
char
*
encoding
=
header
->
value
.
u
.
pszVal
;
if
(
!
strcasecmp
(
encoding
,
"base64"
))
body
->
encoding
=
IET_BASE64
;
else
if
(
!
strcasecmp
(
encoding
,
"quoted-printable"
))
body
->
encoding
=
IET_QP
;
else
if
(
!
strcasecmp
(
encoding
,
"7bit"
))
body
->
encoding
=
IET_7BIT
;
else
if
(
!
strcasecmp
(
encoding
,
"8bit"
))
body
->
encoding
=
IET_8BIT
;
else
FIXME
(
"unknown encoding %s
\n
"
,
debugstr_a
(
encoding
));
}
static
HRESULT
parse_headers
(
MimeBody
*
body
,
IStream
*
stm
)
{
char
*
header_buf
,
*
cur_header_ptr
;
...
...
@@ -780,8 +796,14 @@ static HRESULT parse_headers(MimeBody *body, IStream *stm)
read_value
(
header
,
&
cur_header_ptr
);
list_add_tail
(
&
body
->
headers
,
&
header
->
entry
);
if
(
header
->
prop
->
id
==
PID_HDR_CNTTYPE
)
switch
(
header
->
prop
->
id
)
{
case
PID_HDR_CNTTYPE
:
init_content_type
(
body
,
header
);
break
;
case
PID_HDR_CNTXFER
:
init_content_encoding
(
body
,
header
);
break
;
}
}
HeapFree
(
GetProcessHeap
(),
0
,
header_buf
);
...
...
dlls/inetcomm/tests/mimeole.c
View file @
56dc2469
...
...
@@ -150,7 +150,6 @@ static void test_CreateBody(void)
IStream
*
in
;
LARGE_INTEGER
off
;
ULARGE_INTEGER
pos
;
ENCODINGTYPE
enc
;
ULONG
count
,
found_param
,
i
;
MIMEPARAMINFO
*
param_info
;
IMimeAllocator
*
alloc
;
...
...
@@ -191,9 +190,7 @@ static void test_CreateBody(void)
hr
=
IMimeBody_IsContentType
(
body
,
"text"
,
"plain"
);
todo_wine
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IMimeBody_GetCurrentEncoding
(
body
,
&
enc
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
enc
==
IET_8BIT
,
"encoding %d
\n
"
,
enc
);
test_current_encoding
(
body
,
IET_8BIT
);
memset
(
&
offsets
,
0xcc
,
sizeof
(
offsets
));
hr
=
IMimeBody_GetOffsets
(
body
,
&
offsets
);
...
...
@@ -658,7 +655,6 @@ static void test_CreateMessage(void)
ok
(
count
==
2
,
"got %d
\n
"
,
count
);
if
(
count
==
2
)
{
ENCODINGTYPE
encoding
;
IMimeBody
*
attachment
;
PROPVARIANT
prop
;
...
...
@@ -670,9 +666,7 @@ static void test_CreateMessage(void)
hr
=
IMimeBody_IsContentType
(
attachment
,
"multipart"
,
NULL
);
ok
(
hr
==
S_FALSE
,
"ret %08x
\n
"
,
hr
);
hr
=
IMimeBody_GetCurrentEncoding
(
attachment
,
&
encoding
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
todo_wine
ok
(
encoding
==
IET_8BIT
,
"ret %d
\n
"
,
encoding
);
test_current_encoding
(
attachment
,
IET_8BIT
);
prop
.
vt
=
VT_LPSTR
;
hr
=
IMimeBody_GetProp
(
attachment
,
"Content-Transfer-Encoding"
,
0
,
&
prop
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment