No subject
Wed Jan 27 21:05:54 CET 2016
be done in 2.1 version.
Is it possible to change in asynchronous mode in 1.11 version?
If not, is there a way to achieve asynchronous REST calls for the version o=
f opensips what we are using?
Also I see from documentation,
The following functions may also be called asynchronously:
* avp_db_query<http://www.opensips.org/html/docs/modules/2.1.x/avpops.h=
tml#id294986>
* rest_get<http://www.opensips.org/html/docs/modules/2.1.x/rest_client.=
html#id293741>
* rest_post<http://www.opensips.org/html/docs/modules/2.1.x/rest_client=
.html#id293886>
* exec<http://www.opensips.org/html/docs/modules/2.1.x/exec#id294052>
Can rest_put can also be called asynchronously if we use 2.1 version ?
Please clarify.
Regards,
Agalya
_______________________________________________
Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
--_000_b87dda888e6f43a5a6cf143481c27b6bCOPDCEX28cablecomcastco_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"Trebuchet MS \,sans-serif";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
tt
{mso-style-priority:99;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle23
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:920869609;
mso-list-template-ids:-1225891966;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:1.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:"Courier New";
mso-bidi-font-family:"Times New Roman";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:1.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:2.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:2.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:3.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:3.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:4.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:4.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1
{mso-list-id:1413894460;
mso-list-template-ids:2029389960;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level2
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:1.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level3
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:1.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:2.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level5
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:2.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level6
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:3.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:3.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level8
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:4.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level9
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:4.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=3D"white" lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"color:blue">Hi Bogdan/Liviu,<o:p></o:=
p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"><o:p> </o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">I have downloaded 2.1.4 v=
ersion if opensips and trying to use rest_put call in async mode.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"><o:p> </o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">I have added the necessar=
y code for rest_put () similar to rest_post() in rest_methods.c, rest_metho=
ds.h and rest_client.c
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">If I just call, rest_put =
from config file, without async it works fine. I could see rest_put() is ca=
lled and do the necessary steps.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"><o:p> </o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">And am trying to call asy=
nc from config file as,
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><b><span style=3D"color:blue"> async(rest_put(&=
quot;<a href=3D"http://***url***%20"><span style=3D"color:blue">http://***u=
rl***
</span></a>", "$fU,$tU,$ci ", "application/json", =
"$var(body)", "$var(ct)", "$var(rcode)"),resu=
me_put);<o:p></o:p></span></b></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Further debugging I got s=
ome info that I can share with you so that you can help me out easily.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Instead of calling <b>res=
t_put asynchronously</b> I have tried to call
<b>rest_post async</b> . I could able to see that HTTP request went out(fro=
m wireshark traces) and I got 4xx response for the same.<o:p></o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue"><o:p> </o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">With my code changes in p=
lace and when I call rest_put, am not seeing HTTP request sent out.<o:p></o=
:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Assuming <b>rest_put</b> =
only is not working, there should be some libcurl stuffs not handled proper=
ly in ‘<b>start_async_http_req</b>’ for ‘<b>REST_CLIENT_P=
UT</b>’ case.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"><o:p> </o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Am attaching the files. I=
t contains code for rest_put only. I have removed other code to reduce the =
file size. Can you please take a look guide me here.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Please let me know if you=
need more information on this.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"><o:p> </o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Regards,<br>
Agalya<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa=
n></p>
<div>
<div style=3D"border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in =
0in 0in">
<p class=3D"MsoNormal"><b><span style=3D"color:windowtext">From:</span></b>=
<span style=3D"color:windowtext"> users-bounces at lists.opensips.org [mailto:=
users-bounces at lists.opensips.org]
<b>On Behalf Of </b>Liviu Chircu<br>
<b>Sent:</b> Friday, August 05, 2016 4:47 AM<br>
<b>To:</b> users at lists.opensips.org<br>
<b>Subject:</b> Re: [OpenSIPS-Users] Asynchronous operation for REST querie=
s<o:p></o:p></span></p>
</div>
</div>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><tt><span style=3D"font-size:10.0pt">Hi Agalya,</spa=
n></tt><span style=3D"font-size:10.0pt;font-family:"Courier New""=
><br>
<br>
<tt>1.11 has no async support at core level. If you need that, you will hav=
e to use 2.1+</tt><br>
<br>
<tt>Async rest_put() is currently not implemented, but its logic would be f=
airly similar to the GET and POST counterparts.</tt></span><br>
<br>
<span style=3D"font-size:12.0pt"><o:p></o:p></span></p>
<pre>Liviu Chircu<o:p></o:p></pre>
<pre>OpenSIPS Developer<o:p></o:p></pre>
<pre><a href=3D"http://www.opensips-solutions.com">http://www.opensips-solu=
tions.com</a><o:p></o:p></pre>
<div>
<p class=3D"MsoNormal">On 04.08.2016 23:14, Ramachandran, Agalya (Contracto=
r) wrote:<o:p></o:p></p>
</div>
<blockquote style=3D"margin-top:5.0pt;margin-bottom:5.0pt">
<p class=3D"MsoNormal"><span style=3D"color:blue">Hi team,</span><o:p></o:p=
></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"> </span><o:p></o:p><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">We are using opensips1.11=
.3 version for our project.
</span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">I have a question here. R=
ight now we are using a REST API call from config file for our project requ=
irement and it is in synchronous mode currently.</span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">From the opensips documen=
t, I see asynchronous support at script level can be done in 2.1 version.</=
span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Is it possible to change =
in asynchronous mode in 1.11 version?</span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">If not, is there a way to=
achieve asynchronous REST calls for the version of opensips what we are us=
ing?
</span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"> </span><o:p></o:p><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Also I see from documenta=
tion,</span><o:p></o:p></p>
<p style=3D"margin:0in;margin-bottom:.0001pt;line-height:16.2pt;background:=
white"><span style=3D"font-size:10.0pt">The following functions may also be=
called asynchronously:</span><o:p></o:p></p>
<ul type=3D"disc">
<li class=3D"MsoNormal" style=3D"color:#666666;mso-margin-top-alt:auto;mso-=
margin-bottom-alt:auto;line-height:16.2pt;mso-list:l0 level1 lfo3;backgroun=
d:white">
<span style=3D"font-size:10.0pt;font-family:"Trebuchet MS \,sans-serif=
""><a href=3D"http://www.opensips.org/html/docs/modules/2.1.x/avpops.h=
tml#id294986"><b><span style=3D"color:#185662;text-decoration:none">avp_db_=
query</span></b></a></span><o:p></o:p></li><li class=3D"MsoNormal" style=3D=
"color:#666666;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-heig=
ht:16.2pt;mso-list:l0 level1 lfo3;background:white">
<span style=3D"font-size:10.0pt;font-family:"Trebuchet MS \,sans-serif=
""><a href=3D"http://www.opensips.org/html/docs/modules/2.1.x/rest_cli=
ent.html#id293741"><b><span style=3D"color:#185662;text-decoration:none">re=
st_get</span></b></a></span><o:p></o:p></li><li class=3D"MsoNormal" style=
=3D"color:#666666;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-h=
eight:16.2pt;mso-list:l0 level1 lfo3;background:white">
<span style=3D"font-size:10.0pt;font-family:"Trebuchet MS \,sans-serif=
""><a href=3D"http://www.opensips.org/html/docs/modules/2.1.x/rest_cli=
ent.html#id293886"><b><span style=3D"color:#185662;text-decoration:none">re=
st_post</span></b></a></span><o:p></o:p></li><li class=3D"MsoNormal" style=
=3D"color:#666666;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-h=
eight:16.2pt;mso-list:l0 level1 lfo3;background:white">
<span style=3D"font-size:10.0pt;font-family:"Trebuchet MS \,sans-serif=
""><a href=3D"http://www.opensips.org/html/docs/modules/2.1.x/exec#id2=
94052"><b><span style=3D"color:#185662;text-decoration:none">exec</span></b=
></a></span><o:p></o:p></li></ul>
<p class=3D"MsoNormal"><span style=3D"color:blue">Can rest_put can also be =
called asynchronously if we use 2.1 version ?
</span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Please clarify.</span><o:=
p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"> </span><o:p></o:p><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Regards,</span><o:p></o:p=
></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Agalya</span><o:p></o:p><=
/p>
<p class=3D"MsoNormal"><span style=3D"font-size:12.0pt;font-family:"Ti=
mes New Roman",serif"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Users mailing list<o:p></o:p></pre>
<pre><a href=3D"mailto:Users at lists.opensips.org">Users at lists.opensips.org</=
a><o:p></o:p></pre>
<pre><a href=3D"http://lists.opensips.org/cgi-bin/mailman/listinfo/users">h=
ttp://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></pre=
>
</blockquote>
<p class=3D"MsoNormal"><span style=3D"font-size:12.0pt;font-family:"Ti=
mes New Roman",serif"><o:p> </o:p></span></p>
</div>
</body>
</html>
--_000_b87dda888e6f43a5a6cf143481c27b6bCOPDCEX28cablecomcastco_--
--_006_b87dda888e6f43a5a6cf143481c27b6bCOPDCEX28cablecomcastco_
Content-Type: text/plain; name="rest_client.c"
Content-Description: rest_client.c
Content-Disposition: attachment; filename="rest_client.c"; size=12290;
creation-date="Mon, 15 Aug 2016 20:27:58 GMT";
modification-date="Tue, 16 Aug 2016 14:21:25 GMT"
Content-Transfer-Encoding: base64
LyoKICogQ29weXJpZ2h0IChDKSAyMDEzLTIwMTUgT3BlblNJUFMgU29sdXRpb25zCiAqCiAqIFRo
aXMgZmlsZSBpcyBwYXJ0IG9mIG9wZW5zaXBzLCBhIGZyZWUgU0lQIHNlcnZlci4KICoKICogb3Bl
bnNpcHMgaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1v
ZGlmeQogKiBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNl
bnNlIGFzIHB1Ymxpc2hlZCBieQogKiB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRo
ZXIgdmVyc2lvbiAyIG9mIHRoZSBMaWNlbnNlLCBvcgogKiAoYXQgeW91ciBvcHRpb24pIGFueSBs
YXRlciB2ZXJzaW9uCiAqCiAqIG9wZW5zaXBzIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRo
YXQgaXQgd2lsbCBiZSB1c2VmdWwsCiAqIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91
dCBldmVuIHRoZ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ICAgcmV0dXJuIGZpeHVwX3NwdmUocGFyYW0pOwogICAgICAgIGNhc2UgNDoKICAgICAgICBjYXNl
IDU6CiAgICAgICAgY2FzZSA2OgogICAgICAgICAgICAgICAgcmV0dXJuIGZpeHVwX3B2YXIocGFy
YW0pOwoKICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgTE1fRVJSKCJUb28gbWFueSBw
YXJhbWV0ZXJzIVxuIik7CiAgICAgICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgfQp9CgoK
LyoqKioqKioqKioqKioqKioqKioqKioqKioqKiogTW9kdWxlIGZ1bmN0aW9ucyAqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqLwoKCnN0YXRpYyBpbnQgd19yZXN0X3B1dChzdHJ1Y3Qgc2lw
X21zZyAqbXNnLCBjaGFyICpncF91cmwsIGNoYXIgKmdwX2JvZHksCiAgICAgICAgICAgICAgICAg
ICBjaGFyICpncF9jdHlwZSwgY2hhciAqYm9keV9wdiwgY2hhciAqY3R5cGVfcHYsIGNoYXIgKmNv
ZGVfcHYpCnsKICAgICAgICBzdHIgdXJsLCBib2R5LCBjdHlwZSA9IHsgTlVMTCwgMCB9OwoKICAg
ICAgICBpZiAoZml4dXBfZ2V0X3N2YWx1ZShtc2csIChncGFyYW1fcClncF91cmwsICZ1cmwpICE9
IDApIHsKICAgICAgICAgICAgICAgIExNX0VSUigiSW52YWxpZCBIVFRQIFVSTCBwc2V1ZG8gdmFy
aWFibGUhXG4iKTsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICB9CgogICAgICAg
IGlmIChmaXh1cF9nZXRfc3ZhbHVlKG1zZywgKGdwYXJhbV9wKWdwX2JvZHksICZib2R5KSAhPSAw
KSB7CiAgICAgICAgICAgICAgICBMTV9FUlIoIkludmFsaWQgSFRUUCBQT1NUIGJvZHkgcHNldWRv
IHZhcmlhYmxlIVxuIik7CiAgICAgICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAg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wgMCB9OwogICAgICAgIGludCByZWFkX2ZkOwoKICAgICAgICBpZiAoZml4dXBfZ2V0
X3N2YWx1ZShtc2csIChncGFyYW1fcClncF91cmwsICZ1cmwpICE9IDApIHsKICAgICAgICAgICAg
ICAgIExNX0VSUigiSW52YWxpZCBIVFRQIFVSTCBwc2V1ZG8gdmFyaWFibGUhXG4iKTsKICAgICAg
ICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICB9CgogICAgICAgIGlmIChmaXh1cF9nZXRfc3Zh
bHVlKG1zZywgKGdwYXJhbV9wKWdwX2JvZHksICZib2R5KSAhPSAwKSB7CiAgICAgICAgICAgICAg
ICBMTV9FUlIoIkludmFsaWQgSFRUUCBQT1NUIGJvZHkgcHNldWRvIHZhcmlhYmxlIVxuIik7CiAg
ICAgICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgfQoKICAgICAgICBpZiAoZ3BfY3R5cGUg
JiYgZml4dXBfZ2V0X3N2YWx1ZShtc2csIChncGFyYW1fcClncF9jdHlwZSwgJmN0eXBlKSAhPSAw
KSB7CiAgICAgICAgICAgICAgICBMTV9FUlIoIkludmFsaWQgSFRUUCBQT1NUIGNvbnRlbnQgdHlw
ZSBwc2V1ZG8gdmFyaWFibGUhXG4iKTsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAg
ICB9CgogICAgICAgIExNX0RCRygiYXN5bmMgcmVzdCBwdXQgJyUuKnMnICVwICVwICVwXG4iLCB1
cmwubGVuLCB1cmwucywgYm9keV9wdiwgY3R5cGVfcHYsIGNvZGVfcHYpOwoJIHBhcmFtID0gcGtn
X21hbGxvYyhzaXplb2YgKnBhcmFtKTsKICAgICAgICBpZiAoIXBhcmFtKSB7CiAgICAgICAgICAg
ICAgICBMTV9FUlIoIm5vIG1vcmUgc2htXG4iKTsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsK
ICAgICAgICB9CiAgICAgICAgbWVtc2V0KHBhcmFtLCAnXDAnLCBzaXplb2YgKnBhcmFtKTsKCiAg
ICAgICAgcmVhZF9mZCA9IHN0YXJ0X2FzeW5jX2h0dHBfcmVxKG1zZywgUkVTVF9DTElFTlRfUFVU
LCB1cmwucywgYm9keS5zLCBjdHlwZS5zLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICZwYXJhbS0+aGFuZGxlLCAmcGFyYW0tPmJvZHksIGN0eXBlX3B2ID8gJnBhcmFtLT5jdHlwZSA6
IE5VTEwpOwoKICAgICAgICAvKiBlcnJvciBvY2N1cnJlZDsgbm8gdHJhbnNmZXIgZG9uZSAqLwog
ICAgICAgIGlmIChyZWFkX2ZkID09IEFTWU5DX05PX0lPKSB7CiAgICAgICAgICAgICAgICAqcmVz
dW1lX3BhcmFtID0gTlVMTDsKICAgICAgICAgICAgICAgICpyZXN1bWVfZiA9IE5VTEw7CiAgICAg
ICAgICAgICAgICAvKiBrZWVwIGRlZmF1bHQgYXN5bmMgc3RhdHVzIG9mIE5PX0lPICovCiAgICAg
ICAgICAgICAgICByZXR1cm4gLTE7CgogICAgICAgIC8qIG5vIG5lZWQgZm9yIGFzeW5jIC0gdHJh
bnNmZXIgYWxyZWFkeSBjb21wbGV0ZWQhICovCiAgICAgICAgfSBlbHNlIGlmIChyZWFkX2ZkID09
IEFTWU5DX1NZTkMpIHsKICAgICAgICAgICAgICAgIHNldF9vdXRwdXRfcHZfcGFyYW1zKG1zZywg
JnBhcmFtLT5ib2R5LCAocHZfc3BlY19wKWJvZHlfcHYsCiAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwYXJhbS0+Y3R5cGUsIChwdl9zcGVj
X3ApY3R5cGVfcHYsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIHBhcmFtLT5oYW5kbGUsIChwdl9zcGVjX3ApY29kZV9wdik7CgogICAgICAg
ICAgICAgICAgcGtnX2ZyZWUocGFyYW0tPmJvZHkucyk7CiAgICAgICAgICAgICAgICBpZiAoY3R5
cGVfcHYgJiYgcGFyYW0tPmN0eXBlLnMpCiAgICAgICAgICAgICAgICAgICAgICAgIHBrZ19mcmVl
KHBhcmFtLT5jdHlwZS5zKTsKICAgICAgICAgICAgICAgIGN1cmxfZWFzeV9jbGVhbnVwKHBhcmFt
LT5oYW5kbGUpOwogICAgICAgICAgICAgICAgcGtnX2ZyZWUocGFyYW0pOwoKICAgICAgICAgICAg
ICAgIHJldHVybiBBU1lOQ19TWU5DOwogICAgICAgIH0KCiAgICAgICAgKnJlc3VtZV9mID0gcmVz
dW1lX2FzeW5jX2h0dHBfcmVxOwoKICAgICAgICBwYXJhbS0+bWV0aG9kID0gUkVTVF9DTElFTlRf
UFVUOwogICAgICAgIHBhcmFtLT5ib2R5X3B2ID0gKHB2X3NwZWNfcClib2R5X3B2OwogICAgICAg
IHBhcmFtLT5jdHlwZV9wdiA9IChwdl9zcGVjX3ApY3R5cGVfcHY7CgoJcGFyYW0tPmNvZGVfcHYg
PSAocHZfc3BlY19wKWNvZGVfcHY7CiAgICAgICAgKnJlc3VtZV9wYXJhbSA9IHBhcmFtOwogICAg
ICAgIC8qIGFzeW5jIHN0YXJ0ZWQgd2l0aCBzdWNjZXNzICovCiAgICAgICAgYXN5bmNfc3RhdHVz
ID0gcmVhZF9mZDsKCiAgICAgICAgcmV0dXJuIDE7Cn0KCgo=
--_006_b87dda888e6f43a5a6cf143481c27b6bCOPDCEX28cablecomcastco_
Content-Type: text/plain; name="rest_methods.c"
Content-Description: rest_methods.c
Content-Disposition: attachment; filename="rest_methods.c"; size=15158;
creation-date="Mon, 15 Aug 2016 20:27:57 GMT";
modification-date="Tue, 16 Aug 2016 14:19:38 GMT"
Content-Transfer-Encoding: base64
LyoKICogQ29weXJpZ2h0IChDKSAyMDEzIE9wZW5TSVBTIFNvbHV0aW9ucwogKgogKiBUaGlzIGZp
bGUgaXMgcGFydCBvZiBvcGVuc2lwcywgYSBmcmVlIFNJUCBzZXJ2Z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QgYm9keSBwdiB2YWx1ZSBmYWlsZWQhXG4iKTsKICAgICAgICAgICAgICAgIGdvdG8gY2xlYW51
cDsKICAgICAgICB9CgogICAgICAgIGlmIChyZXNfYm9keS5zKSB7CiAgICAgICAgICAgICAgICBw
a2dfZnJlZShyZXNfYm9keS5zKTsKICAgICAgICB9CgogICAgICAgIGlmIChjdHlwZV9wdikgewog
ICAgICAgICAgICAgICAgcHZfdmFsLnJzID0gc3Q7CgogICAgICAgICAgICAgICAgaWYgKHB2X3Nl
dF92YWx1ZShtc2csIGN0eXBlX3B2LCAwLCAmcHZfdmFsKSAhPSAwKSB7CiAgICAgICAgICAgICAg
ICAgICAgICAgIExNX0VSUigiU2V0IGNvbnRlbnQgdHlwZSBwdiB2YWx1ZSBmYWlsZWQhXG4iKTsK
ICAgICAgICAgICAgICAgICAgICAgICAgZ290byBjbGVhbnVwOwogICAgICAgICAgICAgICAgfQoK
ICAgICAgICAgICAgICAgIGlmIChzdC5zKQogICAgICAgICAgICAgICAgICAgICAgICBwa2dfZnJl
ZShzdC5zKTsKICAgICAgICB9CgogICAgICAgIGN1cmxfZWFzeV9jbGVhbnVwKGhhbmRsZSk7CiAg
ICAgICAgcmV0dXJuIDE7CgpjbGVhbnVwOgogICAgICAgIGNsZWFuX2hlYWRlcl9saXN0KGxpc3Qp
OwoJICBjdXJsX2Vhc3lfY2xlYW51cChoYW5kbGUpOwogICAgICAgIHJldHVybiAtMTsKfQo=
--_006_b87dda888e6f43a5a6cf143481c27b6bCOPDCEX28cablecomcastco_
Content-Type: text/plain; name="rest_methods.h"
Content-Description: rest_methods.h
Content-Disposition: attachment; filename="rest_methods.h"; size=2283;
creation-date="Mon, 15 Aug 2016 20:27:59 GMT";
modification-date="Mon, 15 Aug 2016 20:27:59 GMT"
Content-Transfer-Encoding: base64
LyoKICogQ29weXJpZ2h0IChDKSAyMDEzIE9wZW5TSVBTIFNvbHV0aW9ucwogKgogKiBUaGlzIGZp
bGUgaXMgcGFydCBvZiBvcG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iwgcHZfc3Bl
Y19wIGNvZGVfcHYpOwppbnQgcmVzdF9wb3N0X21ldGhvZChzdHJ1Y3Qgc2lwX21zZyAqbXNnLCBj
aGFyICp1cmwsIGNoYXIgKmJvZHksIGNoYXIgKmN0eXBlLAogICAgICAgICAgICAgICAgICAgICBw
dl9zcGVjX3AgYm9keV9wdiwgcHZfc3BlY19wIGN0eXBlX3B2LCBwdl9zcGVjX3AgY29kZV9wdik7
CmludCByZXN0X3B1dF9tZXRob2Qoc3RydWN0IHNpcF9tc2cgKm1zZywgY2hhciAqdXJsLCBjaGFy
ICpib2R5LCBjaGFyICpjdHlwZSwKICAgICAgICAgICAgICAgICAgICAgcHZfc3BlY19wIGJvZHlf
cHYsIHB2X3NwZWNfcCBjdHlwZV9wdiwgcHZfc3BlY19wIGNvZGVfcHYpOwoKaW50IHN0YXJ0X2Fz
eW5jX2h0dHBfcmVxKHN0cnVjdCBzaXBfbXNnICptc2csIGVudW0gcmVzdF9jbGllbnRfbWV0aG9k
IG1ldGhvZCwKCQkJCQkgICAgIGNoYXIgKnVybCwgY2hhciAqcmVxX2JvZHksIGNoYXIgKnJlcV9j
dHlwZSwKCQkJCQkgICAgIENVUkwgKipvdXRfaGFuZGxlLCBzdHIgKmJvZHksIHN0ciAqY3R5cGUp
OwplbnVtIGFzeW5jX3JldF9jb2RlIHJlc3VtZV9hc3luY19odHRwX3JlcShpbnQgZmQsIHN0cnVj
dCBzaXBfbXNnICptc2csIHZvaWQgKnBhcmFtKTsKCiNlbmRpZiAvKiBfUkVTVF9NRVRIT0RTXyAq
LwoK
--_006_b87dda888e6f43a5a6cf143481c27b6bCOPDCEX28cablecomcastco_--
More information about the Users
mailing list