substitute: Remove connection handling from fetch.
http-fetch does this, so just use that code instead. * guix/scripts/substitute.scm (fetch): Remove connection handling when the port is closed.
This commit is contained in:
		
							parent
							
								
									fbd61b5d3d
								
							
						
					
					
						commit
						08acee2f98
					
				
					 1 changed files with 4 additions and 8 deletions
				
			
		| 
						 | 
					@ -200,14 +200,10 @@ connection (typically PORT) is kept open once data has been fetched from URI."
 | 
				
			||||||
             (warning (G_ "while fetching ~a: server is somewhat slow~%")
 | 
					             (warning (G_ "while fetching ~a: server is somewhat slow~%")
 | 
				
			||||||
                      (uri->string uri))
 | 
					                      (uri->string uri))
 | 
				
			||||||
             (warning (G_ "try `--no-substitutes' if the problem persists~%")))
 | 
					             (warning (G_ "try `--no-substitutes' if the problem persists~%")))
 | 
				
			||||||
           (begin
 | 
					           (http-fetch uri #:text? #f #:port port
 | 
				
			||||||
             (when (or (not port) (port-closed? port))
 | 
					                       #:keep-alive? keep-alive?
 | 
				
			||||||
               (set! port (guix:open-connection-for-uri
 | 
					                       #:buffered? buffered?
 | 
				
			||||||
                           uri #:verify-certificate? #f)))
 | 
					                       #:verify-certificate? #f)))))
 | 
				
			||||||
             (http-fetch uri #:text? #f #:port port
 | 
					 | 
				
			||||||
                         #:keep-alive? keep-alive?
 | 
					 | 
				
			||||||
                         #:buffered? buffered?
 | 
					 | 
				
			||||||
                         #:verify-certificate? #f))))))
 | 
					 | 
				
			||||||
    (else
 | 
					    (else
 | 
				
			||||||
     (leave (G_ "unsupported substitute URI scheme: ~a~%")
 | 
					     (leave (G_ "unsupported substitute URI scheme: ~a~%")
 | 
				
			||||||
            (uri->string uri)))))
 | 
					            (uri->string uri)))))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue