Dear Johnny, In data venerdì 16 aprile 2010 12:30:47, Johnny Mariéthoz ha scritto: > I want to know which part of the python code is called when I have this > kind of http request: > > http://cdsweb.cern.ch/record/1259673/files/CERN-THESIS-2010-055.pdf > > Note: > At RERO we have our own script written in php, and it seems that IE + > acrobat plugin display a wrong dowload progress values, for "fast web" > pdf. I try to put in our HTTP header: > > header("Accept-Ranges: none"); > > as done at the CERN without any success. > > Many thanks for your advises.
The code which decides if you have the rights and which file to actually stream upon a request is mainly contained in: modules/websubmit/lib/websubmit_webinterface.py in the method WebInterfaceFilesPages._lookup (sub-function getfile). How the file is actually stream is through: modules/websubmit/lib/bibdocfile.py where the method BibDocFile.stream in turns calls the function stream_file which implements in Python part of the HTTP protocol. It normally supports multi-range HTTP requests (but we have experienced some issues with IE and Acrobat, like you). Actually is only at CERN that we have recently ad-hoc disabled range requests, for performance reasons, because any range request has to climb up all the Python code before being handled, and therefore this is impacting a bit on the CPU consumption of the server. Anyway, according to the protocol to fully disable range-requests it's perfectly correct what you did, but some applications might still ignore this and try to use range requests. So your code have to fully ignore the "If- Range" and "Range" incoming header, and just stream the whole file upon request. <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35> In practice it really depends on your PHP code :-) Best regards, Samuele -- Samuele Kaplun ** CERN Document Server ** <http://cds.cern.ch/>
