summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibHTTP/Job.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibHTTP/Job.cpp')
-rw-r--r--Userland/Libraries/LibHTTP/Job.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibHTTP/Job.cpp b/Userland/Libraries/LibHTTP/Job.cpp
index 52004cda26..e07e234d66 100644
--- a/Userland/Libraries/LibHTTP/Job.cpp
+++ b/Userland/Libraries/LibHTTP/Job.cpp
@@ -110,7 +110,7 @@ void Job::flush_received_buffers()
return;
dbgln_if(JOB_DEBUG, "Job: Flushing received buffers: have {} bytes in {} buffers for {}", m_buffered_size, m_received_buffers.size(), m_request.url());
for (size_t i = 0; i < m_received_buffers.size(); ++i) {
- auto& payload = m_received_buffers[i];
+ auto& payload = m_received_buffers[i].pending_flush;
auto result = do_write(payload);
if (result.is_error()) {
if (!result.error().is_errno()) {
@@ -127,7 +127,7 @@ void Job::flush_received_buffers()
m_buffered_size -= written;
if (written == payload.size()) {
// FIXME: Make this a take-first-friendly object?
- m_received_buffers.take_first();
+ (void)m_received_buffers.take_first();
--i;
continue;
}
@@ -506,7 +506,7 @@ void Job::on_socket_connected()
}
}
- m_received_buffers.append(payload);
+ m_received_buffers.append(make<ReceivedBuffer>(payload));
m_buffered_size += payload.size();
m_received_size += payload.size();
flush_received_buffers();
@@ -579,8 +579,8 @@ void Job::finish_up()
u8* flat_ptr = flattened_buffer.data();
for (auto& received_buffer : m_received_buffers) {
- memcpy(flat_ptr, received_buffer.data(), received_buffer.size());
- flat_ptr += received_buffer.size();
+ memcpy(flat_ptr, received_buffer.pending_flush.data(), received_buffer.pending_flush.size());
+ flat_ptr += received_buffer.pending_flush.size();
}
m_received_buffers.clear();
@@ -595,7 +595,7 @@ void Job::finish_up()
}
m_buffered_size = flattened_buffer.size();
- m_received_buffers.append(move(flattened_buffer));
+ m_received_buffers.append(make<ReceivedBuffer>(move(flattened_buffer)));
m_can_stream_response = true;
}