char buf[SIZ];
char *serialized_vcard = NULL;
size_t total_len = 0;
- size_t bytes = 0;
- size_t thisblock = 0;
struct vCard *v;
int i;
char *key, *value;
}
}
- total_len = atoi(&buf[4]);
-
-
sprintf(buf, "OPNA %ld|%s", msgnum, partnum);
serv_puts(buf);
serv_gets(buf);
total_len = atoi(&buf[4]);
serialized_vcard = malloc(total_len + 1);
- while (bytes < total_len) {
- thisblock = 4000;
- if ((total_len - bytes) < thisblock) thisblock = total_len - bytes;
- sprintf(buf, "READ %d|%d", bytes, thisblock);
- serv_puts(buf);
- serv_gets(buf);
- if (buf[0] == '6') {
- thisblock = atoi(&buf[4]);
- serv_read(&serialized_vcard[bytes], thisblock);
- bytes += thisblock;
- }
- else {
- wprintf("Error: %s<BR>\n", &buf[4]);
- }
- }
+
+ read_server_binary(serialized_vcard, total_len);
serv_puts("CLOS");
serv_gets(buf);
vcard_free(v);
/* Display the form */
+ do_template("beginbox_nt");
wprintf("<FORM METHOD=\"POST\" ACTION=\"/submit_vcard\">\n");
wprintf("<H2><IMG ALIGN=CENTER SRC=\"/static/vcard.gif\">"
"Contact information for ");
urlescputs(return_to);
wprintf("\">\n");
- wprintf("<CENTER>\n");
- wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
- wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
- wprintf("</CENTER></FORM>\n");
-
-
+ wprintf("<CENTER>\n"
+ "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">"
+ " "
+ "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">"
+ "</CENTER></FORM>\n"
+ );
+
+ do_template("endbox");
wDumpContent(1);
}
if (!strcmp(bstr("return_to"), "/select_user_to_edit")) {
select_user_to_edit(NULL, NULL);
}
+ else if (!strcmp(bstr("return_to"), "/do_welcome")) {
+ do_welcome();
+ }
else {
readloop("readnew");
}