Ignore:
Timestamp:
Dec 28, 2016 3:40:07 AM (8 years ago)
Author:
nanang
Message:

Re #1900: More merged from trunk (r5512 mistakenly contains merged changes in third-party dir only).

Location:
pjproject/branches/projects/uwp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/uwp

  • pjproject/branches/projects/uwp/pjlib/src/pj/ssl_sock_common.c

    r4860 r5513  
    2020#include <pj/assert.h> 
    2121#include <pj/errno.h> 
     22#include <pj/pool.h> 
    2223#include <pj/string.h> 
    2324 
     
    4647    /* Security config */ 
    4748    param->proto = PJ_SSL_SOCK_PROTO_DEFAULT; 
     49} 
     50 
     51 
     52/* 
     53 * Duplicate SSL socket parameter. 
     54 */ 
     55PJ_DEF(void) pj_ssl_sock_param_copy( pj_pool_t *pool,  
     56                                     pj_ssl_sock_param *dst, 
     57                                     const pj_ssl_sock_param *src) 
     58{ 
     59    /* Init secure socket param */ 
     60    pj_memcpy(dst, src, sizeof(*dst)); 
     61    if (src->ciphers_num > 0) { 
     62        unsigned i; 
     63        dst->ciphers = (pj_ssl_cipher*) 
     64                        pj_pool_calloc(pool, src->ciphers_num,  
     65                                       sizeof(pj_ssl_cipher)); 
     66        for (i = 0; i < src->ciphers_num; ++i) 
     67            dst->ciphers[i] = src->ciphers[i]; 
     68    } 
     69 
     70    if (src->curves_num > 0) { 
     71        unsigned i; 
     72        dst->curves = (pj_ssl_curve *)pj_pool_calloc(pool, src->curves_num, 
     73                                                     sizeof(pj_ssl_curve)); 
     74        for (i = 0; i < src->curves_num; ++i) 
     75            dst->curves[i] = src->curves[i]; 
     76    } 
     77 
     78    if (src->server_name.slen) { 
     79        /* Server name must be null-terminated */ 
     80        pj_strdup_with_null(pool, &dst->server_name, &src->server_name); 
     81    } 
     82 
     83    if (src->sigalgs.slen) { 
     84        /* Sigalgs name must be null-terminated */ 
     85        pj_strdup_with_null(pool, &dst->sigalgs, &src->sigalgs); 
     86    } 
     87 
     88    if (src->entropy_path.slen) { 
     89        /* Path name must be null-terminated */ 
     90        pj_strdup_with_null(pool, &dst->entropy_path, &src->entropy_path); 
     91    } 
    4892} 
    4993 
Note: See TracChangeset for help on using the changeset viewer.