Skip to content

Commit 3630742

Browse files
committed
Use curl handle
1 parent 59159c1 commit 3630742

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

R/handle.r

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ handle <- function(url, cookies = TRUE) {
2525
url <- parse_url(http://github.com/%3Cspan%20class=%22pl-smi%22%3Eurl%3C/span%3E)
2626
cookie_path <- if (cookies) tempfile() else NULL
2727

28-
h <- RCurl::getCurlHandle(cookiefile = cookie_path, .defaults = list())
28+
h <- curl::new_handle(cookiefile = cookie_path)
2929
structure(list(handle = h, url = url), class = "handle")
3030
}
3131

3232
#' @export
3333
print.handle <- function(x, ...) {
34-
cat("Host: ", build_url(http://github.com/%3Cspan%20class=%22pl-smi%22%3Ex%3C/span%3E%3Cspan%20class=%22pl-k%22%3E$%3C/span%3E%3Cspan%20class=%22pl-smi%22%3Eurl%3C/span%3E) , " <", ref(x), ">\n", sep = "")
34+
cat("Host: ", build_url(http://github.com/%3Cspan%20class=%22pl-smi%22%3Ex%3C/span%3E%3Cspan%20class=%22pl-k%22%3E$%3C/span%3E%3Cspan%20class=%22pl-smi%22%3Eurl%3C/span%3E) , " <", ref(x$handle), ">\n", sep = "")
3535
}
3636

3737
ref <- function(x) {
38-
str_extract(capture.output(print(x$handle@ref)), "0x[0-9a-f]*")
38+
str_extract(capture.output(print(x))[1], "0x[0-9a-f]*")
3939
}
4040

4141
is.handle <- function(x) inherits(x, "handle")
@@ -44,7 +44,7 @@ reset_handle_config <- function(handle, config) {
4444
# Calls curl_easy_reset (http://curl.haxx.se/libcurl/c/curl_easy_reset.html)
4545
# Does not change live connections, session ID cache, DNS cache, cookies
4646
# or shares.
47-
RCurl::reset(handle$handle)
47+
curl::handle_reset(handle)
4848
invisible(TRUE)
4949
}
5050

0 commit comments

Comments
 (0)