doctrine / couchdb-client

CouchDB Client library
MIT License
122 stars 68 forks source link

[Question] SSL Chunks #60

Closed wandersonwhcr closed 3 years ago

wandersonwhcr commented 8 years ago

Hi,

I'm using CouchDB through Nginx proxy pass and SSL. Using the method execute from Doctrine\CouchDB\View\Query, I receive Doctrine\CouchDB\HTTP\Response with a NULL body, because json_decode can't decode the body response content in Response constructor.

Checking the SocketClient and the do...while loop from request method, the second parameter to fread is $bytesLeft + 2 and that is appending a line break (vim ^M) at the end of the line content read from server. Besides that, after loop, there's a substr "choping off" 2 bytes from the end of the body content, removing the end json content. Chunk capture is breaking the json syntax and json_decode don't work correctly.

Why?


https://github.com/doctrine/couchdb-client/blob/c80f25002d83712209517793d3f5402edaefe68a/lib/Doctrine/CouchDB/HTTP/SocketClient.php#L276-L295


My Nginx proxy_buffering is off and my proxy_buffer have a value of 4k.

I just execute a curl from console with the same path from SocketClient and the response is a valid json syntax.

wandersonwhcr commented 3 years ago

Too old issue.