summaryrefslogtreecommitdiff
path: root/src/http/modules
diff options
context:
space:
mode:
authorNGINX team <nginx@nginx.org>2012-06-26 13:59:09 +0000
committerJon Kolb <jon@b0g.us>2012-06-26 13:59:09 +0000
commit71bb11df293f3584871a0f7a620f5aae36bf7b66 (patch)
treed148694406c1aa5b31d4262f891200d3bfea4e07 /src/http/modules
parent35bc6662c0ab8179a462a4d2d45589d982121a06 (diff)
downloadnginx-71bb11df293f3584871a0f7a620f5aae36bf7b66.tar.gz
Changes with nginx 1.3.2 26 Jun 2012v1.3.2
*) Change: the "single" parameter of the "keepalive" directive is now ignored. *) Change: SSL compression is now disabled when using all versions of OpenSSL, including ones prior to 1.0.0. *) Feature: it is now possible to use the "ip_hash" directive to balance IPv6 clients. *) Feature: the $status variable can now be used not only in the "log_format" directive. *) Bugfix: a segmentation fault might occur in a worker process on shutdown if the "resolver" directive was used. *) Bugfix: a segmentation fault might occur in a worker process if the ngx_http_mp4_module was used. *) Bugfix: in the ngx_http_mp4_module. *) Bugfix: a segmentation fault might occur in a worker process if conflicting wildcard server names were used. *) Bugfix: nginx might be terminated abnormally on a SIGBUS signal on ARM platform. *) Bugfix: an alert "sendmsg() failed (9: Bad file number)" on HP-UX while reconfiguration.
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_geo_module.c2
-rw-r--r--src/http/modules/ngx_http_log_module.c5
-rw-r--r--src/http/modules/ngx_http_mp4_module.c19
-rw-r--r--src/http/modules/ngx_http_upstream_ip_hash_module.c43
-rw-r--r--src/http/modules/ngx_http_upstream_keepalive_module.c33
-rw-r--r--src/http/modules/perl/nginx.pm2
6 files changed, 52 insertions, 52 deletions
diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c
index e792cdb66..189d8ed50 100644
--- a/src/http/modules/ngx_http_geo_module.c
+++ b/src/http/modules/ngx_http_geo_module.c
@@ -145,7 +145,7 @@ typedef struct {
u_char GEORNG[6];
u_char version;
u_char ptr_size;
- uint32_t endianess;
+ uint32_t endianness;
uint32_t crc32;
} ngx_http_geo_header_t;
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c
index b3c9a1126..edb145992 100644
--- a/src/http/modules/ngx_http_log_module.c
+++ b/src/http/modules/ngx_http_log_module.c
@@ -584,10 +584,7 @@ ngx_http_log_status(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
status = r->headers_out.status;
} else if (r->http_version == NGX_HTTP_VERSION_9) {
- *buf++ = '0';
- *buf++ = '0';
- *buf++ = '9';
- return buf;
+ status = 9;
} else {
status = 0;
diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c
index 2c8cfd171..d3be23420 100644
--- a/src/http/modules/ngx_http_mp4_module.c
+++ b/src/http/modules/ngx_http_mp4_module.c
@@ -1024,6 +1024,10 @@ ngx_http_mp4_read_moov_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
+ NGX_HTTP_MP4_MOOV_BUFFER_EXCESS * no_mdat;
}
+ if (ngx_http_mp4_read(mp4, (size_t) atom_data_size) != NGX_OK) {
+ return NGX_ERROR;
+ }
+
mp4->trak.elts = &mp4->traks;
mp4->trak.size = sizeof(ngx_http_mp4_trak_t);
mp4->trak.nalloc = 2;
@@ -1044,6 +1048,12 @@ ngx_http_mp4_read_moov_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
mp4->buffer_start = mp4->buffer_pos;
mp4->buffer_size = NGX_HTTP_MP4_MOOV_BUFFER_EXCESS;
+ if (mp4->buffer_start + mp4->buffer_size > mp4->buffer_end) {
+ mp4->buffer = NULL;
+ mp4->buffer_pos = NULL;
+ mp4->buffer_end = NULL;
+ }
+
} else {
/* skip atoms after moov atom */
mp4->offset = mp4->end;
@@ -2488,7 +2498,13 @@ found:
ngx_mp4_set_32value(entry->chunk, 1);
- if (trak->chunk_samples) {
+ if (trak->chunk_samples && next_chunk - trak->start_chunk == 2) {
+
+ /* last chunk in the entry */
+
+ ngx_mp4_set_32value(entry->samples, samples - trak->chunk_samples);
+
+ } else if (trak->chunk_samples) {
first = &trak->stsc_chunk_entry;
ngx_mp4_set_32value(first->chunk, 1);
@@ -2504,6 +2520,7 @@ found:
ngx_mp4_set_32value(entry->chunk, 2);
+ entries++;
atom_size += sizeof(ngx_mp4_stsc_entry_t);
}
diff --git a/src/http/modules/ngx_http_upstream_ip_hash_module.c b/src/http/modules/ngx_http_upstream_ip_hash_module.c
index 0eadc7d94..89ccc2b85 100644
--- a/src/http/modules/ngx_http_upstream_ip_hash_module.c
+++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c
@@ -16,7 +16,8 @@ typedef struct {
ngx_uint_t hash;
- u_char addr[3];
+ u_char addrlen;
+ u_char *addr;
u_char tries;
@@ -76,7 +77,10 @@ ngx_module_t ngx_http_upstream_ip_hash_module = {
};
-ngx_int_t
+static u_char ngx_http_upstream_ip_hash_pseudo_addr[3];
+
+
+static ngx_int_t
ngx_http_upstream_init_ip_hash(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
{
if (ngx_http_upstream_init_round_robin(cf, us) != NGX_OK) {
@@ -93,8 +97,10 @@ static ngx_int_t
ngx_http_upstream_init_ip_hash_peer(ngx_http_request_t *r,
ngx_http_upstream_srv_conf_t *us)
{
- u_char *p;
struct sockaddr_in *sin;
+#if (NGX_HAVE_INET6)
+ struct sockaddr_in6 *sin6;
+#endif
ngx_http_upstream_ip_hash_peer_data_t *iphp;
iphp = ngx_palloc(r->pool, sizeof(ngx_http_upstream_ip_hash_peer_data_t));
@@ -110,20 +116,25 @@ ngx_http_upstream_init_ip_hash_peer(ngx_http_request_t *r,
r->upstream->peer.get = ngx_http_upstream_get_ip_hash_peer;
- /* AF_INET only */
-
- if (r->connection->sockaddr->sa_family == AF_INET) {
+ switch (r->connection->sockaddr->sa_family) {
+ case AF_INET:
sin = (struct sockaddr_in *) r->connection->sockaddr;
- p = (u_char *) &sin->sin_addr.s_addr;
- iphp->addr[0] = p[0];
- iphp->addr[1] = p[1];
- iphp->addr[2] = p[2];
-
- } else {
- iphp->addr[0] = 0;
- iphp->addr[1] = 0;
- iphp->addr[2] = 0;
+ iphp->addr = (u_char *) &sin->sin_addr.s_addr;
+ iphp->addrlen = 3;
+ break;
+
+#if (NGX_HAVE_INET6)
+ case AF_INET6:
+ sin6 = (struct sockaddr_in6 *) r->connection->sockaddr;
+ iphp->addr = (u_char *) &sin6->sin6_addr.s6_addr;
+ iphp->addrlen = 16;
+ break;
+#endif
+
+ default:
+ iphp->addr = ngx_http_upstream_ip_hash_pseudo_addr;
+ iphp->addrlen = 3;
}
iphp->hash = 89;
@@ -163,7 +174,7 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data)
for ( ;; ) {
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < iphp->addrlen; i++) {
hash = (hash * 113 + iphp->addr[i]) % 6271;
}
diff --git a/src/http/modules/ngx_http_upstream_keepalive_module.c b/src/http/modules/ngx_http_upstream_keepalive_module.c
index 6fd9ac70a..d10e3d016 100644
--- a/src/http/modules/ngx_http_upstream_keepalive_module.c
+++ b/src/http/modules/ngx_http_upstream_keepalive_module.c
@@ -12,7 +12,6 @@
typedef struct {
ngx_uint_t max_cached;
- ngx_uint_t single; /* unsigned:1 */
ngx_queue_t cache;
ngx_queue_t free;
@@ -223,36 +222,11 @@ ngx_http_upstream_get_keepalive_peer(ngx_peer_connection_t *pc, void *data)
kp->failed = 0;
- /* single pool of cached connections */
-
- if (kp->conf->single && !ngx_queue_empty(&kp->conf->cache)) {
-
- q = ngx_queue_head(&kp->conf->cache);
-
- item = ngx_queue_data(q, ngx_http_upstream_keepalive_cache_t, queue);
- c = item->connection;
-
- ngx_queue_remove(q);
- ngx_queue_insert_head(&kp->conf->free, q);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get keepalive peer: using connection %p", c);
-
- c->idle = 0;
- c->log = pc->log;
- c->read->log = pc->log;
- c->write->log = pc->log;
- c->pool->log = pc->log;
-
- pc->connection = c;
- pc->cached = 1;
-
- return NGX_DONE;
- }
+ /* ask balancer */
rc = kp->original_get_peer(pc, kp->data);
- if (kp->conf->single || rc != NGX_OK) {
+ if (rc != NGX_OK) {
return rc;
}
@@ -552,7 +526,8 @@ ngx_http_upstream_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
for (i = 2; i < cf->args->nelts; i++) {
if (ngx_strcmp(value[i].data, "single") == 0) {
- kcf->single = 1;
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+ "the \"single\" parameter is deprecated");
continue;
}
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index b3f86a809..a71574b7b 100644
--- a/src/http/modules/perl/nginx.pm
+++ b/src/http/modules/perl/nginx.pm
@@ -50,7 +50,7 @@ our @EXPORT = qw(
HTTP_INSUFFICIENT_STORAGE
);
-our $VERSION = '1.3.1';
+our $VERSION = '1.3.2';
require XSLoader;
XSLoader::load('nginx', $VERSION);