Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Server a la beard0
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
beard0




PostPosted: Wed Nov 24, 2004 3:23 pm   Post subject: 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!



Server.t
 Description:
The actual server

Download
 Filename:  Server.t
 Filesize:  11.36 KB
 Downloaded:  235 Time(s)


settings.ini.t
 Description:
The settings file (remove .t)

Download
 Filename:  settings.ini.t
 Filesize:  160 Bytes
 Downloaded:  204 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Wed Nov 24, 2004 6:51 pm   Post subject: (No subject)

A couple of things.

I see:

code:
var headername, headerval : array 1 .. 20 of string


And I think you need to use a record type.

code:
type Header :
   record
      name, value : string := ""
   end record


Then your array looks like:

code:
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:

code:
proc headerreset
    for i : 1 .. 20
        headername (i) := ""
        headerval (i) := ""
    end for
    numh := 0
end headerreset


Use something like:

code:
procedure headerReset (var headers : array 1 .. * of Header)
   for i : 1 .. upper (headers)
      headers (i).name := ""
      headers (i).value := ""
   end for
end headerReset
r0ssar00




PostPosted: Tue Jan 18, 2005 10:58 am   Post subject: (No subject)

this is one helluva server, compared to others ive seen
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: