Programming question

Federico Voges fvoges
Mon May 17 11:35:27 PDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

On Sun, 28 Jul 2002 15:03:06 -0500, Richard R. Sivernell wrote:

>Need advise from Developers here. Writing an Proxy server for
>colloege class, almost done. I need to know how to find the users
>or the browser cache and read it for returning already have pages,
>like www.google.com. I have a port open & read the get / post request
>and all data now. Just need to do the cache part. Figure Davis B or Kurt
>might have a answer or at least tell me where to go, & not to fly a kite <g>
>or to the moon<g>. Many thanks in advance.

I'm not sure what you need here.

Maybe you should use some kind of DB so you can store object id (object
= page, graphic, etc), timestamp and location. That way, you don't have
to seach a directory tree for each request. In fact, I think this is
the aproach used by ie netscape (haven't looked into it).

For the cached filename and location I'd use some kind of fast hash
generated from the object URL (ie
www.somehost.com/path/to/some/file.html) and store the file using
direatories named using part of the object id. ie: if the object ID is
3487613688, the I will be stored in the directory named "3" or "34".

Then another thread, would scan the DB periodically for expired objects
based on the timestamp and expiration time (global).

>
>   Has anyone got some good code in c or c++ for doing directory searches
>and the alike in Linux or unix. I have the same for Winders, buyt that is not
>for a real OS.

Not of much help, but a god place to start here is man scandir (see
also opendir, readdir, etc)

>
>   I have developed some c++ shared libraries for Sockets & threads. While
>not 100% developed sockets, enough to get you going. Code for IPv4 & IPv6,
>IPv6 still needs debugging & such. Threads stuff works great. The additions of
>mutex & conditional signals need to be done. Basic threads are there.
>
>cheers
>
>-- 
>Rick Sivernell
>Dallas, Texas  75287
>972 306-2296
>res005ru at gte.net
>Caldera Open Linux eWorkStation 3.1.1
>Registered Linux User
>
>   .~.
>  / v \
> /( _ )\
>   ^ ^
>In Linux we trust!
>_______________________________________________
>Linux-users mailing list - http://linux-sxs.org/mailman/listinfo/linux-users
>Subscribe/Unsubscribe info, Archives,and Digests are located at the above URL.

Federico Voges
Socio gerente

Intrasoft
Malabia 2137 14 A
(1425) Buenos Aires
Argentina

Te/Fax: 54-11-4833-5182
e-mail: fvoges at intrasoft.com.ar
Web: http://www.intrasoft.com.ar

PGP Public Key Fingerprint: A536 4595 EB6F D197  FBC1 5C3A 145C 2516

-----BEGIN PGP SIGNATURE-----
Version: PGPsdk version 1.7.1 (C) 1997-1999 Network Associates, Inc. and its affiliated companies.

iQA/AwUBPURoQxRcJRaVKt4XEQK9OgCgm05Fbc2JZo2PCVUMPKDMiJotN4MAn3Zt
IuNanu9+cKCDvqLFcYvcUFsG
=7DTC
-----END PGP SIGNATURE-----





More information about the Linux-users mailing list