Boost logo

Boost :

From: Divye Kapoor (divyekapoor_at_[hidden])
Date: 2008-03-25 14:02:32


Hello developers,
   I'm attaching below a draft proposal for merging the cpp-netlib and
pion-net projects. Its still in the making stage and I would specially
like your feedback about the timeline and the deliverables. I've
deliberately kept the timeline quite loose to allow for unforseen
delays but I really want to get an estimate of how much more can be
squeezed into the project without making the it overambitious given
the timeframe involved (I'm pretty sure that implementation of rfc1867
would require less than 3 weeks but I would like more feedback on this
point). Also, I would like to know if any of the Boost library authors
would be interested in mentoring this proposal because without them,
this proposal is a sunken ship ;-)
Yours sincerely,
Divye Kapoor
PS: Its not yet in the prescribed format for an application, but
there's an almost one to one mapping.

----
Synopsis
   During the course of the Google Summer of Code, I would like to work on the
cpp-netlib [1] and the pion-net [2] projects to ensure that pion-lib HTTP
client-server library is seamlessly integrated with the general messaging
framework specifed in the cpp-netlib architecture [3]. This will not only
address one of the most important use cases of the Boost Asio library as it will
provide a general, cross platform implementation of network communication via
the the HTTP protocol but it will also lower the entry barrier for creating
cross-platform, network aware C++ applications.
Project
   While working on this project, I will have a large codebase to build upon (~
15000 lines in the pion-net project). To ensure robustness of the code, my first
priority will be to create a test suite with Boost.Test and Python (using the
BaseHTTPServer module) to ensure standards conforming behaviour of the initial
code.
   After a testing suite is set up and any discovered bugs are removed, I would
proceed to refactor the pion-net interface of the library to conform to the
interface exposed by the cpp-netlib message classes. This would involve
non-trivial changes in the code base as it would require conversion of the
pion-HTTP* classes to conform to the transformation layer restrictions of the
cpp-netlib classes. This might cause breaking changes to the implementation. All
such changes will be documented and appropriate test cases generated.
   Support for parsing multipart-form data (both encoding and decoding) will
then have to be coded in accordance with rfc1867 [4]. Currently, the
implementation correctly handles only GET parameters and POST parameters encoded
using url-encoding. This creates a limitation of not being able to send and
receive files and other such binary chunks of data via a POST request over the
network. A correct implementation will enable multiple files potentially as
large as 2 GB to be sent and received correctly over the HTTP protocol.
Robustness of the code will be a serious challenge in this case as disk file
security and large file sizes have to be handled. Ensuring reliable operation in
the face of timeouts and incomplete transfer will form an important
consideration of this part of the project. This will take up a bulk of the time
in the project.
   The multipart/form-data handling capabilities will then be augmented by
support for Compression headers (via gzip compression). This will enable
efficient communication on bandwidth constrained networks and will be useful
even for simple HTTP requests as this compression will be handled in a
transparent manner.
   Complete support for cacheing will then have to be built in to the HTTP
request/response model. In particular, support for the Cache-control directives
and Expires directives will have to be built into the client to prevent
unnecessary bandwidth usage.
   Documentation and examples concerning the most common use cases will be
created and in case any time is left, a Boost Extension based plugin system will
be created to allow easy extension of the HTTP protocol stack to handle custom
headers.
Timeline
Prior to actual coding:
   April 14-May 26:
       Finish off examinations at college. Examinations till 13th May.
       Get familiarized with boost extension, Boost.Test, Boost.Asio, gzip,
pion-net and cpp-netlib projects
May 26 - July 7: 6 weeks mark
         July 14: Midterm evaluation
2 weeks - Create a testing suite, ensuring automation and ironing out any
unexpected bugs.
2 weeks - Break the old interface and make it conform with the message transform
API.
3 weeks - Implement the multipart/form-data encoding and decoding algorithms.
Generate test cases. Clean up code
July 14-August 11:
1 week  - Document all the code changes and the new API to which it conforms.
1 week  - Implement the compression header support via optional gzip support
2 weeks - Implement the Cacheing directives.
 < 1 week  - Clean up supporting docs, test cases, etc.
I believe that the timeline is flexible enough to handle any unforseen bugs and
eventualities that tend to crop up yet is tight enough to keep me busy.
Deliverables
   A feature complete HTTP 1.1 header only implementation conforming to the
message <==> rfc data structure mapping of the cpp-netlib project resulting in
an integration of the pion-net and cpp-netlib projects released under the Boost
Software License.
   Documentation, Test and Use cases for the most common scenarios will be
provided.
   The library will compile and run successfully on atleast 2 platforms
(intended Win32 and linux) and with 2 compilers (gcc 4.2 and MSVC 8) in
accordance with Boost portability policies and will follow the Boost naming
conventions.
Benefits for Boost
   A network library supporting HTTP(S) and the most common use cases will be
ready for review.
Learning Experiences in store
   As a result of this project, I'll gain valuable experience in coding to rfc
specifications and gain valuable insight into the working of the HTTP protocol.
In addition, I'll get a hands-on experience in working with Boost.Asio and
achieve a deeper understanding of the Boost libraries.
About Me
   I'm a 19 year old student from the small town of Jamshedpur, India. I'm
pursuing my Integrated Dual Degree course in Computer Science and Engineering
(Bachelors) with a Masters specialization in Information Technology at the
Indian Institute of Technology, Roorkee. I have a strong algorithmic and coding
background. I've been ranked 2nd at the International Informatics Olympiad 2005
and 7th All India at the National Cyber Olympiad 2006. I've been coding in C++
for the past 6 years and I have been using the STL for the past 3 years. Over
the past year, I've come to use the Boost.Spirit, Boost.Bind and Boost.Lambda
libraries and I have gained valuable experience from them. Now, I wish to make
my own contribution to Boost by helping to bring network abstraction to the
Boost library.
[1] http://sourceforge.net/projects/cpp-netlib/
[2] http://www.pion.org/projects/pion-network-library
[3] http://cpp-netlib.wiki.sourceforge.net/Architectural+Documentation
[4] http://www.ietf.org/rfc/rfc1867.txt
-- 
Whether the chicken crossed the road or the road moved beneath the
chicken depends upon your frame of reference.
My official web site: http://www.iitr.ernet.in/studenthomepages/homepages/061305

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk