Changeset 5953


Ignore:
Timestamp:
Mar 15, 2019 10:22:11 AM (6 years ago)
Author:
ming
Message:

Re #2160: Fixed assertion in pjlib test due to uninitialized ioqueue op keys.

Location:
pjproject/trunk/pjlib/src/pjlib-test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c

    r5170 r5953  
    281281        /* randomize outgoing buffer. */ 
    282282        pj_create_random_string(items[i].outgoing_buffer, buffer_size); 
     283 
     284        /* Init operation keys. */ 
     285        pj_ioqueue_op_key_init(&items[i].recv_op, sizeof(items[i].recv_op)); 
     286        pj_ioqueue_op_key_init(&items[i].send_op, sizeof(items[i].send_op)); 
    283287 
    284288        /* Create socket pair. */ 
  • pjproject/trunk/pjlib/src/pjlib-test/ioq_tcp.c

    r4550 r5953  
    143143    int pending_op = 0; 
    144144    pj_ioqueue_op_key_t read_op, write_op; 
     145 
     146    // Init operation keys. 
     147    pj_ioqueue_op_key_init(&read_op, sizeof(read_op)); 
     148    pj_ioqueue_op_key_init(&write_op, sizeof(write_op)); 
    145149 
    146150    // Start reading on the server side. 
     
    303307    } 
    304308 
     309    // Init operation key. 
     310    pj_ioqueue_op_key_init(&accept_op, sizeof(accept_op)); 
     311 
    305312    // Concurrency 
    306313    rc = pj_ioqueue_set_default_concurrency(ioque, allow_concur); 
  • pjproject/trunk/pjlib/src/pjlib-test/ioq_udp.c

    r5170 r5953  
    209209    pj_create_random_string(send_buf, bufsize); 
    210210 
     211    // Init operation keys. 
     212    pj_ioqueue_op_key_init(&read_op, sizeof(read_op)); 
     213    pj_ioqueue_op_key_init(&write_op, sizeof(write_op)); 
     214 
    211215    // Register reading from ioqueue. 
    212216    TRACE_("start recvfrom..."); 
     
    714718        } 
    715719        bytes = bufsize; 
     720        pj_ioqueue_op_key_init(&inactive_read_op[i], 
     721                               sizeof(inactive_read_op[i])); 
    716722        rc = pj_ioqueue_recv(keys[i], &inactive_read_op[i], recv_buf, &bytes, 0); 
    717723        if (rc != PJ_EPENDING) { 
     
    751757        // Randomize send buffer. 
    752758        pj_create_random_string(send_buf, bufsize); 
     759 
     760        // Init operation keys. 
     761        pj_ioqueue_op_key_init(&read_op, sizeof(read_op)); 
     762        pj_ioqueue_op_key_init(&write_op, sizeof(write_op)); 
    753763 
    754764        // Start reading on the server side. 
Note: See TracChangeset for help on using the changeset viewer.