Code Monkey home page Code Monkey logo

simple-http-server's People

Contributors

1semele avatar bama4 avatar garfr avatar

Watchers

 avatar  avatar

simple-http-server's Issues

Create Task Structure Library

Description
This ticket involves implementing a task structure. The task library should be a separate folder under the utils top level directory.

This task library should be linked with all of the other util packages into one library called libutils.so.
Depending on the design, the components may need to be split up into separate libraries.

The task takes a callback function, and void * function as its members.

Suggested layout:

typedef void * (*callback) (void *);

typedef  struct _task{
   callback a_task;
   void * arg;
} task;

Goal
The task structure is created and its members include

  • A callback function
  • A void * args member to be used as the callback function argument

Create easy, automated way to run unit tests.

Description

There should be a simple way to run all unit tests in a sub-directory or the entire project.

The automated test should:

  • Allow for the mocking out of external dependencies.
  • Allow for the testing of static methods inside a source file.
  • Have an option to keep the test executable produced.

This could be achieved with the introduction of a testing framework, but make sure to keep an eye open for uneeded complexity. We could also hand-roll our own testing framework to exactly suit our needs but this could be a large time sink.

Testing policy specified here: Simple HTTP Server Testing

Goals

  • Decide upon a framework or methodlogy for unit testing
  • Integrate it into our workflow with easy to execute scripts.

Create HashMap Library

Description
This ticket involves implementing a hashmap library. The hashmap library should be under the utils top level directory.

This hashmap library should be linked with all of the other util packages into one library called libutils.so

This will be implemented as:

  • Open address
  • Linear Probing
  • A load capacity of 0.75

(See Open Addressing)

Goal
The following functions are created for the hashmap:

  • Function for mapping string key to index

Also:

  • Write unit tests for the hashmap

Create State Diagram of Socket TCP Manager Design

Description

This ticket involves adding a state diagram for the socket_tcp_manager library.

The library should include the following:

  • Handles tcp socket connections in a multithreaded way
  • Has a limit on number of threads that can be used
  • Has a limit on number of active connections at one time

Prerequisites
N/A

Goal
Design conveys:

  • How sockets will be created
  • How connections will be managed through multithreading
  • How data will be passed back and forth

Improved logging in the testing framework

Description

The testing framework should offer the ability to log the line number where the assert failed. This can be achieved through the usage of the __LINE__, and will greatly improve testing, as currently the test can only output if it failed or succeeded. This will involve a significant change to the way that the testing process works.

Requirements

  • Return the line number on failed asserts
  • Create a preprocessor definition that turns this off

Create String Library

Description

Heavy string processing on null terminated strings can become a tricky and tedious process, and the standard string library has many functions that will readily supply buffer overflows. To deal with this, a string implementation that holds the length of the string with the actual contents of the string can be used instead.

Goal

The string library needs to fit the following qualifications

  • Convert to and from null terminated strings
  • Implement a standard set of string functions (strcpy, strcat, strcmp, etc.)
  • Maintain memory safety, and err on the side of preventing memory errors whenever possible
  • Avoid dynamic memory allocation when possible, yet still provide functions that require it
  • Have a complete set of unit tests

Create generic resizeable array implementation

Description

The vector is similar to the std::vector implementation in the C++ STL. The key difference from other C vector implementation is that it should hold the actual contents of the data its stores, instead of storing pointers to the data. This allows the data to be accessed as the contiguous array it is and allows for better cache locality.

Requirements

  • Support data of any size
  • Support basic functions such as push, pop, and index
  • Allow for the entire internal array to be accessed
  • Write unit tests for the corresponding functions

Create Base Project Directory Structure

Description
This issue involves adding a bare project structure to the main branch
The structure of the project is as follows:

socket_tcp_manager
    |_____________   src
                     |_____________ socket_tcp_manager.c
    |_____________   test
                     |_____________ test_socket_tcp_manager.c
    |_____________   include
                      |_____________ socket_tcp_manager.h  

http	
    |_____________   src
                      |_____________ http.c	
    |_____________   test
                      |_____________ test_http.c
    |_____________   include
                     |_____________ http.h  

simple_http_server
    |_____________   src
                      |____________ simple_http_server.c
    |_____________   test
                      |_____________ test_simple_http_server.c
    |_____________   include
                      |_____________ simple_http_server.h  
scripts
    |_____________   install.sh

man
    |_____________   simple_http_server.man

Prerequisites
Design documents are done.

Goal
This ticket requires the following:

  • Create stubbed out project, files can be empty

Definition of Done
This ticket is completed when this is merged into main

Create Queue Library

Description
This ticket involves implementing a queue library. The queue library should be a separate folder under the utils top level directory.

This queue library should be linked with all of the other util packages into one library called libutils.so

Goal
The following functions are created for the queue:

  • queue_t * init_queue() to initialize an empty queue
  • void enqueue(void * item, queue_t * queue) to add an item to a queue
  • void * dequeue(queue_t * queue) to remove an item from a queue and return it
  • void del_queue(queue_t * queue) to delete a queue and free up any memory associated with constructing the queue (NOT freeing the void * data stored)

Also:

  • Write unit tests for the queue

Add Functions to Linked List Implementation

Description
This ticket makes changes to the implementation of queue/linked list

Goal
The following functions are created:

  • A generic iteration and function pointer call that can be used for printing out linked list nodes generically
  • A remove_node function that given a node, removes it from the linked list.

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.