diff mbox series

channel_curl: Add HTTP 409 Conflict

Message ID 20200420084003.39995-1-christian.storm@siemens.com
State Accepted
Headers show
Series channel_curl: Add HTTP 409 Conflict | expand

Commit Message

Christian Storm April 20, 2020, 8:40 a.m. UTC
Introduce HTTP 409 Conflict to channel_map_http_code().
This is returned when the (POST) request has failed due to
a conflict with the current state of the target resource.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 corelib/channel_curl.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stefano Babic April 20, 2020, 9:27 a.m. UTC | #1
On 20.04.20 10:40, Christian Storm wrote:
> Introduce HTTP 409 Conflict to channel_map_http_code().
> This is returned when the (POST) request has failed due to
> a conflict with the current state of the target resource.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>  corelib/channel_curl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c
> index e150681..128f2ec 100644
> --- a/corelib/channel_curl.c
> +++ b/corelib/channel_curl.c
> @@ -268,6 +268,7 @@ channel_op_res_t channel_map_http_code(channel_t *this, long *http_response_code
>  	case 400: /* Bad Request, e.g., invalid parameters */
>  	case 406: /* Not acceptable. Accept header is not response compliant */
>  	case 443: /* Connection refused */
> +	case 409: /* Conflict */
>  		return CHANNEL_EBADMSG;
>  	case 404: /* Wrong URL */
>  		return CHANNEL_ENOTFOUND;
> 

Acked-by : Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c
index e150681..128f2ec 100644
--- a/corelib/channel_curl.c
+++ b/corelib/channel_curl.c
@@ -268,6 +268,7 @@  channel_op_res_t channel_map_http_code(channel_t *this, long *http_response_code
 	case 400: /* Bad Request, e.g., invalid parameters */
 	case 406: /* Not acceptable. Accept header is not response compliant */
 	case 443: /* Connection refused */
+	case 409: /* Conflict */
 		return CHANNEL_EBADMSG;
 	case 404: /* Wrong URL */
 		return CHANNEL_ENOTFOUND;