
-----------------------------------
beard0
Wed Nov 24, 2004 3:23 pm

Server a la beard0
-----------------------------------
Seeing the server stuff up reminded me of my own server that I have been working on.  It is, in my opinion at least, quite good, so I'll post it here for everyone to take a look at.  It should be remebered however, that it is not perfect.   I have taken precautions to make sure that someone cant /../ out of your web directory, but don't count on it - cause I dont wanna get sued  :D.  I have been playing around too with authentication techniques, but running into problems.  I've been doing actually a fair bit of reading up on http, so a better, more compatible version should be comming.
Enjoy!

-----------------------------------
wtd
Wed Nov 24, 2004 6:51 pm


-----------------------------------
A couple of things.

I see:

var headername, headerval : array 1 .. 20 of string

And I think you need to use a record type.

type Header :
   record
      name, value : string := ""
   end record

Then your array looks like:

var headers : array 1 .. 20 of Header

Also, I noticed you using those arrays in functions and procedures without passing them in as arguments.  You shouldn't do this.  Instead of:

proc headerreset
    for i : 1 .. 20
        headername (i) := ""
        headerval (i) := ""
    end for
    numh := 0
end headerreset

Use something like:

procedure headerReset (var headers : array 1 .. * of Header)
   for i : 1 .. upper (headers)
      headers (i).name := ""
      headers (i).value := ""
   end for
end headerReset

-----------------------------------
r0ssar00
Tue Jan 18, 2005 10:58 am


-----------------------------------
this is one helluva server, compared to others ive seen
