+int writerespb(struct bufio *out, struct hthead *resp)
+{
+ int i;
+
+ if(bioprintf(out, "%s %i %s\r\n", resp->ver, resp->code, resp->msg) < 0)
+ return(-1);
+ for(i = 0; i < resp->noheaders; i++) {
+ if(bioprintf(out, "%s: %s\r\n", resp->headers[i][0], resp->headers[i][1]) < 0)
+ return(-1);
+ }
+ return(0);
+}
+
+int sendreq2(int sock, struct hthead *req, int fd, int flags)