Mercurial > hg > nginx
changeset 806:fc742aa760f3
axe src/core/ngx_unix_domain.*
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 24 Oct 2006 13:43:19 +0000 |
parents | 8ee450f30c25 |
children | 3095bf59059b |
files | auto/sources src/core/ngx_core.h src/core/ngx_unix_domain.c src/core/ngx_unix_domain.h |
diffstat | 4 files changed, 0 insertions(+), 113 deletions(-) [+] |
line wrap: on
line diff
--- a/auto/sources Tue Oct 24 13:22:59 2006 +0000 +++ b/auto/sources Tue Oct 24 13:43:19 2006 +0000 @@ -120,7 +120,6 @@ UNIX_INCS="$CORE_INCS $EVENT_INCS src/os/unix" UNIX_DEPS="$CORE_DEPS $EVENT_DEPS \ - src/core/ngx_unix_domain.h \ src/os/unix/ngx_time.h \ src/os/unix/ngx_types.h \ src/os/unix/ngx_errno.h \ @@ -149,7 +148,6 @@ UNIX_SRCS="$CORE_SRCS $EVENT_SRCS \ - src/core/ngx_unix_domain.c \ src/os/unix/ngx_time.c \ src/os/unix/ngx_errno.c \ src/os/unix/ngx_alloc.c \
--- a/src/core/ngx_core.h Tue Oct 24 13:22:59 2006 +0000 +++ b/src/core/ngx_core.h Tue Oct 24 13:43:19 2006 +0000 @@ -68,9 +68,6 @@ #include <ngx_event_openssl.h> #endif #include <ngx_inet.h> -#if (NGX_HAVE_UNIX_DOMAIN) -#include <ngx_unix_domain.h> -#endif #include <ngx_cycle.h> #include <ngx_process_cycle.h> #include <ngx_conf_file.h>
--- a/src/core/ngx_unix_domain.c Tue Oct 24 13:22:59 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ - -/* - * Copyright (C) Igor Sysoev - */ - - -#include <ngx_config.h> -#include <ngx_core.h> -#include <ngx_event.h> -#include <ngx_event_connect.h> - - -/* Solaris has predefined "#define sun 1" */ -#undef sun - - -ngx_peers_t * -ngx_unix_upstream_parse(ngx_conf_t *cf, ngx_unix_domain_upstream_t *u) -{ - size_t len; - ngx_uint_t i; - ngx_peers_t *peers; - struct sockaddr_un *sun; - - len = u->url.len - 5; - - if (u->uri_part) { - for (i = 5; i < u->url.len; i++) { - if (u->url.data[i] == ':') { - len = i - 5; - u->uri.len = u->url.len - 5 - len - 1; - u->uri.data = u->url.data + 5 + len + 1; - - break; - } - } - } - - if (len == 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "the unix domain socket \"%V\" has no path", - &u->name); - return NULL; - } - - if (len + 1 > sizeof(sun->sun_path)) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "the unix domain socket path \"%V\" is too long", - &u->name); - return NULL; - } - - /* MP: ngx_shared_palloc() */ - - peers = ngx_pcalloc(cf->pool, sizeof(ngx_peers_t)); - if (peers == NULL) { - return NULL; - } - - sun = ngx_pcalloc(cf->pool, sizeof(struct sockaddr_un)); - if (sun == NULL) { - return NULL; - } - - peers->number = 1; - - sun->sun_family = AF_UNIX; - (void) ngx_cpystrn((u_char *) sun->sun_path, u->url.data + 5, len + 1); - - peers->peer[0].sockaddr = (struct sockaddr *) sun; - peers->peer[0].socklen = sizeof(struct sockaddr_un); - - peers->peer[0].name.len = 5 + len; - peers->peer[0].name.data = u->url.data; - - peers->peer[0].uri_separator = ":"; - - return peers; -}
--- a/src/core/ngx_unix_domain.h Tue Oct 24 13:22:59 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ - -/* - * Copyright (C) Igor Sysoev - */ - - -#ifndef _NGX_UNIX_DOMAIN_H_INCLUDED_ -#define _NGX_UNIX_DOMAIN_H_INCLUDED_ - - -#include <ngx_config.h> -#include <ngx_core.h> - - -typedef struct { - ngx_str_t name; /* "schema:unix:path:/uri" */ - ngx_str_t url; /* "unix:path:/uri" */ - ngx_str_t uri; - - ngx_uint_t uri_part; /* unsigned uri_part:1; */ -} ngx_unix_domain_upstream_t; - - -ngx_peers_t *ngx_unix_upstream_parse(ngx_conf_t *cf, - ngx_unix_domain_upstream_t *u); - - -#endif /* _NGX_UNIX_DOMAIN_H_INCLUDED_ */ -