Mercurial > hg > nginx
comparison src/event/ngx_event_openssl.c @ 2720:b3b8c66bd520
support attaching to an existent Win32 shared memory
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sat, 18 Apr 2009 19:27:28 +0000 |
parents | d5896f6608e8 |
children | d4a717592877 |
comparison
equal
deleted
inserted
replaced
2719:9237cf8b400b | 2720:b3b8c66bd520 |
---|---|
1419 if (data) { | 1419 if (data) { |
1420 shm_zone->data = data; | 1420 shm_zone->data = data; |
1421 return NGX_OK; | 1421 return NGX_OK; |
1422 } | 1422 } |
1423 | 1423 |
1424 if (shm_zone->shm.exists) { | |
1425 shm_zone->data = data; | |
1426 return NGX_OK; | |
1427 } | |
1428 | |
1424 shpool = (ngx_slab_pool_t *) shm_zone->shm.addr; | 1429 shpool = (ngx_slab_pool_t *) shm_zone->shm.addr; |
1425 | 1430 |
1426 cache = ngx_slab_alloc(shpool, sizeof(ngx_ssl_session_cache_t)); | 1431 cache = ngx_slab_alloc(shpool, sizeof(ngx_ssl_session_cache_t)); |
1427 if (cache == NULL) { | 1432 if (cache == NULL) { |
1428 return NGX_ERROR; | 1433 return NGX_ERROR; |
1429 } | 1434 } |
1430 | 1435 |
1436 shpool->data = cache; | |
1437 shm_zone->data = cache; | |
1438 | |
1431 ngx_rbtree_init(&cache->session_rbtree, &cache->sentinel, | 1439 ngx_rbtree_init(&cache->session_rbtree, &cache->sentinel, |
1432 ngx_ssl_session_rbtree_insert_value); | 1440 ngx_ssl_session_rbtree_insert_value); |
1433 | 1441 |
1434 ngx_queue_init(&cache->expire_queue); | 1442 ngx_queue_init(&cache->expire_queue); |
1435 | 1443 |
1440 return NGX_ERROR; | 1448 return NGX_ERROR; |
1441 } | 1449 } |
1442 | 1450 |
1443 ngx_sprintf(shpool->log_ctx, " in SSL session shared cache \"%V\"%Z", | 1451 ngx_sprintf(shpool->log_ctx, " in SSL session shared cache \"%V\"%Z", |
1444 &shm_zone->shm.name); | 1452 &shm_zone->shm.name); |
1445 | |
1446 shm_zone->data = cache; | |
1447 | 1453 |
1448 return NGX_OK; | 1454 return NGX_OK; |
1449 } | 1455 } |
1450 | 1456 |
1451 | 1457 |