- /*
- * Add metainformation and then send the request to the root
- * multiplexer:
- */
- if(name.ss_family == AF_INET) {
- headappheader(req, "X-Ash-Address", inet_ntop(AF_INET, &((struct sockaddr_in *)&name)->sin_addr, nmbuf, sizeof(nmbuf)));
- headappheader(req, "X-Ash-Port", sprintf3("%i", ntohs(((struct sockaddr_in *)&name)->sin_port)));
- } else if(name.ss_family == AF_INET6) {
- headappheader(req, "X-Ash-Address", inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&name)->sin6_addr, nmbuf, sizeof(nmbuf)));
- headappheader(req, "X-Ash-Port", sprintf3("%i", ntohs(((struct sockaddr_in6 *)&name)->sin6_port)));
- }
- if((cfd = sendreq(plex, req)) < 0)
- goto out;
+ if((conn->initreq != NULL) && conn->initreq(conn, req))
+ break;
+
+ if(block(plex, EV_WRITE, 60) <= 0)
+ break;
+ if(socketpair(PF_UNIX, SOCK_STREAM, 0, pfds))
+ break;
+ if(sendreq(plex, req, pfds[0]))
+ break;
+ close(pfds[0]);
+ out = mtstdopen(pfds[1], 1, 600, "r+");