Mercurial > hg > orthanc
diff OrthancFramework/Resources/Patches/dcmtk-3.6.0-speed.patch @ 4044:d25f4c0fa160 framework
splitting code into OrthancFramework and OrthancServer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 10 Jun 2020 20:30:34 +0200 |
parents | Resources/Patches/dcmtk-3.6.0-speed.patch@bfcf5a7f92e7 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OrthancFramework/Resources/Patches/dcmtk-3.6.0-speed.patch Wed Jun 10 20:30:34 2020 +0200 @@ -0,0 +1,54 @@ +diff -urEb dcmtk-3.6.0.orig/dcmnet/libsrc/dul.cc dcmtk-3.6.0/dcmnet/libsrc/dul.cc +--- dcmtk-3.6.0.orig/dcmnet/libsrc/dul.cc 2017-03-17 15:49:23.043061969 +0100 ++++ dcmtk-3.6.0/dcmnet/libsrc/dul.cc 2017-03-17 15:50:44.075359547 +0100 +@@ -630,7 +630,10 @@ + if (cond.bad()) + return cond; + +- cond = PRV_NextPDUType(association, block, timeout, &pduType); ++ /* This is the first time we read from this new connection, so in case it ++ * doesn't speak DICOM, we shouldn't wait forever (= DUL_NOBLOCK). ++ */ ++ cond = PRV_NextPDUType(association, DUL_NOBLOCK, PRV_DEFAULTTIMEOUT, &pduType); + + if (cond == DUL_NETWORKCLOSED) + event = TRANS_CONN_CLOSED; +@@ -1770,7 +1773,7 @@ + // send number of socket handle in child process over anonymous pipe + DWORD bytesWritten; + char buf[20]; +- sprintf(buf, "%i", OFreinterpret_cast(int, childSocketHandle)); ++ sprintf(buf, "%i", OFstatic_cast(int, OFreinterpret_cast(size_t, childSocketHandle))); + if (!WriteFile(hChildStdInWriteDup, buf, strlen(buf) + 1, &bytesWritten, NULL)) + { + CloseHandle(hChildStdInWriteDup); +@@ -1780,7 +1783,7 @@ + // return OF_ok status code DULC_FORKEDCHILD with descriptive text + OFOStringStream stream; + stream << "New child process started with pid " << OFstatic_cast(int, pi.dwProcessId) +- << ", socketHandle " << OFreinterpret_cast(int, childSocketHandle) << OFStringStream_ends; ++ << ", socketHandle " << OFstatic_cast(int, OFreinterpret_cast(size_t, childSocketHandle)) << OFStringStream_ends; + OFSTRINGSTREAM_GETOFSTRING(stream, msg) + return makeDcmnetCondition(DULC_FORKEDCHILD, OF_ok, msg.c_str()); + } +@@ -1840,7 +1843,7 @@ + } + #endif + #endif +- setTCPBufferLength(sock); ++ //setTCPBufferLength(sock); + + #ifndef DONT_DISABLE_NAGLE_ALGORITHM + /* +diff -urEb dcmtk-3.6.0.orig/dcmnet/libsrc/dulfsm.cc dcmtk-3.6.0/dcmnet/libsrc/dulfsm.cc +--- dcmtk-3.6.0.orig/dcmnet/libsrc/dulfsm.cc 2017-03-17 15:49:23.043061969 +0100 ++++ dcmtk-3.6.0/dcmnet/libsrc/dulfsm.cc 2017-03-17 15:49:48.467144792 +0100 +@@ -2417,7 +2417,7 @@ + return makeDcmnetCondition(DULC_TCPINITERROR, OF_error, msg.c_str()); + } + #endif +- setTCPBufferLength(s); ++ //setTCPBufferLength(s); + + #ifndef DONT_DISABLE_NAGLE_ALGORITHM + /*