Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:19
erlang
4162-Update-httpc_request-body_length-1-to-hand...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 4162-Update-httpc_request-body_length-1-to-handle-iolists.patch of Package erlang
From 864afac13dafd4e166e0ec6402f15a741f14bfa8 Mon Sep 17 00:00:00 2001 From: Tyler Hughes <artman41@gmail.com> Date: Fri, 29 Jul 2022 02:06:36 +0100 Subject: [PATCH 2/4] Update httpc_request:body_length/1 to handle iolists + Update doc on httpc:request/5 --- lib/inets/src/http_client/httpc.erl | 2 +- lib/inets/src/http_client/httpc_request.erl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl index 3e8fe59ad8..5460bbcedf 100644 --- a/lib/inets/src/http_client/httpc.erl +++ b/lib/inets/src/http_client/httpc.erl @@ -131,7 +131,7 @@ request(Url, Profile) -> %% Header = {Field, Value} %% Field = string() %% Value = string() -%% Body = string() | binary() | {fun(SendAcc) -> SendFunResult, SendAcc} | +%% Body = iolist() | binary() | {fun(SendAcc) -> SendFunResult, SendAcc} | %% {chunkify, fun(SendAcc) -> SendFunResult, SendAcc} - HTLM-code %% SendFunResult = eof | {ok, iolist(), NewSendAcc} %% SendAcc = NewSendAcc = term() diff --git a/lib/inets/src/http_client/httpc_request.erl b/lib/inets/src/http_client/httpc_request.erl index a1ca0da92b..8f3e54970c 100644 --- a/lib/inets/src/http_client/httpc_request.erl +++ b/lib/inets/src/http_client/httpc_request.erl @@ -244,7 +244,7 @@ body_length(Body) when is_binary(Body) -> integer_to_list(size(Body)); body_length(Body) when is_list(Body) -> - integer_to_list(length(Body)). + integer_to_list(iolist_size(Body)). %% Set 'Content-Type' when it is explicitly set. handle_content_type(Headers, "") -> -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor