client.stop();
if (client.connect(RApache, 80)) {
The reuse of the client object is not a good idea. Use two different objects for the server functionality and the client functionality.
req_index is never reset, so I'd guess that on the second connection the buffer overruns.