title: Is there a lightweight multipart/form-data parser in C or C++?
body: <p>I'm looking at integrating multipart form-data parsing in a web server module so that I can relieve backend web applications (often written in dynamic languages) from parsing the multipart data themselves. The multipart grammar (RFC 2046) looks non-trivial and if I implement it by hand a lot of things can go wrong. Is there already a good, lightweight multipart/form-data parser written in C or C++? I'm looking for one with <em>no</em> external dependencies other than the C or C++ standard library. I don't need email attachment handling or buffered I/O classes or a portability runtime or whatever, just multipart/form-data parsing.</p>
  
  <p>Things that I've considered:</p>
  
  <ul>
  <li>GMime - depends on glib, so no go.</li>
  <li>libapreq - too large, depends on APR, badly documented, no unit tests.</li>
  </ul>
  
  <p>I've also looked at writing a parser with Ragel, but I can't figure out how to do it because the grammar is not static: the boundary can change arbitrarily.</p>