help cgi
2011-11-03 08:07:40 GMT
_______________________________________________ help-cgicc mailing list help-cgicc <at> gnu.org https://lists.gnu.org/mailman/listinfo/help-cgicc
_______________________________________________ help-cgicc mailing list help-cgicc <at> gnu.org https://lists.gnu.org/mailman/listinfo/help-cgicc
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.
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;
}
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
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
_______________________________________________ help-cgicc mailing list help-cgicc <at> gnu.org http://lists.gnu.org/mailman/listinfo/help-cgicc
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?
_______________________________________________ help-cgicc mailing list help-cgicc <at> gnu.org http://lists.gnu.org/mailman/listinfo/help-cgicc
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());_______________________________________________ help-cgicc mailing list help-cgicc <at> gnu.org http://lists.gnu.org/mailman/listinfo/help-cgicc
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.
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.
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 |
RSS Feed2 | |
|---|---|
2 | |
1 | |
2 | |
1 | |
9 | |
4 | |
4 | |
1 | |
1 | |
13 | |
4 | |
4 | |
2 | |
5 | |
2 | |
2 | |
1 | |
6 | |
11 | |
8 | |
3 | |
8 | |
2 | |
6 | |
1 | |
3 | |
6 | |
2 | |
3 | |
3 | |
16 | |
2 | |
2 | |
5 | |
5 | |
3 | |
3 | |
1 | |
4 | |
1 | |
21 | |
8 | |
3 | |
7 | |
3 | |
9 | |
2 | |
5 | |
10 | |
10 | |
4 | |
2 | |
1 | |
6 | |
7 | |
9 | |
24 | |
25 | |
13 | |
8 | |
6 | |
6 | |
8 | |
12 |