[MacPorts] #24584: port fetch should use a cookie jar
#24584: port fetch should use a cookie jar -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.9.0 Component: base | Version: 1.8.2 Keywords: | Port: -------------------------------------+-------------------------------------- Some servers require a cookie to be set before they'll give you the download you request (for example websvn's server, tigris.org; see #24583). To accommodate this, `port fetch` should use a cookie jar. For example, if I try to fetch websvn-2.3.1.tar.gz normally, it keeps redirecting back and forth between two URLs and the download never completes: {{{ $ curl -L --max-redirs 10 -O http://websvn.tigris.org/files/documents/1380/47525/websvn-2.3.1.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 322 100 322 0 0 101 0 0:00:03 0:00:03 --:--:-- 101 curl: (47) Maximum (10) redirects followed }}} But if I use a cookie jar, it works fine: {{{ curl -c /tmp/cookiejar -L --max-redirs 10 -O http://websvn.tigris.org/files/documents/1380/47525/websvn-2.3.1.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 773k 100 773k 0 0 79601 0 0:00:09 0:00:09 --:--:-- 73025 }}} I imagine fixing this in MacPorts would just entail a small addition to src/pextlib1.0/curl.c to create a temporary file, pass it to curl using the CURLOPT_COOKIEJAR option, and delete the temp file afterward. -- Ticket URL: <http://trac.macports.org/ticket/24584> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24584: port fetch should use a cookie jar -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.9.0 Component: base | Version: 1.8.2 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by raimue@…): As we actually do not care which cookies are being set, we could use /dev/null as cookie jar. -- Ticket URL: <http://trac.macports.org/ticket/24584#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24584: port fetch should use a cookie jar -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.9.0 Component: base | Version: 1.8.2 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by ryandesign@…): Huh, I didn't expect that to work. I assumed it was setting a cookie, redirecting, then reading the cookie on the next page. But you're right, using /dev/null works for this site. -- Ticket URL: <http://trac.macports.org/ticket/24584#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24584: port fetch should use a cookie jar --------------------------------------+------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: enhancement | Status: closed Priority: Normal | Milestone: MacPorts 1.9.0 Component: base | Version: 1.8.2 Resolution: fixed | Keywords: Port: | --------------------------------------+------------------------------------- Changes (by raimue@…): * status: new => closed * resolution: => fixed Comment: The [http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTCOOKIEJAR libcurl documentation] says it attempts to write to the cookie jar on curl_easy_cleanup(), so it does not read or write to this file before. Fixed in r66785. -- Ticket URL: <http://trac.macports.org/ticket/24584#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts