Skip to content

Fix return value when p->peeked is true

Rick Parrish requested to merge Ree/js_socket_recv-fix into master

When p->peeked is true it's possible for the return value of js_socket_recv to be off-by-one.

This change moves the total += ret line before the MSG-WAITALL check, and then returns total instead of ret to ensure the peeked byte is accounted for in the return value.

Merge request reports