liminspace / django-mjml

The simplest way to use MJML in Django templates.
MIT License
263 stars 32 forks source link

Fix incomplete socket read #14

Closed cavanierc closed 6 years ago

cavanierc commented 6 years ago

The rendered MJML templates is sometimes truncated specially when the message is more than 60KB. The issue comes from the fact that a socket does not guaranteed to receive the whole message and may return partial message.

This PR received from the socket until the message is completed before processing. A length marker was added to the message from django-mjml to tcpserver which create a compatibility break.

cavanierc commented 6 years ago

Hello, did you look at my request? Thank you

liminspace commented 6 years ago

Yes, I've seen your request, but I'm busy at this time. I'll review and update django-mjml as soon as I can. Thank you.

liminspace commented 6 years ago

@cavanierc, hi, I've fixed this bug. Can you review my js code and check the solution? https://github.com/liminspace/django-mjml/commit/b09d627d815194b8caf285e2c0780ad8f096cab4 It is similar to your one but I wrote it in my own way :)

cavanierc commented 6 years ago

With PR #17, it's good for me.