Ignore:
Timestamp:
May 1, 2007 12:25:01 PM (17 years ago)
Author:
bennylp
Message:

Ported PJLIB-UTIL and PJNATH to Symbian

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c

    r1031 r1239  
    244244 
    245245    /* Create pool and name */ 
    246     resv = pj_pool_zalloc(pool, sizeof(struct pj_dns_resolver)); 
     246    resv = PJ_POOL_ZALLOC_T(pool, struct pj_dns_resolver); 
    247247    resv->pool = pool; 
    248248    resv->udp_sock = PJ_INVALID_SOCKET; 
     
    338338        it = pj_hash_first(resolver->hquerybyid, &it_buf); 
    339339        while (it) { 
    340             pj_dns_async_query *q = pj_hash_this(resolver->hquerybyid, it); 
     340            pj_dns_async_query *q = (pj_dns_async_query *) 
     341                                    pj_hash_this(resolver->hquerybyid, it); 
    341342            pj_dns_async_query *cq; 
    342343            if (q->cb) 
     
    498499        pj_bzero(q, sizeof(*q)); 
    499500    } else { 
    500         q = pj_pool_zalloc(resolver->pool, sizeof(*q)); 
     501        q = PJ_POOL_ZALLOC_T(resolver->pool, pj_dns_async_query); 
    501502    } 
    502503 
     
    658659     */ 
    659660    hval = 0; 
    660     cache = pj_hash_get(resolver->hrescache, &key, sizeof(key), &hval); 
     661    cache = (struct cached_res *) pj_hash_get(resolver->hrescache, &key,  
     662                                              sizeof(key), &hval); 
    661663    if (cache) { 
    662664        /* We've found a cached entry. */ 
     
    703705 
    704706    /* Next, check if we have pending query on the same resource */ 
    705     q = pj_hash_get(resolver->hquerybyres, &key, sizeof(key), NULL); 
     707    q = (pj_dns_async_query *) pj_hash_get(resolver->hquerybyres, &key,  
     708                                           sizeof(key), NULL); 
    706709    if (q) { 
    707710        /* Yes, there's another pending query to the same key. 
     
    942945    /* If status is unsuccessful, clear the same entry from the cache */ 
    943946    if (status != PJ_SUCCESS) { 
    944         cache = pj_hash_get(resolver->hrescache, key, sizeof(*key), &hval); 
     947        cache = (struct cached_res *) pj_hash_get(resolver->hrescache, key,  
     948                                                  sizeof(*key), &hval); 
    945949        if (cache) 
    946950            pj_list_push_back(&resolver->res_free_nodes, cache); 
     
    977981    /* If TTL is zero, clear the same entry in the hash table */ 
    978982    if (ttl == 0) { 
    979         cache = pj_hash_get(resolver->hrescache, key, sizeof(*key), &hval); 
     983        cache = (struct cached_res *) pj_hash_get(resolver->hrescache, key,  
     984                                                  sizeof(*key), &hval); 
    980985        if (cache) 
    981986            pj_list_push_back(&resolver->res_free_nodes, cache); 
     
    985990 
    986991    /* Get a cache response entry */ 
    987     cache = pj_hash_get(resolver->hrescache, key, sizeof(*key), &hval); 
     992    cache = (struct cached_res *) pj_hash_get(resolver->hrescache, key,  
     993                                              sizeof(*key), &hval); 
    988994    if (cache == NULL) { 
    989995        if (!pj_list_empty(&resolver->res_free_nodes)) { 
     
    991997            pj_list_erase(cache); 
    992998        } else { 
    993             cache = pj_pool_zalloc(resolver->pool, sizeof(*cache)); 
     999            cache = PJ_POOL_ZALLOC_T(resolver->pool, struct cached_res); 
    9941000        } 
    9951001    } 
     
    10411047    PJ_UNUSED_ARG(timer_heap); 
    10421048 
    1043     q = entry->user_data; 
     1049    q = (pj_dns_async_query *) entry->user_data; 
    10441050    resolver = q->resolver; 
    10451051 
     
    11251131 
    11261132 
    1127     resolver = pj_ioqueue_get_user_data(key); 
     1133    resolver = (pj_dns_resolver *) pj_ioqueue_get_user_data(key); 
    11281134    pj_mutex_lock(resolver->mutex); 
    11291135 
     
    11881194 
    11891195    /* Find the query based on the transaction ID */ 
    1190     q = pj_hash_get(resolver->hquerybyid, &dns_pkt->hdr.id,  
     1196    q = (pj_dns_async_query*)  
     1197        pj_hash_get(resolver->hquerybyid, &dns_pkt->hdr.id, 
    11911198                    sizeof(dns_pkt->hdr.id), NULL); 
    11921199    if (!q) { 
     
    13721379        it = pj_hash_first(resolver->hrescache, &itbuf); 
    13731380        while (it) { 
    1374             struct cached_res *cache = pj_hash_this(resolver->hrescache, it); 
     1381            struct cached_res *cache; 
     1382            cache = (struct cached_res*)pj_hash_this(resolver->hrescache, it); 
    13751383            PJ_LOG(3,(resolver->name.ptr,  
    13761384                      "   Type %s: %s", 
     
    13901398        while (it) { 
    13911399            struct pj_dns_async_query *q; 
    1392             q = pj_hash_this(resolver->hquerybyid, it); 
     1400            q = (pj_dns_async_query*) pj_hash_this(resolver->hquerybyid, it); 
    13931401            PJ_LOG(3,(resolver->name.ptr,  
    13941402                      "   Type %s: %s", 
Note: See TracChangeset for help on using the changeset viewer.