Re: I have read and worked since 2 weeks ago

From: Mohsen Pahlevanzadeh <mohsen_at_pahlevanzadeh.org>
Date: Fri, 15 Jul 2011 02:59:36 +0430

On Fri, 2011-07-15 at 04:00 +1200, Amos Jeffries wrote:
> On 13/07/11 22:22, Mohsen Pahlevanzadeh wrote:
> > Dear all,
> >
> > I have read and examined source code of squid 2.7 with GDB since 2 weeks
> > ago and i want to continue....Because i need to change squid source code
> > and add features to it.May be i publish my code.
>
> :( 2.7 has being declared end-of-life now. Will be obsoleted in a few
> months.
>
> If your changes are only small they might be ported to squid-3.
> Otherwise if you are planning anthing that might be big, please start
> with the 3.HEAD code. The data flow and layout are mosty the same, just
> differences in object names.
>
My boss had decide to use which version.I don't any role,But i
downloaded 3.x.x and was reviewing its source, by the way, i like OOP.
>
> > I have the following question, However i know this ML for contributor:
> > 1. If i want to add a port and myself read and analyze my data,(separate
> > form squid's data), how i do it? it mean What's algorithm of squid that
> > i can use it?(which loop, thread or fork? [i didn't see any thread],did
> > you rewrite C syscall and so on).....

> Squid was written in multi-threaded design before thread syscalls
> existed. Each "callback" function is a new thread segment within a whole
> request transaction. I/O events from the OS are the 'thread' starting
> points. Thousands of request transactions can happen in parallel since
> they are all interleaved within one OS-level thread. Data is a shared
> resource.
>
> So, *everything* uses ports to drive the event threads. They all start
> with a read/write/open/close/timer callback receiving data from somewhere.
>
> So for a brand new type of port you must create handlers for all
> relevant events. Each handler then uses whatever algorithms it needs to
> produce its output.
>

After your knowledge about IO event, i would read a paper about IO event
and i get the following result:
The one of reasons of squid's magic speed is such using IO event.It's
very nice and decided to use it later in my projects.Thank you about
your knowledge.

> Usually the *StateData objects you will see around Squid are the
> component state engines created by an open() or start() event which link
> the socket (FD) to all related handlers and data for that transaction.
>

> > 2. For each func, we have 3 steps: a.definition. b. call. c. Data
> > gathering.
> > I have problem with Data gathering of squid.for instance, what do i fill
> > StoryEntry data type variable?
> > stroeComplete or storeRelease or many
> > func use a set of data type that i have problem with them.i want to know
> > where,when,and which variables are initialized that i handle a http page
> > or http reply that it can store into storage.
> >
> > Yours,
> > Mohsen
> >
>
> StoreEntry is the small pipe buffer through which large data streams
> flow. (no joke).
I believe, it's not joke, i read src/structs.h and src/store.c and
http.c and i saw importance of StoryEntry data type.
>
> whois.c has the simplest code for writing to one. ftp.c, http.c,
> gopher.c, and store_*.c all have various other ways to do it. The
> actual creating and setup code is buried deep in client_side.c and
> involves copying meta data from the config file port settings and HTTP
> request headers.
>
> So.. start with passing Squid storeEntryCreate() details from an HTTP
> GET request ... um, sounds familiar?
>
I have starting reading RFC2616 and RFC2068 and as well as trace squid
with GDB as well as reading source code, Of course 90% of my time is
reading source code along with RFCs not gdb.

> I guess you are still trying to "push" data straight to the squid cache
> despite advice to the contrary, true? So, why now?
>
You guessed correctly, but push data straight, is 10% of our project,
after previous our talk on general ML, i spoken with my boss and
understand that it's big.
You made me happy if you help me a bit when i have problem with data
gathering, because all of my problem is data gathering.
 
By the way, by now, i read portions of structs.h http.c comm.c store.c
client_side.c main.c squid.h enum.h refresh.c store_dir.c url.c pconn.c
globals.c fd.c globals.h typedefs.h lib/getopt.c
and manipulated the following files:
globals.c globals.h main.c squid.h
Because i forced to add a option to squid "-c".

Yours,
Mohsen

> Amos

Received on Thu Jul 14 2011 - 22:30:01 MDT

This archive was generated by hypermail 2.2.0 : Fri Jul 15 2011 - 12:00:04 MDT