Re: [squid-users] Need help to build my own external help

From: John Doe <jdmls_at_yahoo.com>
Date: Mon, 16 Apr 2012 09:03:43 -0700 (PDT)

From: Mohamed Amine Kadimi <amine.kadimi_at_gmail.com> > I reduced my program to that: > > #include <stdio.h> > #include <stdlib.h> > #include <string.h> > #define MAX_INPUT 8192 > int main(int argc, char **argv) > { >   char request [MAX_INPUT]; >   while (fgets(request, MAX_INPUT , stdin) != NULL) >   { >       printf ("OK\n"); >   } >   return 0; > } > > But, I still get the same problem, I jump in the middle of the conversation but, the return will constantly end the helper... It is supposed to loop "forever". I used to use this: #define INPUTSIZE 8192 char input[INPUTSIZE]; while (fgets(input, sizeof(input), stdin)) { if ((cp=strchr(input, '\n')) == NULL) { fprintf(stderr, "filter: input too big: %s\n", input); } else { *cp = '\0'; } ... fflush(stderr); fflush(stdout); } JD
Received on Mon Apr 16 2012 - 16:03:49 MDT

This archive was generated by hypermail 2.2.0 : Tue Apr 17 2012 - 12:00:03 MDT