Project

General

Profile

Actions

Bug #10986

closed

RGW: wrong length is returned by RGWFormatter_Plain::get_len()

Added by Radoslaw Zarzynski about 9 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

When the formatted content has non-zero length, RGWFormatter_Plain::get_len() method returns its size minus 1 byte. It leads to wrong behaviour when the method is used to generate "Content-Length" HTTP header. Please refer to: https://github.com/ceph/ceph/blob/master/src/rgw/rgw_formats.cc#L153.

The behaviour could be seen with following patch applied: https://github.com/ceph/ceph/commit/9357a669ead149f264370af32556786563e377f6.

1. RGW via FCGI frontend: curl -i http://localhost:8080/swift/v1/cont -X GET -H "X-Auth-Token: $token"

HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Mon, 02 Mar 2015 11:36:48 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 4
Connection: keep-alive
Accept-Ranges: bytes

file

2. Swift: curl -H "X-Auth-Token: $token" -X GET -i http://localhost:9090/v1/AUTH_test/cont

HTTP/1.1 200 OK
Content-Length: 5
X-Container-Object-Count: 1
Accept-Ranges: bytes
X-Timestamp: 1424789735.12920
X-Container-Bytes-Used: 0
Content-Type: text/plain; charset=utf-8
X-Trans-Id: txb860f447f6054d10878f4-0054f44a5d
Date: Mon, 02 Mar 2015 11:32:45 GMT

file

Actions #1

Updated by Radoslaw Zarzynski about 9 years ago

I'm working on that.

Actions #2

Updated by Dmytro Yurchenko about 9 years ago

  • Assignee set to Radoslaw Zarzynski
Actions #4

Updated by Radoslaw Zarzynski about 9 years ago

  • Status changed from New to Fix Under Review
Actions #5

Updated by Casey Bodley about 4 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF