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

ACRA 4.7 RC1 PHP server POST empty. #310

Closed
asamaru7 opened this issue Oct 1, 2015 · 3 comments
Closed

ACRA 4.7 RC1 PHP server POST empty. #310

asamaru7 opened this issue Oct 1, 2015 · 3 comments

Comments

@asamaru7
Copy link

asamaru7 commented Oct 1, 2015

php server not received post data. php server is php-fpm. "Transfer-Encoding: chunked" not work.
when I remove this line. worked.

HttpRequest.java

urlConnection.setChunkedStreamingMode(0);
@william-ferguson-au
Copy link
Member

This appears to be a problem with servers running PHP version prior to 5.3.0

See http://stackoverflow.com/questions/15913844/setting-setchunkedstreamingmode-in-httpurlconnection-fails-to-deliver-data-to-se

I'm not sure I want to change that in the code. as it would mean that the client will cache the entire request until it is 100% sent.

@william-ferguson-au
Copy link
Member

If you want to change my mind you'll need to provide some good justification.

@asamaru7
Copy link
Author

@william-ferguson-au
i am sorry. I am not good at English.

I tested php version is PHP 5.5.2 and httpd-2.4.7. not prior to 5.3.0.

Tested mod_php with apache : OK
Tested mod_proxy_fcgi(php-fpm) with apache : Fail(Empty body).

This problem occurs when i use a proxy mode.

I changed HttpRequest.java. it's work;

// urlConnection.setChunkedStreamingMode(0);
urlConnection.setFixedLengthStreamingMode(content.getBytes("UTF-8").length);

ACRA know content length. therefore acra can use setFixedLengthStreamingMode.
How about this? Or how about giving ACRA the option to choose? for not support chunked mode(http servers).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants