Deleted Added
full compact
45a46,51
> /* Returns 1 if according to RFC2626 this response can have a body, 0 if it
> must not have a body. */
> static int expect_body(response_context_t *ctx)
> {
> if (ctx->head_req)
> return 0;
46a53,69
> /* 100 Continue and 101 Switching Protocols */
> if (ctx->sl.code >= 100 && ctx->sl.code < 200)
> return 0;
>
> /* 204 No Content */
> if (ctx->sl.code == 204)
> return 0;
>
> /* 205? */
>
> /* 304 Not Modified */
> if (ctx->sl.code == 304)
> return 0;
>
> return 1;
> }
>
240a264,272
> /* If this is a response to a HEAD request, or code == 1xx,204 or304
> then we don't receive a real body. */
> if (!expect_body(ctx)) {
> ctx->body = serf_bucket_simple_create(NULL, 0, NULL, NULL,
> bkt->allocator);
> ctx->state = STATE_BODY;
> break;
> }
>
264,267d295
<
< if (!v && (ctx->sl.code == 204 || ctx->sl.code == 304)) {
< ctx->state = STATE_DONE;
< }
283,286d310
< /* If we're a HEAD request, we don't receive a body. */
< if (ctx->head_req) {
< ctx->state = STATE_DONE;
< }