~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/rgw/rgw_common.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
 
67
67
#define RGW_SUSPENDED_USER_AUID (uint64_t)-2
68
68
 
 
69
#define RGW_DEFAULT_MAX_BUCKETS 1000
 
70
 
69
71
#define CGI_PRINTF(state, format, ...) do { \
70
72
   int __ret = FCGX_FPrintF(state->fcgx->out, format, __VA_ARGS__); \
71
73
   if (state->header_ended) \
117
119
#define ERR_INVALID_UTF8         2017
118
120
#define ERR_UNPROCESSABLE_ENTITY 2018
119
121
#define ERR_TOO_LARGE            2019
 
122
#define ERR_TOO_MANY_BUCKETS     2020
 
123
#define ERR_INVALID_REQUEST      2021
120
124
#define ERR_USER_SUSPENDED       2100
121
125
#define ERR_INTERNAL_ERROR       2200
122
126
 
250
254
  void init(CephContext *cct, RGWEnv * env);
251
255
public:
252
256
  RGWConf() :
253
 
    should_log(1) {}
 
257
    enable_ops_log(1), enable_usage_log(1) {}
254
258
 
255
 
  int should_log;
 
259
  int enable_ops_log;
 
260
  int enable_usage_log;
256
261
};
257
262
 
258
263
enum http_op {
327
332
  map<string, RGWAccessKey> swift_keys;
328
333
  map<string, RGWSubUser> subusers;
329
334
  __u8 suspended;
 
335
  uint32_t max_buckets;
330
336
 
331
 
  RGWUserInfo() : auid(0), suspended(0) {}
 
337
  RGWUserInfo() : auid(0), suspended(0), max_buckets(RGW_DEFAULT_MAX_BUCKETS) {}
332
338
 
333
339
  void encode(bufferlist& bl) const {
334
 
     ENCODE_START(9, 9, bl);
 
340
     ENCODE_START(10, 9, bl);
335
341
     ::encode(auid, bl);
336
342
     string access_key;
337
343
     string secret_key;
360
366
     ::encode(subusers, bl);
361
367
     ::encode(suspended, bl);
362
368
     ::encode(swift_keys, bl);
 
369
     ::encode(max_buckets, bl);
363
370
     ENCODE_FINISH(bl);
364
371
  }
365
372
  void decode(bufferlist::iterator& bl) {
366
 
     DECODE_START_LEGACY_COMPAT_LEN_32(9, 9, 9, bl);
 
373
     DECODE_START_LEGACY_COMPAT_LEN_32(10, 9, 9, bl);
367
374
     if (struct_v >= 2) ::decode(auid, bl);
368
375
     else auid = CEPH_AUTH_UID_DEFAULT;
369
376
     string access_key;
397
404
    if (struct_v >= 8) {
398
405
      ::decode(swift_keys, bl);
399
406
    }
 
407
    if (struct_v >= 10) {
 
408
      ::decode(max_buckets, bl);
 
409
    } else {
 
410
      max_buckets = RGW_DEFAULT_MAX_BUCKETS;
 
411
    }
400
412
    DECODE_FINISH(bl);
401
413
  }
402
414
  void dump(Formatter *f) const;
543
555
   uint64_t bytes_sent; // bytes sent as a response, excluding header
544
556
   uint64_t bytes_received; // data received
545
557
   uint64_t obj_size;
546
 
   bool should_log;
 
558
   bool enable_ops_log;
 
559
   bool enable_usage_log;
547
560
   uint32_t perm_mask;
548
561
   utime_t header_time;
549
562