- omalloc(bl);
- bl->fd = fd;
- bl->ev = ev;
- if(to > 0)
- bl->to = time(NULL) + to;
- bl->th = current;
- bl->n = blockers;
- if(blockers)
- blockers->p = bl;
- blockers = bl;
- rv = yield();
- if(bl->n)
- bl->n->p = bl->p;
- if(bl->p)
- bl->p->n = bl->n;
- if(bl == blockers)
- blockers = bl->n;
- return(rv);
-}
-
-static int listensock4(int port)
-{
- struct sockaddr_in name;
- int fd;
- int valbuf;
-
- memset(&name, 0, sizeof(name));
- name.sin_family = AF_INET;
- name.sin_port = htons(port);
- if((fd = socket(PF_INET, SOCK_STREAM, 0)) < 0)
- return(-1);
- valbuf = 1;
- setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &valbuf, sizeof(valbuf));
- if(bind(fd, (struct sockaddr *)&name, sizeof(name))) {
- close(fd);
- return(-1);
- }
- if(listen(fd, 16) < 0) {
- close(fd);
- return(-1);
- }
- return(fd);
-}
-
-static int listensock6(int port)
-{
- struct sockaddr_in6 name;
- int fd;
- int valbuf;
-
- memset(&name, 0, sizeof(name));
- name.sin6_family = AF_INET6;
- name.sin6_port = htons(port);
- if((fd = socket(PF_INET6, SOCK_STREAM, 0)) < 0)
- return(-1);
- valbuf = 1;
- setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &valbuf, sizeof(valbuf));
- if(bind(fd, (struct sockaddr *)&name, sizeof(name))) {
- close(fd);
- return(-1);
- }
- if(listen(fd, 16) < 0) {
- close(fd);
- return(-1);
+ i = 0;
+ while(i < req->noheaders) {
+ if(!strncasecmp(req->headers[i][0], "x-ash-", 6)) {
+ free(req->headers[i][0]);
+ free(req->headers[i][1]);
+ free(req->headers[i]);
+ memmove(req->headers + i, req->headers + i + 1, sizeof(*req->headers) * (--req->noheaders - i));
+ } else {
+ i++;
+ }