qdecoder icon indicating copy to clipboard operation
qdecoder copied to clipboard

Let us know if you're using qDecoder.

Open wolkykim opened this issue 10 years ago • 12 comments

It's always my great pleasure to know how it gets used. Please leave your comment if you're using qDecoder. Many thanks.

wolkykim avatar Apr 29 '14 06:04 wolkykim

qDecoder was/is about the last active CGI library project in C (with FastCGI support) I could find. Or maybe people just don't use one in their projects (looking at cgit here). For now it's just a learning experience, i'm not using it actively. But it occured to me that I'd like to replace some functionality of a big ugly php webshop not-to-be-named with small, speedy FastCGI scripts (KISS principle and all that). Can't say if I'll get around to that, or if I could manage that in C, yet.

I like qDecoder because it sticks to the relevant things. It doesn't try to be a magic form builder or c-to-html template engine, and I can work with that. The license is amazing, too.

nyov avatar May 13 '14 15:05 nyov

Thanks for qDecoder. Included in how-to at http://www.linuxmovies.org/2015/10/cmake-hello-world-how-to-with-qdecoder/

Robin

robinrowe avatar Oct 23 '15 01:10 robinrowe

I'm evaluating it against cgic, which are arguably the best two c cgi lib with a free license now.

the last release is in 2014.5, since then there are many commits, any plan to release a newer version?

laoshaw avatar Jan 23 '17 17:01 laoshaw

@laoshaw Hey, git shows many commits but it's a sort of a sync error. I just released a 12.0.6 as a maintenance release. Check it out! Thx

wolkykim avatar Jan 23 '17 17:01 wolkykim

Hi, thank you for sharing this great lib with us. We're using it with fastcgi. Everything works like a charm so far, except one problem which we can't repeat every time and have no idea what causes the problem. Appreciated if you could give some advices.

Let me explain what we're doing first. We build a fastcgi loop for accept the requests and use qDecoder to process the requests and session. There is a variable "logged" we save into the session to indicate if the user has logged in. We destroy the session when the user sent "logout" request. The problem seems related to this session handling.

  1. If the user login back right after the "logout" request (after the session has just been destroyed) ;
  2. However, if they hold on for a couple of mins and then try login. All functions related to stdio will go wrong. I understand fastcgi has redefined the stdio.h in fcgi_stdio.h and qDecoder is using such definitions once in Fastcgi mode. But our functions are compiled and linked with standard stdio.h into a separate object file. In addition, they work well before we destroy the session. Is this because we haven't handled the session in the correct way? Please see attached a simplified version of our code.

while(FCGI_Accept() >= 0) { qentry_t *req = qcgireq_parse(NULL, Q_CGI_ALL); qentry_t *sess=qcgisess_init(req, NULL); bool bNeedDestroySession=false;

if it is a login req
     req->putstr(sess,"logged","1",true);
else if it is a logout req
     bNeedDestroySession=true;

qcgisess_save(sess);

if(bNeedDestroySession==false) sess->free(sess); else qcgisess_destroy(sess);

req->free(req);

}

lookwei avatar Aug 13 '17 05:08 lookwei

I've been using this library for many years to create CGI commandline applications with Visual Studio 6. I'm actually trying to upgrade the applications and compile then in VS 2017 or at least VS 2008, but there is a compile error in the version of qdecoder.h I have from years ago, and I don't see that you still include code for Visual Studio. Is there still a Win32 version being maintained?

atariguy avatar May 13 '19 17:05 atariguy

I'm facing the same issue... Being able to compile on modern compilers or VS2017 using C++14.. I need cross platform support for Win/Linux. Given that everything is old, it's impossible to find a CGI library now. I do think this is the best one that I found however. Thinking about taking on a porting project to get it up to date on modern compilers.

chrisw24 avatar Feb 13 '20 17:02 chrisw24

@chrisw24 There are alternatives to CGI these days which may be why you're seeing less development done with it. Another approach is to use a web proxy on your main server and run a full HTTP server like Boost.Beast.

Erroneous1 avatar Feb 14 '20 15:02 Erroneous1

qdecoder is useful for some restricted embedded devices, small and neat, Boost.Beast with proxy is not a good alternative there. cgic https://github.com/boutell/cgic might be a close alternative but I personally favor qdecoder. I hope this code can be updated by someone skillful.

laoshaw avatar Feb 15 '20 01:02 laoshaw

@Erroneous1 Yeah, I've been out of the game for some time.. I've seen lots of projects with boost.beast and think I need to modernize my best practices for web application development. Need to get up to speed on C++14 and C++17 as well. Lots of changes since 2010. Thanks for the suggestion, I will for sure review boost.beast.

chrisw24 avatar Feb 15 '20 02:02 chrisw24

I needed a small lightweight JS engine to run JavaScript scripts via Fast CGI for IoT. A combination of my own code, Duktape and qdecoder solved the problem. :-)

MelanieRed avatar Feb 11 '21 14:02 MelanieRed

Using it from almost 10-15 years. (when it was not on github)

amishmm avatar Jul 06 '21 05:07 amishmm