*** empty log message ***

This commit is contained in:
David Rose 2001-05-02 16:25:39 +00:00
parent 893ecf7d5e
commit 5a1d6dbcad
3 changed files with 106 additions and 95 deletions

View File

@ -3,19 +3,23 @@
dtoolutil:c dtoolbase:c dtool:m
#define USE_ZLIB yes
#define USE_IPC yes
#define USE_NET yes
#begin lib_target
#define TARGET downloader
#define SOURCES \
config_downloader.cxx \
config_downloader.h downloadDb.I \
config_downloader.h \
asyncUtility.I asyncUtility.cxx asyncUtility.h \
downloadDb.cxx downloadDb.h \
downloader.I downloader.cxx downloader.h extractor.cxx extractor.h \
extractor.cxx extractor.h \
multiplexStream.I multiplexStream.cxx multiplexStream.h \
multiplexStreamBuf.I multiplexStreamBuf.cxx multiplexStreamBuf.h
#define IF_NET_SOURCES \
downloadDb.I downloadDb.cxx downloadDb.h \
downloader.I downloader.cxx downloader.h
#define IF_ZLIB_SOURCES \
decompressor.cxx decompressor.h zcompressor.I zcompressor.cxx \
zcompressor.h download_utils.cxx download_utils.h

View File

@ -12,60 +12,6 @@
#include <winsock.h>
#endif
////////////////////////////////////////////////////////////////////
// Function: handle_socket_error
// Description:
////////////////////////////////////////////////////////////////////
const char*
handle_socket_error(void) {
#ifndef WIN32
return strerror(errno);
#else
int err = WSAGetLastError();
switch (err) {
case 10022:
return "An invalid argument was supplied";
case 10036:
return "A blocking operation is currently executing";
case 10040:
return "Message was larger than internal buffer or network limit";
case 10050:
return "Network dead";
case 10051:
return "Network unreachable";
case 10052:
return "Connection broken because keep-alive detected a failure";
case 10053:
return "Connection aborted by local host software";
case 10054:
return "Connection closed by remote host";
case 10055:
return "Out of buffer space or queue overflowed";
case 10057:
return "Socket was not connected";
case 10058:
return "Socket was previously shut down";
case 10060:
return "Connection timed out";
case 10061:
return "Connection refused by remote host";
case 10064:
return "Remote host is down";
case 10065:
return "Remote host is unreachable";
case 10093:
return "WSAStartup() was not called";
case 0:
return strerror(errno);
default:
if (express_cat.is_debug())
express_cat.debug()
<< "handle_socket_error - unknown error: " << err << endl;
return "Unknown WSA error";
}
#endif
}
////////////////////////////////////////////////////////////////////
// Function: error_to_text
// Description:
@ -146,6 +92,100 @@ error_to_text(int err) {
}
}
////////////////////////////////////////////////////////////////////
// Function: get_write_error
// Description:
////////////////////////////////////////////////////////////////////
int
get_write_error(void) {
#ifndef WIN32
return EU_error_abort;
#else
switch (errno) {
case 4:
case 18:
return EU_error_write_out_of_files;
case 8:
case 14:
return EU_error_write_out_of_memory;
case 20:
return EU_error_write_disk_not_found;
case 25:
case 27:
return EU_error_write_disk_sector_not_found;
case 29:
case 30:
case 31:
return EU_error_write_disk_fault;
case 32:
case 33:
case 36:
return EU_error_write_sharing_violation;
case 39:
return EU_error_write_disk_full;
default:
return EU_error_abort;
}
#endif
}
#ifdef HAVE_NET
////////////////////////////////////////////////////////////////////
// Function: handle_socket_error
// Description:
////////////////////////////////////////////////////////////////////
const char*
handle_socket_error(void) {
#ifndef WIN32
return strerror(errno);
#else
int err = WSAGetLastError();
switch (err) {
case 10022:
return "An invalid argument was supplied";
case 10036:
return "A blocking operation is currently executing";
case 10040:
return "Message was larger than internal buffer or network limit";
case 10050:
return "Network dead";
case 10051:
return "Network unreachable";
case 10052:
return "Connection broken because keep-alive detected a failure";
case 10053:
return "Connection aborted by local host software";
case 10054:
return "Connection closed by remote host";
case 10055:
return "Out of buffer space or queue overflowed";
case 10057:
return "Socket was not connected";
case 10058:
return "Socket was previously shut down";
case 10060:
return "Connection timed out";
case 10061:
return "Connection refused by remote host";
case 10064:
return "Remote host is down";
case 10065:
return "Remote host is unreachable";
case 10093:
return "WSAStartup() was not called";
case 0:
return strerror(errno);
default:
if (express_cat.is_debug())
express_cat.debug()
<< "handle_socket_error - unknown error: " << err << endl;
return "Unknown WSA error";
}
#endif
}
#endif
#ifdef HAVE_NET
////////////////////////////////////////////////////////////////////
// Function: get_network_error
// Description:
@ -198,40 +238,4 @@ get_network_error(void) {
}
#endif
}
////////////////////////////////////////////////////////////////////
// Function: get_write_error
// Description:
////////////////////////////////////////////////////////////////////
int
get_write_error(void) {
#ifndef WIN32
return EU_error_abort;
#else
switch (errno) {
case 4:
case 18:
return EU_error_write_out_of_files;
case 8:
case 14:
return EU_error_write_out_of_memory;
case 20:
return EU_error_write_disk_not_found;
case 25:
case 27:
return EU_error_write_disk_sector_not_found;
case 29:
case 30:
case 31:
return EU_error_write_disk_fault;
case 32:
case 33:
case 36:
return EU_error_write_sharing_violation;
case 39:
return EU_error_write_disk_full;
default:
return EU_error_abort;
}
#endif
}

View File

@ -65,11 +65,14 @@ enum ErrorUtilCode {
EU_error_zlib = -80,
};
EXPCL_PANDAEXPRESS const char *handle_socket_error(void);
EXPCL_PANDAEXPRESS const char *error_to_text(int err);
EXPCL_PANDAEXPRESS int get_network_error(void);
EXPCL_PANDAEXPRESS int get_write_error(void);
#ifdef HAVE_NET
EXPCL_PANDAEXPRESS const char *handle_socket_error(void);
EXPCL_PANDAEXPRESS int get_network_error(void);
#endif
END_PUBLISH
#endif