Giter VIP home page Giter VIP logo

mountain-cms's Introduction

Mountain CMS Notes
Daniel A. White

This is by far a very incomplete web server using pthreads and sqlite.

All you need to do to compile it is call to `make`. This will build everything.

To run it, execute `./mtn-cms`.  No parameters are implemeted at this time.

To test, run `telnet` with like this from another terminal
  
  telnet localhost 27000

To retrieve a page (only page1 and page2 exist); type `GET page1` or 
`GET page2`

If run in succession (within the 60 time to live window), the page returned
will be from cache.  The pages are date stamped to show this. Once 60 seconds
has elapsed, the cache is no longer used, but then the page is rebuilt and 
stamped.

This is my basic structure.


     ~~ Main Thread ~~
     	  | Open and listen for connection
     	  | On accept() unblocking
     	  | \
	  |  | ~~ Child Thread (mtn_cms_http_worker) ~~
	  |    	  \
	  |	   | Read the header
	  |	   | Process the header
	  |	   | Get the Page (or build it if needed)
	  | 	   | Build response header
	  |	   | Write the response header
	  |	   | Write the page data
	  |	   | Close the connection
          |        * Thread dies
	  | Loop back and wait for another on accept()



I hope this is all good for you.  I am so sorry it took me so long.

Some notes:  I didnt write CppSqlite3 or even SQLite for that matter.  Its from 
     <http://www.codeproject.com/KB/database/CppSQLite.aspx>

Have a great time in China.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.