Permalink
Browse files

TS-672 cleanup Win32 references

nuke win32 completely.
  • Loading branch information...
1 parent a79a638 commit 53ebc2f729d41c76a7cdbd8e9e1930544976c083 @mingzym mingzym committed May 9, 2012
Showing with 50 additions and 1,247 deletions.
  1. +2 −0 CHANGES
  2. +0 −4 example/append-transform/append-transform.c
  3. +1 −45 example/basic-auth/basic-auth.c
  4. +0 −4 example/output-header/output-header.c
  5. +0 −12 example/redirect-1/redirect-1.c
  6. +0 −8 example/server-transform/server-transform.c
  7. +0 −4 iocore/aio/P_AIO.h
  8. +1 −1 iocore/aio/test_AIO.i
  9. +0 −13 iocore/cache/Cache.cc
  10. +0 −4 iocore/cache/P_CacheVol.h
  11. +1 −1 iocore/cluster/test_I_Cluster.cc
  12. +1 −1 iocore/cluster/test_P_Cluster.cc
  13. +1 −1 iocore/dns/test_I_DNS.cc
  14. +1 −1 iocore/eventsystem/I_ProxyAllocator.h
  15. +0 −12 iocore/eventsystem/I_VConnection.h
  16. +1 −5 iocore/eventsystem/test_Buffer.cc
  17. +1 −1 iocore/eventsystem/test_Event.i
  18. +0 −17 iocore/hostdb/HostDB.cc
  19. +0 −15 iocore/hostdb/P_MultiCache.h
  20. +1 −1 iocore/hostdb/test_I_HostDB.cc
  21. +0 −2 iocore/net/P_CompletionUtil.h
  22. +0 −12 iocore/net/P_SSLConfig.h
  23. +0 −3 iocore/net/P_SSLNetAccept.h
  24. +0 −11 iocore/net/P_SSLNetProcessor.h
  25. +0 −4 iocore/net/P_SSLNetVConnection.h
  26. +0 −5 iocore/net/P_Socks.h
  27. +0 −44 iocore/net/P_UDPNet.h
  28. +0 −4 iocore/net/P_UnixCompletionUtil.h
  29. +0 −3 iocore/net/P_UnixUDPConnection.h
  30. +1 −15 iocore/net/SSLConfig.cc
  31. +1 −5 iocore/net/test_I_Net.cc
  32. +1 −1 iocore/net/test_I_UDPNet.cc
  33. +1 −1 iocore/net/test_P_UDPNet.cc
  34. +1 −1 iocore/utils/diags.i
  35. +0 −9 lib/records/P_RecCompatibility.h
  36. +0 −4 lib/ts/ink_res_init.cc
  37. +0 −19 lib/ts/test_atomic.cc
  38. +0 −44 mgmt/Alarms.cc
  39. +2 −49 mgmt/FileManager.cc
  40. +1 −4 mgmt/LocalManager.cc
  41. +0 −11 mgmt/LocalManager.h
  42. +0 −11 mgmt/Main.cc
  43. +0 −37 mgmt/MultiFile.cc
  44. +0 −55 mgmt/ProcessManager.cc
  45. +0 −12 mgmt/ProcessManager.h
  46. +1 −86 mgmt/Rollback.cc
  47. +0 −3 mgmt/api/CoreAPI.cc
  48. +1 −49 mgmt/api/CoreAPIShared.cc
  49. +0 −4 mgmt/api/GenericParser.cc
  50. +0 −3 mgmt/api/INKMgmtAPIStub.cc
  51. +0 −11 mgmt/api/include/mgmtapi.h
  52. +0 −4 mgmt/api/remote/EventRegistration.cc
  53. +0 −3 mgmt/api/remote/EventRegistration.h
  54. +0 −97 mgmt/cluster/ClusterCom.cc
  55. +0 −54 mgmt/cluster/VMap.h
  56. +0 −4 mgmt/preparse/IPRange.cc
  57. +1 −162 mgmt/utils/MgmtUtils.cc
  58. +0 −5 mgmt/utils/MgmtUtils.h
  59. +2 −39 mgmt/utils/WebMgmtUtils.cc
  60. +0 −9 mgmt/web2/WebCompatibility.h
  61. +1 −63 mgmt/web2/WebHttp.cc
  62. +1 −1 mgmt/web2/WebIntrMain.cc
  63. +0 −9 mgmt/web2/WebUtils.cc
  64. +1 −7 proxy/CoreUtils.cc
  65. +20 −28 proxy/ICP.cc
  66. +1 −1 proxy/Initialize.cc
  67. +0 −4 proxy/InkIOCoreAPI.cc
  68. +1 −1 proxy/Main.cc
  69. +0 −30 proxy/StatSystem.h
  70. +0 −5 proxy/Update.cc
  71. +1 −3 proxy/config/plugin.config.default
  72. +0 −9 proxy/config/vaddrs.config.default
  73. +0 −17 proxy/config/winnt_intr.config.default
  74. +0 −6 proxy/hdrs/HdrTest.cc
  75. +0 −14 proxy/http/HttpSM.cc
View
@@ -1,5 +1,7 @@
-*- coding: utf-8 -*-
Changes with Apache Traffic Server 3.1.4
+ *) [TS-672] cleanup Win32 references.
+
*) [TS-1181] Make the overridable configs work with "byte" configs.
*) [TS-1252] Fixed include issues when using mgmtapi.h.
@@ -268,11 +268,7 @@ transformable(TSHttpTxn txnp)
}
value = TSMimeHdrFieldValueStringGet(bufp, hdr_loc, field_loc, 0, &val_length);
-#ifndef _WIN32
if (value && (strncasecmp(value, "text/html", sizeof("text/html") - 1) == 0)) {
-#else
- if (value && (strnicmp(value, "text/html", sizeof("text/html") - 1) == 0)) {
-#endif
ASSERT_SUCCESS(TSHandleMLocRelease(bufp, hdr_loc, field_loc));
ASSERT_SUCCESS(TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc));
@@ -25,11 +25,7 @@
#include <stdio.h>
#include <string.h>
-#if !defined (_WIN32)
#include <unistd.h>
-#else
-#include <windows.h>
-#endif
#include <ts/ts.h>
@@ -76,34 +72,10 @@ authorized(char *user, char *password)
{
/*
* This routine checks the validity of the user name and
- * password. Sample NT code is provided for illustration.
- * For UNIX systems, enter your own authorization code
+ * password. UNIX systems, enter your own authorization code
* here.
*/
-#if !defined (_WIN32)
-
-#else
- // LogonUser() will work only if the account is set with
- // SE_TCB_NAME privilege. If SE_TCB_NAME is missing,
- // Traffic server will attempt to add this privilege to
- // the running account, but may fail depending on the access
- // levels provided to the said account. In such a case, an
- // NT systems administrator will have to set the privilege
- // "Act as part of the operating system" from the NT user manager.
- //
- int nErr = 0;
- HANDLE hToken = 0;
- BOOL bRet = LogonUser(user, NULL, password, LOGON32_LOGON_NETWORK,
- LOGON32_PROVIDER_DEFAULT, &hToken);
-
- if (FALSE == bRet) {
- nErr = GetLastError();
- return 0;
- }
-
- CloseHandle(hToken);
-#endif
return 1;
}
@@ -297,19 +269,3 @@ TSPluginInit(int argc, const char *argv[])
TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, TSContCreate(auth_plugin, NULL));
}
-
-#if defined (_WIN32)
-BOOL APIENTRY
-DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
-{
- switch (ul_reason_for_call) {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-#endif
-
@@ -37,11 +37,7 @@
#include <stdio.h>
#include <string.h>
-#if !defined (_WIN32)
#include <unistd.h>
-#else
-#include <windows.h>
-#endif
#include <ts/ts.h>
@@ -36,21 +36,13 @@
#include <stdio.h>
#include <string.h>
-#if !defined (_WIN32)
# include <unistd.h>
# include <netinet/in.h>
# include <arpa/inet.h>
-#else
-# include <windows.h>
-#endif
#include <ts/ts.h>
-#if !defined (_WIN32)
static in_addr_t ip_deny;
-#else
-static unsigned int ip_deny;
-#endif
/*
* uncoupled statistics variables:
@@ -94,11 +86,7 @@ handle_client_lookup(TSHttpTxn txnp, TSCont contp)
TSMLoc hdr_loc, url_loc;
int host_length;
-#if !defined (_WIN32)
in_addr_t clientip = 0;
-#else
- unsigned int clientip;
-#endif
const char *host;
@@ -55,11 +55,7 @@
#include <string.h>
#include <stdio.h>
-#if !defined (_WIN32)
# include <netinet/in.h>
-#else
-# include <windows.h>
-#endif
#include <ts/ts.h>
@@ -105,11 +101,7 @@ static int transform_read_event(TSCont contp, TransformData * data, TSEvent even
static int transform_bypass_event(TSCont contp, TransformData * data, TSEvent event, void *edata);
static int transform_handler(TSCont contp, TSEvent event, void *edata);
-#if !defined (_WIN32)
static in_addr_t server_ip;
-#else
-static unsigned int server_ip;
-#endif
static int server_port;
View
@@ -126,8 +126,4 @@ enum aio_stat_enum
};
extern RecRawStatBlock *aio_rsb;
-#ifdef _WIN32
-extern NTIOCompletionPort aio_completion_port;
-#endif
-
#endif
View
@@ -80,7 +80,7 @@ reconfigure_diags()
////////////////////////////////////
// change the diags config values //
////////////////////////////////////
-#if !defined (_WIN32) && !defined(__GNUC__) && !defined(hpux)
+#if !defined(__GNUC__) && !defined(hpux)
diags->config = c;
#else
memcpy(((void *) &diags->config), ((void *) &c), sizeof(DiagsConfigState));
View
@@ -532,11 +532,9 @@ CacheProcessor::start_internal(int flags)
int opts = O_RDWR;
ink_strlcpy(path, sd->pathname, sizeof(path));
if (!sd->file_pathname) {
-#if !defined(_WIN32)
if (config_volumes.num_http_volumes && config_volumes.num_stream_volumes) {
Warning("It is suggested that you use raw disks if streaming and http are in the same cache");
}
-#endif
ink_strlcat(path, "/cache.db", sizeof(path));
opts |= O_CREAT;
}
@@ -551,21 +549,10 @@ CacheProcessor::start_internal(int flags)
int fd = open(path, opts, 0644);
int blocks = sd->blocks;
if (fd > 0) {
-#if defined (_WIN32)
- aio_completion_port.register_handle((void *) fd, 0);
-#endif
if (!sd->file_pathname) {
if (ftruncate(fd, ((uint64_t) blocks) * STORE_BLOCK_SIZE) < 0) {
Warning("unable to truncate cache file '%s' to %d blocks", path, blocks);
diskok = 0;
-#if defined(_WIN32)
- /* We can do a specific check for FAT32 systems on NT,
- * to print a specific warning */
- if ((((uint64_t) blocks) * STORE_BLOCK_SIZE) > (1 << 32)) {
- Warning("If you are using a FAT32 file system, please ensure that cachesize"
- "specified in storage.config, does not exceed 4GB!. ");
- }
-#endif
}
}
if (diskok) {
@@ -256,11 +256,7 @@ struct Vol: public Continuation
evacuate_size(0), disk(NULL), last_sync_serial(0), last_write_serial(0), recover_wrapped(false),
dir_sync_waiting(0), dir_sync_in_progress(0), writing_end_marker(0) {
open_dir.mutex = mutex;
-#if defined(_WIN32)
- agg_buffer = (char *)ats_malloc(AGG_SIZE);
-#else
agg_buffer = (char *)ats_memalign(sysconf(_SC_PAGESIZE), AGG_SIZE);
-#endif
memset(agg_buffer, 0, AGG_SIZE);
SET_HANDLER(&Vol::aggWrite);
}
@@ -89,7 +89,7 @@ reconfigure_diags()
// change the diags config values //
////////////////////////////////////
// XXX: HP-UX ???
-#if !defined (_WIN32) && !defined(__GNUC__) && !defined(hpux)
+#if !defined(__GNUC__) && !defined(hpux)
diags->config = c;
#else
memcpy(((void *) &diags->config), ((void *) &c), sizeof(DiagsConfigState));
@@ -89,7 +89,7 @@ reconfigure_diags()
// change the diags config values //
////////////////////////////////////
// XXX: HP-UX ???
-#if !defined (_WIN32) && !defined(__GNUC__) && !defined(hpux)
+#if !defined(__GNUC__) && !defined(hpux)
diags->config = c;
#else
memcpy(((void *) &diags->config), ((void *) &c), sizeof(DiagsConfigState));
View
@@ -81,7 +81,7 @@ reconfigure_diags()
////////////////////////////////////
// change the diags config values //
////////////////////////////////////
-#if !defined (_WIN32) && !defined(__GNUC__) && !defined(hpux)
+#if !defined(__GNUC__) && !defined(hpux)
diags->config = c;
#else
memcpy(((void *) &diags->config), ((void *) &c), sizeof(DiagsConfigState));
@@ -81,7 +81,7 @@ thread_freeup(ClassAllocator<C> &a, ProxyAllocator & l)
ink_assert(!l.allocated);
}
-#if !defined(_IOCORE_WIN32) && defined(TS_USE_FREELIST)
+#if defined(TS_USE_FREELIST)
#define THREAD_ALLOC(_a, _t) thread_alloc(::_a, _t->_a)
#define THREAD_ALLOC_INIT(_a, _t) thread_alloc_init(::_a, _t->_a)
#define THREAD_FREE_TO(_p, _a, _t, _m) do { \
@@ -317,10 +317,6 @@ class VConnection:public Continuation
VConnection(ProxyMutex *aMutex);
-#if defined (_IOCORE_WIN32_WINNT)
- virtual void set_nbytes(VIO *vio, int64_t nbytes);
-#endif
-
/** @deprecated */
VIO *do_io(int op, Continuation *c = NULL, int64_t nbytes = INT64_MAX, MIOBuffer *buf = 0, int data = 0);
@@ -411,14 +407,6 @@ struct DummyVConnection: public VConnection
(void) howto;
ink_debug_assert(!"VConnection::do_io_shutdown -- " "cannot use default implementation");
}
-#ifdef _IOCORE_WIN32_WINNT
- virtual void set_nbytes(VIO *vio, int64_t nbytes)
- {
- (void) vio;
- (void) nbytes;
- ink_debug_assert(!"DummyVConnection::set_nbytes -- " "cannot use default implementation");
- }
-#endif
DummyVConnection(ProxyMutex *m):VConnection(m) {
}
};
@@ -83,7 +83,7 @@ reconfigure_diags()
////////////////////////////////////
// change the diags config values //
////////////////////////////////////
-#if !defined (_IOCORE_WIN32) && !defined(__GNUC__) && !defined(hpux)
+#if !defined(__GNUC__) && !defined(hpux)
diags->config = c;
#else
memcpy(((void *) &diags->config), ((void *) &c), sizeof(DiagsConfigState));
@@ -151,10 +151,6 @@ main()
}
exit(0);
-#ifndef _IOCORE_WIN32_WINNT
this_thread()->execute();
-#else
- Sleep(INFINITE);
-#endif
return 0;
}
@@ -81,7 +81,7 @@ reconfigure_diags()
////////////////////////////////////
// change the diags config values //
////////////////////////////////////
-#if !defined (_WIN32) && !defined(__GNUC__) && !defined(hpux)
+#if !defined(__GNUC__) && !defined(hpux)
diags->config = c;
#else
memcpy(((void *) &diags->config), ((void *) &c), sizeof(DiagsConfigState));
View
@@ -317,24 +317,7 @@ HostDBCache::start(int flags)
IOCORE_ReadConfigInt32(hostdb_enable, "proxy.config.hostdb");
IOCORE_ReadConfigString(hostdb_filename, "proxy.config.hostdb.filename", PATH_NAME_MAX);
IOCORE_ReadConfigInt32(hostdb_size, "proxy.config.hostdb.size");
-
-#if defined (_IOCORE_WIN32)
- // since the config directory is always based of TSBase, we make sure
- // all the internal paths correctly get set.
- char szPath[PATH_NAME_MAX + 1];
- IOCORE_ReadConfigString(szPath, "proxy.config.hostdb.storage_path", PATH_NAME_MAX);
- int i = 0;
- while (szPath[i] != 0) {
- if (szPath[i] == '/')
- szPath[i] = '\\';
- i++;
- }
- ink_strlcpy(storage_path, system_root_dir, sizeof(storage_path));
- ink_strlcat(storage_path, "\\", sizeof(storage_path));
- ink_strlcat(storage_path, szPath, sizeof(storage_path));
-#else
IOCORE_ReadConfigString(storage_path, "proxy.config.hostdb.storage_path", PATH_NAME_MAX);
-#endif
IOCORE_ReadConfigInt32(storage_size, "proxy.config.hostdb.storage_size");
if (storage_path[0] != '/') {
@@ -202,12 +202,6 @@ struct MultiCacheBase: public MultiCacheHeader
MultiCacheHeader header_snap;
-#ifdef _WIN32
- // windows exclusive //
- int m_nEntry;
- Unmaper m_mUnmapTable[MULTI_CACHE_MAX_FILES];
-#endif
-
// mmap-ed region
//
char *data;
@@ -328,24 +322,15 @@ struct MultiCacheBase: public MultiCacheHeader
uint64_t make_tag(uint64_t folded_md5)
{
uint64_t ttag = folded_md5 / (uint64_t) buckets;
-#if !defined (_WIN32)
if (!ttag)
return 1LL;
-#else
- if (!ttag)
- return 1i 64;
-#endif
// beeping gcc 2.7.2 is broken
if (tag_bits > 32) {
uint64_t mask = 0x100000000LL << (tag_bits - 32);
mask = mask - 1;
return ttag & mask;
} else {
-#if !defined (_WIN32)
uint64_t mask = 1LL;
-#else
- uint64_t mask = 1i 64;
-#endif
mask <<= tag_bits;
mask = mask - 1;
return ttag & mask;
@@ -81,7 +81,7 @@ reconfigure_diags()
////////////////////////////////////
// change the diags config values //
////////////////////////////////////
-#if !defined (_WIN32) && !defined(__GNUC__) && !defined(hpux)
+#if !defined(__GNUC__) && !defined(hpux)
diags->config = c;
#else
memcpy(((void *) &diags->config), ((void *) &c), sizeof(DiagsConfigState));
@@ -42,8 +42,6 @@ class completionUtil
static void releaseReferences(Event * e);
};
-#ifndef _IOCORE_WIN32_WINNT
#include "P_UnixCompletionUtil.h"
-#endif
#endif
Oops, something went wrong.

0 comments on commit 53ebc2f

Please sign in to comment.