diff options
Diffstat (limited to 'chrome_frame/npapi_url_request.cc')
-rw-r--r-- | chrome_frame/npapi_url_request.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome_frame/npapi_url_request.cc b/chrome_frame/npapi_url_request.cc index 885c390..ac091df 100644 --- a/chrome_frame/npapi_url_request.cc +++ b/chrome_frame/npapi_url_request.cc @@ -91,8 +91,14 @@ bool NPAPIUrlRequest::Start() { buffer += base::IntToString(data_len); buffer += "\r\n\r\n"; } - buffer.append(reinterpret_cast<char*>(&upload_data_[0]), - upload_data_.size()); + + std::string data; + data.resize(data_len); + uint32 bytes_read; + upload_data_->Read(&data[0], data_len, + reinterpret_cast<ULONG*>(&bytes_read)); + DCHECK_EQ(data_len, bytes_read); + buffer += data; result = npapi::PostURLNotify(instance_, url().c_str(), NULL, buffer.length(), buffer.c_str(), false, this); |