Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kraken: rgw: Swift API: spurious newline after http body causes weird errors #13224

Merged
merged 1 commit into from Jun 20, 2017

Conversation

smithfarm
Copy link
Contributor

@smithfarm smithfarm self-assigned this Feb 1, 2017
@smithfarm smithfarm added this to the kraken milestone Feb 1, 2017
@smithfarm smithfarm changed the title kraken: radosgw swift: error messages: spurious newline after http body causes weird errors. kraken: rgw: Swift API: spurious newline after http body causes weird errors Feb 21, 2017
@smithfarm smithfarm requested a review from yehudasa April 12, 2017 10:54
@smithfarm
Copy link
Contributor Author

@yehudasa This passed an RGW suite at http://tracker.ceph.com/issues/19009#note-8

Please review/approve if you agree it can be merged.

@smithfarm
Copy link
Contributor Author

@yehudasa This PR passed another RGW suite at http://tracker.ceph.com/issues/19009#note-18

Waiting for review.

The current code emits a newline after swift errors, but fails
to account for it when it calculates 'content-length'.  This results in
some clients (go github.com/ncw/swift) producing complaints about the
unsolicited newline such as this,
	Unsolicited response received on idle HTTP channel starting with "\n"; err=<nil>

This logic eliminates the newline on flush.  This makes the content length
calculation correct and eliminates the stray newline.

There was already existing separator logic in the rgw plain formatter
that can emit a newline at the correct point.  It had been checking
"len" to decide if previous data had been emitted, but that's reset to 0
by flush().  So, this logic adds a new per-instance variable to separately
track state that it emitted a previous item (and should emit a newline).

Fixes: http://tracker.ceph.com/issues/18473
Signed-off-by: Marcus Watts <mwatts@redhat.com>
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 5f229d6)
@smithfarm
Copy link
Contributor Author

Could someone please review this PR.

@oritwas
Copy link
Member

oritwas commented Jun 20, 2017

jenkins test this please

1 similar comment
@cbodley
Copy link
Contributor

cbodley commented Jun 20, 2017

jenkins test this please

@smithfarm smithfarm merged commit 7706a38 into ceph:kraken Jun 20, 2017
@smithfarm smithfarm deleted the wip-18780-kraken branch June 20, 2017 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants