changeset 2032:65b1ce7cb84f

Replaced "localhost" by "127.0.0.1", as it might impact performance on Windows
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 Jun 2016 09:26:56 +0200
parents a6e8e2251304
children bfdf24883ff3
files Core/HttpServer/HttpToolbox.cpp Core/WebServiceParameters.cpp NEWS OrthancServer/DicomProtocol/RemoteModalityParameters.cpp Resources/Configuration.json Resources/Samples/ImportDicomFiles/ImportDicomFiles.py Resources/Samples/Lua/CallWebService.lua Resources/Samples/Python/AnonymizeAllPatients.py Resources/Samples/Python/ArchiveAllPatients.py Resources/Samples/Python/ArchiveStudiesInTimeRange.py Resources/Samples/Python/AutoClassify.py Resources/Samples/Python/ChangesLoop.py Resources/Samples/Python/ContinuousPatientAnonymization.py Resources/Samples/Python/DownloadAnonymized.py Resources/Samples/Python/HighPerformanceAutoRouting.py Resources/Samples/Python/ManualModification.py Resources/Samples/Python/Replicate.py
diffstat 17 files changed, 20 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/Core/HttpServer/HttpToolbox.cpp	Mon Jun 20 16:03:26 2016 +0200
+++ b/Core/HttpServer/HttpToolbox.cpp	Tue Jun 21 09:26:56 2016 +0200
@@ -41,7 +41,7 @@
 #include "StringHttpOutput.h"
 
 
-static const char* LOCALHOST = "localhost";
+static const char* LOCALHOST = "127.0.0.1";
 
 
 
--- a/Core/WebServiceParameters.cpp	Mon Jun 20 16:03:26 2016 +0200
+++ b/Core/WebServiceParameters.cpp	Tue Jun 21 09:26:56 2016 +0200
@@ -43,7 +43,7 @@
 {
   WebServiceParameters::WebServiceParameters() : 
     advancedFormat_(false),
-    url_("http://localhost:8042/"),
+    url_("http://127.0.0.1:8042/"),
     pkcs11Enabled_(false)
   {
   }
--- a/NEWS	Mon Jun 20 16:03:26 2016 +0200
+++ b/NEWS	Tue Jun 21 09:26:56 2016 +0200
@@ -54,6 +54,7 @@
 * Fix issue 11 (is_regular_file() fails for FILE_ATTRIBUTE_REPARSE_POINT)
 * Fix issue 16 ("Limit" parameter error in REST API /tools/find method)
 * Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
+* Replaced "localhost" by "127.0.0.1", as it might impact performance on Windows
 * Compatibility with CMake >= 3.5.0
 * Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
 * Upgrade to Boost 1.60.0 for static builds
--- a/OrthancServer/DicomProtocol/RemoteModalityParameters.cpp	Mon Jun 20 16:03:26 2016 +0200
+++ b/OrthancServer/DicomProtocol/RemoteModalityParameters.cpp	Tue Jun 21 09:26:56 2016 +0200
@@ -43,7 +43,7 @@
 {
   RemoteModalityParameters::RemoteModalityParameters() :
     aet_("ORTHANC"),
-    host_("localhost"),
+    host_("127.0.0.1"),
     port_(104),
     manufacturer_(ModalityManufacturer_Generic)
   {
--- a/Resources/Configuration.json	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Configuration.json	Tue Jun 21 09:26:56 2016 +0200
@@ -145,7 +145,7 @@
      * store (shipped in the DCMTK distribution) started by the
      * command line "storescp 2000".
      **/
-    // "sample" : [ "STORESCP", "localhost", 2000 ]
+    // "sample" : [ "STORESCP", "127.0.0.1", 2000 ]
 
     /**
      * A fourth parameter is available to enable patches for a
@@ -165,8 +165,8 @@
      * followed by the username/password pair (if the password
      * protection is enabled on the peer).
      **/
-    // "peer"  : [ "http://localhost:8043/", "alice", "alicePassword" ]
-    // "peer2" : [ "http://localhost:8044/" ]
+    // "peer"  : [ "http://127.0.0.1:8043/", "alice", "alicePassword" ]
+    // "peer2" : [ "http://127.0.0.1:8044/" ]
 
     /**
      * This is another, more advanced format to define Orthanc
@@ -175,7 +175,7 @@
      * enable PKCS#11 authentication for smart cards.
      **/
     // "peer" : {
-    //   "Url" : "http://localhost:8043/",
+    //   "Url" : "http://127.0.0.1:8043/",
     //   "Username" : "alice",
     //   "Password" : "alicePassword",
     //   "CertificateFile" : "client.crt",
--- a/Resources/Samples/ImportDicomFiles/ImportDicomFiles.py	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/ImportDicomFiles/ImportDicomFiles.py	Tue Jun 21 09:26:56 2016 +0200
@@ -33,7 +33,7 @@
 
 Usage: %s [hostname] [HTTP port] [path]
 Usage: %s [hostname] [HTTP port] [path] [username] [password]
-For instance: %s localhost 8042 .
+For instance: %s 127.0.0.1 8042 .
 """ % (sys.argv[0], sys.argv[0], sys.argv[0]))
     exit(-1)
 
--- a/Resources/Samples/Lua/CallWebService.lua	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/Lua/CallWebService.lua	Tue Jun 21 09:26:56 2016 +0200
@@ -17,7 +17,7 @@
    info['PatientID'] = tags['PatientID']
 
    -- Send the POST request
-   local answer = HttpPost('http://localhost:8000/', JSON:encode(info))
+   local answer = HttpPost('http://127.0.0.1:8000/', JSON:encode(info))
 
    -- The answer equals "ERROR" in case of an error
    print('Web service called, answer received: ' .. answer)
--- a/Resources/Samples/Python/AnonymizeAllPatients.py	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/Python/AnonymizeAllPatients.py	Tue Jun 21 09:26:56 2016 +0200
@@ -20,7 +20,7 @@
 
 
 
-URL = 'http://localhost:8042'
+URL = 'http://127.0.0.1:8042'
 
 #
 # This sample code will anonymize all the patients that are stored in
--- a/Resources/Samples/Python/ArchiveAllPatients.py	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/Python/ArchiveAllPatients.py	Tue Jun 21 09:26:56 2016 +0200
@@ -28,7 +28,7 @@
 def PrintHelp():
     print('Download one ZIP archive for all the patients stored in Orthanc\n')
     print('Usage: %s <URL> <Target>\n' % sys.argv[0])
-    print('Example: %s http://localhost:8042/ /tmp/Archive.zip\n' % sys.argv[0])
+    print('Example: %s http://127.0.0.1:8042/ /tmp/Archive.zip\n' % sys.argv[0])
     exit(-1)
 
 if len(sys.argv) != 3:
--- a/Resources/Samples/Python/ArchiveStudiesInTimeRange.py	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/Python/ArchiveStudiesInTimeRange.py	Tue Jun 21 09:26:56 2016 +0200
@@ -29,7 +29,7 @@
     print('Download ZIP archives for all the studies generated '
           'during a given time range (according to the StudyDate tag)\n')
     print('Usage: %s <URL> <StartDate> <EndDate> <TargetFolder>\n' % sys.argv[0])
-    print('Example: %s http://localhost:8042/ 20150101 20151231 /tmp/\n' % sys.argv[0])
+    print('Example: %s http://127.0.0.1:8042/ 20150101 20151231 /tmp/\n' % sys.argv[0])
     exit(-1)
 
 def CheckIsDate(date):
--- a/Resources/Samples/Python/AutoClassify.py	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/Python/AutoClassify.py	Tue Jun 21 09:26:56 2016 +0200
@@ -30,7 +30,7 @@
     description = 'Automated classification of DICOM files from Orthanc.',
     formatter_class = argparse.ArgumentDefaultsHelpFormatter)
 
-parser.add_argument('--host', default = 'localhost',
+parser.add_argument('--host', default = '127.0.0.1',
                     help = 'The host address that runs Orthanc')
 parser.add_argument('--port', type = int, default = '8042',
                     help = 'The port number to which Orthanc is listening for the REST API')
--- a/Resources/Samples/Python/ChangesLoop.py	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/Python/ChangesLoop.py	Tue Jun 21 09:26:56 2016 +0200
@@ -34,7 +34,7 @@
 images into Orthanc (through the Changes API).
 
 Usage: %s [hostname] [HTTP port]
-For instance: %s localhost 8042
+For instance: %s 127.0.0.1 8042
 """ % (sys.argv[0], sys.argv[0]))
     exit(-1)
 
--- a/Resources/Samples/Python/ContinuousPatientAnonymization.py	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/Python/ContinuousPatientAnonymization.py	Tue Jun 21 09:26:56 2016 +0200
@@ -37,7 +37,7 @@
 the configuration option "StableAge").
 
 Usage: %s [hostname] [HTTP port]
-For instance: %s localhost 8042
+For instance: %s 127.0.0.1 8042
 """ % (sys.argv[0], sys.argv[0]))
     exit(-1)
 
--- a/Resources/Samples/Python/DownloadAnonymized.py	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/Python/DownloadAnonymized.py	Tue Jun 21 09:26:56 2016 +0200
@@ -20,7 +20,7 @@
 
 
 
-URL = 'http://localhost:8042'
+URL = 'http://127.0.0.1:8042'
 
 #
 # This sample code will download a ZIP file for each patient that has
--- a/Resources/Samples/Python/HighPerformanceAutoRouting.py	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/Python/HighPerformanceAutoRouting.py	Tue Jun 21 09:26:56 2016 +0200
@@ -20,7 +20,7 @@
 
 
 
-URL = 'http://localhost:8042'
+URL = 'http://127.0.0.1:8042'
 TARGET = 'sample'
 
 
--- a/Resources/Samples/Python/ManualModification.py	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/Python/ManualModification.py	Tue Jun 21 09:26:56 2016 +0200
@@ -29,7 +29,7 @@
 
 from RestToolbox import *
 
-URL = 'http://localhost:8042'
+URL = 'http://127.0.0.1:8042'
 STUDY = '27f7126f-4f66fb14-03f4081b-f9341db2-53925988'
 
 identifiers = {}
--- a/Resources/Samples/Python/Replicate.py	Mon Jun 20 16:03:26 2016 +0200
+++ b/Resources/Samples/Python/Replicate.py	Tue Jun 21 09:26:56 2016 +0200
@@ -33,7 +33,7 @@
 server through their REST API.
 
 Usage: %s [SourceURI] [TargetURI]
-For instance: %s http://orthanc:password@localhost:8042/ http://localhost:8043/
+For instance: %s http://orthanc:password@127.0.0.1:8042/ http://127.0.0.1:8043/
 """ % (sys.argv[0], sys.argv[0]))
     exit(-1)