When forwarding a metadata request through forward_request() we were
adding the required newline char to our buffer, but then sending the
data without it - this results in the forwarded request and the next one
to be garbled together.
Additionally while at it add a warning comment that request string is
not zero terminated anymore after a call to the forward_request()
function - for now this is ok as it is not used by any caller after this.
}
void forward_request(connection_t *from, char *request) {
+ /* Note: request is not zero terminated anymore after a call to this function! */
ifdebug(PROTOCOL) {
ifdebug(META)
logger(LOG_DEBUG, "Forwarding %s from %s (%s): %s",
}
int len = strlen(request);
- request[len] = '\n';
+ request[len++] = '\n';
broadcast_meta(from, request, len);
}