rem: if(write(CLIENT_OUT, data, size) != size) { DEBUG0("Short write to client"); exit(1);
add: while(size > 0) { ssize_t wr = write(CLIENT_OUT, data, size); switch(wr) { case 0: DEBUG0("Short write to client"); exit(1); case -1: DEBUG0("Write to client failed"); exit(1); default: data += wr; size -= wr; }
context: void write_client(char* data, ssize_t size){  if(write(CLIENT_OUT, data, size) != size) {    DEBUG0("Short write to client");    exit(1);  }  bytes_client += size;}