Commit d2389dc0 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Fix post data parsing.

parent 9dffd134
...@@ -405,6 +405,8 @@ static void parse_post_data(nsIInputStream *post_data_stream, LPWSTR *headers_re ...@@ -405,6 +405,8 @@ static void parse_post_data(nsIInputStream *post_data_stream, LPWSTR *headers_re
post_data = GlobalAlloc(0, available+1); post_data = GlobalAlloc(0, available+1);
nsIInputStream_Read(post_data_stream, post_data, available, &post_data_len); nsIInputStream_Read(post_data_stream, post_data, available, &post_data_len);
TRACE("post_data = %s\n", debugstr_an(post_data, post_data_len));
ptr = ptr2 = post_data; ptr = ptr2 = post_data;
while(*ptr && (*ptr != '\r' || ptr[1] != '\n')) { while(*ptr && (*ptr != '\r' || ptr[1] != '\n')) {
...@@ -452,8 +454,8 @@ static void parse_post_data(nsIInputStream *post_data_stream, LPWSTR *headers_re ...@@ -452,8 +454,8 @@ static void parse_post_data(nsIInputStream *post_data_stream, LPWSTR *headers_re
} }
if(headers_len) { if(headers_len) {
memmove(post_data, ptr, ptr-(const char*)post_data);
post_data_len -= ptr-(const char*)post_data; post_data_len -= ptr-(const char*)post_data;
memmove(post_data, ptr, post_data_len);
post_data = GlobalReAlloc(post_data, post_data_len+1, 0); post_data = GlobalReAlloc(post_data, post_data_len+1, 0);
} }
...@@ -476,7 +478,7 @@ void hlink_frame_navigate(NSContainer *container, IHlinkFrame *hlink_frame, ...@@ -476,7 +478,7 @@ void hlink_frame_navigate(NSContainer *container, IHlinkFrame *hlink_frame,
if(post_data_stream) { if(post_data_stream) {
parse_post_data(post_data_stream, &headers, &post_data, &post_data_len); parse_post_data(post_data_stream, &headers, &post_data, &post_data_len);
TRACE("%s %s\n", debugstr_w(headers), debugstr_a(post_data)); TRACE("headers = %s post_data = %s\n", debugstr_w(headers), debugstr_a(post_data));
} }
callback = BSCallback_Create(container->doc, uri, post_data, post_data_len, headers); callback = BSCallback_Create(container->doc, uri, post_data, post_data_len, headers);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment