|
|
@@ -0,0 +1,285 @@ |
|
|
diff --git a/mythtv/external/libexiv2/include/exiv2/exv_conf.h b/mythtv/external/libexiv2/include/exiv2/exv_conf.h |
|
|
index 99622ed5b7..ac0a9dfe20 100644 |
|
|
--- a/mythtv/external/libexiv2/include/exiv2/exv_conf.h |
|
|
+++ b/mythtv/external/libexiv2/include/exiv2/exv_conf.h |
|
|
@@ -13,7 +13,9 @@ |
|
|
/* #undef EXV_ENABLE_WEBREADY */ |
|
|
|
|
|
// Define if you have the `gmtime_r' function. |
|
|
-#define EXV_HAVE_GMTIME_R |
|
|
+#ifndef _WIN32 |
|
|
+ #define EXV_HAVE_GMTIME_R |
|
|
+#endif |
|
|
|
|
|
// Define if you have the <libintl.h> header file. |
|
|
/* #undef EXV_HAVE_LIBINTL_H */ |
|
|
@@ -61,10 +63,14 @@ |
|
|
#define EXV_HAVE_STRINGS_H |
|
|
|
|
|
// Define if you have the mmap function. |
|
|
-#define EXV_HAVE_MMAP |
|
|
+#ifndef _WIN32 |
|
|
+ #define EXV_HAVE_MMAP |
|
|
+#endif |
|
|
|
|
|
// Define if you have the munmap function. |
|
|
-#define EXV_HAVE_MUNMAP |
|
|
+#ifndef _WIN32 |
|
|
+ #define EXV_HAVE_MUNMAP |
|
|
+#endif |
|
|
|
|
|
// Define if you have <sys/stat.h> header file. |
|
|
#define EXV_HAVE_SYS_STAT_H |
|
|
diff --git a/mythtv/external/libexiv2/libexiv2.pro b/mythtv/external/libexiv2/libexiv2.pro |
|
|
index 1ccb983477..04819c0cb3 100644 |
|
|
--- a/mythtv/external/libexiv2/libexiv2.pro |
|
|
+++ b/mythtv/external/libexiv2/libexiv2.pro |
|
|
@@ -5,6 +5,8 @@ TARGET = mythexiv2-0.28 |
|
|
target.path = $${LIBDIR} |
|
|
INSTALLS = target |
|
|
|
|
|
+mingw:LIBS += -lz -liconv |
|
|
+ |
|
|
darwin { |
|
|
QMAKE_CXXFLAGS = "-I. -I./include -I./include/exiv2 -I./src -I./xmpsdk/include" $${QMAKE_CXXFLAGS} |
|
|
LIBS += -lexpat -liconv -lz |
|
|
diff --git a/mythtv/external/libexiv2/src/crwimage_int.cpp b/mythtv/external/libexiv2/src/crwimage_int.cpp |
|
|
index 9959f2310a..00bf2d333e 100644 |
|
|
--- a/mythtv/external/libexiv2/src/crwimage_int.cpp |
|
|
+++ b/mythtv/external/libexiv2/src/crwimage_int.cpp |
|
|
@@ -1141,7 +1141,7 @@ namespace Exiv2 { |
|
|
struct tm tm; |
|
|
std::memset(&tm, 0x0, sizeof(tm)); |
|
|
int rc = exifTime(ed->toString().c_str(), &tm); |
|
|
- if (rc == 0) t = timegm(&tm); |
|
|
+ //if (rc == 0) t = timegm(&tm); |
|
|
} |
|
|
if (t != 0) { |
|
|
DataBuf buf(12); |
|
|
diff --git a/mythtv/external/libexiv2/src/futils.cpp b/mythtv/external/libexiv2/src/futils.cpp |
|
|
index 884fb5ff68..9948ff18e1 100644 |
|
|
--- a/mythtv/external/libexiv2/src/futils.cpp |
|
|
+++ b/mythtv/external/libexiv2/src/futils.cpp |
|
|
@@ -479,9 +479,9 @@ namespace Exiv2 { |
|
|
processHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, GetCurrentProcessId()); |
|
|
if (processHandle != nullptr) { |
|
|
TCHAR filename[MAX_PATH]; |
|
|
- if (GetModuleFileNameEx(processHandle, nullptr, filename, MAX_PATH) != 0) { |
|
|
+ //if (GetModuleFileNameEx(processHandle, nullptr, filename, MAX_PATH) != 0) { |
|
|
ret = filename; |
|
|
- } |
|
|
+ //} |
|
|
CloseHandle(processHandle); |
|
|
} |
|
|
#elif defined(__APPLE__) |
|
|
@@ -526,14 +526,14 @@ namespace Exiv2 { |
|
|
// enumerate loaded libraries and determine path to executable |
|
|
HMODULE handles[200]; |
|
|
DWORD cbNeeded; |
|
|
- if ( EnumProcessModules(GetCurrentProcess(),handles,lengthof(handles),&cbNeeded)) { |
|
|
- char szFilename[_MAX_PATH]; |
|
|
- for ( DWORD h = 0 ; h < cbNeeded/sizeof(handles[0]) ; h++ ) { |
|
|
- GetModuleFileNameA(handles[h],szFilename,lengthof(szFilename)) ; |
|
|
- std::string path(szFilename); |
|
|
- pushPath(path,libs,paths); |
|
|
- } |
|
|
- } |
|
|
+ //if ( EnumProcessModules(GetCurrentProcess(),handles,lengthof(handles),&cbNeeded)) { |
|
|
+ //char szFilename[_MAX_PATH]; |
|
|
+ //for ( DWORD h = 0 ; h < cbNeeded/sizeof(handles[0]) ; h++ ) { |
|
|
+ //GetModuleFileNameA(handles[h],szFilename,lengthof(szFilename)) ; |
|
|
+ //std::string path(szFilename); |
|
|
+ //pushPath(path,libs,paths); |
|
|
+ //} |
|
|
+ //} |
|
|
#elif defined(__APPLE__) |
|
|
// man 3 dyld |
|
|
uint32_t count = _dyld_image_count(); |
|
|
diff --git a/mythtv/external/libexiv2/src/http.cpp b/mythtv/external/libexiv2/src/http.cpp |
|
|
index dc5f0ac97c..9d073fa823 100644 |
|
|
--- a/mythtv/external/libexiv2/src/http.cpp |
|
|
+++ b/mythtv/external/libexiv2/src/http.cpp |
|
|
@@ -132,7 +132,7 @@ int sleep_ = SLEEP; |
|
|
|
|
|
static int forgive(int n, int& err) |
|
|
{ |
|
|
- err = WSAGetLastError(); |
|
|
+ err = 0;//WSAGetLastError(); |
|
|
if (!n && !err) |
|
|
return FINISH; |
|
|
#ifndef WIN32 |
|
|
@@ -140,7 +140,7 @@ static int forgive(int n, int& err) |
|
|
return FINISH; // server hungup |
|
|
#endif |
|
|
bool bForgive = err == WSAEWOULDBLOCK || err == WSAENOTCONN; |
|
|
- bool bError = n == SOCKET_ERROR; |
|
|
+ bool bError = true;//n == SOCKET_ERROR; |
|
|
if (bError && bForgive) |
|
|
return 0; |
|
|
return n; |
|
|
@@ -192,7 +192,8 @@ static int makeNonBlocking(int sockfd) |
|
|
{ |
|
|
#ifdef WIN32 |
|
|
ULONG ioctl_opt = 1; |
|
|
- return ioctlsocket(sockfd, FIONBIO, &ioctl_opt); |
|
|
+ //return ioctlsocket(sockfd, FIONBIO, &ioctl_opt); |
|
|
+ return 0; |
|
|
#else |
|
|
int result = fcntl(sockfd, F_SETFL, O_NONBLOCK); |
|
|
return result >= 0 ? result : SOCKET_ERROR; |
|
|
@@ -217,8 +218,8 @@ int Exiv2::http(Exiv2::Dictionary& request, Exiv2::Dictionary& response, std::st |
|
|
//////////////////////////////////// |
|
|
// Windows specific code |
|
|
#ifdef WIN32 |
|
|
- WSADATA wsaData; |
|
|
- WSAStartup(MAKEWORD(2, 2), &wsaData); |
|
|
+ //WSADATA wsaData; |
|
|
+ //WSAStartup(MAKEWORD(2, 2), &wsaData); |
|
|
#endif |
|
|
|
|
|
const char* servername = request["server"].c_str(); |
|
|
@@ -268,41 +269,41 @@ int Exiv2::http(Exiv2::Dictionary& request, Exiv2::Dictionary& response, std::st |
|
|
|
|
|
//////////////////////////////////// |
|
|
// open the socket |
|
|
- int sockfd = (int)socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
|
|
+ int sockfd = 0; //(int)socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
|
|
if (sockfd < 0) |
|
|
return error(errors, "unable to create socket\n", nullptr, nullptr, 0); |
|
|
|
|
|
// fill in the address |
|
|
- struct sockaddr_in serv_addr; |
|
|
- int serv_len = sizeof(serv_addr); |
|
|
- memset((char*)&serv_addr, 0, serv_len); |
|
|
+ //struct sockaddr_in serv_addr; |
|
|
+ int serv_len = 0; //sizeof(serv_addr); |
|
|
+ //memset((char*)&serv_addr, 0, serv_len); |
|
|
|
|
|
- serv_addr.sin_addr.s_addr = inet_addr(servername_p); |
|
|
- serv_addr.sin_family = AF_INET; |
|
|
- serv_addr.sin_port = htons(atoi(port_p)); |
|
|
+ //serv_addr.sin_addr.s_addr = inet_addr(servername_p); |
|
|
+ //serv_addr.sin_family = AF_INET; |
|
|
+ //serv_addr.sin_port = htons(atoi(port_p)); |
|
|
|
|
|
// convert unknown servername into IP address |
|
|
// http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/rzab6/rzab6uafinet.htm |
|
|
- if (serv_addr.sin_addr.s_addr == (unsigned long)INADDR_NONE) { |
|
|
- struct hostent* host = gethostbyname(servername_p); |
|
|
- if (!host) { |
|
|
- closesocket(sockfd); |
|
|
- return error(errors, "no such host", servername_p); |
|
|
- } |
|
|
- memcpy(&serv_addr.sin_addr, host->h_addr, sizeof(serv_addr.sin_addr)); |
|
|
- } |
|
|
+ //if (serv_addr.sin_addr.s_addr == (unsigned long)INADDR_NONE) { |
|
|
+ //struct hostent* host = gethostbyname(servername_p); |
|
|
+ //if (!host) { |
|
|
+ ////closesocket(sockfd); |
|
|
+ //return error(errors, "no such host", servername_p); |
|
|
+ //} |
|
|
+ //memcpy(&serv_addr.sin_addr, host->h_addr, sizeof(serv_addr.sin_addr)); |
|
|
+ //} |
|
|
|
|
|
makeNonBlocking(sockfd); |
|
|
|
|
|
//////////////////////////////////// |
|
|
// connect the socket to the server |
|
|
- auto server = connect(sockfd, (const struct sockaddr*)&serv_addr, serv_len); |
|
|
- if (server == SOCKET_ERROR && WSAGetLastError() != WSAEWOULDBLOCK) { |
|
|
- auto errorCode = WSAGetLastError(); |
|
|
- closesocket(sockfd); |
|
|
- return error(errors, "error - unable to connect to server = %s port = %s wsa_error = %d", servername_p, port_p, |
|
|
- errorCode); |
|
|
- } |
|
|
+ //auto server = connect(sockfd, (const struct sockaddr*)&serv_addr, serv_len); |
|
|
+ //if (server == SOCKET_ERROR && WSAGetLastError() != WSAEWOULDBLOCK) { |
|
|
+ //auto errorCode = WSAGetLastError(); |
|
|
+ //closesocket(sockfd); |
|
|
+ //return error(errors, "error - unable to connect to server = %s port = %s wsa_error = %d", servername_p, port_p, |
|
|
+ // errorCode); |
|
|
+ //} |
|
|
|
|
|
char buffer[32 * 1024 + 1]; |
|
|
size_t buff_l = sizeof buffer - 1; |
|
|
@@ -315,17 +316,17 @@ int Exiv2::http(Exiv2::Dictionary& request, Exiv2::Dictionary& response, std::st |
|
|
|
|
|
//////////////////////////////////// |
|
|
// send the header (we'll have to wait for the connection by the non-blocking socket) |
|
|
- while (sleep_ >= 0 && send(sockfd, buffer, n, 0) == SOCKET_ERROR /* && WSAGetLastError() == WSAENOTCONN */) { |
|
|
- Sleep(snooze); |
|
|
- sleep_ -= snooze; |
|
|
- } |
|
|
+ //while (sleep_ >= 0 && send(sockfd, buffer, n, 0) == SOCKET_ERROR /* && WSAGetLastError() == WSAENOTCONN */) { |
|
|
+ //Sleep(snooze); |
|
|
+ //sleep_ -= snooze; |
|
|
+ //} |
|
|
|
|
|
if (sleep_ < 0) { |
|
|
- auto errorCode = WSAGetLastError(); |
|
|
- closesocket(server); |
|
|
- closesocket(sockfd); |
|
|
- return error(errors, "error - timeout connecting to server = %s port = %s wsa_error = %d", servername, port, |
|
|
- errorCode); |
|
|
+ //auto errorCode = WSAGetLastError(); |
|
|
+ //closesocket(server); |
|
|
+ //closesocket(sockfd); |
|
|
+ //return error(errors, "error - timeout connecting to server = %s port = %s wsa_error = %d", servername, port, |
|
|
+ // errorCode); |
|
|
} |
|
|
|
|
|
int end = 0; // write position in buffer |
|
|
@@ -335,7 +336,7 @@ int Exiv2::http(Exiv2::Dictionary& request, Exiv2::Dictionary& response, std::st |
|
|
//////////////////////////////////// |
|
|
// read and process the response |
|
|
int err; |
|
|
- n = forgive(recv(sockfd, buffer, (int)buff_l, 0), err); |
|
|
+ n = false; //forgive(recv(sockfd, buffer, (int)buff_l, 0), err); |
|
|
while (n >= 0 && OK(status)) { |
|
|
if (n) { |
|
|
end += n; |
|
|
@@ -400,7 +401,7 @@ int Exiv2::http(Exiv2::Dictionary& request, Exiv2::Dictionary& response, std::st |
|
|
flushBuffer(buffer, body, end, file); |
|
|
} |
|
|
} |
|
|
- n = forgive(recv(sockfd, buffer + end, (int)(buff_l - end), 0), err); |
|
|
+ n = false;//forgive(recv(sockfd, buffer + end, (int)(buff_l - end), 0), err); |
|
|
if (!n) { |
|
|
Sleep(snooze); |
|
|
sleep_ -= snooze; |
|
|
@@ -410,26 +411,26 @@ int Exiv2::http(Exiv2::Dictionary& request, Exiv2::Dictionary& response, std::st |
|
|
} |
|
|
|
|
|
if (n != FINISH || !OK(status)) { |
|
|
- snprintf(buffer, sizeof buffer, "wsa_error = %d,n = %d,sleep_ = %d status = %d", WSAGetLastError(), n, sleep_, |
|
|
- status); |
|
|
+ // snprintf(buffer, sizeof buffer, "wsa_error = %d,n = %d,sleep_ = %d status = %d", WSAGetLastError(), n, sleep_, |
|
|
+ // status); |
|
|
error(errors, buffer, nullptr, nullptr, 0); |
|
|
} else if (bSearching && OK(status)) { |
|
|
if (end) { |
|
|
// we finished OK without finding headers, flush the buffer |
|
|
flushBuffer(buffer, 0, end, file); |
|
|
} else { |
|
|
- auto errorCode = WSAGetLastError(); |
|
|
- closesocket(server); |
|
|
- closesocket(sockfd); |
|
|
- return error(errors, "error - no response from server = %s port = %s wsa_error = %d", servername, port, |
|
|
- errorCode); |
|
|
+ //auto errorCode = WSAGetLastError(); |
|
|
+ //closesocket(server); |
|
|
+ //closesocket(sockfd); |
|
|
+ //return error(errors, "error - no response from server = %s port = %s wsa_error = %d", servername, port, |
|
|
+ // errorCode); |
|
|
} |
|
|
} |
|
|
|
|
|
//////////////////////////////////// |
|
|
// close sockets |
|
|
- closesocket(server); |
|
|
- closesocket(sockfd); |
|
|
+ //closesocket(server); |
|
|
+ //closesocket(sockfd); |
|
|
response["body"] = file; |
|
|
return result; |
|
|
} |