- switch (state->send_state) {
- case SST_IDLE:
- /* Nothing to do */
- if (state->update_requested) {
- outputf("RFB send: update requested");
- state->update_requested = 0;
- state->send_state = SST_NEEDS_UPDATE;
- } else {
- break;
- }
-
- /* potential FALL THROUGH */
-
- case SST_NEEDS_UPDATE:
- outputf("RFB send: sending header");
- /* Send a header */
- state->frame_bytes = fb->curmode.xres * fb->curmode.yres * fb->curmode.bytestride;
- hdr.msgtype = 0;
- hdr.nrects = htons(1);
- hdr.xpos = htons(0);
- hdr.ypos = htons(0);
- hdr.width = htons(fb->curmode.xres);
- hdr.height = htons(fb->curmode.yres);
- hdr.enctype = htonl(0);
- tcp_write(pcb, &hdr, sizeof(hdr), 0);
- tcp_output(pcb);