- if (checksum == state->checksums[state->chunk_xnum][state->chunk_ynum]) {
- state->chunk_lindex = state->chunk_height;
- continue;
- } else {
- state->checksums[state->chunk_xnum][state->chunk_ynum] = checksum;
- }
- }
-/*
- outputf("RFB send: sending header");
-*/
- /* Send a header */
- hdr.msgtype = 0;
- state->chunk_lindex = 0;
- hdr.nrects = htons(1);
- hdr.xpos = htons(state->chunk_xpos);
- hdr.ypos = htons(state->chunk_ypos);
- hdr.width = htons(state->chunk_width);
- hdr.height= htons(state->chunk_height);
- hdr.enctype = htonl(0);
- lines_left = state->chunk_height;
-
- err = tcp_write(pcb, &hdr, sizeof(hdr), TCP_WRITE_FLAG_COPY);
-
- if (err != ERR_OK) {
- if (err != ERR_MEM)
- outputf("RFB: header send error %d", err);
-
- /* Crap. Reset chunk_height to 0 so that next time around,
- * we'll recalculate this chunk (not advance) and try to
- * send the header again.
- */
- state->chunk_height = 0;
- }
- }