[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] [Code Review] 4185: sorcery: Make ast_sorcery_is_object_field_registered handle f
From:       "George Joseph" <reviewboard () asterisk ! org>
Date:       2014-11-21 17:41:20
Message-ID: 20141121174120.3312.31696 () sonic ! digium ! api
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4185/
-----------------------------------------------------------

(Updated Nov. 21, 2014, 5:41 p.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers, Joshua Colp and Mark Michelson.


Changes
-------

Committed in revision 428543


Bugs: ASTERISK-24520
    https://issues.asterisk.org/jira/browse/ASTERISK-24520


Repository: Asterisk


Description
-------

As a result of https://reviewboard.asterisk.org/r/3305, res_sorcery_realtime was \
tossing database fields that didn't have an exact match to a sorcery registered \
field.  This broke the ability to use regexes as field names which manifested itself \
as a failure of res_pjsip_phoneprov_provider which uses this capability.  It also \
broke handling of fields that start with '@' in realtime but I don't think anyone \
noticed.

This patch does the following...
Modifies ast_sorcery_fields_register to pre-compile the name regex.
Modifies ast_sorcery_is_object_field_registered to test the regex if it exists \
instead of doing an exact strcmp. Modifies res_pjsip_phoneprov_provider with a few \
tweaks to get it to work with realtime.


Diffs
-----

  branches/12/tests/test_sorcery.c 428504 
  branches/12/res/res_pjsip_phoneprov_provider.c 428504 
  branches/12/main/sorcery.c 428504 

Diff: https://reviewboard.asterisk.org/r/4185/diff/


Testing
-------

Tested by me with realtime phoneprov, aor and registration objects both with and \
without registered objects. Testsuite testing in progress.  EDIT: complete.  No \
issues. Will also be tested by John Kiniston who reported the \
res_pjsip_phoneprov_provider issue.  EDIT: complete.


Thanks,

George Joseph


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/4185/">https://reviewboard.asterisk.org/r/4185/</a>
  </td>
    </tr>
   </table>
   <br />



<table bgcolor="#e0e0e0" width="100%" cellpadding="8" style="border: 1px gray \
solid;">  <tr>
  <td>
   <h1 style="margin-right: 0.2em; padding: 0; font-size: 10pt;">This change has been \
marked as submitted.</h1>  </td>
 </tr>
</table>
<br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Asterisk Developers, Joshua Colp and Mark Michelson.</div>
<div>By George Joseph.</div>


<p style="color: grey;"><i>Updated Nov. 21, 2014, 5:41 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Committed in revision 428543</pre>  </td>
 </tr>
</table>





<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-24520">ASTERISK-24520</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">As a result of https://reviewboard.asterisk.org/r/3305, \
res_sorcery_realtime was tossing database fields that didn&#39;t have an exact match \
to a sorcery registered field.  This broke the ability to use regexes as field names \
which manifested itself as a failure of res_pjsip_phoneprov_provider which uses this \
capability.  It also broke handling of fields that start with &#39;@&#39; in realtime \
but I don&#39;t think anyone noticed.

This patch does the following...
Modifies ast_sorcery_fields_register to pre-compile the name regex.
Modifies ast_sorcery_is_object_field_registered to test the regex if it exists \
instead of doing an exact strcmp. Modifies res_pjsip_phoneprov_provider with a few \
tweaks to get it to work with realtime.

</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Tested by me with realtime phoneprov, aor and registration objects both \
with and without registered objects. Testsuite testing in progress.  EDIT: complete.  \
No issues. Will also be tested by John Kiniston who reported the \
res_pjsip_phoneprov_provider issue.  EDIT: complete.

</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>branches/12/tests/test_sorcery.c <span style="color: grey">(428504)</span></li>

 <li>branches/12/res/res_pjsip_phoneprov_provider.c <span style="color: \
grey">(428504)</span></li>

 <li>branches/12/main/sorcery.c <span style="color: grey">(428504)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/4185/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>




  </div>
 </body>
</html>



-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic