This loops seems weird. Why zero-terminate the HTTP response and then used zero-termination-seeking append, when you have the exact size to be appended? Also this would break if someone decided to copy this code into a generic handler for binary data.