From 0286a3fe89441273d561af3ad8059da4cd5d296c Mon Sep 17 00:00:00 2001 From: scullin Date: Thu, 28 May 1998 00:17:37 +0000 Subject: [PATCH] Eliminate SOCKET_ERRNO and xp_sock.h --- network/main/mkconect.c | 2 -- network/main/mkgeturl.c | 5 ++--- network/main/mksockrw.c | 2 -- network/main/mktcp.h | 2 -- network/main/mkutils.c | 1 - network/protocol/file/mkfile.c | 1 - network/protocol/ftp/mkftp.c | 4 ++-- network/protocol/gopher/mkgopher.c | 8 ++------ network/protocol/http/mkhttp.c | 9 ++++----- network/protocol/nntp/mknews.c | 24 ++++++++++++------------ network/protocol/pop3/mkpop3.c | 5 ++--- network/protocol/smtp/mksmtp.c | 3 +-- 12 files changed, 25 insertions(+), 41 deletions(-) diff --git a/network/main/mkconect.c b/network/main/mkconect.c index e05fb2e5684d..ebdd0c6b5525 100644 --- a/network/main/mkconect.c +++ b/network/main/mkconect.c @@ -86,8 +86,6 @@ #endif /* XP_UNIX */ -#include "xp_error.h" - /* for XP_GetString() */ #include "xpgetstr.h" extern int MK_CONNECTION_REFUSED; diff --git a/network/main/mkgeturl.c b/network/main/mkgeturl.c index 274efdba4a0b..84976908694b 100644 --- a/network/main/mkgeturl.c +++ b/network/main/mkgeturl.c @@ -98,7 +98,6 @@ #endif /* NSPR20 */ #include "sslerr.h" -#include "xp_error.h" #include "merrors.h" #include "prefetch.h" @@ -3231,7 +3230,7 @@ PUBLIC int NET_ProcessNet (PRFileDesc *ready_fd, int fd_type) } else if(tmpEntry->status < 0 && !tmpEntry->URL_s->use_local_copy - && XP_GetError() != SSL_ERROR_BAD_CERTIFICATE + && PR_GetError() != SSL_ERROR_BAD_CERTIFICATE && (tmpEntry->status == MK_CONNECTION_REFUSED || tmpEntry->status == MK_CONNECTION_TIMED_OUT || tmpEntry->status == MK_UNABLE_TO_CREATE_SOCKET @@ -3319,7 +3318,7 @@ PUBLIC int NET_ProcessNet (PRFileDesc *ready_fd, int fd_type) * window may be active, but it should get * the same error */ - if(SOCKET_ERRNO == XP_ERRNO_ENETDOWN) + if(PR_GetOSError() == XP_ERRNO_ENETDOWN) { NET_SilentInterruptWindow(tmpEntry->window_id); } diff --git a/network/main/mksockrw.c b/network/main/mksockrw.c index 7b9ea4cf3905..9c758228baf1 100644 --- a/network/main/mksockrw.c +++ b/network/main/mksockrw.c @@ -25,8 +25,6 @@ #include "merrors.h" #include "ssl.h" -#include "xp_error.h" - extern int MK_HTTP_TYPE_CONFLICT; extern int XP_ERRNO_EWOULDBLOCK; diff --git a/network/main/mktcp.h b/network/main/mktcp.h index f3dc9cffd769..eb3a78d0992a 100644 --- a/network/main/mktcp.h +++ b/network/main/mktcp.h @@ -18,8 +18,6 @@ #ifndef MKTCP_H #define MKTCP_H -#include "xp_sock.h" - PR_BEGIN_EXTERN_C /* state machine data for host connect */ diff --git a/network/main/mkutils.c b/network/main/mkutils.c index 483e398122c5..0b5c73eb4eb9 100644 --- a/network/main/mkutils.c +++ b/network/main/mkutils.c @@ -45,7 +45,6 @@ #include "mktcp.h" #include "netutils.h" -#include "xp_error.h" #include "xpgetstr.h" #include "mimeenc.h" diff --git a/network/protocol/file/mkfile.c b/network/protocol/file/mkfile.c index 8344fdd063b5..de936fb6d77d 100644 --- a/network/protocol/file/mkfile.c +++ b/network/protocol/file/mkfile.c @@ -50,7 +50,6 @@ IL_Type(const char *buf, int32 len); #include "errno.h" #endif -#include "xp_error.h" #include "prefapi.h" /* for XP_GetString() */ diff --git a/network/protocol/ftp/mkftp.c b/network/protocol/ftp/mkftp.c index a5620dca6134..012980c7b8f8 100644 --- a/network/protocol/ftp/mkftp.c +++ b/network/protocol/ftp/mkftp.c @@ -65,7 +65,6 @@ #endif #endif /* XP_UNIX */ -#include "xp_error.h" #include "prefapi.h" /* for XP_GetString() */ @@ -2617,7 +2616,8 @@ net_ftp_push_partial_cache_file(ActiveEntry * ce) if( status < 0 ) { - ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, + PR_GetOSError()); return MK_TCP_READ_ERROR; } else if( status == 0 ) diff --git a/network/protocol/gopher/mkgopher.c b/network/protocol/gopher/mkgopher.c index da465ec2c174..02e9e86e53f8 100644 --- a/network/protocol/gopher/mkgopher.c +++ b/network/protocol/gopher/mkgopher.c @@ -58,10 +58,6 @@ #include "mkparse.h" /* NET_ParseURL() */ #include "remoturl.h" /* NET_RemoteHostLoad */ - -#include "xp_error.h" - - /* for XP_GetString() */ #include "xpgetstr.h" extern int XP_HTML_GOPHER_INDEX; @@ -199,7 +195,7 @@ net_parse_menu (ActiveEntry * cur_entry) } else if(CE_STATUS < 0) { - NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */ @@ -462,7 +458,7 @@ net_parse_cso (ActiveEntry * cur_entry) */ if(CE_STATUS < 0) { - NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */ diff --git a/network/protocol/http/mkhttp.c b/network/protocol/http/mkhttp.c index 5350a3242510..88f307c76856 100644 --- a/network/protocol/http/mkhttp.c +++ b/network/protocol/http/mkhttp.c @@ -46,7 +46,6 @@ #include "ssl.h" #include "jscookie.h" #include "prefapi.h" -#include "xp_error.h" #include "libi18n.h" #include "prtime.h" #include "prmem.h" @@ -496,7 +495,7 @@ net_start_http_connect(ActiveEntry * ce) } TRACEMSG(("HTTP: Unable to connect to host for `%s' (errno = %d).", - CE_URL_S->address, SOCKET_ERRNO)); + CE_URL_S->address, PR_GetOSError())); /* * Proxy failover */ @@ -619,7 +618,7 @@ net_finish_http_connect(ActiveEntry * ce) NET_ClearConnectSelect(CE_WINDOW_ID, CE_CON_SOCK); TRACEMSG(("HTTP: Unable to connect to host for `%s' (errno = %d).", - CE_URL_S->address, SOCKET_ERRNO)); + CE_URL_S->address, PR_GetOSError())); /* * Proxy failover @@ -1752,7 +1751,7 @@ net_parse_http_mime_headers (ActiveEntry *ce) if(CE_STATUS < 0) { - NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */ @@ -2964,7 +2963,7 @@ net_http_push_partial_cache_file(ActiveEntry *ce) /* @@@ This is the wrong error code */ ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, - SOCKET_ERRNO); + PR_GetOSError()); return(MK_TCP_READ_ERROR); } else if(status == 0) diff --git a/network/protocol/nntp/mknews.c b/network/protocol/nntp/mknews.c index 190906f8bae1..d84396b5ee3a 100644 --- a/network/protocol/nntp/mknews.c +++ b/network/protocol/nntp/mknews.c @@ -58,7 +58,6 @@ #include "prtime.h" #include "prlog.h" -#include "xp_error.h" #include "secnav.h" #include "prefapi.h" @@ -672,7 +671,7 @@ net_news_response (ActiveEntry * ce) if(ce->status < 0) { ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, - SOCKET_ERRNO); + PR_GetOSError()); /* return TCP error */ @@ -869,7 +868,7 @@ PRIVATE int net_nntp_send_list_extensions_response (ActiveEntry *ce) return ce->status; /* no line yet */ if (ce->status < 0) { - ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */ return MK_TCP_READ_ERROR; } @@ -942,7 +941,7 @@ PRIVATE int net_nntp_send_list_searches_response (ActiveEntry *ce) return ce->status; /* no line yet */ if (ce->status < 0) { - ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */ return MK_TCP_READ_ERROR; } @@ -997,7 +996,7 @@ PRIVATE int net_send_list_search_headers_response (ActiveEntry *ce) return ce->status; /* no line yet */ if (ce->status < 0) { - ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */ return MK_TCP_READ_ERROR; } @@ -1055,7 +1054,7 @@ PRIVATE int nntp_get_properties_response (ActiveEntry *ce) return ce->status; /* no line yet */ if (ce->status < 0) { - ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */ return MK_TCP_READ_ERROR; } @@ -1133,7 +1132,7 @@ PRIVATE int net_send_list_subscriptions_response (ActiveEntry *ce) return ce->status; /* no line yet */ if (ce->status < 0) { - ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */ return MK_TCP_READ_ERROR; } @@ -2103,7 +2102,7 @@ net_process_newgroups (ActiveEntry *ce) if(ce->status<0) { - ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */ @@ -2235,7 +2234,7 @@ net_read_news_list (ActiveEntry *ce) if(ce->status<0) { - ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */ @@ -2511,7 +2510,7 @@ net_read_xover (ActiveEntry *ce) if(ce->status<0) { ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, - SOCKET_ERRNO); + PR_GetOSError()); /* return TCP error */ @@ -2741,7 +2740,7 @@ net_read_news_group_body (ActiveEntry *ce) if(ce->status < 0) { - ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */ @@ -3677,7 +3676,8 @@ PRIVATE int net_nntp_search_results (ActiveEntry *ce) return ce->status; /* no line yet */ if (ce->status < 0) { - ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_READ_ERROR, + PR_GetOSError()); /* return TCP error */ return MK_TCP_READ_ERROR; } diff --git a/network/protocol/pop3/mkpop3.c b/network/protocol/pop3/mkpop3.c index 749dbb207871..9b61c9f6659b 100644 --- a/network/protocol/pop3/mkpop3.c +++ b/network/protocol/pop3/mkpop3.c @@ -54,7 +54,6 @@ and change the POP3_QUIT_RESPONSE state to flush the newly committed deletes. */ #include "secnav.h" #include "ssl.h" -#include "xp_error.h" #include "xpgetstr.h" #include "prefapi.h" @@ -748,7 +747,7 @@ net_pop3_send_command(ActiveEntry *ce, const char * command) if(status < 0) { - ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_WRITE_ERROR, SOCKET_ERRNO); + ce->URL_s->error_msg = NET_ExplainErrorDetails(MK_TCP_WRITE_ERROR, PR_GetOSError()); cd->next_state = POP3_ERROR_DONE; return(MK_TCP_WRITE_ERROR); } @@ -812,7 +811,7 @@ net_pop3_auth_response(ActiveEntry *ce) } else if (ce->status < 0) { - int rv = SOCKET_ERRNO; + int rv = PR_GetOSError(); TRACEMSG(("TCP Error: %d", rv)); diff --git a/network/protocol/smtp/mksmtp.c b/network/protocol/smtp/mksmtp.c index 4867c9dbf798..7e5aff8a7cd4 100644 --- a/network/protocol/smtp/mksmtp.c +++ b/network/protocol/smtp/mksmtp.c @@ -40,7 +40,6 @@ #include "ssl.h" #include "imap.h" -#include "xp_error.h" #include "prefapi.h" #ifdef AUTH_SKEY_DEFINED @@ -313,7 +312,7 @@ net_smtp_response (ActiveEntry * cur_entry) if(CE_STATUS < 0) { CE_URL_S->error_msg = - NET_ExplainErrorDetails(MK_TCP_READ_ERROR, SOCKET_ERRNO); + NET_ExplainErrorDetails(MK_TCP_READ_ERROR, PR_GetOSError()); /* return TCP error */