Changeset 130


Ignore:
Timestamp:
Feb 2, 2006 9:14:29 PM (18 years ago)
Author:
bennylp
Message:

Added more asserts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    r127 r130  
    975975    pj_status_t status; 
    976976 
    977     PJ_ASSERT_RETURN(tdata!=NULL && p_tsx!=NULL, PJ_EINVAL); 
     977    /* Validate arguments. */ 
     978    PJ_ASSERT_RETURN(tdata && tdata->msg && p_tsx, PJ_EINVAL); 
     979    PJ_ASSERT_RETURN(tdata->msg->type == PJSIP_REQUEST_MSG, 
     980                     PJSIP_ENOTREQUESTMSG); 
     981 
     982    /* Method MUST NOT be ACK! */ 
     983    PJ_ASSERT_RETURN(tdata->msg->line.req.method.id != PJSIP_ACK_METHOD, 
     984                     PJ_EINVALIDOP); 
    978985 
    979986    /* Keep shortcut */ 
     
    10981105    struct tsx_lock_data lck; 
    10991106 
    1100     PJ_ASSERT_RETURN(rdata!=NULL && p_tsx!=NULL, PJ_EINVAL); 
     1107    /* Validate arguments. */ 
     1108    PJ_ASSERT_RETURN(rdata && rdata->msg_info.msg && p_tsx, PJ_EINVAL); 
    11011109 
    11021110    /* Keep shortcut to message */ 
     
    11051113    /* Make sure this is a request message. */ 
    11061114    PJ_ASSERT_RETURN(msg->type == PJSIP_REQUEST_MSG, PJSIP_ENOTREQUESTMSG); 
     1115 
     1116    /* Make sure method is not ACK */ 
     1117    PJ_ASSERT_RETURN(msg->line.req.method.id != PJSIP_ACK_METHOD, 
     1118                     PJ_EINVALIDOP); 
    11071119 
    11081120    /* Make sure CSeq header is present. */ 
Note: See TracChangeset for help on using the changeset viewer.