Changeset 5907 for pjproject


Ignore:
Timestamp:
Nov 7, 2018 4:34:01 AM (6 months ago)
Author:
ming
Message:

Fixed #2160: stuck issue in ioqueue when detaching UDP media transport

  • Fixed transport_udp so it won't call another read operation when being stopped.
  • Add robustness checks (assertion) in ioqueue recv, recvfrom, and accept to prevent the same op key being used twice.
Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c

    r5737 r5907  
    720720 
    721721    read_op = (struct read_operation*)op_key; 
     722    PJ_ASSERT_RETURN(read_op->op == PJ_IOQUEUE_OP_NONE, PJ_EPENDING); 
    722723    read_op->op = PJ_IOQUEUE_OP_NONE; 
    723724 
     
    793794 
    794795    read_op = (struct read_operation*)op_key; 
     796    PJ_ASSERT_RETURN(read_op->op == PJ_IOQUEUE_OP_NONE, PJ_EPENDING); 
    795797    read_op->op = PJ_IOQUEUE_OP_NONE; 
    796798 
     
    11281130 
    11291131    accept_op = (struct accept_operation*)op_key; 
     1132    PJ_ASSERT_RETURN(accept_op->op == PJ_IOQUEUE_OP_NONE, PJ_EPENDING); 
    11301133    accept_op->op = PJ_IOQUEUE_OP_NONE; 
    11311134 
  • pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c

    r5820 r5907  
    466466    PJ_UNUSED_ARG(op_key); 
    467467 
     468    if (-bytes_read == PJ_ECANCELLED) return; 
     469 
    468470    udp = (struct transport_udp*) pj_ioqueue_get_user_data(key); 
    469471 
     
    585587 
    586588    PJ_UNUSED_ARG(op_key); 
     589 
     590    if (-bytes_read == PJ_ECANCELLED) return; 
    587591 
    588592    udp = (struct transport_udp*) pj_ioqueue_get_user_data(key); 
Note: See TracChangeset for help on using the changeset viewer.