Partial output was caused by failing to read the HTTP request. This patch reads the HTTP request into a temporary buffer before discarding it.
Signed-off-by: Jonathan Mzengeza jtmze87@gmail.com Index: vis.c =================================================================== --- vis.c (revision 1343) +++ vis.c (working copy) @@ -566,6 +566,7 @@ buffer_t *last_send = NULL; size_t ret; char* send_buffer = NULL; + char tmp[512];
while ( !is_aborted() ) {
@@ -579,6 +580,11 @@ send_buffer = current->dot_buffer; } else { send_buffer = current->json_buffer; + ret = read( thread_data->socket, tmp, sizeof( tmp )); + while ( ret == -1 ) { + ret = read( thread_data->socket, tmp, sizeof( tmp )); + usleep(250); + } }
ret = write( thread_data->socket, send_buffer, strlen( send_buffer ) );