search for: cagent

Displaying 1 result from an estimated 1 matches for "cagent".

Did you mean: agent
2018 Dec 04
3
patch to support custom HTTP headers in download.file() and url()
...t;))); #endif SEXP utilsNS = PROTECT(R_FindNamespace(mkString("utils"))); - sheaders = eval(agentFun, utilsNS); + sagent = eval(agentFun, utilsNS); UNPROTECT(1); /* utilsNS */ - PROTECT(sheaders); - const char *headers = (TYPEOF(sheaders) == NILSXP) ? + PROTECT(sagent); + const char *cagent = (TYPEOF(sagent) == NILSXP) ? + NULL : CHAR(STRING_ELT(sagent, 0)); + /* TODO: flatten headers */ + const char *cheaders = (TYPEOF(sheaders) == NILSXP) ? NULL : CHAR(STRING_ELT(sheaders, 0)); - ctxt = Ri_HTTPOpen(url, headers, cacheOK); + ctxt = Ri_HTTPOpen(url, cagent, cheaders, cacheOK);...