Hi All,

*Which scripting is better for this implementation*

I have been developing the same implementation which is halfway done in Node
[1] <https://github.com/GPrathap/wso2nodeserver> using Apache modules[2]
<http://httpd.apache.org/>. CGI[3]
<http://en.wikipedia.org/wiki/Common_Gateway_Interface> and FastCGI[4]
<http://en.wikipedia.org/wiki/FastCGI> are the two main scripting methods.
My problem is which one is the well-suited implementation for this.
Because here in memory database is used not shared memory one. Even though
each CGI script which is doing a different task, all those tasks are
required database access so can not make a persistent connection to
database. also can't do IPC(Inter process communication).

But Wikipedia says[4] <http://en.wikipedia.org/wiki/FastCGI> ...

Instead of creating a new process for each request, FastCGI uses persistent
processes to handle such requests. Multiple processes can configured,
increasing stability and scalability. Each individual FastCGI process can
handle many requests over its lifetime, thereby avoiding the overhead of
per-request process creation and termination.

My view is that CGI is better that FastCGI in this case. Is this correct
method ?

Thanks,

Geesara Prathap Kulathunga,
Software Engineering Intern,
University of Peradeniya.
gees...@wso2.com <Email:++gees...@wso2.com>
+940772684174


On Wed, Jan 28, 2015 at 7:12 AM, Geesara Prathap <gees...@wso2.com> wrote:

> Hi All,
>
> The cookie should be set in this way
> COOKIE =  JSESSIONID=1F2469D0FA739E730B15F694D015BBB2; Path=/publisher/;
> HttpOnly
>
> I forgot to remove "\r\n" . This is wrong
> COOKIE =  JSESSIONID=1F2469D0FA739E730B15F694D015BBB2; Path=/publisher/;
> HttpOnly \r\n
>
> Thanks,
>
>
> Geesara Prathap Kulathunga,
> Software Engineering Intern,
> University of Peradeniya.
> gees...@wso2.com <Email:++gees...@wso2.com>
> +940772684174
>
>
> On Mon, Jan 26, 2015 at 9:31 AM, Geesara Prathap <gees...@wso2.com> wrote:
>
>> Hi All,
>>
>> I have set the cookie into HTTP header in this way.
>>
>>     .....
>>     CURL *curl;
>>     CURLcode res;
>>
>>     struct curl_slist *headers = NULL;
>>     headers = curl_slist_append(headers, "Accept:
>> application/x-www-form-urlencoded");
>>     headers = curl_slist_append(headers, "Content-Type:
>> application/x-www-form-urlencoded");
>>     headers = curl_slist_append(headers, "charsets: utf-8");
>>
>>     curl_global_init(CURL_GLOBAL_ALL);
>>     curl = curl_easy_init();
>>     curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
>>     curl_easy_setopt(curl,CURLOPT_HTTPHEADER,headers);
>>     curl_easy_setopt(curl, CURLOPT_URL,"
>> http://localhost:9763/store/site/blocks/subscription/subscription-add/ajax
>> /subscription-add.jag");
>>     curl_easy_setopt(curl, CURLOPT_POST, 1);
>>     curl_easy_setopt(curl, CURLOPT_POSTFIELDS,reqbody);
>>     curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, body_callback);
>>     curl_easy_setopt(curl, CURLOPT_WRITEDATA, &data);
>>     curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_callback);
>>     curl_easy_setopt(curl, CURLOPT_HEADERDATA,&cookieGet);
>>     curl_easy_setopt(curl, CURLOPT_COOKIE,cookie);
>>     res=curl_easy_perform(curl);
>>     ......
>>
>> In server side when I retrieved post data they seem to be null. But when
>> I check from Wireshark actually those post data are sent. But when I remove
>>
>>     curl_easy_setopt(curl, CURLOPT_COOKIE,cookie);
>>
>> I can access the post data in the server side. If I make any mistake in
>> my post request please correct me.
>>
>> Thanks,
>>
>>
>> Geesara Prathap Kulathunga,
>> Software Engineering Intern,
>> University of Peradeniya.
>> gees...@wso2.com <Email:++gees...@wso2.com>
>> +940772684174
>>
>>
>> On Tue, Jan 6, 2015 at 3:43 PM, Geesara Prathap <gees...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> There is a Node server which acts as a hub  among devices,clients  and
>>> WSO2 API Manager.
>>>
>>> As of now the Client is able to,
>>>
>>>    1. sign up
>>>    2. login
>>>    3. add  applications
>>>    4. subscribe to applications
>>>    5. get the access token from API Manager
>>>
>>>  through Node server.
>>>
>>> When adding an application, client is able to configure how devices are
>>> arranged and that configuration file should be sent to the node server with
>>> a client request. Then Node server reads that file and generates a REST API
>>> with respect to the relevant client.
>>>
>>>
>>>
>>> I did the first part of this implementation. Now a client can do all
>>> those operations which were  mentioned above except REST API generation
>>> part. Here is the code repository[1]  what I did so far.
>>>
>>> [1] https://github.com/GPrathap/wso2nodeserver
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Geesara Prathap Kulathunga
>>> Software Engineer Intern
>>> University of Peradeniya
>>> gees...@wso2.com <Email:++gees...@wso2.com>
>>> +940772684174
>>>
>>>
>>
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to