From e8dc37e0e30dbbed532b7471516d1ba5e6e08f27 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Mon, 10 Dec 2007 22:36:09 +0100 Subject: Avoid redundant declaration of missing_target() Signed-off-by: Mike Hommey Signed-off-by: Junio C Hamano --- http.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'http.h') diff --git a/http.h b/http.h index fe1b0d153b..b9d6f4823d 100644 --- a/http.h +++ b/http.h @@ -82,4 +82,17 @@ extern int active_requests; extern char curl_errorstr[CURL_ERROR_SIZE]; +static inline int missing__target(int code, int result) +{ + return /* file:// URL -- do we ever use one??? */ + (result == CURLE_FILE_COULDNT_READ_FILE) || + /* http:// and https:// URL */ + (code == 404 && result == CURLE_HTTP_RETURNED_ERROR) || + /* ftp:// URL */ + (code == 550 && result == CURLE_FTP_COULDNT_RETR_FILE) + ; +} + +#define missing_target(a) missing__target((a)->http_code, (a)->curl_result) + #endif /* HTTP_H */ -- cgit v1.3-5-g9baa