[Prev][Next][Index][Thread]

Re: Library architecture



Matthew Freedman writes:
 > 
 > On Tue, 1 Aug 1995, Mark Friedman wrote:
 > > I'm a little confused about the library architecture. I see how to do
 > > the "hard" stuff but not how to do the "easy" stuff. For example, if
 > > I just want to get the raw source for an http request and write it to
 > > a socket what functions do I need to override to get the minimal amount
 > > of stuff loaded from the library?
 > 
 > I went through the same process you did, all I wanted to do was use libwww
 > to simply retrieve files via http, and give them to me unmunged. It turns
 > out that by far the easiest way to do this is to simply build the linemode
 > browser www, and fork it off with a -source flag. I.e something like...
 > 
 >   fp = popen("www -source <URL>", "r")
 > 
 > Then read the contents of the URL from the file stream.
 > 
 > Obviously it would run a bit faster if you did not have to fork and do all
 > the www startup for each retrieval, but the over-head is really not that
 > bad, and it was not worth it for me to try and figure out how to integrate
 > it.

I've already figured out one way to do it (the code I included with my
original message is the basic technique). What I really want to know
is how the library works and how to avoid pulling in a lot of what
should be unnecessary library code. Forking a new process is even
worse for me than that!

I believe that my code pretty much does what the Line Mode browser
would do in the case of "-source".

-Mark


References: