From: Yehuda Sadeh Date: Tue, 26 Jul 2011 21:27:36 +0000 (-0700) Subject: rgw: modify print macro to log using default log api X-Git-Tag: v0.33~159 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=857f18e1bcfb5f140ed77de8175a6d15c9268104;p=ceph.git rgw: modify print macro to log using default log api so that different output fds being used are the same and the log would actually make sense --- diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 0ccddb0242d2..dfbecb13c87e 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -67,7 +67,15 @@ extern string rgw_root_bucket; int __ret = FCGX_FPrintF(state->fcgx->out, format, __VA_ARGS__); \ if (state->header_ended) \ state->bytes_sent += __ret; \ - printf(">" format, __VA_ARGS__); \ + int l = 32, n; \ + while (1) { \ + char __buf[l]; \ + n = snprintf(__buf, sizeof(__buf), format, __VA_ARGS__); \ + if (n != l) \ + RGW_LOG(0) << "--> " << __buf << dendl; \ + break; \ + l *= 2; \ + } \ } while (0) #define CGI_PutStr(state, buf, len) do { \ @@ -91,6 +99,7 @@ extern string rgw_root_bucket; #define ERR_INVALID_PART 2007 #define ERR_INVALID_PART_ORDER 2008 #define ERR_NO_SUCH_UPLOAD 2009 +#define ERR_REQUEST_TIMEOUT 2010 #define ERR_USER_SUSPENDED 2100 @@ -389,6 +398,7 @@ struct req_state { const char *method; const char *query; const char *length; + uint64_t content_length; const char *content_type; struct rgw_err err; bool expect_cont;