@@ -138,21 +138,21 @@ end
138138function grpc_timeout_header_val (timeout:: Real )
139139 if round (Int, timeout) == timeout
140140 timeout_secs = round (Int64, timeout)
141- return " $(timeout_secs) S"
141+ return " $(string ( timeout_secs) ) S"
142142 end
143143 timeout *= 1000
144144 if round (Int, timeout) == timeout
145145 timeout_millisecs = round (Int64, timeout)
146- return " $(timeout_millisecs) m"
146+ return " $(string ( timeout_millisecs) ) m"
147147 end
148148 timeout *= 1000
149149 if round (Int, timeout) == timeout
150150 timeout_microsecs = round (Int64, timeout)
151- return " $(timeout_microsecs) u"
151+ return " $(string ( timeout_microsecs) ) u"
152152 end
153153 timeout *= 1000
154154 timeout_nanosecs = round (Int64, timeout)
155- return " $(timeout_nanosecs) n"
155+ return " $(string ( timeout_nanosecs) ) n"
156156end
157157
158158mutable struct gRPCRequest
@@ -238,22 +238,19 @@ mutable struct gRPCRequest
238238 # Uncomment this for debugging purposes
239239 # curl_easy_setopt(easy_handle, CURLOPT_VERBOSE, UInt32(1))
240240
241- http_url = replace (url, " grpc://" => " http://" )
242- http_url = replace (http_url, " grpcs://" => " https://" )
243-
244- curl_easy_setopt (easy_handle, CURLOPT_URL, http_url)
241+ curl_easy_setopt (easy_handle, CURLOPT_URL, url)
245242 curl_easy_setopt (easy_handle, CURLOPT_TIMEOUT, deadline)
246243 curl_easy_setopt (easy_handle, CURLOPT_PIPEWAIT, Clong (1 ))
247244 curl_easy_setopt (easy_handle, CURLOPT_POST, Clong (1 ))
248245 curl_easy_setopt (easy_handle, CURLOPT_CUSTOMREQUEST, " POST" )
249246
250- if startswith (http_url , " http://" )
247+ if startswith (url , " http://" )
251248 curl_easy_setopt (
252249 easy_handle,
253250 CURLOPT_HTTP_VERSION,
254251 CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE,
255252 )
256- elseif startswith (http_url , " https://" )
253+ elseif startswith (url , " https://" )
257254 curl_easy_setopt (easy_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS)
258255 end
259256
@@ -275,7 +272,7 @@ mutable struct gRPCRequest
275272 easy_handle,
276273 grpc. multi,
277274 headers,
278- http_url ,
275+ url ,
279276 request,
280277 0 ,
281278 response,
@@ -797,8 +794,9 @@ function check_multi_info(grpc::gRPCCURL)
797794 # The actual cleanup/notification happens here
798795 cleanup_request (grpc, req)
799796
800- # Remove from the list of requests associated
801- grpc. requests = filter (x -> x != = req, grpc. requests)
797+ # Remove from the list of requests associated (in-place, no allocation)
798+ idx = findfirst (x -> x === req, grpc. requests)
799+ ! isnothing (idx) && deleteat! (grpc. requests, idx)
802800 else
803801 @error (" curl_multi_info_read: unknown message" , message, maxlog = 1_000 )
804802 end
0 commit comments