<div dir="ltr">I tested but it fails somewhere else.<div>In the file ulinet.c at the function named "processDownloads" the command below fail:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><i>curl_multi_remove_handle(hInternet->handle, hInternet->ihandle[i].handle);</i></div></blockquote><i><br></i><div>Best regards</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-05-24 12:00 GMT+02:00 Fenoy Gerald <span dir="ltr"><<a href="mailto:gerald.fenoy@geolabs.fr" target="_blank">gerald.fenoy@geolabs.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry I have forgotten the ulinet.h part in the previous patch file, here it is.<br>
<br>
<br><br>
<br>
Gérald Fenoy<br>
<a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
<br>
> Le 24 mai 2017 à 11:56, Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>> a écrit :<br>
><br>
> François,<br>
> thanks for the feedbacks.<br>
><br>
> Strange, the id field should never take such kind of value.<br>
><br>
> You can find attached a patch that I would like to invite you to try on your platform to see if it fixes the issue. In case the issue is with the psInternet pointer itself, then it won’t solve anything.<br>
><br>
> I hope to hear back from you.<br>
><br>
> Best regards,<br>
><br>
> <cookie.patch><br>
><br>
> Gérald Fenoy<br>
> <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
><br>
>> Le 24 mai 2017 à 11:19, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
>><br>
>> Gerald,<br>
>><br>
>> I think the problem should be created by the function header_write_data in the file ulinet.c<br>
>><br>
>> In case of presence of "Set-Cookie" in the headers red, it stores the cookie identifier in CCookie it's done with :<br>
>> sprintf(CCookie[psInternet-><wbr>id],"%s",tmp);<br>
>><br>
>> And the CCookie variable is set like this :<br>
>> #define MAX_REQ 50<br>
>> static char CCookie[MAX_REQ][1024];<br>
>><br>
>><br>
>> I logged the value of psInternet->id and this value is random. For exemple I get :<br>
>> [DEBUG - ulinet] Variable psInternet->id: 1041416742<br>
>> And this value are not include between 0 and 50 and cause a segmentation fault.<br>
>><br>
>> Best regards<br>
>><br>
>> 2017-05-24 10:21 GMT+02:00 François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>>:<br>
>> Hello Gerald,<br>
>><br>
>> Thank you when I set the cookie it's work but it's not expected processing.<br>
>> Sorry for being not clear.<br>
>><br>
>> For exemple when I do the GET request with CURL it's working without set a cookie in the headers request:<br>
>> curl -v "http://<host>/crv/<key>/<wbr>doSomething?p1=ZH&p2=ZH&p3=3&<wbr>p4=46.6947&p5=-2.8564"<br>
>><br>
>> Here the log :<br>
>><br>
>> * About to connect() to <host> port 80 (#0)<br>
>><br>
>> * Trying xxx.xxx.xxx.xxx... connected<br>
>><br>
>> * Connected to <host> (xxx.xxx.xxx.xxx) port 80 (#0)<br>
>><br>
>>> GET /crv/<key>/doSomething?p1=ZH&<wbr>p2=ZH&p3=3&p4=46.6947&p5=-2.<wbr>8564 HTTP/1.1<br>
>><br>
>>> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2<br>
>><br>
>>> Host: <host><br>
>><br>
>>> Accept: */*<br>
>><br>
>>><br>
>><br>
>> < HTTP/1.1 200 OK<br>
>><br>
>> < Server: nginx<br>
>><br>
>> < Date: Wed, 24 May 2017 07:53:24 GMT<br>
>><br>
>> < Content-Type: text/html; charset=utf-8<br>
>><br>
>> < Vary: Accept-Encoding<br>
>><br>
>> < Set-Cookie: route=<wbr>abe6a29b89be7b9be8f1bf07ea11b8<wbr>63; Path=/<br>
>><br>
>> < X-Powered-By: Express<br>
>><br>
>> < Content-Length: 29<br>
>><br>
>> < X-Cache: xxxxxxxx<br>
>><br>
>> < X-Cache-Lookup: xxxxxxxxx<br>
>><br>
>> < Connection: keep-alive<br>
>><br>
>> <<br>
>><br>
>> * Connection #0 to host <host> left intact<br>
>><br>
>> * Closing connection #0<br>
>><br>
>><br>
>><br>
>> The cookie is set in the response header and the first time I request the service, no cookies are set. So in the JS file I have just to do that : ZOO.Request.Get(url, params)<br>
>><br>
>> But it's fails due to an segmentation fault when the ulinet set the response header at line "Set-Cookie: "<br>
>><br>
>> I add log in the ulinet programs for show this :<br>
>><br>
>> * About to connect() to <host> port 80 (#0)<br>
>><br>
>> * Trying xxx.xxx.xxx.xxx... connected<br>
>><br>
>> * Connected to <host> (xxx.xxx.xxx.xxx) port 80 (#0)<br>
>><br>
>>> GET /crv/<key>/doSomething?p1=ZH&<wbr>p2=ZH&p3=3&p4=46.6947&p5=-2.<wbr>8564 HTTP/1.1<br>
>><br>
>> User-Agent: ZooWPSClient<br>
>><br>
>> Host: <host><br>
>><br>
>> Accept: */*<br>
>><br>
>><br>
>><br>
>> < HTTP/1.1 200 OK<br>
>><br>
>> [DEBUG - ulinet] In function header_write_data<br>
>><br>
>> < Server: nginx<br>
>><br>
>> [DEBUG - ulinet] In function header_write_data<br>
>><br>
>> < Date: Wed, 24 May 2017 08:09:39 GMT<br>
>><br>
>> [DEBUG - ulinet] In function header_write_data<br>
>><br>
>> < Content-Type: text/html; charset=utf-8<br>
>><br>
>> [DEBUG - ulinet] In function header_write_data<br>
>><br>
>> < Vary: Accept-Encoding<br>
>><br>
>> [DEBUG - ulinet] In function header_write_data<br>
>><br>
>> * Added cookie route="<wbr>abe6a29b89be7b9be8f1bf07ea11b8<wbr>63" for domain <host>, path /, expire 0<br>
>><br>
>> < Set-Cookie: route=<wbr>abe6a29b89be7b9be8f1bf07ea11b8<wbr>63; Path=/<br>
>><br>
>> [DEBUG - ulinet] In function header_write_data<br>
>><br>
>> [DEBUG - ulinet] Variable tmp: route=<wbr>abe6a29b89be7b9be8f1bf07ea11b8<wbr>63<br>
>><br>
>> [DEBUG - ulinet] the line before sprintf(CCookie[psInternet-><wbr>id],"",tmp);<br>
>><br>
>><br>
>> I hope it's help you for understand the issue.<br>
>><br>
>> Best regards<br>
>><br>
>> 2017-05-23 14:01 GMT+02:00 Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>>:<br>
>> François,<br>
>> you should try using the revision 828.<br>
>><br>
>> You should consider using the new version of ZOO-API.js it contains.<br>
>><br>
>> There were no support for passing any headers to GET request from the js ZOO-API.<br>
>><br>
>> I have modified the ZOO-API to enable this support.<br>
>><br>
>> Still, note that defining conf["lenv"]["cookie"] is required only for services that are supposed to produce a session environment and a linked Cookie is generated and returned to the client application. So it is not the way to pass headers to your requests from the js ZOO-API.<br>
>><br>
>> You can use the following syntaxe from your js code:<br>
>><br>
>> var i=ZOO.Request.Get("<a href="http://www.gogle.com/" rel="noreferrer" target="_blank">http://www.<wbr>gogle.com/</a>",{"toto":"toto"},{"<wbr>Cookie": "XXX=XXXXXXXX01"});<br>
>><br>
>> or<br>
>><br>
>> var i=ZOO.Request.Get("<a href="http://www.gogle.com/" rel="noreferrer" target="_blank">http://www.<wbr>gogle.com/</a>",{"toto":"toto"},["<wbr>Cookie: XXX=XXXXXXXX01;"]);<br>
>><br>
>> I hope it helps.<br>
>><br>
>> Gérald Fenoy<br>
>> <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
>><br>
>>> Le 23 mai 2017 à 10:39, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
>>><br>
>>> Hello,<br>
>>><br>
>>> Thank you. I tested this revision but it fails. I have a segmentation error.<br>
>>> The line where the program fail is 97 :<br>
>>> sprintf(CCookie[psInternet-><wbr>id],"%s",tmp);<br>
>>> The value in the tmp variable is correct.<br>
>>><br>
>>> Maybe I do wrong when I declare the cookie in the JS file.<br>
>>> In the JS file I add this line :<br>
>>> conf["lenv"]["cookie"]="XXX=<wbr>XXX1000000; path=/";<br>
>>><br>
>>> and after that I do the ZOO.Request.Get<br>
>>><br>
>>><br>
>>><br>
>>> Also in the ulinet.h, the prototype was not change to :<br>
>>><br>
>>><br>
>>> bool setProxiesForProtcol(CURL*,<wbr>const char*);<br>
>>><br>
>>><br>
>>><br>
>>> Best regards<br>
>>><br>
>>><br>
>>> 2017-05-22 21:33 GMT+02:00 Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>>:<br>
>>> Thanks for your feedback.<br>
>>><br>
>>> The previous ulinet.c version was containing an error. Please can you give revision 827 a try ?<br>
>>><br>
>>> I suppose it will solve your issue.<br>
>>><br>
>>> Best regards,<br>
>>><br>
>>><br>
>>> Gérald Fenoy<br>
>>> <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
>>><br>
>>>> Le 22 mai 2017 à 17:36, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
>>>><br>
>>>> Thank you for your presicions.<br>
>>>><br>
>>>> I have noticed an issue in the file ulinet.c of 825 revision :<br>
>>>> The env variable is undeclared in the function header_write_data but use in line 96.<br>
>>>> For test I set : char env[256]<br>
>>>> I don't know if it's the right correction but I when I do GET request on web service who send cookies to the client the ZOORequest failed.<br>
>>>><br>
>>>> 2017-05-22 14:56 GMT+02:00 Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>>:<br>
>>>> François,<br>
>>>> sorry for being not clear.<br>
>>>><br>
>>>> In the file ZOOMakefile.opts (generated by the configure script, so you may also edit <a href="http://ZOOMakefile.opts.in" rel="noreferrer" target="_blank">ZOOMakefile.opts.in</a> in case you run the ./configure command again) you should add to you CFLAGS definition the following option: -DMSG_LAF_VERBOSE. Then remove any ulinet.o already built and run make again.<br>
>>>><br>
>>>> I hope it helps.<br>
>>>><br>
>>>> Best regards,<br>
>>>><br>
>>>> Gérald Fenoy<br>
>>>> <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
>>>><br>
>>>>> Le 22 mai 2017 à 14:52, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
>>>>><br>
>>>>> Hello,<br>
>>>>><br>
>>>>> Thank you.<br>
>>>>> I tested to add MSG_LAF_VERBOSE= -DMSG_LAF_VERBOSE in the zoo-kernel Makefile but it's not working.<br>
>>>>><br>
>>>>> In the main.cfg I put this in the main section:<br>
>>>>> logPath = /var/log/zoo/out.log<br>
>>>>> But nothing is log when I use the ZOO.Request.Get in the script hello.js :<br>
>>>>> ./zoo_loader.cgi "Request=Execute&service=WPS&<wbr>Identifier=hellojs&version=1.<wbr>0.0&DataInputs=S=test"<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> Best regards<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> 2017-05-22 10:21 GMT+02:00 Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>>:<br>
>>>>> Hello François,<br>
>>>>> sorry for late reply.<br>
>>>>><br>
>>>>> In case you want to debug the CURL call used for every internal HTTP request and the one coming from the JS ZOO-API call, then you can define the MSG_LAF_VERBOSE variable at compilation time to produce a debug version. Once you have added the -DMSG_LAF_VERBOSE in your Makefile, simply remove the ulinet.o and run the make command again.<br>
>>>>><br>
>>>>> In case you need only to debug the result returned by the ZOO-API call, then you can simply use the alert function from the ZOO-API to display debug messages in your web server error log file. In case you want to handle exception you can then use basic try / catch blocks.<br>
>>>>><br>
>>>>> I hope it helps.<br>
>>>>><br>
>>>>> ps: I have noticed that the discussion is not available to the public, you may think of answering this email using the ZOO-Discuss mailing list. What you are asking may be of interest to other also.<br>
>>>>><br>
>>>>> Gérald Fenoy<br>
>>>>> <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
>>>>><br>
>>>>>> Le 20 mai 2017 à 19:26, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
>>>>>><br>
>>>>>> Hello Gerald,<br>
>>>>>><br>
>>>>>> Thanks a lot for your help. Now it's work perfectly with the new revision.<br>
>>>>>> I think I had an old revision.<br>
>>>>>><br>
>>>>>> Another question, how can I get log from the ZOORequest and handle exceptions ?<br>
>>>>>><br>
>>>>>> Best regards,<br>
>>>>>><br>
>>>>>> Dodé François<br>
>>>>>><br>
>>>>>> 2017-05-17 14:55 GMT+02:00 Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>>:<br>
>>>>>> Hello François,<br>
>>>>>> thanks for the feedbacks about this issue.<br>
>>>>>><br>
>>>>>> May I ask you to build a new ZOO-Kernel using the revision 825 [1] ? This version should solve this issue.<br>
>>>>>><br>
>>>>>> I hope to hear back from you.<br>
>>>>>><br>
>>>>>> Best regards,<br>
>>>>>><br>
>>>>>> [1] <a href="http://www.zoo-project.org/trac/changeset/825" rel="noreferrer" target="_blank">http://www.zoo-project.org/<wbr>trac/changeset/825</a><br>
>>>>>><br>
>>>>>>> Le 17 mai 2017 à 10:25, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
>>>>>>><br>
>>>>>>> Hello Gerald,<br>
>>>>>>><br>
>>>>>>> Thank you for your quick response.<br>
>>>>>>> Maybe it's my install of mozjs. I run the ZOO on CentOs 6 and I had to build this library.<br>
>>>>>>> Here is the library :<br>
>>>>>>> <a href="http://ftp.mozilla.org/pub/js/js185-1.0.0.tar.gz" rel="noreferrer" target="_blank">http://ftp.mozilla.org/pub/js/<wbr>js185-1.0.0.tar.gz</a><br>
>>>>>>><br>
>>>>>>> I add the request GET in the script hello.js.<br>
>>>>>>> My Javascript process call the ZOO.Request.Get like this :<br>
>>>>>>> ZOO.Request.Get("<a href="http://www.google.fr/" rel="noreferrer" target="_blank">http://www.<wbr>google.fr/</a>")<br>
>>>>>>> I put the result in the alert() function.<br>
>>>>>>><br>
>>>>>>> Best regards,<br>
>>>>>>><br>
>>>>>>> Dodé François<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> 2017-05-12 19:42 GMT+02:00 Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>>:<br>
>>>>>>> Hello François,<br>
>>>>>>> ZOORequest shall be defined at runtime by the ZOO-Kernel [1].<br>
>>>>>>><br>
>>>>>>> Are you sure the issue comes from call to ZOO.Request.Get ?<br>
>>>>>>><br>
>>>>>>> Can you please provide more details about your JavScript service ?<br>
>>>>>>><br>
>>>>>>> Best regards,<br>
>>>>>>><br>
>>>>>>> [1] <a href="http://www.zoo-project.org/trac/browser/trunk/zoo-project/zoo-kernel/service_internal_js.c#L152" rel="noreferrer" target="_blank">http://www.zoo-project.org/<wbr>trac/browser/trunk/zoo-<wbr>project/zoo-kernel/service_<wbr>internal_js.c#L152</a><br>
>>>>>>><br>
>>>>>>>> Le 12 mai 2017 à 16:06, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
>>>>>>>><br>
>>>>>>>> Hello,<br>
>>>>>>>><br>
>>>>>>>> I want to make a GET request with the ZOO-api but I have the following error :<br>
>>>>>>>> <ows:Exception exceptionCode="InternalError"><br>
>>>>>>>> <ows:ExceptionText>ZOO Kernel failed to process your request, receiving signal 11 = SIGSEGV</ows:ExceptionText><br>
>>>>>>>> </ows:Exception><br>
>>>>>>>><br>
>>>>>>>> In the ZOO-api.js in the function ZOO.Request.Get(url, params) it returns a class named ZOORequest but this class doesn't exist.<br>
>>>>>>>><br>
>>>>>>>> Have you a solution ?<br>
>>>>>>>><br>
>>>>>>>> Best regards<br>
>>>>>>>> ______________________________<wbr>_________________<br>
>>>>>>>> Zoo-discuss mailing list<br>
>>>>>>>> <a href="mailto:Zoo-discuss@lists.osgeo.org">Zoo-discuss@lists.osgeo.org</a><br>
>>>>>>>> <a href="https://lists.osgeo.org/mailman/listinfo/zoo-discuss" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/zoo-discuss</a><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> Gérald Fenoy<br>
>>>>>>> <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
>>>>>>><br>
>>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>> Gérald Fenoy<br>
>>>>>> <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
>>>>>><br>
>>>>>><br>
>>>>><br>
>>>>><br>
>>>>> ______________________________<wbr>_________________<br>
>>>>> Zoo-discuss mailing list<br>
>>>>> <a href="mailto:Zoo-discuss@lists.osgeo.org">Zoo-discuss@lists.osgeo.org</a><br>
>>>>> <a href="https://lists.osgeo.org/mailman/listinfo/zoo-discuss" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/zoo-discuss</a><br>
>>>><br>
>>>><br>
>>>> ______________________________<wbr>_________________<br>
>>>> Zoo-discuss mailing list<br>
>>>> <a href="mailto:Zoo-discuss@lists.osgeo.org">Zoo-discuss@lists.osgeo.org</a><br>
>>>> <a href="https://lists.osgeo.org/mailman/listinfo/zoo-discuss" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/zoo-discuss</a><br>
>>><br>
>>><br>
>><br>
>><br>
>><br>
><br>
> ______________________________<wbr>_________________<br>
> Zoo-discuss mailing list<br>
> <a href="mailto:Zoo-discuss@lists.osgeo.org">Zoo-discuss@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/zoo-discuss" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/zoo-discuss</a><br>
<br>
<br></blockquote></div><br></div>