mostafa rezvani | 3 Nov 09:07
Picon
Favicon

help cgi

Hi,
 
I have a CGI which fetch data from database and create a .cert file. how can I save it on client system.
Thanks.
 
Regards,
Mostafa Rezvani


_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
https://lists.gnu.org/mailman/listinfo/help-cgicc
Andrey Vul | 21 Dec 10:58

about CgiEnvironment and POSTDATA when using multiplexed FastCgi

In the CgiEnvironment constructor, it looks like it attempts to read all
of stdin.
FastCgi, however, chunks the stdin packets.

1) Is the read function, as defined in a subclass bridging a
multiplexing FastCgi with Cgicc, supposed to block until there
everything can be read, as done in the official FastCgi SDK's
FCGX_GetStr(FCGX_Stream*, char*, int)?
Or use EAGAIN / exceptions and wrap input->read in a for(;;)?
I'm using another FastCgi class because the fact that I'm threading
the processing means that multiplexing is the way to go to unleash the
performance of parallelism, and FCGX_* is not multiplexing-safe.
Note: the FastCgi instance class basically calls
std::string::append(input_buffer.end(), stdin_data, stdin_len). 
2) Is there an ability to limit the size of POSTDATA by using a function
hook? The non-virtuality of CgiEnvironment implies that implementing
this would require patch && make && sudo make install.

Note: I am not on the mailinglist. CC me when needed.
John Faith | 31 Aug 19:17
Picon

Cross building cgicc, getElements() app link error

Hello,
I built cgicc 3.2.8 using 2009q1 CodeSourcery ARM tools in
OpenEmbedded which built fine.  I was able to build and run the app
code below, but when I enable the getElements() section, I get a
linker error:
  hello.cpp:(.text+0x198): undefined reference to
`cgicc::Cgicc::getElements() const'

, which seems odd since getElements) is defined as inline in
cgicc/Cgicc.h.  I built the same app for x86 using g++ 4.4.1 and it
linked and ran fine.  Not sure if this is an issue with g++ or cgicc,
or can be patched in cgicc.  Anyone see this before?

Thanks!
,
John

int main(int argc, char **argv)
{
    Cgicc cgi;
    cout << HTTPHTMLHeader() << endl;
    form_iterator name = cgi.getElement("name");
    //if(name != cgi.getElements().end()) {
    //    cout << "Your name: " << **name << endl;
    //}

    return 0;
}
Eduard Bareev | 10 Aug 16:23
Picon

newbie question, help heeded

Hi!
I trying to develop highspeed web-service and i have some questions, and also i am not c++ programmer, this is my first cpp project.

I have this following code:
-------------------------------------------
#include <string>
#include "fcgi_stdio.h"
#include <stdlib.h>
#include <iostream>

void handle(FCGX_Request request){
        FCGX_FPrintF(request.out, "Content-type: text/html\r\n\r\n<TITLE>fastcgi</TITLE>\n<H1>Fastcgi: Hello world!</H1>\n");
}

int main(int argc, char* const argv[] )
{
    std::string port=":9001";       
    int listenQueueBacklog = 400;   
    FCGX_Stream *in, *out, *err;
    FCGX_ParamArray envp;
   
    if(FCGX_Init())    exit(1);

    int listen_socket = FCGX_OpenSocket(port.c_str(), listenQueueBacklog);
    if(listen_socket < 0)    exit(1);

    FCGX_Request request;
    if(FCGX_InitRequest(&request,  listen_socket, 0)) exit(1);

    int reqCounter = 0;
    while(FCGX_Accept_r(&request) == 0)
    {
        handle(request);
        reqCounter++;
        FCGX_FPrintF(request.out, "\n\r\n\r counter: %d", reqCounter);
        FCGX_Finish_r(&request);
    }
    return 0;
}
-------------------------------------------

It works good listening 9001 port and serving resquests from nginx http server. I choose fcgi_stdio beacuse it can listen on tcp socket and it is simple to integrate it with nginx web server.

Question:
Can i use this configuration and include GNU Cgicc Library to access post field values, headers, cookie?
Anyone, please point to an example of using this both libraries in my case!

Thanks!

--
Eduard Bareev
eduard <at> bareev.ru

_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-cgicc
Pilar Fernandez | 4 Aug 22:21
Picon

Upload files with demo upload.cpp

Hello,

  I'm trying to upload file with the demo we can find on the gnu website because I have to develop an application which has this utility. My problem is this, I cannot see where the file has been uploaded, I can only see what file contains, no more. I'm using ubuntu as principal tool, and xampp.

  I hope you could help me.

 Thanks a lot.

 

_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-cgicc
Matthew Kettlewell | 20 Apr 01:34
Favicon
Gravatar

secure login code?

Has anyone put together a secure login form using cgicc?

I'm not really sure of the best way to start...

I've been looking at a lot of PHP login scripts (and WordPress logins), and I see roughly what I should be doing

but if someone has something to start with that they would be willing to share, that would be great...

Thanks

Matt

-- Matthew Kettlewell http://www.Kettlewell.net/ Free Job Hunting Guide http://www.kettlewell.net/how-to-find-a-job-in-2009-complete-manual/ Follow me: Twitter: http://www.twitter.com/kettlewell Linkedin: http://www.linkedin.com/in/kettlewell Skype: kettlewell-enterprises-inc
_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-cgicc
Frank Büttner | 22 Mar 19:44

cgicc and Qt

Hallo,
I try to use cgicc with the Qt Framework.
But my problem is, to connect it with the QTextStream class of qt.
Have anybody try it`on an idea how to do it?

Attachment (smime.p7s): application/x-pkcs7-signature, 5024 bytes
_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-cgicc
xamiw | 23 Jan 16:18
Picon
Favicon

HTTP-ACCEPT-LANGUAGE and cgicc

Can somebody tell me how to get the environment variable HTTP_ACCEPT_LANGUAGE with cgicc?

Thanks in advance

Goran
Vedro | 9 Jan 09:26
Picon

how access to HTML controls atributes ?

Hi,
 
I am new to cgicc library and I have a following problem.
I defined <select> HTML control like this:
 
cgicc::select sel1 = cgicc::select();

sel1.set("name","someName").set("class","selectfield").set("SIZE","1");sel1.add(br());

sel1.add(option(

"0/1").set("class","selectfield").set("value","1"));sel1.add(br());

sel1.add(option(

"0/2").set("class","selectfield").set("value","2"));sel1.add(br());

sel1.add(option(

"0/3").set("class","selectfield").set("value","3"));sel1.add(br());

sel1.add(option(

"0/4").set("class","selectfield").set("value","4"));sel1.add(br());
 
I would like to access to every embedded object (each option) inside sel1 object going through some loop, check value of
each option object and set "selected" atribute if needed.
 
I see that  HTMLElement object has HTMLElementList data which contains embedded object but it is private and it's possible to add new object into this list only.
There is no interface which provide accessing  i.e. reading and seting different atribute inside particular object ( in this case in "options" object inside "select" object) and I do not understand why it's like that.
 
Are there any other ways to access (and changes) atributes inside defined objects ?
 
Thanks in advance
 
V.
 
_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-cgicc
Artyom Beilis | 6 Jan 12:09
Picon
Favicon

Interface to Remove Cookies


CgiCC HTTPCookies supports MaxAge that may be 0 (browser) or positive
according to RFC,

Other very important options Expires is not supported. This option is mostly
useless because requires
definition of absolute time. However one special case exists: Cookies
Removal.

In many cases it is very useful to remove cookies by setting Expiration date
in past.

I've written a little patch to fix this problem, please consider to merge it
into upstream

Artyom

--- cgicc-3.2.7/cgicc/HTTPCookie.cpp	2008-07-06 18:27:18.000000000 +0300
+++ cgicc-3.2.7-patched/cgicc/HTTPCookie.cpp	2009-01-05 14:12:07.972561100
+0200
@@ -33,7 +33,8 @@
 // ============================================================
 cgicc::HTTPCookie::HTTPCookie()
   : fMaxAge(0),
-    fSecure(false)
+    fSecure(false),
+    fRemoved(false)
 {}

 cgicc::HTTPCookie::HTTPCookie(const std::string& name, 
@@ -41,7 +42,20 @@
   : fName(name),
     fValue(value),
     fMaxAge(0),
-    fSecure(false)
+    fSecure(false),
+    fRemoved(false)
+{}
+
+cgicc::HTTPCookie::HTTPCookie(const std::string& name, 
+			      const std::string& domain, 
+			      const std::string& path,
+			      bool secure)
+  : fName(name),
+    fDomain(domain), 
+    fMaxAge(0),
+    fPath(path), 
+    fSecure(secure),
+    fRemoved(false)
 {}

 cgicc::HTTPCookie::HTTPCookie(const std::string& name, 
@@ -57,7 +71,8 @@
     fDomain(domain), 
     fMaxAge(maxAge),
     fPath(path), 
-    fSecure(secure)
+    fSecure(secure),
+    fRemoved(false)
 {}

 cgicc::HTTPCookie::HTTPCookie(const HTTPCookie& cookie)
@@ -94,8 +109,10 @@
     out << "; Comment=" << fComment;
   if(false == fDomain.empty())
     out << "; Domain=" << fDomain;
-  if(0 != fMaxAge)
-    out << "; Max-Age=" << fMaxAge;
+  if(fRemoved)
+    out << "; Expires=Fri, 01-Jan-1971 01:00:00 GMT;";
+  else if(0 != fMaxAge)
+      out << "; Max-Age=" << fMaxAge;
   if(false == fPath.empty())
     out << "; Path=" << fPath;
   if(true == fSecure)
--- cgicc-3.2.7/cgicc/HTTPCookie.h	2008-07-06 18:27:18.000000000 +0300
+++ cgicc-3.2.7-patched/cgicc/HTTPCookie.h	2009-01-05 14:08:30.729184100
+0200
@@ -104,6 +104,22 @@
 	       bool secure);

     /*!
+     * \brief Create a new partially-spefified HTTPCookie for deletion 
+     *
+     * 
+     * \param name The name of the cookie.
+     * \param domain The domain for which this cookie is valid- an empty
string
+     * will use the hostname of the server which generated the cookie
response.
+     * If specified, the domain <em>must</em> start with a period('.'). 
+     * \param path The subset of URLS in a domain for which the cookie is 
+     * valid, for example \c /
+     * @param secure Specifies whether this is a secure cookie.
+     */
+    HTTPCookie(const std::string& name, 
+	       const std::string& domain, 
+	       const std::string& path,
+	       bool secure);
+    /*!
      * \brief Copy constructor
      *
      * Set the name, value, comment, domain, age and path of this cookie
@@ -303,6 +319,16 @@
     setSecure(bool secure)
     { fSecure = secure; }
     //@}    
+
+    /*!
+     * \brief Mark this cookie as secure or unsecure.
+     *
+     * \param secure Whether this is a secure cookie.
+     */
+    inline void 
+    remove()
+    { fRemoved = true; }
+    //@}    

     // ============================================================

@@ -320,6 +346,7 @@
     unsigned long 	fMaxAge;
     std::string 	fPath;
     bool 		fSecure;
+    bool		fRemoved;
   };

 } // namespace cgicc

--

-- 
View this message in context: http://www.nabble.com/Interface-to-Remove-Cookies-tp21308545p21308545.html
Sent from the cgicc - General mailing list archive at Nabble.com.
Artyom Beilis | 6 Jan 11:53
Picon
Favicon

Sending Redirect and Status Headers


Hello,

There is two headers: HTTPRedirectHeader and HTTPStatusHeader. On of the
problems
with them is a fact that sometimes you should send them both

---------------------
Status: 302 Found
Location: /some/new/place

-------------------

Otherwise apache and nginx  would not redirect (only lighttpd works for me
without status header).
The problem is that each one of these headers adds "\n\n" at the and and you
can send them as is
So I should add Status header manually 

cout<<"Status: 302 Found"<<endl;
cout<<HTTPRedirectHeader("/some/new/place");

Is there way to send both headers together?

I don't see this option in the code, all render() virtual functions send
final "\n\n".

Thanks,
Artyom
--

-- 
View this message in context: http://www.nabble.com/Sending-Redirect-and-Status-Headers-tp21308353p21308353.html
Sent from the cgicc - General mailing list archive at Nabble.com.

Gmane