http: make http_get_file() external
This method will be used in an upcoming extension of git-remote-curl to download a single file over HTTP(S) by request. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
							parent
							
								
									1f6cf4508e
								
							
						
					
					
						commit
						c1d024b843
					
				
							
								
								
									
										4
									
								
								http.c
								
								
								
								
							
							
						
						
									
										4
									
								
								http.c
								
								
								
								
							|  | @ -1945,8 +1945,8 @@ int http_get_strbuf(const char *url, | ||||||
|  * If a previous interrupted download is detected (i.e. a previous temporary |  * If a previous interrupted download is detected (i.e. a previous temporary | ||||||
|  * file is still around) the download is resumed. |  * file is still around) the download is resumed. | ||||||
|  */ |  */ | ||||||
| static int http_get_file(const char *url, const char *filename, | int http_get_file(const char *url, const char *filename, | ||||||
| 			 struct http_get_options *options) | 		  struct http_get_options *options) | ||||||
| { | { | ||||||
| 	int ret; | 	int ret; | ||||||
| 	struct strbuf tmpfile = STRBUF_INIT; | 	struct strbuf tmpfile = STRBUF_INIT; | ||||||
|  |  | ||||||
							
								
								
									
										9
									
								
								http.h
								
								
								
								
							
							
						
						
									
										9
									
								
								http.h
								
								
								
								
							|  | @ -163,6 +163,15 @@ struct http_get_options { | ||||||
|  */ |  */ | ||||||
| int http_get_strbuf(const char *url, struct strbuf *result, struct http_get_options *options); | int http_get_strbuf(const char *url, struct strbuf *result, struct http_get_options *options); | ||||||
|  |  | ||||||
|  | /* | ||||||
|  |  * Downloads a URL and stores the result in the given file. | ||||||
|  |  * | ||||||
|  |  * If a previous interrupted download is detected (i.e. a previous temporary | ||||||
|  |  * file is still around) the download is resumed. | ||||||
|  |  */ | ||||||
|  | int http_get_file(const char *url, const char *filename, | ||||||
|  | 		  struct http_get_options *options); | ||||||
|  |  | ||||||
| int http_fetch_ref(const char *base, struct ref *ref); | int http_fetch_ref(const char *base, struct ref *ref); | ||||||
|  |  | ||||||
| /* Helpers for fetching packs */ | /* Helpers for fetching packs */ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Derrick Stolee
						Derrick Stolee