[squid-users] Re: Malformed Urls

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

Hi All,
   Using strace I have noticed the following problem
:-
    For the mentioned url, I get the HTTP/1.0 204
response at one time. But when the sam request is
given again, the request is serviced and the page
displays properly.
     read(16, "GET http://www.google.com/url?sa"...,
4095) = 674
write(6, "http://www.google.com/url?sa=T&s"..., 121) =
121
read(6, "\n\n", 8192) = 2
write(17, "GET /url?sa=T&start=5&url=http%3"..., 751)
= 751
read(17, "HTTP/1.0 204 No Content\r\nCache-c"...,
87380) = 173
write(16, "HTTP/1.0 204 No Content\r\nCache-C"...,
206) = 206
write(5, "1077176973.319 1100 10.10.10.1"..., 116) =
116
write(12, "1077176973.319 RELEASE -1 FFFFFF"..., 149)
= 149
read(16, 0x82937e0, 4095) = -1 EAGAIN
(Resource temporarily unavailable)
read(16, 0xbffe7fc0, 87380) = -1
ECONNRESET (Connection reset by peer)

   Plz let me know as to why this happens.
   
  Regards and TIA,
    Deepa

 --- Deepa D <deepndharma@yahoo.co.in> wrote: > 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 Fri Feb 20 2004 - 04:39:43 MST

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