+ switch(type) {
+ case SPTPS_HANDSHAKE:
+ return sptps_send_record(&sptps, 0, cookie, sizeof(cookie));
+
+ case 0:
+ data = xrealloc(data, datalen + len + 1);
+ memcpy(data + datalen, msg, len);
+ datalen += len;
+ data[datalen] = 0;
+ break;
+
+ case 1:
+ return finalize_join();
+
+ case 2:
+ fprintf(stderr, "Invitation successfully accepted.\n");
+ shutdown(sock, SHUT_RDWR);
+ success = true;
+ break;
+
+ default:
+ return false;