Mercurial > hg > orthanc
diff Core/HttpServer/MongooseServer.cpp @ 59:c996319e90bc orthanc-renaming
renaming in Core
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sun, 16 Sep 2012 09:28:56 +0200 |
parents | a15e90e5d6fc |
children | a6e41de88a53 |
line wrap: on
line diff
--- a/Core/HttpServer/MongooseServer.cpp Sun Sep 16 09:24:13 2012 +0200 +++ b/Core/HttpServer/MongooseServer.cpp Sun Sep 16 09:28:56 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palanthir - A Lightweight, RESTful DICOM Store + * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -31,17 +31,17 @@ #include <stdio.h> #include <boost/thread.hpp> -#include "../PalanthirException.h" +#include "../OrthancException.h" #include "../ChunkedBuffer.h" #include "mongoose.h" -#define PALANTHIR_REALM "Palanthir Secure Area" +#define ORTHANC_REALM "Orthanc Secure Area" static const long LOCALHOST = (127ll << 24) + 1ll; -namespace Palanthir +namespace Orthanc { static const char multipart[] = "multipart/form-data; boundary="; static unsigned int multipartLength = sizeof(multipart) / sizeof(char) - 1; @@ -402,7 +402,7 @@ static void SendUnauthorized(HttpOutput& output) { std::string s = "HTTP/1.1 401 Unauthorized\r\n" - "WWW-Authenticate: Basic realm=\"" PALANTHIR_REALM "\"" + "WWW-Authenticate: Basic realm=\"" ORTHANC_REALM "\"" "\r\n\r\n"; output.Send(&s[0], s.size()); } @@ -481,7 +481,7 @@ HttpHandler::Arguments::const_iterator ct = headers.find("content-type"); if (ct == headers.end()) { - output.SendHeader(Palanthir_HttpStatus_400_BadRequest); + output.SendHeader(Orthanc_HttpStatus_400_BadRequest); return (void*) ""; } @@ -501,11 +501,11 @@ switch (status) { case PostDataStatus_NoLength: - output.SendHeader(Palanthir_HttpStatus_411_LengthRequired); + output.SendHeader(Orthanc_HttpStatus_411_LengthRequired); return (void*) ""; case PostDataStatus_Failure: - output.SendHeader(Palanthir_HttpStatus_400_BadRequest); + output.SendHeader(Orthanc_HttpStatus_400_BadRequest); return (void*) ""; case PostDataStatus_Pending: @@ -528,15 +528,15 @@ handler->Handle(output, std::string(request->request_method), uri, headers, arguments, postData); } - catch (PalanthirException& e) + catch (OrthancException& e) { std::cerr << "MongooseServer Exception [" << e.What() << "]" << std::endl; - output.SendHeader(Palanthir_HttpStatus_500_InternalServerError); + output.SendHeader(Orthanc_HttpStatus_500_InternalServerError); } } else { - output.SendHeader(Palanthir_HttpStatus_404_NotFound); + output.SendHeader(Orthanc_HttpStatus_404_NotFound); } // Mark as processed @@ -599,7 +599,7 @@ pimpl_->context_ = mg_start(&Callback, this, options); if (!pimpl_->context_) { - throw PalanthirException("Unable to launch the Mongoose server"); + throw OrthancException("Unable to launch the Mongoose server"); } } } @@ -654,10 +654,10 @@ { Stop(); -#if PALANTHIR_SSL_ENABLED == 0 +#if ORTHANC_SSL_ENABLED == 0 if (enabled) { - throw PalanthirException("Palanthir has been built without SSL support"); + throw OrthancException("Orthanc has been built without SSL support"); } else {