[asterisk-commits] mmichelson: branch mmichelson/issue14220 r169194 - /team/mmichelson/issue1422...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 17 16:22:08 CST 2009


Author: mmichelson
Date: Sat Jan 17 16:22:08 2009
New Revision: 169194

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=169194
Log:
Clarify some comments and add some Doxygen to the REQ_OFFSET
macro. I think that macro may need a better name...

Oh, and by the way, tests are going smoothly thus far


Modified:
    team/mmichelson/issue14220/channels/chan_sip.c

Modified: team/mmichelson/issue14220/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/team/mmichelson/issue14220/channels/chan_sip.c?view=diff&rev=169194&r1=169193&r2=169194
==============================================================================
--- team/mmichelson/issue14220/channels/chan_sip.c (original)
+++ team/mmichelson/issue14220/channels/chan_sip.c Sat Jan 17 16:22:08 2009
@@ -1187,8 +1187,8 @@
  * \endverbatim
  */
 struct sip_request {
-	ptrdiff_t rlPart1; 	        /*!< SIP Method Name or "SIP/2.0" protocol version */
-	ptrdiff_t rlPart2; 	        /*!< The Request URI or Response Status */
+	ptrdiff_t rlPart1; 	        /*!< Offset of the SIP Method Name or "SIP/2.0" protocol version */
+	ptrdiff_t rlPart2; 	        /*!< Offset of the Request URI or Response Status */
 	int len;                /*!< bytes used in data[], excluding trailing null terminator. Rarely used. */
 	int headers;            /*!< # of SIP Headers */
 	int method;             /*!< Method of this request */
@@ -1198,7 +1198,9 @@
 	char debug;		/*!< print extra debugging if non zero */
 	char has_to_tag;	/*!< non-zero if packet has To: tag */
 	char ignore;		/*!< if non-zero This is a re-transmit, ignore it */
+	/* Array of offsets into the request string of each SIP header*/
 	ptrdiff_t header[SIP_MAX_HEADERS];
+	/* Array of offsets into the request string of each SDP line*/
 	ptrdiff_t line[SIP_MAX_LINES];
 	struct ast_str *data;	
 	/* XXX Do we need to unref socket.ser when the request goes away? */
@@ -1206,6 +1208,13 @@
 	AST_LIST_ENTRY(sip_request) next;
 };
 
+/* \brief given a sip_request and an offset, return the char * that resides there
+ *
+ * It used to be that rlPart1, rlPart2, and the header and line arrays were character
+ * pointers. They are now offsets into the ast_str portion of the sip_request structure.
+ * To avoid adding a bunch of redundant pointer arithmetic to the code, this macro is
+ * provided to retrieve the string at a particular offset within the request's buffer
+ */
 #define REQ_OFFSET(req,offset) ((req)->data->str + (req)->offset)
 
 /*! \brief structure used in transfers */




More information about the asterisk-commits mailing list