[squid-users] Re: Malformed urls

From: Deepa D <deepndharma@dont-contact.us>
Date: Thu, 19 Feb 2004 05:11:39 +0000 (GMT)

Hi,
  Thanks for the info.
  I am trying to do an strace. In the meanwhile, I am
sending the log function for ur perusal :-
void log(char *filename, char *msg , char * msg1) {
  FILE *log;
  char *date_str = NULL;
  log = fopen(filename, "at");
  if(log == NULL){
      return;
  }
  date_str = getDate();
  fprintf(log, "%s: %s %s\n", date_str, msg, msg1);
  fflush(log);
  free(date_str);
  fclose(log);
}

char *getDate(void) {
  time_t tp;
  char *ascitime;
  char *s;
  tp = (time_t)time(NULL);
  ascitime = (char *)ctime(&tp);
  s = (char *)malloc(sizeof(char) *
(strlen(ascitime)+1));
  /* no use writing an error message, because this
function
  will keep getting called! */
  if(s == NULL) {
    exit(3);
  }
  strcpy(s, ascitime);
  s[strlen(ascitime) - 1] = '\0';
  return s;
}

   Another problem that I am now facing is that
eventhough the redirector program is writing a new
line to the stdout(I figure this out from the log
message), the squid is redirecting the page to the
redirect url.
   Plz tell me if u know the solution to this problem.

   Regards and TIA,
      Deepa

 --- Henrik Nordstrom <hno@squid-cache.org> wrote: >
On Wed, 18 Feb 2004, Deepa D wrote:
>
> > Hi,
> > Thanks for the response.
> > access.log is listing the urls correctly. Sample
> :-
> >
>
http://in.yimg.com/i/in/adv/hp/pbhp_84x28_blu_yahoo.gif
> >
> > The redirector code is as follows :-
> >
> > char buff[MAX_BUFF] = "";
> > setbuf(stdout, NULL);
> > memset(buff,'\0',MAX_BUFF);
> >
> > while(fgets(buff, MAX_BUFF, stdin) != NULL) {
> >
> > log(LOG_INFO," Client - read from stdin = ",
> > buff);
> > }
> >
>
> What does the log function look like?
>
> Also try strace/truss of the redirector process to
> verify that what it
> logs matches what it reads from Squid.
>
> Regards
> Henrik
>

________________________________________________________________________
Yahoo! India Insurance Special: Be informed on the best policies, services, tools and more.
Go to: http://in.insurance.yahoo.com/licspecial/index.html
Received on Wed Feb 18 2004 - 22:11:45 MST

This archive was generated by hypermail pre-2.1.9 : Mon Mar 01 2004 - 12:00:02 MST