|
Search squid archive
|
|
Re: Need help to build my own external help | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
From: Mohamed Amine Kadimi <amine.kadimi@xxxxxxxxx>
> 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
[Linux Audio Users] [Photo] [Yosemite News] [Samba] [Video Projectors] [Video Devices] [Big List of Linux Books] [LCD TVs] [Webcams] [Linux USB]
![]() |