From 55a7bf96123d2851dbecf3c89c6b5c4d8d5288f7 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Mon, 30 Jan 2017 17:21:07 -0500 Subject: [PATCH] Fix Requests on 0.6 --- src/multipart.jl | 2 +- src/parsing.jl | 2 +- src/streaming.jl | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/multipart.jl b/src/multipart.jl index 4ac452e..a707885 100644 --- a/src/multipart.jl +++ b/src/multipart.jl @@ -225,7 +225,7 @@ function prepare_multipart_request!(request, files) chunked = true end - datasizes = Array(Int,length(files)) + datasizes = Array{Int}(length(files)) # Try to determine final size of the request. If this fails, # we fall back to chunked transfer diff --git a/src/parsing.jl b/src/parsing.jl index 96a2b84..4b745e8 100644 --- a/src/parsing.jl +++ b/src/parsing.jl @@ -140,7 +140,7 @@ end function on_body(parser, at, len) response_stream = pd(parser) - append!(response_stream.buffer.data, unsafe_wrap(Array, convert(Ptr{UInt8}, at), (len,))) + write(response_stream.buffer, unsafe_wrap(Array, convert(Ptr{UInt8}, at), (len,))) response_stream.buffer.size = length(response_stream.buffer.data) response_stream.state = OnBody notify(response_stream.state_change) diff --git a/src/streaming.jl b/src/streaming.jl index 814c4a0..e14054a 100644 --- a/src/streaming.jl +++ b/src/streaming.jl @@ -18,12 +18,12 @@ function ResponseStream{T}(response, socket::T) r.response = response r.socket = socket r.state = NotStarted - r.buffer = IOBuffer() + r.buffer = IOBuffer(UInt8[], true, true, true, true, typemax(Int)) r.parser = ResponseParser(r) r.timeout = Inf r.current_header = Nullable() r.state_change = Condition() - r.cookie_buffer = IOBuffer() + r.cookie_buffer = IOBuffer(UInt8[], true, true, true, true, typemax(Int)) r end