rgw: send 100-continue response only if requested

This commit is contained in:
Yehuda Sadeh 2010-09-27 09:37:07 -07:00
parent da41f66fa8
commit 5a9a5e74df
5 changed files with 9 additions and 1 deletions

View File

@ -164,6 +164,7 @@ struct req_state {
const char *content_type;
bool err_exist;
struct rgw_err err;
bool expect_cont;
XMLArgs args;

View File

@ -275,7 +275,8 @@ int main(int argc, char *argv[])
abort_early(&s, ret);
continue;
}
dump_continue(&s);
if (s.expect_cont)
dump_continue(&s);
RGWOp *op = rgwhandler.get_op();
if (op) {

View File

@ -712,6 +712,7 @@ void RGWHandler::init_state(struct req_state *s, struct fcgx_state *fcgx)
s->acl = new RGWAccessControlPolicy;
}
s->canned_acl.clear();
s->expect_cont = false;
provider_init_state();
}

View File

@ -648,6 +648,9 @@ void RGWHandler_REST::provider_init_state()
s->copy_source = FCGX_GetParam("HTTP_X_AMZ_COPY_SOURCE", s->fcgx->envp);
s->http_auth = FCGX_GetParam("HTTP_AUTHORIZATION", s->fcgx->envp);
const char *expect = FCGX_GetParam("HTTP_EXPECT", s->fcgx->envp);
s->expect_cont = (expect && !strcasecmp(expect, "100-continue"));
}
static bool is_acl_op(struct req_state *s)

View File

@ -115,6 +115,8 @@ class RGWHandler_REST : public RGWHandler {
RGWOp *get_create_op(struct req_state *s);
RGWOp *get_delete_op(struct req_state *s);
bool expect100cont;
protected:
void provider_init_state();
public: