OUTPUT_BUF_SIZE
outbuf = malloc(OUTPUT_BUF_SIZE);
maxavail = OUTPUT_BUF_SIZE - 20;
maxavail = OUTPUT_BUF_SIZE - strlen(localname) - 2;