Skip to content

Commit c8e821f

Browse files
committed
Fix. Use WEIRD_SERVER_REPLY by default in libcurl > 7.51.0.
1 parent baab7c5 commit c8e821f

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/lcerr_easy.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ ERR_ENTRY ( NOT_BUILT_IN )
88
ERR_ENTRY ( COULDNT_RESOLVE_PROXY )
99
ERR_ENTRY ( COULDNT_RESOLVE_HOST )
1010
ERR_ENTRY ( COULDNT_CONNECT )
11-
ERR_ENTRY ( FTP_WEIRD_SERVER_REPLY )
1211
#if LCURL_CURL_VER_GE(7,51,0)
1312
ERR_ENTRY ( WEIRD_SERVER_REPLY )
1413
#else

src/lcerror.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,15 @@ static const lcurl_const_t lcurl_error_codes[] = {
278278
#include "lcerr_easy.h"
279279
#undef ERR_ENTRY
280280

281+
/* libcurl rename CURLE_FTP_WEIRD_SERVER_REPLY to CURLE_WEIRD_SERVER_REPLY in version 7.51.0*/
282+
/* we can not have both codes in general because we have to be able convern error number to error name*/
283+
/* so we use newest name but add error code as alias.*/
284+
#if LCURL_CURL_VER_GE(7,51,0)
285+
{ "E_FTP_WEIRD_SERVER_REPLY", CURLE_FTP_WEIRD_SERVER_REPLY },
286+
#else
287+
{ "E_WEIRD_SERVER_REPLY", CURLE_WEIRD_SERVER_REPLY },
288+
#endif
289+
281290
#define ERR_ENTRY(N) { "E_MULTI_"#N, CURLM_##N },
282291
#include "lcerr_multi.h"
283292
#undef ERR_ENTRY

0 commit comments

Comments
 (0)