Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Dev

Varnishlog.c

 

 

Varnish dev RSS feed   Index | Next | Previous | View Threaded


andersb at vgnett

Jul 28, 2006, 5:06 AM

Post #1 of 12 (186 views)
Permalink
Varnishlog.c

Hi,

I took a look at:

http://varnish.projects.linpro.no/browser/trunk/varnish-cache/bin/
varnishlog/varnishlog.c


Line 132 sould be: if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD",
4) I guess, rather than:

if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)

Not sure since I have only a vague clue as to what the code does, but
the pattern suggests it :)

Also, I am scratching my head about the -h parameter in the code
line: 214. Is this supposed to be the -r param?

Anders Berg


andersb at vgnett

Jul 28, 2006, 5:06 AM

Post #2 of 12 (177 views)
Permalink
Varnishlog.c [In reply to]

Hi,

I took a look at:

http://varnish.projects.linpro.no/browser/trunk/varnish-cache/bin/
varnishlog/varnishlog.c


Line 132 sould be: if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD",
4) I guess, rather than:

if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)

Not sure since I have only a vague clue as to what the code does, but
the pattern suggests it :)

Also, I am scratching my head about the -h parameter in the code
line: 214. Is this supposed to be the -r param?

Anders Berg


phk at phk

Jul 28, 2006, 5:31 AM

Post #3 of 12 (179 views)
Permalink
Varnishlog.c [In reply to]

In message <E9EE0BDF-4329-47CF-8F1F-457D7046672E at vgnett.no>, Anders Berg writes
:
>Hi,
>
>I took a look at:
>
>http://varnish.projects.linpro.no/browser/trunk/varnish-cache/bin/
>varnishlog/varnishlog.c
>
>
>Line 132 sould be: if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD",
>4) I guess, rather than:
>
>if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)

No, it is correct. the "p[1] == 4" checks that the argument is
4 bytes long and the memcpy checks that it has the right contents.

>Also, I am scratching my head about the -h parameter in the code
>line: 214. Is this supposed to be the -r param?

The -h option is an (experimental) attempt to show only "not normal"
goings on.

It's supposed to supress any GET or HEAD request that gets a hit and
delivers it with 200, or which does a fetch&insert and delivers with
200.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


phk at phk

Jul 28, 2006, 5:31 AM

Post #4 of 12 (179 views)
Permalink
Varnishlog.c [In reply to]

In message <E9EE0BDF-4329-47CF-8F1F-457D7046672E at vgnett.no>, Anders Berg writes
:
>Hi,
>
>I took a look at:
>
>http://varnish.projects.linpro.no/browser/trunk/varnish-cache/bin/
>varnishlog/varnishlog.c
>
>
>Line 132 sould be: if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD",
>4) I guess, rather than:
>
>if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)

No, it is correct. the "p[1] == 4" checks that the argument is
4 bytes long and the memcpy checks that it has the right contents.

>Also, I am scratching my head about the -h parameter in the code
>line: 214. Is this supposed to be the -r param?

The -h option is an (experimental) attempt to show only "not normal"
goings on.

It's supposed to supress any GET or HEAD request that gets a hit and
delivers it with 200, or which does a fetch&insert and delivers with
200.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


des at linpro

Jul 28, 2006, 5:40 AM

Post #5 of 12 (177 views)
Permalink
Varnishlog.c [In reply to]

"Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
> Anders Berg <andersb at vgnett.no> writes:
> > Line 132 sould be:
> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 4)
> > I guess, rather than:
> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)
> No, it is correct. the "p[1] == 4" checks that the argument is
> 4 bytes long and the memcpy checks that it has the right contents.

Yes, the 3 should be a 4 since "HEAD" has four letters.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no


des at linpro

Jul 28, 2006, 5:40 AM

Post #6 of 12 (178 views)
Permalink
Varnishlog.c [In reply to]

"Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
> Anders Berg <andersb at vgnett.no> writes:
> > Line 132 sould be:
> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 4)
> > I guess, rather than:
> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)
> No, it is correct. the "p[1] == 4" checks that the argument is
> 4 bytes long and the memcpy checks that it has the right contents.

Yes, the 3 should be a 4 since "HEAD" has four letters.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no


andersb at vgnett

Jul 28, 2006, 6:28 AM

Post #7 of 12 (180 views)
Permalink
Varnishlog.c [In reply to]

> "Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
>> Anders Berg <andersb at vgnett.no> writes:
>> > Line 132 sould be:
>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 4)
>> > I guess, rather than:
>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)
>> No, it is correct. the "p[1] == 4" checks that the argument is
>> 4 bytes long and the memcpy checks that it has the right contents.
>
> Yes, the 3 should be a 4 since "HEAD" has four letters.

Thats what I also "figured" out.

Anders Berg

> DES
> --
> Dag-Erling Sm?rgrav
> Senior Software Developer
> Linpro AS - www.linpro.no
> _______________________________________________
> varnish-dev mailing list
> varnish-dev at projects.linpro.no
> http://projects.linpro.no/mailman/listinfo/varnish-dev
>
>


andersb at vgnett

Jul 28, 2006, 6:28 AM

Post #8 of 12 (178 views)
Permalink
Varnishlog.c [In reply to]

> "Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
>> Anders Berg <andersb at vgnett.no> writes:
>> > Line 132 sould be:
>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 4)
>> > I guess, rather than:
>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)
>> No, it is correct. the "p[1] == 4" checks that the argument is
>> 4 bytes long and the memcpy checks that it has the right contents.
>
> Yes, the 3 should be a 4 since "HEAD" has four letters.

Thats what I also "figured" out.

Anders Berg

> DES
> --
> Dag-Erling Sm?rgrav
> Senior Software Developer
> Linpro AS - www.linpro.no
> _______________________________________________
> varnish-dev mailing list
> varnish-dev at projects.linpro.no
> http://projects.linpro.no/mailman/listinfo/varnish-dev
>
>


phk at phk

Jul 28, 2006, 6:40 AM

Post #9 of 12 (180 views)
Permalink
Varnishlog.c [In reply to]

In message <1441.193.213.34.102.1154093304.squirrel at denise.vg.no>, "Anders Berg
" writes:
>> "Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
>>> Anders Berg <andersb at vgnett.no> writes:
>>> > Line 132 sould be:
>>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 4)
>>> > I guess, rather than:
>>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)
>>> No, it is correct. the "p[1] == 4" checks that the argument is
>>> 4 bytes long and the memcpy checks that it has the right contents.
>>
>> Yes, the 3 should be a 4 since "HEAD" has four letters.
>
>Thats what I also "figured" out.

Duh! I looked at the wrong line...

yes, "HEAD" has four characters.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


phk at phk

Jul 28, 2006, 6:40 AM

Post #10 of 12 (181 views)
Permalink
Varnishlog.c [In reply to]

In message <1441.193.213.34.102.1154093304.squirrel at denise.vg.no>, "Anders Berg
" writes:
>> "Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
>>> Anders Berg <andersb at vgnett.no> writes:
>>> > Line 132 sould be:
>>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 4)
>>> > I guess, rather than:
>>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)
>>> No, it is correct. the "p[1] == 4" checks that the argument is
>>> 4 bytes long and the memcpy checks that it has the right contents.
>>
>> Yes, the 3 should be a 4 since "HEAD" has four letters.
>
>Thats what I also "figured" out.

Duh! I looked at the wrong line...

yes, "HEAD" has four characters.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


andersb at vgnett

Jul 28, 2006, 7:12 AM

Post #11 of 12 (178 views)
Permalink
Varnishlog.c [In reply to]

> In message <1441.193.213.34.102.1154093304.squirrel at denise.vg.no>, "Anders
> Berg
> " writes:
>>> "Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
>>>> Anders Berg <andersb at vgnett.no> writes:
>>>> > Line 132 sould be:
>>>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 4)
>>>> > I guess, rather than:
>>>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)
>>>> No, it is correct. the "p[1] == 4" checks that the argument is
>>>> 4 bytes long and the memcpy checks that it has the right contents.
>>>
>>> Yes, the 3 should be a 4 since "HEAD" has four letters.
>>
>>Thats what I also "figured" out.
>
> Duh! I looked at the wrong line...
>
> yes, "HEAD" has four characters.

Wohoo! I can claim a bug-fix :)

Anders Berg

> --
> Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
> phk at FreeBSD.ORG | TCP/IP since RFC 956
> FreeBSD committer | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by
> incompetence.
>
>


andersb at vgnett

Jul 28, 2006, 7:12 AM

Post #12 of 12 (179 views)
Permalink
Varnishlog.c [In reply to]

> In message <1441.193.213.34.102.1154093304.squirrel at denise.vg.no>, "Anders
> Berg
> " writes:
>>> "Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
>>>> Anders Berg <andersb at vgnett.no> writes:
>>>> > Line 132 sould be:
>>>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 4)
>>>> > I guess, rather than:
>>>> > if (h_opt && p[1] == 4 && !memcmp(p + 4, "HEAD", 3)
>>>> No, it is correct. the "p[1] == 4" checks that the argument is
>>>> 4 bytes long and the memcpy checks that it has the right contents.
>>>
>>> Yes, the 3 should be a 4 since "HEAD" has four letters.
>>
>>Thats what I also "figured" out.
>
> Duh! I looked at the wrong line...
>
> yes, "HEAD" has four characters.

Wohoo! I can claim a bug-fix :)

Anders Berg

> --
> Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
> phk at FreeBSD.ORG | TCP/IP since RFC 956
> FreeBSD committer | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by
> incompetence.
>
>

Varnish dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.