Skip to content
Prev 273425 / 398506 Next

Behaviour of 'source' with URLs and proxy

On 05/10/2011 13:45, Prof Brian Ripley wrote:
I agree. I just thought -- incorrectly -- that any attempt to download a 
file from R would eventually call the same C code as download.file. Or 
maybe source() does not download and source, but reads the file on the fly?
OK, I agree that my settings look special, but in the end it is supposed 
to be a plain local proxy with no authentication.
The proxy is effectively used by the internal method and, from the 
messages (below), the remote file is opened, http headers are returned, 
but nothing else happens and I have to cancel the command (Ctrl-C).

This is where I would like to have some input, so that I can work out 
the issue.
I tried to go through the C code for internet with no great luck: seems 
that in_R_HTTPRead and RxmlNanoHTTPRead would the place to look at.

Any idea on what would cause these functions to hang (infinite loop, 
communication problem, ...)?
I know, I am too curious.

Thank you


 > Sys.getenv('http_proxy')
[1] "http://localhost:8080/"
 > Sys.getenv('no_proxy')
[1] "localhost,127.0.0.0/8,*.local"
 > options(internet.info=0)
 > download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt")
trying URL 'http://lib.stat.cmu.edu/datasets/csb/ch3a.txt'
Content type 'text/plain' length 1209 bytes
opened URL
^C
There were 15 warnings (use warnings() to see them)
 > warnings()
Warning messages:
1: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
   connected to 'localhost' on port 8080.
2: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
   -> (Proxy) GET http://lib.stat.cmu.edu/datasets/csb/ch3a.txt HTTP/1.0
Host: lib.stat.cmu.edu
User-Agent: R (2.13.2 x86_64-pc-linux-gnu x86_64 linux-gnu)

3: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- HTTP/1.1 200 OK
4: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- Via: 1.1 SRVWINTMG003, 1.1 SRVWINTMG004
5: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- Connection: Keep-Alive
6: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- Proxy-Connection: Keep-Alive
7: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- Content-Length: 1209
8: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- Age: 747
9: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- Date: Wed, 05 Oct 2011 11:52:25 GMT
10: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- Content-Type: text/plain
11: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- ETag: "5c700f3-4b9-399383c0"
12: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- Server: Apache
13: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- Accept-Ranges: bytes
14: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
<- Last-Modified: Fri, 29 Jul 1994 14:21:11 GMT
15: In download.file("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt",  ... :
   Code 200, content-type 'text/plain'
###

UNIVERSITY OF CAPE TOWN 

This e-mail is subject to the UCT ICT policies and e-mai...{{dropped:5}}