comparison Core/HttpServer/HttpServer.cpp @ 3445:4944b03bb9c6

notes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 24 Jun 2019 17:46:18 +0200
parents b9cba6a91780
children 9cc09f4c0fa9
comparison
equal deleted inserted replaced
3444:6fe42a335a80 3445:4944b03bb9c6
481 typedef boost::find_iterator<std::string::iterator> FindIterator; 481 typedef boost::find_iterator<std::string::iterator> FindIterator;
482 typedef boost::iterator_range<char*> Range; 482 typedef boost::iterator_range<char*> Range;
483 483
484 //chunkStore.Print(); 484 //chunkStore.Print();
485 485
486 // TODO - Refactor using class "MultipartStreamReader"
486 try 487 try
487 { 488 {
488 FindIterator last; 489 FindIterator last;
489 for (FindIterator it = 490 for (FindIterator it =
490 make_find_iterator(body, boost::first_finder(boundary)); 491 make_find_iterator(body, boost::first_finder(boundary));
839 IHttpHandler::Arguments::const_iterator ct = headers.find("content-type"); 840 IHttpHandler::Arguments::const_iterator ct = headers.find("content-type");
840 if (ct != headers.end() && 841 if (ct != headers.end() &&
841 ct->second.size() >= MULTIPART_FORM_LENGTH && 842 ct->second.size() >= MULTIPART_FORM_LENGTH &&
842 !memcmp(ct->second.c_str(), MULTIPART_FORM, MULTIPART_FORM_LENGTH)) 843 !memcmp(ct->second.c_str(), MULTIPART_FORM, MULTIPART_FORM_LENGTH))
843 { 844 {
845 /**
846 * The user uses the "upload" form of Orthanc Explorer, for
847 * file uploads through a HTML form.
848 **/
844 status = ParseMultipartForm(body, connection, headers, ct->second, server.GetChunkStore()); 849 status = ParseMultipartForm(body, connection, headers, ct->second, server.GetChunkStore());
845 isMultipartForm = true; 850 isMultipartForm = true;
846 } 851 }
847 852
848 if (!isMultipartForm) 853 if (!isMultipartForm)