Re: [PATCH 5/5] http: don't hardcode the value of CURL_SOCKOPT_OK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:

> +/**
> + * CURL_SOCKOPT_OK was added in 7.21.5, released in April 2011.
> + */
> +#ifndef CURL_SOCKOPT_OK
> +#define CURL_SOCKOPT_OK 0
> +#endif
> +
>  /**
>   * CURLOPT_TCP_KEEPALIVE was added in 7.25.0, released in March 2012.
>   */
> diff --git a/http.c b/http.c
> index e38fcc34d64..c40439d39ce 100644
> --- a/http.c
> +++ b/http.c
> @@ -533,7 +533,7 @@ static int sockopt_callback(void *client, curl_socket_t fd, curlsocktype type)
>  	if (rc < 0)
>  		warning_errno("unable to set SO_KEEPALIVE on socket");
>  
> -	return 0; /* CURL_SOCKOPT_OK only exists since curl 7.21.5 */
> +	return CURL_SOCKOPT_OK;
>  }

This is much better than the one in the previous round where an
extra CPP macro with GIT_CURL_SOCKOPT_OK_AVAILABLE or some other
name was used to conditionally return 0 or CURL_SOCKOPT_OK.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux