Re: FCGI also required rewriting read_cb
Brandon Long <[email protected]> Sun, 17 Feb 2008 23:32:35 -0800
| Newsgroups | gmane.text.clearsilver.general |
|---|---|
| Organization | Fiction L Networks |
| Message-ID | <20080218073235.GA21050@bl1> |
Cool, thanks.
Brandon
On 02/18/08 Bjorn uttered the following other thing:
> If you want to read POST variables with a fastcgi setup in clearsilver
> and using C you have to wrap read_cb:
>
> static int read_cb(void *ctx, char *buf, int buf_len){
> return fread (buf, sizeof(char), buf_len, FCGI_stdin);
> }
>
> in addtion to wrapping all that other stuff (which is in the
> clearsilver source):
>
> static int cs_printf(void *ctx, const char *s, va_list args) {
> return printf(s, args);
> }
>
> static int cs_write(void *ctx, const char *s, int n) {
> return fwrite((char *) s, 1, n, FCGI_stdout);
> }
>
> And then call these:
> cgiwrap_init_std(argc, argv, envp);
> cgiwrap_init_emu(NULL, read_cb, cs_printf, cs_write, NULL, NULL, NULL);
>
> Just FYI, I had to figure out how to do that myself. I was getting
> this error:
>
> Short read on CGI POST input
>
> but wraping read_cb fixed it. :)
>
>
>
>
> Yahoo! Groups Links
>
>
>
--
"Also, of course, I'm not allowed to play favorites among my students,
so y'know, if I plonked one, I'd have to do every man and woman in
the class, and that could get tiring." -- Todd Markle
http://www.fiction.net/blong/