diff options
Diffstat (limited to 'netwerk')
41 files changed, 445 insertions, 3784 deletions
diff --git a/netwerk/base/Tickler.h b/netwerk/base/Tickler.h index 573fe6e76..63353a924 100644 --- a/netwerk/base/Tickler.h +++ b/netwerk/base/Tickler.h @@ -27,7 +27,7 @@ // The tickler only applies to wifi on mobile right now. Hopefully it // can also be restricted to particular handset models in the future. -#if defined(ANDROID) && !defined(MOZ_B2G) +#if defined(ANDROID) #define MOZ_USE_WIFI_TICKLER #endif diff --git a/netwerk/base/moz.build b/netwerk/base/moz.build index 5de1eea81..3198d746c 100644 --- a/netwerk/base/moz.build +++ b/netwerk/base/moz.build @@ -182,11 +182,6 @@ EXPORTS.mozilla.net += [ 'ReferrerPolicy.h', ] -if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - EXPORTS += [ - 'NetStatistics.h', - ] - UNIFIED_SOURCES += [ 'ArrayBufferInputStream.cpp', 'BackgroundFileSaver.cpp', diff --git a/netwerk/base/nsINetworkInterceptController.idl b/netwerk/base/nsINetworkInterceptController.idl index 17d27de42..721b7a334 100644 --- a/netwerk/base/nsINetworkInterceptController.idl +++ b/netwerk/base/nsINetworkInterceptController.idl @@ -14,12 +14,16 @@ interface nsIURI; %{C++ #include "nsIConsoleReportCollector.h" namespace mozilla { +class TimeStamp; + namespace dom { class ChannelInfo; } } %} +native TimeStamp(mozilla::TimeStamp); + [ptr] native ChannelInfo(mozilla::dom::ChannelInfo); /** @@ -97,6 +101,30 @@ interface nsIInterceptedChannel : nsISupports [noscript] readonly attribute nsIConsoleReportCollector consoleReportCollector; + /** + * Save the timestamps of various service worker interception phases. + */ + [noscript] + void SetLaunchServiceWorkerStart(in TimeStamp aTimeStamp); + + [noscript] + void SetLaunchServiceWorkerEnd(in TimeStamp aTimeStamp); + + [noscript] + void SetDispatchFetchEventStart(in TimeStamp aTimeStamp); + + [noscript] + void SetDispatchFetchEventEnd(in TimeStamp aTimeStamp); + + [noscript] + void SetHandleFetchEventStart(in TimeStamp aTimeStamp); + + [noscript] + void SetHandleFetchEventEnd(in TimeStamp aTimeStamp); + + [noscript] + void SaveTimeStampsToUnderlyingChannel(); + %{C++ already_AddRefed<nsIConsoleReportCollector> GetConsoleReportCollector() diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp index 8b7f31f99..e13541acf 100644 --- a/netwerk/base/nsIOService.cpp +++ b/netwerk/base/nsIOService.cpp @@ -59,11 +59,6 @@ #include "nsContentUtils.h" #include "xpcpublic.h" -#ifdef MOZ_WIDGET_GONK -#include "nsINetworkManager.h" -#include "nsINetworkInterface.h" -#endif - namespace mozilla { namespace net { diff --git a/netwerk/base/nsITimedChannel.idl b/netwerk/base/nsITimedChannel.idl index 13b65e7b8..83670a11e 100644 --- a/netwerk/base/nsITimedChannel.idl +++ b/netwerk/base/nsITimedChannel.idl @@ -21,7 +21,8 @@ interface nsITimedChannel : nsISupports { attribute boolean timingEnabled; // The number of redirects - attribute uint16_t redirectCount; + attribute uint8_t redirectCount; + attribute uint8_t internalRedirectCount; [noscript] readonly attribute TimeStamp channelCreation; [noscript] readonly attribute TimeStamp asyncOpen; @@ -37,6 +38,15 @@ interface nsITimedChannel : nsISupports { [noscript] readonly attribute TimeStamp responseStart; [noscript] readonly attribute TimeStamp responseEnd; + // The following are only set when the request is intercepted by a service + // worker no matter the response is synthesized. + [noscript] attribute TimeStamp launchServiceWorkerStart; + [noscript] attribute TimeStamp launchServiceWorkerEnd; + [noscript] attribute TimeStamp dispatchFetchEventStart; + [noscript] attribute TimeStamp dispatchFetchEventEnd; + [noscript] attribute TimeStamp handleFetchEventStart; + [noscript] attribute TimeStamp handleFetchEventEnd; + // The redirect attributes timings must be writeble, se we can transfer // the data from one channel to the redirected channel. [noscript] attribute TimeStamp redirectStart; @@ -67,6 +77,12 @@ interface nsITimedChannel : nsISupports { // All following are PRTime versions of the above. readonly attribute PRTime channelCreationTime; readonly attribute PRTime asyncOpenTime; + readonly attribute PRTime launchServiceWorkerStartTime; + readonly attribute PRTime launchServiceWorkerEndTime; + readonly attribute PRTime dispatchFetchEventStartTime; + readonly attribute PRTime dispatchFetchEventEndTime; + readonly attribute PRTime handleFetchEventStartTime; + readonly attribute PRTime handleFetchEventEndTime; readonly attribute PRTime domainLookupStartTime; readonly attribute PRTime domainLookupEndTime; readonly attribute PRTime connectStartTime; diff --git a/netwerk/base/nsIncrementalDownload.cpp b/netwerk/base/nsIncrementalDownload.cpp index 42cd6faa5..47f7cb98b 100644 --- a/netwerk/base/nsIncrementalDownload.cpp +++ b/netwerk/base/nsIncrementalDownload.cpp @@ -49,27 +49,6 @@ WriteToFile(nsIFile *lf, const char *data, uint32_t len, int32_t flags) PRFileDesc *fd; int32_t mode = 0600; nsresult rv; -#if defined(MOZ_WIDGET_GONK) - // The sdcard on a B2G phone looks like: - // d---rwx--- system sdcard_rw 1970-01-01 01:00:00 sdcard - // On the emulator, xpcshell fails when using 0600 mode to open the file, - // and 0660 works. - nsCOMPtr<nsIFile> parent; - rv = lf->GetParent(getter_AddRefs(parent)); - if (NS_FAILED(rv)) { - return rv; - } - uint32_t parentPerm; - rv = parent->GetPermissions(&parentPerm); - if (NS_FAILED(rv)) { - return rv; - } - if ((parentPerm & 0700) == 0) { - // Parent directory has no owner-write, so try to use group permissions - // instead of owner permissions. - mode = 0660; - } -#endif rv = lf->OpenNSPRFileDesc(flags, mode, &fd); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index 8ff3e788f..d60c909c5 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -71,11 +71,6 @@ #include "nsHttpHandler.h" #include "nsNSSComponent.h" -#ifdef MOZ_WIDGET_GONK -#include "nsINetworkManager.h" -#include "nsThreadUtils.h" // for NS_IsMainThread -#endif - #include <limits> using namespace mozilla; @@ -1285,16 +1280,10 @@ NS_HasBeenCrossOrigin(nsIChannel* aChannel, bool aReport) nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo(); MOZ_RELEASE_ASSERT(loadInfo, "Origin tracking only works for channels created with a loadinfo"); -#ifdef DEBUG - // Don't enforce TYPE_DOCUMENT assertions for loads - // initiated by javascript tests. - bool skipContentTypeCheck = false; - skipContentTypeCheck = Preferences::GetBool("network.loadinfo.skip_type_assertion"); -#endif - - MOZ_ASSERT(skipContentTypeCheck || - loadInfo->GetExternalContentPolicyType() != nsIContentPolicy::TYPE_DOCUMENT, - "calling NS_HasBeenCrossOrigin on a top level load"); + // TYPE_DOCUMENT loads have a null LoadingPrincipal and can not be cross origin. + if (!loadInfo->LoadingPrincipal()) { + return false; + } // Always treat tainted channels as cross-origin. if (loadInfo->GetTainting() != LoadTainting::Basic) { diff --git a/netwerk/base/nsUDPSocket.cpp b/netwerk/base/nsUDPSocket.cpp index 84f6b8ea5..5973a205d 100644 --- a/netwerk/base/nsUDPSocket.cpp +++ b/netwerk/base/nsUDPSocket.cpp @@ -31,10 +31,6 @@ #include "nsIDNSService.h" #include "nsICancelable.h" -#ifdef MOZ_WIDGET_GONK -#include "NetStatistics.h" -#endif - namespace mozilla { namespace net { @@ -626,15 +622,6 @@ nsUDPSocket::InitWithAddress(const NetAddr *aAddr, nsIPrincipal *aPrincipal, aPrincipal->GetIsInIsolatedMozBrowserElement(); } -#ifdef MOZ_WIDGET_GONK - if (mAppId != NECKO_UNKNOWN_APP_ID) { - nsCOMPtr<nsINetworkInfo> activeNetworkInfo; - GetActiveNetworkInfo(activeNetworkInfo); - mActiveNetworkInfo = - new nsMainThreadPtrHolder<nsINetworkInfo>(activeNetworkInfo); - } -#endif - uint16_t port; if (NS_FAILED(net::GetPort(aAddr, &port))) { NS_WARNING("invalid bind address"); @@ -770,29 +757,7 @@ nsUDPSocket::GetLocalAddr(nsINetAddr * *aResult) void nsUDPSocket::SaveNetworkStats(bool aEnforce) { -#ifdef MOZ_WIDGET_GONK - if (!mActiveNetworkInfo || mAppId == NECKO_UNKNOWN_APP_ID) { - return; - } - - if (mByteReadCount == 0 && mByteWriteCount == 0) { - return; - } - - uint64_t total = mByteReadCount + mByteWriteCount; - if (aEnforce || total > NETWORK_STATS_THRESHOLD) { - // Create the event to save the network statistics. - // the event is then dispathed to the main thread. - RefPtr<Runnable> event = - new SaveNetworkStatsEvent(mAppId, mIsInIsolatedMozBrowserElement, mActiveNetworkInfo, - mByteReadCount, mByteWriteCount, false); - NS_DispatchToMainThread(event); - - // Reset the counters after saving. - mByteReadCount = 0; - mByteWriteCount = 0; - } -#endif + /*** STUB ***/ } void diff --git a/netwerk/base/nsUDPSocket.h b/netwerk/base/nsUDPSocket.h index 4ddff4248..f8ae87cee 100644 --- a/netwerk/base/nsUDPSocket.h +++ b/netwerk/base/nsUDPSocket.h @@ -12,11 +12,6 @@ #include "nsAutoPtr.h" #include "nsCycleCollectionParticipant.h" -#ifdef MOZ_WIDGET_GONK -#include "nsINetworkInterface.h" -#include "nsProxyRelease.h" -#endif - //----------------------------------------------------------------------------- namespace mozilla { @@ -76,9 +71,6 @@ private: uint64_t mByteReadCount; uint64_t mByteWriteCount; -#ifdef MOZ_WIDGET_GONK - nsMainThreadPtrHandle<nsINetworkInfo> mActiveNetworkInfo; -#endif }; //----------------------------------------------------------------------------- diff --git a/netwerk/dns/mdns/libmdns/moz.build b/netwerk/dns/mdns/libmdns/moz.build index d2dca4955..efad64d64 100644 --- a/netwerk/dns/mdns/libmdns/moz.build +++ b/netwerk/dns/mdns/libmdns/moz.build @@ -4,8 +4,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' or \ - (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['ANDROID_VERSION'] >= '16'): +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': UNIFIED_SOURCES += [ 'MDNSResponderOperator.cpp', 'MDNSResponderReply.cpp', @@ -16,13 +15,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' or \ '/netwerk/base', ] - if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - LOCAL_INCLUDES += [ - '%' + '%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [ - 'external/mdnsresponder/mDNSShared', - ] - ] - else: EXTRA_COMPONENTS += [ 'nsDNSServiceDiscovery.js', diff --git a/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.cpp b/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.cpp index 8ffa74b71..cec8033d1 100644 --- a/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.cpp +++ b/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.cpp @@ -9,10 +9,6 @@ #include "nsXULAppAPI.h" #include "private/pprio.h" -#ifdef MOZ_WIDGET_GONK -#include <cutils/properties.h> -#endif // MOZ_WIDGET_GONK - namespace mozilla { namespace net { @@ -21,29 +17,13 @@ namespace { inline void StartService() { -#ifdef MOZ_WIDGET_GONK - char value[PROPERTY_VALUE_MAX] = { '\0' }; - property_get("init.svc.mdnsd", value, ""); - - if (strcmp(value, "running") == 0) { - return; - } - property_set("ctl.start", "mdnsd"); -#endif // MOZ_WIDGET_GONK + /*** STUB ***/ } inline void StopService() { -#ifdef MOZ_WIDGET_GONK - char value[PROPERTY_VALUE_MAX] = { '\0' }; - property_get("init.svc.mdnsd", value, ""); - - if (strcmp(value, "stopped") == 0) { - return; - } - property_set("ctl.stop", "mdnsd"); -#endif // MOZ_WIDGET_GONK + /*** STUB ***/ } class ServiceCounter @@ -157,9 +137,6 @@ NS_IMPL_ISUPPORTS(nsDNSServiceDiscovery, nsIDNSServiceDiscovery) nsDNSServiceDiscovery::~nsDNSServiceDiscovery() { -#ifdef MOZ_WIDGET_GONK - StopService(); -#endif } nsresult diff --git a/netwerk/dns/mdns/libmdns/nsMulticastDNSModule.cpp b/netwerk/dns/mdns/libmdns/nsMulticastDNSModule.cpp index 22bad3bc7..aa1c973b5 100644 --- a/netwerk/dns/mdns/libmdns/nsMulticastDNSModule.cpp +++ b/netwerk/dns/mdns/libmdns/nsMulticastDNSModule.cpp @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#if defined(MOZ_WIDGET_COCOA) || (defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 16) +#if defined(MOZ_WIDGET_COCOA) #define ENABLE_DNS_SERVICE_DISCOVERY #endif diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build index f788d9a33..c3b84df2f 100644 --- a/netwerk/dns/moz.build +++ b/netwerk/dns/moz.build @@ -66,13 +66,7 @@ LOCAL_INCLUDES += [ '/netwerk/base', ] -if CONFIG['ENABLE_INTL_API']: - DEFINES['IDNA2008'] = True - USE_LIBS += ['icu'] -else: - UNIFIED_SOURCES += [ - 'nameprep.c', - ] +USE_LIBS += ['icu'] if CONFIG['GNU_CXX']: CXXFLAGS += ['-Wno-error=shadow'] diff --git a/netwerk/dns/nameprep.c b/netwerk/dns/nameprep.c deleted file mode 100644 index 039797885..000000000 --- a/netwerk/dns/nameprep.c +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Copyright (c) 2001,2002 Japan Network Information Center. - * All rights reserved. - * - * By using this file, you agree to the terms and conditions set forth bellow. - * - * LICENSE TERMS AND CONDITIONS - * - * The following License Terms and Conditions apply, unless a different - * license is obtained from Japan Network Information Center ("JPNIC"), - * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda, - * Chiyoda-ku, Tokyo 101-0047, Japan. - * - * 1. Use, Modification and Redistribution (including distribution of any - * modified or derived work) in source and/or binary forms is permitted - * under this License Terms and Conditions. - * - * 2. Redistribution of source code must retain the copyright notices as they - * appear in each source code file, this License Terms and Conditions. - * - * 3. Redistribution in binary form must reproduce the Copyright Notice, - * this License Terms and Conditions, in the documentation and/or other - * materials provided with the distribution. For the purposes of binary - * distribution the "Copyright Notice" refers to the following language: - * "Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved." - * - * 4. The name of JPNIC may not be used to endorse or promote products - * derived from this Software without specific prior written approval of - * JPNIC. - * - * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - */ - - -#include <stdlib.h> -#include <string.h> - -#include "nsIDNKitInterface.h" - -#define UCS_MAX 0x7fffffff -#define UNICODE_MAX 0x10ffff - - -/* - * Load NAMEPREP compiled tables. - */ -#include "nameprepdata.c" - -/* - * Define mapping/checking functions for each version of the draft. - */ - -#define VERSION id11 -#include "nameprep_template.c" -#undef VERSION - -typedef const char *(*nameprep_mapproc)(uint32_t v); -typedef int (*nameprep_checkproc)(uint32_t v); -typedef idn_biditype_t (*nameprep_biditypeproc)(uint32_t v); - -static struct idn_nameprep { - char *version; - nameprep_mapproc map_proc; - nameprep_checkproc prohibited_proc; - nameprep_checkproc unassigned_proc; - nameprep_biditypeproc biditype_proc; -} nameprep_versions[] = { -#define MAKE_NAMEPREP_HANDLE(version, id) \ - { version, \ - compose_sym2(nameprep_map_, id), \ - compose_sym2(nameprep_prohibited_, id), \ - compose_sym2(nameprep_unassigned_, id), \ - compose_sym2(nameprep_biditype_, id), } - MAKE_NAMEPREP_HANDLE("nameprep-11", id11), - { NULL, NULL, NULL, NULL, NULL }, -}; - -static idn_result_t idn_nameprep_check(nameprep_checkproc proc, - const uint32_t *str, - const uint32_t **found); - -idn_result_t -idn_nameprep_create(const char *version, idn_nameprep_t *handlep) { - idn_nameprep_t handle; - - assert(handlep != NULL); - - TRACE(("idn_nameprep_create(version=%-.50s)\n", - version == NULL ? "<NULL>" : version)); - - if (version == NULL) - version = IDN_NAMEPREP_CURRENT; - - /* - * Lookup table for the specified version. Since the number of - * versions won't be large (I don't want see draft-23 or such :-), - * simple linear search is OK. - */ - for (handle = nameprep_versions; handle->version != NULL; handle++) { - if (strcmp(handle->version, version) == 0) { - *handlep = handle; - return (idn_success); - } - } - return (idn_notfound); -} - -void -idn_nameprep_destroy(idn_nameprep_t handle) { - assert(handle != NULL); - - TRACE(("idn_nameprep_destroy()\n")); - - /* Nothing to do. */ -} - -idn_result_t -idn_nameprep_map(idn_nameprep_t handle, const uint32_t *from, - uint32_t *to, size_t tolen) { - assert(handle != NULL && from != NULL && to != NULL); - - TRACE(("idn_nameprep_map(ctx=%s, from=\"%s\")\n", - handle->version, idn__debug_ucs4xstring(from, 50))); - - while (*from != '\0') { - uint32_t v = *from; - const char *mapped; - - if (v > UCS_MAX) { - /* This cannot happen, but just in case.. */ - return (idn_invalid_codepoint); - } else if (v > UNICODE_MAX) { - /* No mapping is possible. */ - mapped = NULL; - } else { - /* Try mapping. */ - mapped = (*handle->map_proc)(v); - } - - if (mapped == NULL) { - /* No mapping. Just copy verbatim. */ - if (tolen < 1) - return (idn_buffer_overflow); - *to++ = v; - tolen--; - } else { - const unsigned char *mappeddata; - size_t mappedlen; - - mappeddata = (const unsigned char *)mapped + 1; - mappedlen = *mapped; - - if (tolen < (mappedlen + 3) / 4) - return (idn_buffer_overflow); - tolen -= (mappedlen + 3) / 4; - while (mappedlen >= 4) { - *to = *mappeddata++; - *to |= *mappeddata++ << 8; - *to |= *mappeddata++ << 16; - *to |= *mappeddata++ << 24; - mappedlen -= 4; - to++; - } - if (mappedlen > 0) { - *to = *mappeddata++; - *to |= (mappedlen >= 2) ? - *mappeddata++ << 8: 0; - *to |= (mappedlen >= 3) ? - *mappeddata++ << 16: 0; - to++; - } - } - from++; - } - if (tolen == 0) - return (idn_buffer_overflow); - *to = '\0'; - return (idn_success); -} - -idn_result_t -idn_nameprep_isprohibited(idn_nameprep_t handle, const uint32_t *str, - const uint32_t **found) { - assert(handle != NULL && str != NULL && found != NULL); - - TRACE(("idn_nameprep_isprohibited(ctx=%s, str=\"%s\")\n", - handle->version, idn__debug_ucs4xstring(str, 50))); - - return (idn_nameprep_check(handle->prohibited_proc, str, found)); -} - -idn_result_t -idn_nameprep_isunassigned(idn_nameprep_t handle, const uint32_t *str, - const uint32_t **found) { - assert(handle != NULL && str != NULL && found != NULL); - - TRACE(("idn_nameprep_isunassigned(handle->version, str=\"%s\")\n", - handle->version, idn__debug_ucs4xstring(str, 50))); - - return (idn_nameprep_check(handle->unassigned_proc, str, found)); -} - -static idn_result_t -idn_nameprep_check(nameprep_checkproc proc, const uint32_t *str, - const uint32_t **found) { - uint32_t v; - - while (*str != '\0') { - v = *str; - - if (v > UCS_MAX) { - /* This cannot happen, but just in case.. */ - return (idn_invalid_codepoint); - } else if (v > UNICODE_MAX) { - /* It is invalid.. */ - *found = str; - return (idn_success); - } else if ((*proc)(v)) { - *found = str; - return (idn_success); - } - str++; - } - *found = NULL; - return (idn_success); -} - -idn_result_t -idn_nameprep_isvalidbidi(idn_nameprep_t handle, const uint32_t *str, - const uint32_t **found) { - uint32_t v; - idn_biditype_t first_char; - idn_biditype_t last_char; - int found_r_al; - - assert(handle != NULL && str != NULL && found != NULL); - - TRACE(("idn_nameprep_isvalidbidi(ctx=%s, str=\"%s\")\n", - handle->version, idn__debug_ucs4xstring(str, 50))); - - if (*str == '\0') { - *found = NULL; - return (idn_success); - } - - /* - * check first character's type and initialize variables. - */ - found_r_al = 0; - if (*str > UCS_MAX) { - /* This cannot happen, but just in case.. */ - return (idn_invalid_codepoint); - } else if (*str > UNICODE_MAX) { - /* It is invalid.. */ - *found = str; - return (idn_success); - } - first_char = last_char = (*(handle->biditype_proc))(*str); - if (first_char == idn_biditype_r_al) { - found_r_al = 1; - } - str++; - - /* - * see whether string is valid or not. - */ - while (*str != '\0') { - v = *str; - - if (v > UCS_MAX) { - /* This cannot happen, but just in case.. */ - return (idn_invalid_codepoint); - } else if (v > UNICODE_MAX) { - /* It is invalid.. */ - *found = str; - return (idn_success); - } else { - last_char = (*(handle->biditype_proc))(v); - if (found_r_al && last_char == idn_biditype_l) { - *found = str; - return (idn_success); - } - if (first_char != idn_biditype_r_al && last_char == idn_biditype_r_al) { - *found = str; - return (idn_success); - } - if (last_char == idn_biditype_r_al) { - found_r_al = 1; - } - } - str++; - } - - if (found_r_al) { - if (last_char != idn_biditype_r_al) { - *found = str - 1; - return (idn_success); - } - } - - *found = NULL; - return (idn_success); -} - -idn_result_t -idn_nameprep_createproc(const char *parameter, void **handlep) { - return idn_nameprep_create(parameter, (idn_nameprep_t *)handlep); -} - -void -idn_nameprep_destroyproc(void *handle) { - idn_nameprep_destroy((idn_nameprep_t)handle); -} - -idn_result_t -idn_nameprep_mapproc(void *handle, const uint32_t *from, - uint32_t *to, size_t tolen) { - return idn_nameprep_map((idn_nameprep_t)handle, from, to, tolen); -} - -idn_result_t -idn_nameprep_prohibitproc(void *handle, const uint32_t *str, - const uint32_t **found) { - return idn_nameprep_isprohibited((idn_nameprep_t)handle, str, found); -} - -idn_result_t -idn_nameprep_unassignedproc(void *handle, const uint32_t *str, - const uint32_t **found) { - return idn_nameprep_isunassigned((idn_nameprep_t)handle, str, found); -} - -idn_result_t -idn_nameprep_bidiproc(void *handle, const uint32_t *str, - const uint32_t **found) { - return idn_nameprep_isvalidbidi((idn_nameprep_t)handle, str, found); -} diff --git a/netwerk/dns/nameprep_template.c b/netwerk/dns/nameprep_template.c deleted file mode 100644 index 7fe36518a..000000000 --- a/netwerk/dns/nameprep_template.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 2001 Japan Network Information Center. All rights reserved. - * - * By using this file, you agree to the terms and conditions set forth bellow. - * - * LICENSE TERMS AND CONDITIONS - * - * The following License Terms and Conditions apply, unless a different - * license is obtained from Japan Network Information Center ("JPNIC"), - * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda, - * Chiyoda-ku, Tokyo 101-0047, Japan. - * - * 1. Use, Modification and Redistribution (including distribution of any - * modified or derived work) in source and/or binary forms is permitted - * under this License Terms and Conditions. - * - * 2. Redistribution of source code must retain the copyright notices as they - * appear in each source code file, this License Terms and Conditions. - * - * 3. Redistribution in binary form must reproduce the Copyright Notice, - * this License Terms and Conditions, in the documentation and/or other - * materials provided with the distribution. For the purposes of binary - * distribution the "Copyright Notice" refers to the following language: - * "Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved." - * - * 4. The name of JPNIC may not be used to endorse or promote products - * derived from this Software without specific prior written approval of - * JPNIC. - * - * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - */ - -/* - * Include this file once for each version of NAMEPREP. - * VERSION should be defined to appropriate value before inclusion. - */ - -#ifndef NAMEPREP_TEMPLATE_INIT -#define NAMEPREP_TEMPLATE_INIT - -/* Symbol composition. */ -#define compose_sym2(a, b) compose_sym2X(a, b) -#define compose_sym2X(a, b) a ## b -#define compose_sym3(a, b, c) compose_sym3X(a, b, c) -#define compose_sym3X(a, b, c) a ## b ## c - -/* The table is based on "Optimized Two-Stage Table" mentioned in - * Unicode 3.0 page 106, extended to handle 21bit data instead of 16 bit. - */ - -/* Index calculation for multi-level index tables. */ -#define IDX0(type, v) IDX_0(v, BITS1(type), BITS2(type)) -#define IDX1(type, v) IDX_1(v, BITS1(type), BITS2(type)) -#define IDX2(type, v) IDX_2(v, BITS1(type), BITS2(type)) - -#define IDX_0(v, bits1, bits2) ((v) >> ((bits1) + (bits2))) -#define IDX_1(v, bits1, bits2) (((v) >> (bits2)) & ((1 << (bits1)) - 1)) -#define IDX_2(v, bits1, bits2) ((v) & ((1 << (bits2)) - 1)) - -#define BITS1(type) type ## _BITS_1 -#define BITS2(type) type ## _BITS_2 - -#endif /* NAMEPREP_TEMPLATE_INIT */ - -static const char * -compose_sym2(nameprep_map_, VERSION) (uint32_t v) { - int idx0 = IDX0(MAP, v); - int idx1 = IDX1(MAP, v); - int idx2 = IDX2(MAP, v); - int offset; - -#define IMAP compose_sym3(nameprep_, VERSION, _map_imap) -#define TABLE compose_sym3(nameprep_, VERSION, _map_table) -#define DATA compose_sym3(nameprep_, VERSION, _map_data) - offset = TABLE[IMAP[IMAP[idx0] + idx1]].tbl[idx2]; - if (offset == 0) - return (NULL); /* no mapping */ - return (const char *)(DATA + offset); -#undef IMAP -#undef TABLE -#undef DATA -} - -static int -compose_sym2(nameprep_prohibited_, VERSION) (uint32_t v) { - int idx0 = IDX0(PROH, v); - int idx1 = IDX1(PROH, v); - int idx2 = IDX2(PROH, v); - const unsigned char *bm; - -#define IMAP compose_sym3(nameprep_, VERSION, _prohibited_imap) -#define BITMAP compose_sym3(nameprep_, VERSION, _prohibited_bitmap) - bm = BITMAP[IMAP[IMAP[idx0] + idx1]].bm; - return (bm[idx2 / 8] & (1 << (idx2 % 8))); -#undef IMAP -#undef BITMAP -} - -static int -compose_sym2(nameprep_unassigned_, VERSION) (uint32_t v) { - int idx0 = IDX0(UNAS, v); - int idx1 = IDX1(UNAS, v); - int idx2 = IDX2(UNAS, v); - const unsigned char *bm; - -#define IMAP compose_sym3(nameprep_, VERSION, _unassigned_imap) -#define BITMAP compose_sym3(nameprep_, VERSION, _unassigned_bitmap) - bm = BITMAP[IMAP[IMAP[idx0] + idx1]].bm; - return (bm[idx2 / 8] & (1 << (idx2 % 8))); -#undef IMAP -#undef BITMAP -} - -static idn_biditype_t -compose_sym2(nameprep_biditype_, VERSION) (uint32_t v) { - int idx0 = IDX0(BIDI, v); - int idx1 = IDX1(BIDI, v); - int idx2 = IDX2(BIDI, v); - int offset; - -#define IMAP compose_sym3(nameprep_, VERSION, _bidi_imap) -#define TABLE compose_sym3(nameprep_, VERSION, _bidi_table) -#define DATA compose_sym3(nameprep_, VERSION, _bidi_data) - offset = TABLE[IMAP[IMAP[idx0] + idx1]].tbl[idx2]; - return DATA[offset]; -#undef IMAP -#undef TABLE -#undef DATA -} diff --git a/netwerk/dns/nameprepdata.c b/netwerk/dns/nameprepdata.c deleted file mode 100644 index cd7e2db0e..000000000 --- a/netwerk/dns/nameprepdata.c +++ /dev/null @@ -1,2588 +0,0 @@ -/* - * Copyright (c) 2001,2002 Japan Network Information Center. - * All rights reserved. - * - * By using this file, you agree to the terms and conditions set forth bellow. - * - * LICENSE TERMS AND CONDITIONS - * - * The following License Terms and Conditions apply, unless a different - * license is obtained from Japan Network Information Center ("JPNIC"), - * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda, - * Chiyoda-ku, Tokyo 101-0047, Japan. - * - * 1. Use, Modification and Redistribution (including distribution of any - * modified or derived work) in source and/or binary forms is permitted - * under this License Terms and Conditions. - * - * 2. Redistribution of source code must retain the copyright notices as they - * appear in each source code file, this License Terms and Conditions. - * - * 3. Redistribution in binary form must reproduce the Copyright Notice, - * this License Terms and Conditions, in the documentation and/or other - * materials provided with the distribution. For the purposes of binary - * distribution the "Copyright Notice" refers to the following language: - * "Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved." - * - * 4. The name of JPNIC may not be used to endorse or promote products - * derived from this Software without specific prior written approval of - * JPNIC. - * - * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - */ - - /* - * Do not edit this file! - * This file is generated from NAMEPREP specification. - */ - -#define MAP_BITS_0 9 -#define MAP_BITS_1 7 -#define MAP_BITS_2 5 - -#define PROH_BITS_0 7 -#define PROH_BITS_1 7 -#define PROH_BITS_2 7 - -#define UNAS_BITS_0 7 -#define UNAS_BITS_1 7 -#define UNAS_BITS_2 7 - -#define BIDI_BITS_0 9 -#define BIDI_BITS_1 7 -#define BIDI_BITS_2 5 - - -static const unsigned short nameprep_id11_map_imap[] = { - 272, 400, 528, 656, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 912, - 1040, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 1168, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 0, 0, 1, 0, 0, 2, 3, 0, - 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 0, 0, 0, 0, 0, 0, - 0, 0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, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -}; - -static const struct { - unsigned short tbl[32]; -} nameprep_id11_map_table[] = { - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, - 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, - 44, 46, 48, 50, 52, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 54, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, - 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, - 101, 0, 103, 105, 107, 109, 111, 113, 115, 117, - }}, - {{ - 123, 0, 126, 0, 129, 0, 132, 0, 135, 0, 138, - 0, 141, 0, 144, 0, 147, 0, 150, 0, 153, 0, - 156, 0, 159, 0, 162, 0, 165, 0, 168, 0, - }}, - {{ - 171, 0, 174, 0, 177, 0, 180, 0, 183, 0, 186, - 0, 189, 0, 192, 0, 195, 0, 202, 0, 205, 0, - 208, 0, 0, 211, 0, 214, 0, 217, 0, 220, - }}, - {{ - 0, 223, 0, 226, 0, 229, 0, 232, 0, 235, 241, - 0, 244, 0, 247, 0, 250, 0, 253, 0, 256, 0, - 259, 0, 262, 0, 265, 0, 268, 0, 271, 0, - }}, - {{ - 274, 0, 277, 0, 280, 0, 283, 0, 286, 0, 289, - 0, 292, 0, 295, 0, 298, 0, 301, 0, 304, 0, - 307, 0, 310, 312, 0, 315, 0, 318, 0, 38, - }}, - {{ - 0, 321, 324, 0, 327, 0, 330, 333, 0, 336, 339, - 342, 0, 0, 345, 348, 351, 354, 0, 357, 360, 0, - 363, 366, 369, 0, 0, 0, 372, 375, 0, 378, - }}, - {{ - 381, 0, 384, 0, 387, 0, 390, 393, 0, 396, 0, - 0, 399, 0, 402, 405, 0, 408, 411, 414, 0, 417, - 0, 420, 423, 0, 0, 0, 426, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 429, 429, 0, 432, 432, 0, 435, - 435, 0, 438, 0, 441, 0, 444, 0, 447, 0, 450, - 0, 453, 0, 456, 0, 459, 0, 0, 462, 0, - }}, - {{ - 465, 0, 468, 0, 471, 0, 474, 0, 477, 0, 480, - 0, 483, 0, 486, 0, 489, 496, 496, 0, 499, 0, - 502, 505, 508, 0, 511, 0, 514, 0, 517, 0, - }}, - {{ - 520, 0, 523, 0, 526, 0, 529, 0, 532, 0, 535, - 0, 538, 0, 541, 0, 544, 0, 547, 0, 550, 0, - 553, 0, 556, 0, 559, 0, 562, 0, 565, 0, - }}, - {{ - 568, 0, 571, 0, 574, 0, 577, 0, 580, 0, 583, - 0, 586, 0, 589, 0, 592, 0, 595, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 598, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 601, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 608, 0, 611, 614, 617, - 0, 620, 0, 623, 626, 629, 640, 643, 646, 649, 652, - 655, 658, 661, 598, 664, 667, 54, 670, 673, 676, - }}, - {{ - 679, 682, 0, 685, 688, 691, 694, 697, 700, 703, 706, - 709, 0, 0, 0, 0, 712, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 685, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 643, 661, 691, 623, 709, 694, - 679, 0, 723, 0, 726, 0, 729, 0, 732, 0, - }}, - {{ - 735, 0, 738, 0, 741, 0, 744, 0, 747, 0, 750, - 0, 753, 0, 756, 0, 664, 682, 685, 0, 661, 652, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 759, 762, 765, 768, 771, 774, 777, 780, 783, 786, 789, - 792, 795, 798, 801, 804, 807, 810, 813, 816, 819, 822, - 825, 828, 831, 834, 837, 840, 843, 846, 849, 852, - }}, - {{ - 855, 858, 861, 864, 867, 870, 873, 876, 879, 882, 885, - 888, 891, 894, 897, 900, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 903, 0, 906, 0, 909, 0, 912, 0, 915, 0, 918, - 0, 921, 0, 924, 0, 927, 0, 930, 0, 933, 0, - 936, 0, 939, 0, 942, 0, 945, 0, 948, 0, - }}, - {{ - 951, 0, 0, 0, 0, 0, 0, 0, 0, 0, 954, - 0, 957, 0, 960, 0, 963, 0, 966, 0, 969, 0, - 972, 0, 975, 0, 978, 0, 981, 0, 984, 0, - }}, - {{ - 987, 0, 990, 0, 993, 0, 996, 0, 999, 0, 1002, - 0, 1005, 0, 1008, 0, 1011, 0, 1014, 0, 1017, 0, - 1020, 0, 1023, 0, 1026, 0, 1029, 0, 1032, 0, - }}, - {{ - 0, 1035, 0, 1038, 0, 1041, 0, 1044, 0, 1047, 0, - 1050, 0, 1053, 0, 0, 1056, 0, 1059, 0, 1062, 0, - 1065, 0, 1068, 0, 1071, 0, 1074, 0, 1077, 0, - }}, - {{ - 1080, 0, 1083, 0, 1086, 0, 1089, 0, 1092, 0, 1095, - 0, 1098, 0, 1101, 0, 1104, 0, 1107, 0, 1110, 0, - 0, 0, 1113, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 1116, 0, 1119, 0, 1122, 0, 1125, 0, 1128, 0, 1131, - 0, 1134, 0, 1137, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1140, 1143, 1146, 1149, 1152, - 1155, 1158, 1161, 1164, 1167, 1170, 1173, 1176, 1179, 1182, - }}, - {{ - 1185, 1188, 1191, 1194, 1197, 1200, 1203, 1206, 1209, 1212, 1215, - 1218, 1221, 1224, 1227, 1230, 1233, 1236, 1239, 1242, 1245, 1248, - 1251, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 1254, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 1261, 0, 1264, 0, 1267, 0, 1270, 0, 1273, 0, 1276, - 0, 1279, 0, 1282, 0, 1285, 0, 1288, 0, 1291, 0, - 1294, 0, 1297, 0, 1300, 0, 1303, 0, 1306, 0, - }}, - {{ - 1309, 0, 1312, 0, 1315, 0, 1318, 0, 1321, 0, 1324, - 0, 1327, 0, 1330, 0, 1333, 0, 1336, 0, 1339, 0, - 1342, 0, 1345, 0, 1348, 0, 1351, 0, 1354, 0, - }}, - {{ - 1357, 0, 1360, 0, 1363, 0, 1366, 0, 1369, 0, 1372, - 0, 1375, 0, 1378, 0, 1381, 0, 1384, 0, 1387, 0, - 1390, 0, 1393, 0, 1396, 0, 1399, 0, 1402, 0, - }}, - {{ - 1405, 0, 1408, 0, 1411, 0, 1414, 0, 1417, 0, 1420, - 0, 1423, 0, 1426, 0, 1429, 0, 1432, 0, 1435, 0, - 1438, 0, 1441, 0, 1444, 0, 1447, 0, 1450, 0, - }}, - {{ - 1453, 0, 1456, 0, 1459, 0, 1462, 0, 1465, 0, 1468, - 0, 1471, 0, 1474, 0, 1477, 0, 1480, 0, 1483, 0, - 1486, 1493, 1500, 1507, 1514, 1405, 0, 0, 0, 0, - }}, - {{ - 1521, 0, 1524, 0, 1527, 0, 1530, 0, 1533, 0, 1536, - 0, 1539, 0, 1542, 0, 1545, 0, 1548, 0, 1551, 0, - 1554, 0, 1557, 0, 1560, 0, 1563, 0, 1566, 0, - }}, - {{ - 1569, 0, 1572, 0, 1575, 0, 1578, 0, 1581, 0, 1584, - 0, 1587, 0, 1590, 0, 1593, 0, 1596, 0, 1599, 0, - 1602, 0, 1605, 0, 1608, 0, 1611, 0, 1614, 0, - }}, - {{ - 1617, 0, 1620, 0, 1623, 0, 1626, 0, 1629, 0, 1632, - 0, 1635, 0, 1638, 0, 1641, 0, 1644, 0, 1647, 0, - 1650, 0, 1653, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 1656, 1659, 1662, - 1665, 1668, 1671, 1674, 1677, 0, 0, 0, 0, 0, 0, - 0, 0, 1680, 1683, 1686, 1689, 1692, 1695, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 1698, 1701, 1704, - 1707, 1710, 1713, 1716, 1719, 0, 0, 0, 0, 0, 0, - 0, 0, 1722, 1725, 1728, 1731, 1734, 1737, 1740, 1743, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 1746, 1749, 1752, - 1755, 1758, 1761, 0, 0, 1764, 0, 1771, 0, 1782, 0, - 1793, 0, 0, 1804, 0, 1807, 0, 1810, 0, 1813, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 1816, 1819, 1822, - 1825, 1828, 1831, 1834, 1837, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 1840, 1847, 1854, 1861, 1868, 1875, 1882, 1889, 1840, 1847, 1854, - 1861, 1868, 1875, 1882, 1889, 1896, 1903, 1910, 1917, 1924, 1931, - 1938, 1945, 1896, 1903, 1910, 1917, 1924, 1931, 1938, 1945, - }}, - {{ - 1952, 1959, 1966, 1973, 1980, 1987, 1994, 2001, 1952, 1959, 1966, - 1973, 1980, 1987, 1994, 2001, 0, 0, 2008, 2015, 2022, 0, - 2029, 2036, 2047, 2050, 2053, 2056, 2015, 0, 598, 0, - }}, - {{ - 0, 0, 2059, 2066, 2073, 0, 2080, 2087, 2098, 2101, 2104, - 2107, 2066, 0, 0, 0, 0, 0, 2110, 629, 0, 0, - 2121, 2128, 2139, 2142, 2145, 2148, 0, 0, 0, 0, - }}, - {{ - 0, 0, 2151, 712, 2162, 0, 2169, 2176, 2187, 2190, 2193, - 2196, 2199, 0, 0, 0, 0, 0, 2202, 2209, 2216, 0, - 2223, 2230, 2241, 2244, 2247, 2250, 2209, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 2253, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 6, 2259, 0, 0, 0, 351, 0, 2265, 0, - 16, 16, 16, 0, 0, 18, 18, 24, 0, 0, 28, - 2271, 0, 0, 32, 34, 36, 36, 36, 0, 0, - }}, - {{ - 2277, 2283, 2293, 0, 52, 0, 703, 0, 52, 0, 22, - 67, 4, 6, 0, 0, 10, 12, 0, 26, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 646, 679, - }}, - {{ - 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 2299, 2302, 2305, 2308, 2311, 2314, 2317, 2320, 2323, 2326, 2329, - 2332, 2335, 2338, 2341, 2344, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2347, 2350, 2353, 2356, 2359, 2362, 2365, 2368, 2371, 2374, - }}, - {{ - 2377, 2380, 2383, 2386, 2389, 2392, 2395, 2398, 2401, 2404, 2407, - 2410, 2413, 2416, 2419, 2422, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2425, 0, 2435, 0, 2441, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 2447, 2453, 2459, 2465, 2471, 2477, 2483, 2489, 0, 0, 2495, - 2501, 2507, 0, 0, 0, 2513, 2519, 2529, 2539, 2549, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2447, 2559, - 2569, 2579, 0, 0, 0, 0, 0, 0, 0, 2589, 2595, - 2601, 2607, 2613, 2607, 2619, 2625, 2631, 2637, 2643, 2637, - }}, - {{ - 2649, 2656, 0, 2663, 0, 0, 2669, 2683, 2693, 2699, 0, - 2705, 0, 2711, 2717, 0, 0, 0, 0, 0, 0, 0, - 0, 2723, 0, 2729, 2739, 0, 2745, 2751, 0, 0, - }}, - {{ - 2757, 2763, 2769, 2775, 2785, 2795, 2795, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2801, 2808, 2815, - 2822, 2829, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - }}, - {{ - 0, 2836, 2839, 2842, 2845, 2848, 2851, 2854, 2857, 2860, 2863, - 2866, 2869, 2872, 2875, 2878, 2881, 2884, 2887, 2890, 2893, 2896, - 2899, 2902, 2905, 2908, 2911, 0, 0, 0, 0, 0, - }}, - {{ - 2914, 2918, 2922, 2926, 2930, 2934, 2938, 2942, 2946, 2950, 2954, - 2958, 2962, 2966, 2970, 2974, 2978, 2982, 2986, 2990, 2994, 2998, - 3002, 3006, 3010, 3014, 3018, 3022, 3026, 3030, 3034, 3038, - }}, - {{ - 3042, 3046, 3050, 3054, 3058, 3062, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, - 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, - 46, 48, 50, 52, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, - 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, - }}, - {{ - 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, - 48, 50, 52, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 6, - 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, - 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, - }}, - {{ - 50, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, 0, 6, 8, - }}, - {{ - 0, 0, 14, 0, 0, 20, 22, 0, 0, 28, 30, - 32, 34, 0, 38, 40, 42, 44, 46, 48, 50, 52, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 2, 4, 6, 8, 10, 12, - 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, - }}, - {{ - 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 2, 4, 0, 8, 10, 12, 14, - 0, 0, 20, 22, 24, 26, 28, 30, 32, 34, 0, - 38, 40, 42, 44, 46, 48, 50, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2, 4, 0, 8, 10, 12, 14, 0, - }}, - {{ - 18, 20, 22, 24, 26, 0, 30, 0, 0, 0, 38, - 40, 42, 44, 46, 48, 50, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, - 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, - }}, - {{ - 42, 44, 46, 48, 50, 52, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 50, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, 4, 6, 8, - }}, - {{ - 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, - 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 640, 643, 646, - 649, 652, 655, 658, 661, 598, 664, 667, 54, 670, 673, - 676, 679, 682, 661, 685, 688, 691, 694, 697, 700, - }}, - {{ - 703, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 685, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 640, 643, 646, 649, 652, 655, 658, 661, 598, - 664, 667, 54, 670, 673, 676, 679, 682, 661, 685, 688, - 691, 694, 697, 700, 703, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 685, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 640, 643, 646, 649, - }}, - {{ - 652, 655, 658, 661, 598, 664, 667, 54, 670, 673, 676, - 679, 682, 661, 685, 688, 691, 694, 697, 700, 703, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 685, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 640, 643, 646, 649, 652, 655, 658, 661, 598, 664, - }}, - {{ - 667, 54, 670, 673, 676, 679, 682, 661, 685, 688, 691, - 694, 697, 700, 703, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 685, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 640, 643, 646, 649, 652, 655, - 658, 661, 598, 664, 667, 54, 670, 673, 676, 679, - }}, - {{ - 682, 661, 685, 688, 691, 694, 697, 700, 703, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 685, 0, 0, 0, 0, - }}, -}; - -static const unsigned char nameprep_id11_map_data[] = { - 0, 0, 1, 97, 1, 98, 1, 99, 1, 100, 1, 101, - 1, 102, 1, 103, 1, 104, 1, 105, 1, 106, 1, 107, - 1, 108, 1, 109, 1, 110, 1, 111, 1, 112, 1, 113, - 1, 114, 1, 115, 1, 116, 1, 117, 1, 118, 1, 119, - 1, 120, 1, 121, 1, 122, 2, 188, 3, 1, 224, 1, - 225, 1, 226, 1, 227, 1, 228, 1, 229, 1, 230, 1, - 231, 1, 232, 1, 233, 1, 234, 1, 235, 1, 236, 1, - 237, 1, 238, 1, 239, 1, 240, 1, 241, 1, 242, 1, - 243, 1, 244, 1, 245, 1, 246, 1, 248, 1, 249, 1, - 250, 1, 251, 1, 252, 1, 253, 1, 254, 5, 115, 0, - 0, 0, 115, 2, 1, 1, 2, 3, 1, 2, 5, 1, - 2, 7, 1, 2, 9, 1, 2, 11, 1, 2, 13, 1, - 2, 15, 1, 2, 17, 1, 2, 19, 1, 2, 21, 1, - 2, 23, 1, 2, 25, 1, 2, 27, 1, 2, 29, 1, - 2, 31, 1, 2, 33, 1, 2, 35, 1, 2, 37, 1, - 2, 39, 1, 2, 41, 1, 2, 43, 1, 2, 45, 1, - 2, 47, 1, 6, 105, 0, 0, 0, 7, 3, 2, 51, - 1, 2, 53, 1, 2, 55, 1, 2, 58, 1, 2, 60, - 1, 2, 62, 1, 2, 64, 1, 2, 66, 1, 2, 68, - 1, 2, 70, 1, 2, 72, 1, 5, 188, 2, 0, 0, - 110, 2, 75, 1, 2, 77, 1, 2, 79, 1, 2, 81, - 1, 2, 83, 1, 2, 85, 1, 2, 87, 1, 2, 89, - 1, 2, 91, 1, 2, 93, 1, 2, 95, 1, 2, 97, - 1, 2, 99, 1, 2, 101, 1, 2, 103, 1, 2, 105, - 1, 2, 107, 1, 2, 109, 1, 2, 111, 1, 2, 113, - 1, 2, 115, 1, 2, 117, 1, 2, 119, 1, 1, 255, - 2, 122, 1, 2, 124, 1, 2, 126, 1, 2, 83, 2, - 2, 131, 1, 2, 133, 1, 2, 84, 2, 2, 136, 1, - 2, 86, 2, 2, 87, 2, 2, 140, 1, 2, 221, 1, - 2, 89, 2, 2, 91, 2, 2, 146, 1, 2, 96, 2, - 2, 99, 2, 2, 105, 2, 2, 104, 2, 2, 153, 1, - 2, 111, 2, 2, 114, 2, 2, 117, 2, 2, 161, 1, - 2, 163, 1, 2, 165, 1, 2, 128, 2, 2, 168, 1, - 2, 131, 2, 2, 173, 1, 2, 136, 2, 2, 176, 1, - 2, 138, 2, 2, 139, 2, 2, 180, 1, 2, 182, 1, - 2, 146, 2, 2, 185, 1, 2, 189, 1, 2, 198, 1, - 2, 201, 1, 2, 204, 1, 2, 206, 1, 2, 208, 1, - 2, 210, 1, 2, 212, 1, 2, 214, 1, 2, 216, 1, - 2, 218, 1, 2, 220, 1, 2, 223, 1, 2, 225, 1, - 2, 227, 1, 2, 229, 1, 2, 231, 1, 2, 233, 1, - 2, 235, 1, 2, 237, 1, 2, 239, 1, 6, 106, 0, - 0, 0, 12, 3, 2, 243, 1, 2, 245, 1, 2, 149, - 1, 2, 191, 1, 2, 249, 1, 2, 251, 1, 2, 253, - 1, 2, 255, 1, 2, 1, 2, 2, 3, 2, 2, 5, - 2, 2, 7, 2, 2, 9, 2, 2, 11, 2, 2, 13, - 2, 2, 15, 2, 2, 17, 2, 2, 19, 2, 2, 21, - 2, 2, 23, 2, 2, 25, 2, 2, 27, 2, 2, 29, - 2, 2, 31, 2, 2, 158, 1, 2, 35, 2, 2, 37, - 2, 2, 39, 2, 2, 41, 2, 2, 43, 2, 2, 45, - 2, 2, 47, 2, 2, 49, 2, 2, 51, 2, 2, 185, - 3, 6, 32, 0, 0, 0, 185, 3, 2, 172, 3, 2, - 173, 3, 2, 174, 3, 2, 175, 3, 2, 204, 3, 2, - 205, 3, 2, 206, 3, 10, 185, 3, 0, 0, 8, 3, - 0, 0, 1, 3, 2, 177, 3, 2, 178, 3, 2, 179, - 3, 2, 180, 3, 2, 181, 3, 2, 182, 3, 2, 183, - 3, 2, 184, 3, 2, 186, 3, 2, 187, 3, 2, 189, - 3, 2, 190, 3, 2, 191, 3, 2, 192, 3, 2, 193, - 3, 2, 195, 3, 2, 196, 3, 2, 197, 3, 2, 198, - 3, 2, 199, 3, 2, 200, 3, 2, 201, 3, 2, 202, - 3, 2, 203, 3, 10, 197, 3, 0, 0, 8, 3, 0, - 0, 1, 3, 2, 217, 3, 2, 219, 3, 2, 221, 3, - 2, 223, 3, 2, 225, 3, 2, 227, 3, 2, 229, 3, - 2, 231, 3, 2, 233, 3, 2, 235, 3, 2, 237, 3, - 2, 239, 3, 2, 80, 4, 2, 81, 4, 2, 82, 4, - 2, 83, 4, 2, 84, 4, 2, 85, 4, 2, 86, 4, - 2, 87, 4, 2, 88, 4, 2, 89, 4, 2, 90, 4, - 2, 91, 4, 2, 92, 4, 2, 93, 4, 2, 94, 4, - 2, 95, 4, 2, 48, 4, 2, 49, 4, 2, 50, 4, - 2, 51, 4, 2, 52, 4, 2, 53, 4, 2, 54, 4, - 2, 55, 4, 2, 56, 4, 2, 57, 4, 2, 58, 4, - 2, 59, 4, 2, 60, 4, 2, 61, 4, 2, 62, 4, - 2, 63, 4, 2, 64, 4, 2, 65, 4, 2, 66, 4, - 2, 67, 4, 2, 68, 4, 2, 69, 4, 2, 70, 4, - 2, 71, 4, 2, 72, 4, 2, 73, 4, 2, 74, 4, - 2, 75, 4, 2, 76, 4, 2, 77, 4, 2, 78, 4, - 2, 79, 4, 2, 97, 4, 2, 99, 4, 2, 101, 4, - 2, 103, 4, 2, 105, 4, 2, 107, 4, 2, 109, 4, - 2, 111, 4, 2, 113, 4, 2, 115, 4, 2, 117, 4, - 2, 119, 4, 2, 121, 4, 2, 123, 4, 2, 125, 4, - 2, 127, 4, 2, 129, 4, 2, 139, 4, 2, 141, 4, - 2, 143, 4, 2, 145, 4, 2, 147, 4, 2, 149, 4, - 2, 151, 4, 2, 153, 4, 2, 155, 4, 2, 157, 4, - 2, 159, 4, 2, 161, 4, 2, 163, 4, 2, 165, 4, - 2, 167, 4, 2, 169, 4, 2, 171, 4, 2, 173, 4, - 2, 175, 4, 2, 177, 4, 2, 179, 4, 2, 181, 4, - 2, 183, 4, 2, 185, 4, 2, 187, 4, 2, 189, 4, - 2, 191, 4, 2, 194, 4, 2, 196, 4, 2, 198, 4, - 2, 200, 4, 2, 202, 4, 2, 204, 4, 2, 206, 4, - 2, 209, 4, 2, 211, 4, 2, 213, 4, 2, 215, 4, - 2, 217, 4, 2, 219, 4, 2, 221, 4, 2, 223, 4, - 2, 225, 4, 2, 227, 4, 2, 229, 4, 2, 231, 4, - 2, 233, 4, 2, 235, 4, 2, 237, 4, 2, 239, 4, - 2, 241, 4, 2, 243, 4, 2, 245, 4, 2, 249, 4, - 2, 1, 5, 2, 3, 5, 2, 5, 5, 2, 7, 5, - 2, 9, 5, 2, 11, 5, 2, 13, 5, 2, 15, 5, - 2, 97, 5, 2, 98, 5, 2, 99, 5, 2, 100, 5, - 2, 101, 5, 2, 102, 5, 2, 103, 5, 2, 104, 5, - 2, 105, 5, 2, 106, 5, 2, 107, 5, 2, 108, 5, - 2, 109, 5, 2, 110, 5, 2, 111, 5, 2, 112, 5, - 2, 113, 5, 2, 114, 5, 2, 115, 5, 2, 116, 5, - 2, 117, 5, 2, 118, 5, 2, 119, 5, 2, 120, 5, - 2, 121, 5, 2, 122, 5, 2, 123, 5, 2, 124, 5, - 2, 125, 5, 2, 126, 5, 2, 127, 5, 2, 128, 5, - 2, 129, 5, 2, 130, 5, 2, 131, 5, 2, 132, 5, - 2, 133, 5, 2, 134, 5, 6, 101, 5, 0, 0, 130, - 5, 2, 1, 30, 2, 3, 30, 2, 5, 30, 2, 7, - 30, 2, 9, 30, 2, 11, 30, 2, 13, 30, 2, 15, - 30, 2, 17, 30, 2, 19, 30, 2, 21, 30, 2, 23, - 30, 2, 25, 30, 2, 27, 30, 2, 29, 30, 2, 31, - 30, 2, 33, 30, 2, 35, 30, 2, 37, 30, 2, 39, - 30, 2, 41, 30, 2, 43, 30, 2, 45, 30, 2, 47, - 30, 2, 49, 30, 2, 51, 30, 2, 53, 30, 2, 55, - 30, 2, 57, 30, 2, 59, 30, 2, 61, 30, 2, 63, - 30, 2, 65, 30, 2, 67, 30, 2, 69, 30, 2, 71, - 30, 2, 73, 30, 2, 75, 30, 2, 77, 30, 2, 79, - 30, 2, 81, 30, 2, 83, 30, 2, 85, 30, 2, 87, - 30, 2, 89, 30, 2, 91, 30, 2, 93, 30, 2, 95, - 30, 2, 97, 30, 2, 99, 30, 2, 101, 30, 2, 103, - 30, 2, 105, 30, 2, 107, 30, 2, 109, 30, 2, 111, - 30, 2, 113, 30, 2, 115, 30, 2, 117, 30, 2, 119, - 30, 2, 121, 30, 2, 123, 30, 2, 125, 30, 2, 127, - 30, 2, 129, 30, 2, 131, 30, 2, 133, 30, 2, 135, - 30, 2, 137, 30, 2, 139, 30, 2, 141, 30, 2, 143, - 30, 2, 145, 30, 2, 147, 30, 2, 149, 30, 6, 104, - 0, 0, 0, 49, 3, 6, 116, 0, 0, 0, 8, 3, - 6, 119, 0, 0, 0, 10, 3, 6, 121, 0, 0, 0, - 10, 3, 6, 97, 0, 0, 0, 190, 2, 2, 161, 30, - 2, 163, 30, 2, 165, 30, 2, 167, 30, 2, 169, 30, - 2, 171, 30, 2, 173, 30, 2, 175, 30, 2, 177, 30, - 2, 179, 30, 2, 181, 30, 2, 183, 30, 2, 185, 30, - 2, 187, 30, 2, 189, 30, 2, 191, 30, 2, 193, 30, - 2, 195, 30, 2, 197, 30, 2, 199, 30, 2, 201, 30, - 2, 203, 30, 2, 205, 30, 2, 207, 30, 2, 209, 30, - 2, 211, 30, 2, 213, 30, 2, 215, 30, 2, 217, 30, - 2, 219, 30, 2, 221, 30, 2, 223, 30, 2, 225, 30, - 2, 227, 30, 2, 229, 30, 2, 231, 30, 2, 233, 30, - 2, 235, 30, 2, 237, 30, 2, 239, 30, 2, 241, 30, - 2, 243, 30, 2, 245, 30, 2, 247, 30, 2, 249, 30, - 2, 0, 31, 2, 1, 31, 2, 2, 31, 2, 3, 31, - 2, 4, 31, 2, 5, 31, 2, 6, 31, 2, 7, 31, - 2, 16, 31, 2, 17, 31, 2, 18, 31, 2, 19, 31, - 2, 20, 31, 2, 21, 31, 2, 32, 31, 2, 33, 31, - 2, 34, 31, 2, 35, 31, 2, 36, 31, 2, 37, 31, - 2, 38, 31, 2, 39, 31, 2, 48, 31, 2, 49, 31, - 2, 50, 31, 2, 51, 31, 2, 52, 31, 2, 53, 31, - 2, 54, 31, 2, 55, 31, 2, 64, 31, 2, 65, 31, - 2, 66, 31, 2, 67, 31, 2, 68, 31, 2, 69, 31, - 6, 197, 3, 0, 0, 19, 3, 10, 197, 3, 0, 0, - 19, 3, 0, 0, 0, 3, 10, 197, 3, 0, 0, 19, - 3, 0, 0, 1, 3, 10, 197, 3, 0, 0, 19, 3, - 0, 0, 66, 3, 2, 81, 31, 2, 83, 31, 2, 85, - 31, 2, 87, 31, 2, 96, 31, 2, 97, 31, 2, 98, - 31, 2, 99, 31, 2, 100, 31, 2, 101, 31, 2, 102, - 31, 2, 103, 31, 6, 0, 31, 0, 0, 185, 3, 6, - 1, 31, 0, 0, 185, 3, 6, 2, 31, 0, 0, 185, - 3, 6, 3, 31, 0, 0, 185, 3, 6, 4, 31, 0, - 0, 185, 3, 6, 5, 31, 0, 0, 185, 3, 6, 6, - 31, 0, 0, 185, 3, 6, 7, 31, 0, 0, 185, 3, - 6, 32, 31, 0, 0, 185, 3, 6, 33, 31, 0, 0, - 185, 3, 6, 34, 31, 0, 0, 185, 3, 6, 35, 31, - 0, 0, 185, 3, 6, 36, 31, 0, 0, 185, 3, 6, - 37, 31, 0, 0, 185, 3, 6, 38, 31, 0, 0, 185, - 3, 6, 39, 31, 0, 0, 185, 3, 6, 96, 31, 0, - 0, 185, 3, 6, 97, 31, 0, 0, 185, 3, 6, 98, - 31, 0, 0, 185, 3, 6, 99, 31, 0, 0, 185, 3, - 6, 100, 31, 0, 0, 185, 3, 6, 101, 31, 0, 0, - 185, 3, 6, 102, 31, 0, 0, 185, 3, 6, 103, 31, - 0, 0, 185, 3, 6, 112, 31, 0, 0, 185, 3, 6, - 177, 3, 0, 0, 185, 3, 6, 172, 3, 0, 0, 185, - 3, 6, 177, 3, 0, 0, 66, 3, 10, 177, 3, 0, - 0, 66, 3, 0, 0, 185, 3, 2, 176, 31, 2, 177, - 31, 2, 112, 31, 2, 113, 31, 6, 116, 31, 0, 0, - 185, 3, 6, 183, 3, 0, 0, 185, 3, 6, 174, 3, - 0, 0, 185, 3, 6, 183, 3, 0, 0, 66, 3, 10, - 183, 3, 0, 0, 66, 3, 0, 0, 185, 3, 2, 114, - 31, 2, 115, 31, 2, 116, 31, 2, 117, 31, 10, 185, - 3, 0, 0, 8, 3, 0, 0, 0, 3, 6, 185, 3, - 0, 0, 66, 3, 10, 185, 3, 0, 0, 8, 3, 0, - 0, 66, 3, 2, 208, 31, 2, 209, 31, 2, 118, 31, - 2, 119, 31, 10, 197, 3, 0, 0, 8, 3, 0, 0, - 0, 3, 6, 193, 3, 0, 0, 19, 3, 6, 197, 3, - 0, 0, 66, 3, 10, 197, 3, 0, 0, 8, 3, 0, - 0, 66, 3, 2, 224, 31, 2, 225, 31, 2, 122, 31, - 2, 123, 31, 2, 229, 31, 6, 124, 31, 0, 0, 185, - 3, 6, 201, 3, 0, 0, 185, 3, 6, 206, 3, 0, - 0, 185, 3, 6, 201, 3, 0, 0, 66, 3, 10, 201, - 3, 0, 0, 66, 3, 0, 0, 185, 3, 2, 120, 31, - 2, 121, 31, 2, 124, 31, 2, 125, 31, 5, 114, 0, - 0, 0, 115, 5, 176, 0, 0, 0, 99, 5, 176, 0, - 0, 0, 102, 5, 110, 0, 0, 0, 111, 5, 115, 0, - 0, 0, 109, 9, 116, 0, 0, 0, 101, 0, 0, 0, - 108, 5, 116, 0, 0, 0, 109, 2, 112, 33, 2, 113, - 33, 2, 114, 33, 2, 115, 33, 2, 116, 33, 2, 117, - 33, 2, 118, 33, 2, 119, 33, 2, 120, 33, 2, 121, - 33, 2, 122, 33, 2, 123, 33, 2, 124, 33, 2, 125, - 33, 2, 126, 33, 2, 127, 33, 2, 208, 36, 2, 209, - 36, 2, 210, 36, 2, 211, 36, 2, 212, 36, 2, 213, - 36, 2, 214, 36, 2, 215, 36, 2, 216, 36, 2, 217, - 36, 2, 218, 36, 2, 219, 36, 2, 220, 36, 2, 221, - 36, 2, 222, 36, 2, 223, 36, 2, 224, 36, 2, 225, - 36, 2, 226, 36, 2, 227, 36, 2, 228, 36, 2, 229, - 36, 2, 230, 36, 2, 231, 36, 2, 232, 36, 2, 233, - 36, 9, 104, 0, 0, 0, 112, 0, 0, 0, 97, 5, - 97, 0, 0, 0, 117, 5, 111, 0, 0, 0, 118, 5, - 112, 0, 0, 0, 97, 5, 110, 0, 0, 0, 97, 5, - 188, 3, 0, 0, 97, 5, 109, 0, 0, 0, 97, 5, - 107, 0, 0, 0, 97, 5, 107, 0, 0, 0, 98, 5, - 109, 0, 0, 0, 98, 5, 103, 0, 0, 0, 98, 5, - 112, 0, 0, 0, 102, 5, 110, 0, 0, 0, 102, 5, - 188, 3, 0, 0, 102, 5, 104, 0, 0, 0, 122, 9, - 107, 0, 0, 0, 104, 0, 0, 0, 122, 9, 109, 0, - 0, 0, 104, 0, 0, 0, 122, 9, 103, 0, 0, 0, - 104, 0, 0, 0, 122, 9, 116, 0, 0, 0, 104, 0, - 0, 0, 122, 9, 107, 0, 0, 0, 112, 0, 0, 0, - 97, 9, 109, 0, 0, 0, 112, 0, 0, 0, 97, 9, - 103, 0, 0, 0, 112, 0, 0, 0, 97, 5, 112, 0, - 0, 0, 118, 5, 110, 0, 0, 0, 118, 5, 188, 3, - 0, 0, 118, 5, 109, 0, 0, 0, 118, 5, 107, 0, - 0, 0, 118, 5, 112, 0, 0, 0, 119, 5, 110, 0, - 0, 0, 119, 5, 188, 3, 0, 0, 119, 5, 109, 0, - 0, 0, 119, 5, 107, 0, 0, 0, 119, 6, 107, 0, - 0, 0, 201, 3, 6, 109, 0, 0, 0, 201, 3, 5, - 98, 0, 0, 0, 113, 13, 99, 0, 0, 0, 21, 34, - 0, 0, 107, 0, 0, 0, 103, 9, 99, 0, 0, 0, - 111, 0, 0, 0, 46, 5, 100, 0, 0, 0, 98, 5, - 103, 0, 0, 0, 121, 5, 104, 0, 0, 0, 112, 5, - 107, 0, 0, 0, 107, 5, 107, 0, 0, 0, 109, 5, - 112, 0, 0, 0, 104, 9, 112, 0, 0, 0, 112, 0, - 0, 0, 109, 5, 112, 0, 0, 0, 114, 5, 115, 0, - 0, 0, 118, 5, 119, 0, 0, 0, 98, 5, 102, 0, - 0, 0, 102, 5, 102, 0, 0, 0, 105, 5, 102, 0, - 0, 0, 108, 9, 102, 0, 0, 0, 102, 0, 0, 0, - 105, 9, 102, 0, 0, 0, 102, 0, 0, 0, 108, 5, - 115, 0, 0, 0, 116, 6, 116, 5, 0, 0, 118, 5, - 6, 116, 5, 0, 0, 101, 5, 6, 116, 5, 0, 0, - 107, 5, 6, 126, 5, 0, 0, 118, 5, 6, 116, 5, - 0, 0, 109, 5, 2, 65, 255, 2, 66, 255, 2, 67, - 255, 2, 68, 255, 2, 69, 255, 2, 70, 255, 2, 71, - 255, 2, 72, 255, 2, 73, 255, 2, 74, 255, 2, 75, - 255, 2, 76, 255, 2, 77, 255, 2, 78, 255, 2, 79, - 255, 2, 80, 255, 2, 81, 255, 2, 82, 255, 2, 83, - 255, 2, 84, 255, 2, 85, 255, 2, 86, 255, 2, 87, - 255, 2, 88, 255, 2, 89, 255, 2, 90, 255, 3, 40, - 4, 1, 3, 41, 4, 1, 3, 42, 4, 1, 3, 43, - 4, 1, 3, 44, 4, 1, 3, 45, 4, 1, 3, 46, - 4, 1, 3, 47, 4, 1, 3, 48, 4, 1, 3, 49, - 4, 1, 3, 50, 4, 1, 3, 51, 4, 1, 3, 52, - 4, 1, 3, 53, 4, 1, 3, 54, 4, 1, 3, 55, - 4, 1, 3, 56, 4, 1, 3, 57, 4, 1, 3, 58, - 4, 1, 3, 59, 4, 1, 3, 60, 4, 1, 3, 61, - 4, 1, 3, 62, 4, 1, 3, 63, 4, 1, 3, 64, - 4, 1, 3, 65, 4, 1, 3, 66, 4, 1, 3, 67, - 4, 1, 3, 68, 4, 1, 3, 69, 4, 1, 3, 70, - 4, 1, 3, 71, 4, 1, 3, 72, 4, 1, 3, 73, - 4, 1, 3, 74, 4, 1, 3, 75, 4, 1, 3, 76, - 4, 1, 3, 77, 4, 1, -}; - -static const unsigned short nameprep_id11_prohibited_imap[] = { - 68, 196, 196, 324, 196, 196, 196, 452, - 196, 196, 196, 580, 196, 196, 196, 580, - 196, 196, 196, 580, 196, 196, 196, 580, - 196, 196, 196, 580, 196, 196, 196, 580, - 196, 196, 196, 580, 196, 196, 196, 580, - 196, 196, 196, 580, 196, 196, 196, 580, - 196, 196, 196, 580, 196, 196, 196, 580, - 708, 196, 196, 580, 836, 836, 836, 836, - 836, 836, 836, 836, 0, 1, 0, 0, - 0, 0, 2, 0, 0, 0, 0, 0, - 0, 3, 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 8, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0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 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, -}; - -static const struct { - unsigned char bm[16]; -} nameprep_id11_prohibited_bitmap[] = { - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 255,255,255,255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, - }}, - {{ - 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 255,199, 0, 0, 0,255, 0, 0, 0, 0, 0,128, 14,252, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 15, - }}, - {{ - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 7, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, - }}, - {{ - 2, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255, - }}, -}; - -static const unsigned short nameprep_id11_unassigned_imap[] = { - 68, 196, 324, 452, 580, 708, 708, 836, - 964, 964, 1092, 1220, 708, 708, 708, 1348, - 708, 708, 708, 1348, 708, 708, 708, 1348, - 708, 708, 708, 1348, 708, 708, 708, 1348, - 708, 708, 708, 1348, 708, 708, 708, 1348, - 708, 708, 708, 1348, 708, 708, 708, 1348, - 708, 708, 708, 1348, 708, 708, 708, 1348, - 1476, 708, 708, 1348, 964, 964, 964, 964, - 964, 964, 964, 964, 0, 0, 0, 0, - 1, 2, 3, 4, 0, 5, 6, 7, - 8, 9, 10, 11, 12, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 0, 0, 0, - 36, 37, 38, 39, 40, 41, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 0, 42, 43, 44, 45, 46, 47, 48, - 0, 0, 0, 49, 50, 51, 0, 0, - 52, 53, 54, 55, 0, 0, 0, 0, - 0, 0, 12, 12, 12, 12, 12, 12, - 12, 56, 0, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 66, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 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 12, 12, 12, - 12, 12, 78, 12, 79, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 0, 80, 81, 82, - 12, 12, 12, 12, 83, 84, 85, 0, - 0, 86, 0, 87, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 88, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 89, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 0, 0, 0, 0, - 90, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 88, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 88, 91, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, -}; - -static const struct { - unsigned char bm[16]; -} nameprep_id11_unassigned_bitmap[] = { - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 2, 0,240,255,255,255, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0,192, 0, 0, 0, 0, 0, 0, 0,128,255,255, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0,207,187, - }}, - {{ - 15, 40, 0, 0, 4, 0, 0, 0, 0,128, 0, 0, 0, 0,128,255, - }}, - {{ - 128, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0,192,252, - }}, - {{ - 0, 0,255,255,255,255, 1, 0, 0, 0,128, 1, 1, 0, 0, 0, - }}, - {{ - 0,249, 1, 0, 4, 0, 0, 4,224,255, 0, 0, 0,248,224,255, - }}, - {{ - 255,239,255,119, 1, 0, 0,248, 0, 0,192,255, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 0,128, - }}, - {{ - 0, 64, 0, 0, 0,224, 0, 0, 0,248,255,255,255,255,255,255, - }}, - {{ - 0, 0, 0, 0, 0, 0,252,255,255,255,255,255,255,255,255,255, - }}, - {{ - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - }}, - {{ - 17, 0, 0, 0, 0, 0, 0, 12, 0,192,224, 0, 0, 0,254,255, - }}, - {{ - 17, 96, 6, 0, 0, 2, 58, 44, 96,198,127, 79, 48, 0, 0,248, - }}, - {{ - 27,120, 6, 0, 0, 2,146, 44,120,198,255,161, 63, 0,224,255, - }}, - {{ - 17, 80, 4, 0, 0, 2, 18, 12, 64,196,254,255, 62, 0,255,255, - }}, - {{ - 17, 96, 6, 0, 0, 2, 50, 12,112,198, 63, 79, 60, 0,254,255, - }}, - {{ - 19, 56,194, 41,231, 56, 64, 60, 56,194,127,255,127, 0,248,255, - }}, - {{ - 17, 32, 2, 0, 0, 2, 16, 60, 32,194,159,255, 60, 0,255,255, - }}, - {{ - 19, 32, 2, 0, 0, 2, 16, 60, 32,194,159,191, 60, 0,255,255, - }}, - {{ - 19, 32, 2, 0, 0, 2, 0, 60, 48,194,127,255, 60, 0,255,255, - }}, - {{ - 19, 0,128, 3, 0, 0, 4,208,128,123,160, 0,255,255,227,255, - }}, - {{ - 1, 0, 0, 0, 0, 0, 0,120, 0, 0, 0,240,255,255,255,255, - }}, - {{ - 105,218, 15, 1, 81, 19, 0,196,160,192, 0,204,255,255,255,255, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,248, 1, 0, - }}, - {{ - 0,240, 0, 1, 0, 0, 0, 32, 0, 96,255,255,255,255,255,255, - }}, - {{ - 0, 0, 0, 0, 4, 9, 56,252, 0, 0, 0,252,255,255,255,255, - }}, - {{ - 255,255,255,255, 0, 0, 0, 0,192,255, 0, 0, 0, 0, 0,246, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0,248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,252, - }}, - {{ - 128, 0, 0, 0, 0, 0, 0, 0,128,194,128,194, 0, 0, 0, 0, - }}, - {{ - 128,194, 0, 0, 0,128,194,128,194,128,128, 0, 0,128, 0, 0, - }}, - {{ - 0,128,194,128, 0, 0, 0, 0,128, 0, 0,248, 1, 0, 0,224, - }}, - {{ - 255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,255, - }}, - {{ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,255, - }}, - {{ - 0, 0, 0,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,255, - }}, - {{ - 0, 32,224,255, 0, 0,128,255, 0, 0,240,255, 0, 32,242,255, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224, 0,252,255,255, - }}, - {{ - 0,128, 0,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, - }}, - {{ - 0, 0, 0, 0, 0,252,255,255,255,255,255,255,255,255,255,255, - }}, - {{ - 0, 0, 0,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,252, - }}, - {{ - 0, 0,192,192, 0, 0, 0, 0,192,192, 0, 85, 0, 0, 0,192, - }}, - {{ - 0, 0, 0, 0, 0, 0, 32, 0, 32, 0, 48, 16, 0, 0, 35,128, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,127,240, 3, 12, 0, - }}, - {{ - 0,128,255,255, 0, 0,252,255,255,255, 0, 0, 0,248,255,255, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 24, 0,240, 7, 0, 0, 0, 0, 0, - }}, - {{ - 240,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0,128,255,255,255,255,255,255, - }}, - {{ - 0, 0, 0, 0,128,255,255,255, 0,248,255,255, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, - }}, - {{ - 0, 0, 48, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, - }}, - {{ - 0,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - }}, - {{ - 33, 12, 0, 0, 0, 1, 0, 0, 0, 80,184,128, 1, 0, 0, 0, - }}, - {{ - 0, 0,224, 0, 0, 0, 1,128,255,255, 0, 0, 0,240, 0, 0, - }}, - {{ - 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,255, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,255,255,255, 0,240, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0,128, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 31, 0, 0, 0, 0,224, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0,128, 0, 0, 0, 0, 0,255,255,255,255,255,255,255, 0, 0, - }}, - {{ - 0, 0, 0,224, 0, 0, 0, 0,240,255, 1, 0, 0, 0, 0,112, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 0, 0, 0, 0, 0,128, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 7, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 0, 0, 0,128, - }}, - {{ - 0, 0, 0, 0, 0, 0,192,255,255,255,255,255,255,255,255,255, - }}, - {{ - 0, 0, 0, 0,192,255,255,255,255,255,255,255,255,255,255,255, - }}, - {{ - 0,224, 0, 0, 0, 0, 0, 0,128,255,255,255,255,255,255,255, - }}, - {{ - 0, 0, 0, 0,240,255,255,255,255,255,255,255,255,255,255,255, - }}, - {{ - 0, 0, 0, 0, 0,192, 0, 0, 0, 0, 0, 0, 0,248,255,255, - }}, - {{ - 128,255, 7, 31, 0, 0,128,160, 36, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0,252,255,255,255, 7, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 3, 0, 0, 0, 0, 0, 0,255, 0, 0, 0, 0, 0,224, - }}, - {{ - 0, 0,255,255,240,255, 0, 0,128, 1, 8, 0,128,240, 32, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0,128, 3, 3, 3,227,128,128,255, 1, - }}, - {{ - 0, 0, 0,128,240,255, 0, 0, 0,248,255,255,255,255,255,255, - }}, - {{ - 0, 0, 0, 0,192, 0, 0, 0, 0,192,255,255,255,255,255,255, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,255, - }}, - {{ - 0, 0, 0, 0,128, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,255,255,255,255, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 32,155, 33, 0, 20, 18, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 64, 24, 32, 32, 0, 0, 0,132,160, 3, 2, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, - }}, - {{ - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 63, - }}, - {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,255,255,255,255,255, - }}, - {{ - 0, 0, 0,192,255,255,255,255,255,255,255,255,255,255,255,255, - }}, - {{ - 253,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }}, -}; - -static const unsigned short nameprep_id11_bidi_imap[] = { - 272, 400, 528, 656, 784, 912, 912, 912, - 912, 1040, 1168, 912, 912, 1296, 912, 1424, - 1552, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1808, 1680, 1680, - 912, 912, 912, 912, 912, 912, 912, 912, - 912, 912, 1936, 1680, 1680, 1680, 1680, 2064, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, - 912, 912, 912, 912, 912, 912, 912, 912, - 912, 912, 912, 912, 912, 912, 912, 2192, - 912, 912, 912, 912, 912, 912, 912, 912, - 912, 912, 912, 912, 912, 912, 912, 2192, - 0, 0, 1, 1, 0, 2, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 5, 6, 4, 4, 7, 8, 9, - 0, 0, 0, 10, 11, 12, 13, 14, - 4, 4, 4, 4, 15, 4, 13, 16, - 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 29, 30, 31, - 32, 33, 0, 0, 29, 34, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, - 39, 51, 41, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 60, - 61, 64, 65, 60, 66, 67, 68, 69, - 20, 70, 71, 0, 72, 73, 74, 0, - 75, 76, 77, 78, 79, 80, 81, 0, - 4, 82, 83, 0, 0, 4, 84, 85, - 4, 4, 86, 4, 4, 87, 4, 88, - 89, 4, 90, 4, 91, 92, 93, 13, - 92, 4, 94, 95, 0, 4, 4, 96, - 20, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 97, 1, 4, 4, 98, - 99, 100, 101, 102, 4, 103, 104, 105, - 106, 4, 4, 83, 4, 107, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 4, 4, 4, 4, 108, 4, 4, 88, - 109, 4, 110, 111, 4, 112, 113, 114, - 115, 0, 0, 116, 0, 0, 0, 0, - 117, 118, 119, 4, 120, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 121, 4, 122, 123, 0, 0, 0, - 0, 0, 0, 0, 124, 4, 4, 105, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 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, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 120, 0, 0, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 138, 4, 139, 0, 0, 0, 0, - 140, 141, 142, 29, 29, 143, 144, 29, - 29, 29, 29, 29, 29, 29, 29, 29, - 29, 145, 146, 29, 147, 29, 148, 149, - 0, 0, 0, 150, 29, 29, 29, 151, - 0, 1, 1, 152, 4, 134, 153, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 134, 154, 139, 0, 0, 0, 0, 0, - 4, 155, 156, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, - }}, - {{ - 0, 0, 2, 0, 0, 2, 2, 0, 0, 2, 2, 2, 2, 0, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, - }}, - {{ - 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - }}, - {{ - 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, - 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, - }}, - {{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, - }}, - {{ - 2, 2, 2, 2, 2, 0, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - }}, - {{ - 2, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - }}, -}; - -static const unsigned char nameprep_id11_bidi_data[] = { - idn_biditype_others, - idn_biditype_r_al, - idn_biditype_l, -}; - diff --git a/netwerk/dns/nsIDNService.cpp b/netwerk/dns/nsIDNService.cpp index 49beecbb3..31ba12b4c 100644 --- a/netwerk/dns/nsIDNService.cpp +++ b/netwerk/dns/nsIDNService.cpp @@ -17,7 +17,6 @@ #include "nsISupportsPrimitives.h" #include "punycode.h" -#ifdef IDNA2008 // Currently we use the non-transitional processing option -- see // http://unicode.org/reports/tr46/ // To switch to transitional processing, change the value of this flag @@ -27,7 +26,6 @@ const bool kIDNA2008_TransitionalProcessing = false; #include "ICUUtils.h" #include "unicode/uscript.h" -#endif using namespace mozilla::unicode; @@ -136,32 +134,19 @@ nsIDNService::nsIDNService() : mShowPunycode(false) , mIDNUseWhitelist(false) { -#ifdef IDNA2008 uint32_t IDNAOptions = UIDNA_CHECK_BIDI | UIDNA_CHECK_CONTEXTJ; if (!kIDNA2008_TransitionalProcessing) { IDNAOptions |= UIDNA_NONTRANSITIONAL_TO_UNICODE; } UErrorCode errorCode = U_ZERO_ERROR; mIDNA = uidna_openUTS46(IDNAOptions, &errorCode); -#else - if (idn_success != idn_nameprep_create(nullptr, &mNamePrepHandle)) - mNamePrepHandle = nullptr; - - mNormalizer = do_GetService(NS_UNICODE_NORMALIZER_CONTRACTID); - /* member initializers and constructor code */ -#endif } nsIDNService::~nsIDNService() { -#ifdef IDNA2008 uidna_close(mIDNA); -#else - idn_nameprep_destroy(mNamePrepHandle); -#endif } -#ifdef IDNA2008 nsresult nsIDNService::IDNA2008ToUnicode(const nsACString& input, nsAString& output) { @@ -226,7 +211,6 @@ nsIDNService::IDNA2008StringPrep(const nsAString& input, return rv; } -#endif NS_IMETHODIMP nsIDNService::ConvertUTF8toACE(const nsACString & input, nsACString & ace) { @@ -486,21 +470,6 @@ static nsresult utf16ToUcs4(const nsAString& in, return NS_OK; } -#ifndef IDNA2008 -static void ucs4toUtf16(const uint32_t *in, nsAString& out) -{ - while (*in) { - if (!IS_IN_BMP(*in)) { - out.Append((char16_t) H_SURROGATE(*in)); - out.Append((char16_t) L_SURROGATE(*in)); - } - else - out.Append((char16_t) *in); - in++; - } -} -#endif - static nsresult punycode(const nsAString& in, nsACString& out) { uint32_t ucs4Buf[kMaxDNSNodeLen + 1]; @@ -551,74 +520,12 @@ static nsresult punycode(const nsAString& in, nsACString& out) // any unassigned Unicode points and if any are found return an error. // This is described in section 7. // +// => All this is handled by ICU's StringPrep(). +// nsresult nsIDNService::stringPrep(const nsAString& in, nsAString& out, stringPrepFlag flag) { -#ifdef IDNA2008 return IDNA2008StringPrep(in, out, flag); -#else - if (!mNamePrepHandle || !mNormalizer) - return NS_ERROR_FAILURE; - - uint32_t ucs4Buf[kMaxDNSNodeLen + 1]; - uint32_t ucs4Len; - nsresult rv = utf16ToUcs4(in, ucs4Buf, kMaxDNSNodeLen, &ucs4Len); - NS_ENSURE_SUCCESS(rv, rv); - - // map - idn_result_t idn_err; - - uint32_t namePrepBuf[kMaxDNSNodeLen * 3]; // map up to three characters - idn_err = idn_nameprep_map(mNamePrepHandle, (const uint32_t *) ucs4Buf, - (uint32_t *) namePrepBuf, kMaxDNSNodeLen * 3); - NS_ENSURE_TRUE(idn_err == idn_success, NS_ERROR_MALFORMED_URI); - - nsAutoString namePrepStr; - ucs4toUtf16(namePrepBuf, namePrepStr); - if (namePrepStr.Length() >= kMaxDNSNodeLen) - return NS_ERROR_MALFORMED_URI; - - // normalize - nsAutoString normlizedStr; - rv = mNormalizer->NormalizeUnicodeNFKC(namePrepStr, normlizedStr); - if (normlizedStr.Length() >= kMaxDNSNodeLen) - return NS_ERROR_MALFORMED_URI; - - // set the result string - out.Assign(normlizedStr); - - if (flag == eStringPrepIgnoreErrors) { - return NS_OK; - } - - // prohibit - const uint32_t *found = nullptr; - idn_err = idn_nameprep_isprohibited(mNamePrepHandle, - (const uint32_t *) ucs4Buf, &found); - if (idn_err != idn_success || found) { - rv = NS_ERROR_MALFORMED_URI; - } else { - // check bidi - idn_err = idn_nameprep_isvalidbidi(mNamePrepHandle, - (const uint32_t *) ucs4Buf, &found); - if (idn_err != idn_success || found) { - rv = NS_ERROR_MALFORMED_URI; - } else if (flag == eStringPrepForUI) { - // check unassigned code points - idn_err = idn_nameprep_isunassigned(mNamePrepHandle, - (const uint32_t *) ucs4Buf, &found); - if (idn_err != idn_success || found) { - rv = NS_ERROR_MALFORMED_URI; - } - } - } - - if (flag == eStringPrepForDNS && NS_FAILED(rv)) { - out.Truncate(); - } - - return rv; -#endif } nsresult nsIDNService::stringPrepAndACE(const nsAString& in, nsACString& out, @@ -709,31 +616,8 @@ nsresult nsIDNService::decodeACE(const nsACString& in, nsACString& out, } nsAutoString utf16; -#ifdef IDNA2008 nsresult result = IDNA2008ToUnicode(in, utf16); NS_ENSURE_SUCCESS(result, result); -#else - // RFC 3490 - 4.2 ToUnicode - // The ToUnicode output never contains more code points than its input. - punycode_uint output_length = in.Length() - kACEPrefixLen + 1; - auto *output = new punycode_uint[output_length]; - NS_ENSURE_TRUE(output, NS_ERROR_OUT_OF_MEMORY); - - enum punycode_status status = punycode_decode(in.Length() - kACEPrefixLen, - PromiseFlatCString(in).get() + kACEPrefixLen, - &output_length, - output, - nullptr); - if (status != punycode_success) { - delete [] output; - return NS_ERROR_MALFORMED_URI; - } - - // UCS4 -> UTF8 - output[output_length] = 0; - ucs4toUtf16(output, utf16); - delete [] output; -#endif if (flag != eStringPrepForUI || isLabelSafe(utf16)) { CopyUTF16toUTF8(utf16, out); } else { diff --git a/netwerk/dns/nsIDNService.h b/netwerk/dns/nsIDNService.h index 19aa94da0..82a05021d 100644 --- a/netwerk/dns/nsIDNService.h +++ b/netwerk/dns/nsIDNService.h @@ -12,12 +12,7 @@ #include "nsUnicodeScriptCodes.h" #include "nsWeakReference.h" -#ifdef IDNA2008 #include "unicode/uidna.h" -#else -#include "nsIUnicodeNormalizer.h" -#include "nsIDNKitInterface.h" -#endif #include "nsString.h" @@ -151,7 +146,6 @@ private: bool illegalScriptCombo(mozilla::unicode::Script script, int32_t& savedScript); -#ifdef IDNA2008 /** * Convert a DNS label from ASCII to Unicode using IDNA2008 */ @@ -164,10 +158,6 @@ private: stringPrepFlag flag); UIDNA* mIDNA; -#else - idn_nameprep_t mNamePrepHandle; - nsCOMPtr<nsIUnicodeNormalizer> mNormalizer; -#endif nsXPIDLString mIDNBlacklist; /** diff --git a/netwerk/ipc/NeckoChannelParams.ipdlh b/netwerk/ipc/NeckoChannelParams.ipdlh index 4f4dcf6a9..bb7562c64 100644 --- a/netwerk/ipc/NeckoChannelParams.ipdlh +++ b/netwerk/ipc/NeckoChannelParams.ipdlh @@ -20,6 +20,7 @@ using struct mozilla::void_t from "ipc/IPCMessageUtils.h"; using RequestHeaderTuples from "mozilla/net/PHttpChannelParams.h"; using struct nsHttpAtom from "nsHttp.h"; using class nsHttpResponseHead from "nsHttpResponseHead.h"; +using class mozilla::TimeStamp from "mozilla/TimeStamp.h"; namespace mozilla { namespace net { @@ -134,6 +135,12 @@ struct HttpChannelOpenArgs nsCString channelId; uint64_t contentWindowId; nsCString preferredAlternativeType; + TimeStamp launchServiceWorkerStart; + TimeStamp launchServiceWorkerEnd; + TimeStamp dispatchFetchEventStart; + TimeStamp dispatchFetchEventEnd; + TimeStamp handleFetchEventStart; + TimeStamp handleFetchEventEnd; }; struct HttpChannelConnectArgs diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp index 1119fcff5..2ae12846a 100644 --- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp +++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp @@ -45,10 +45,6 @@ #include "nsIAuthPrompt2.h" #include "nsIFTPChannelParentInternal.h" -#ifdef MOZ_WIDGET_GONK -#include "NetStatistics.h" -#endif - using namespace mozilla; using namespace mozilla::net; @@ -1619,13 +1615,6 @@ nsFtpState::Init(nsFtpChannel *channel) // initialize counter for network metering mCountRecv = 0; -#ifdef MOZ_WIDGET_GONK - nsCOMPtr<nsINetworkInfo> activeNetworkInfo; - GetActiveNetworkInfo(activeNetworkInfo); - mActiveNetworkInfo = - new nsMainThreadPtrHolder<nsINetworkInfo>(activeNetworkInfo); -#endif - mKeepRunning = true; mSuppliedEntityID = channel->EntityID(); @@ -2104,43 +2093,7 @@ nsFtpState::ReadSegments(nsWriteSegmentFun writer, void *closure, nsresult nsFtpState::SaveNetworkStats(bool enforce) { -#ifdef MOZ_WIDGET_GONK - // Obtain app id - uint32_t appId; - bool isInBrowser; - NS_GetAppInfo(mChannel, &appId, &isInBrowser); - - // Check if active network and appid are valid. - if (!mActiveNetworkInfo || appId == NECKO_NO_APP_ID) { - return NS_OK; - } - - if (mCountRecv <= 0) { - // There is no traffic, no need to save. - return NS_OK; - } - - // If |enforce| is false, the traffic amount is saved - // only when the total amount exceeds the predefined - // threshold. - if (!enforce && mCountRecv < NETWORK_STATS_THRESHOLD) { - return NS_OK; - } - - // Create the event to save the network statistics. - // the event is then dispathed to the main thread. - RefPtr<Runnable> event = - new SaveNetworkStatsEvent(appId, isInBrowser, mActiveNetworkInfo, - mCountRecv, 0, false); - NS_DispatchToMainThread(event); - - // Reset the counters after saving. - mCountRecv = 0; - - return NS_OK; -#else return NS_ERROR_NOT_IMPLEMENTED; -#endif } NS_IMETHODIMP diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.h b/netwerk/protocol/ftp/nsFtpConnectionThread.h index dd48da562..b4e71bd10 100644 --- a/netwerk/protocol/ftp/nsFtpConnectionThread.h +++ b/netwerk/protocol/ftp/nsFtpConnectionThread.h @@ -17,11 +17,6 @@ #include "nsFtpControlConnection.h" #include "nsIProtocolProxyCallback.h" -#ifdef MOZ_WIDGET_GONK -#include "nsINetworkInterface.h" -#include "nsProxyRelease.h" -#endif - // ftp server types #define FTP_GENERIC_TYPE 0 #define FTP_UNIX_TYPE 1 @@ -215,11 +210,7 @@ private: bool mDeferredCallbackPending; // These members are used for network per-app metering (bug 855948) -// Currently, they are only available on gonk. uint64_t mCountRecv; -#ifdef MOZ_WIDGET_GONK - nsMainThreadPtrHandle<nsINetworkInfo> mActiveNetworkInfo; -#endif nsresult SaveNetworkStats(bool); void CountRecvBytes(uint64_t recvBytes) { diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 278c94db0..d161f9a43 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -105,6 +105,7 @@ HttpBaseChannel::HttpBaseChannel() , mHttpHandler(gHttpHandler) , mReferrerPolicy(REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE) , mRedirectCount(0) + , mInternalRedirectCount(0) , mForcePending(false) , mCorsIncludeCredentials(false) , mCorsMode(nsIHttpChannelInternal::CORS_MODE_NO_CORS) @@ -3128,12 +3129,6 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI, // convey the mAllowPipelining and mAllowSTS flags httpChannel->SetAllowPipelining(mAllowPipelining); httpChannel->SetAllowSTS(mAllowSTS); - // convey the new redirection limit - // make sure we don't underflow - uint32_t redirectionLimit = mRedirectionLimit - ? mRedirectionLimit - 1 - : 0; - httpChannel->SetRedirectionLimit(redirectionLimit); // convey the Accept header value { @@ -3215,23 +3210,40 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI, do_QueryInterface(static_cast<nsIHttpChannel*>(this))); if (oldTimedChannel && newTimedChannel) { newTimedChannel->SetTimingEnabled(mTimingEnabled); - newTimedChannel->SetRedirectCount(mRedirectCount + 1); + + if (redirectFlags & nsIChannelEventSink::REDIRECT_INTERNAL) { + int8_t newCount = mInternalRedirectCount + 1; + newTimedChannel->SetInternalRedirectCount( + std::max(newCount, mInternalRedirectCount)); + } else { + int8_t newCount = mRedirectCount + 1; + newTimedChannel->SetRedirectCount( + std::max(newCount, mRedirectCount)); + } // If the RedirectStart is null, we will use the AsyncOpen value of the // previous channel (this is the first redirect in the redirects chain). if (mRedirectStartTimeStamp.IsNull()) { - TimeStamp asyncOpen; - oldTimedChannel->GetAsyncOpen(&asyncOpen); - newTimedChannel->SetRedirectStart(asyncOpen); - } - else { + // Only do this for real redirects. Internal redirects should be hidden. + if (!(redirectFlags & nsIChannelEventSink::REDIRECT_INTERNAL)) { + TimeStamp asyncOpen; + oldTimedChannel->GetAsyncOpen(&asyncOpen); + newTimedChannel->SetRedirectStart(asyncOpen); + } + } else { newTimedChannel->SetRedirectStart(mRedirectStartTimeStamp); } - // The RedirectEnd timestamp is equal to the previous channel response end. - TimeStamp prevResponseEnd; - oldTimedChannel->GetResponseEnd(&prevResponseEnd); - newTimedChannel->SetRedirectEnd(prevResponseEnd); + // For internal redirects just propagate the last redirect end time + // forward. Otherwise the new redirect end time is the last response + // end time. + TimeStamp newRedirectEnd; + if (redirectFlags & nsIChannelEventSink::REDIRECT_INTERNAL) { + oldTimedChannel->GetRedirectEnd(&newRedirectEnd); + } else { + oldTimedChannel->GetResponseEnd(&newRedirectEnd); + } + newTimedChannel->SetRedirectEnd(newRedirectEnd); nsAutoString initiatorType; oldTimedChannel->GetInitiatorType(initiatorType); @@ -3253,6 +3265,16 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI, mAllRedirectsPassTimingAllowCheck && oldTimedChannel->TimingAllowCheck(principal)); } + + // Propagate service worker measurements across redirects. The + // PeformanceResourceTiming.workerStart API expects to see the + // worker start time after a redirect. + newTimedChannel->SetLaunchServiceWorkerStart(mLaunchServiceWorkerStart); + newTimedChannel->SetLaunchServiceWorkerEnd(mLaunchServiceWorkerEnd); + newTimedChannel->SetDispatchFetchEventStart(mDispatchFetchEventStart); + newTimedChannel->SetDispatchFetchEventEnd(mDispatchFetchEventEnd); + newTimedChannel->SetHandleFetchEventStart(mHandleFetchEventStart); + newTimedChannel->SetHandleFetchEventEnd(mHandleFetchEventEnd); } // Pass the preferred alt-data type on to the new channel. @@ -3318,20 +3340,34 @@ HttpBaseChannel::GetAsyncOpen(TimeStamp* _retval) { * redirects. This check must be done by the consumers. */ NS_IMETHODIMP -HttpBaseChannel::GetRedirectCount(uint16_t *aRedirectCount) +HttpBaseChannel::GetRedirectCount(uint8_t *aRedirectCount) { *aRedirectCount = mRedirectCount; return NS_OK; } NS_IMETHODIMP -HttpBaseChannel::SetRedirectCount(uint16_t aRedirectCount) +HttpBaseChannel::SetRedirectCount(uint8_t aRedirectCount) { mRedirectCount = aRedirectCount; return NS_OK; } NS_IMETHODIMP +HttpBaseChannel::GetInternalRedirectCount(uint8_t *aRedirectCount) +{ + *aRedirectCount = mInternalRedirectCount; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::SetInternalRedirectCount(uint8_t aRedirectCount) +{ + mInternalRedirectCount = aRedirectCount; + return NS_OK; +} + +NS_IMETHODIMP HttpBaseChannel::GetRedirectStart(TimeStamp* _retval) { *_retval = mRedirectStartTimeStamp; @@ -3431,6 +3467,84 @@ HttpBaseChannel::TimingAllowCheck(nsIPrincipal *aOrigin, bool *_retval) } NS_IMETHODIMP +HttpBaseChannel::GetLaunchServiceWorkerStart(TimeStamp* _retval) { + MOZ_ASSERT(_retval); + *_retval = mLaunchServiceWorkerStart; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::SetLaunchServiceWorkerStart(TimeStamp aTimeStamp) { + mLaunchServiceWorkerStart = aTimeStamp; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::GetLaunchServiceWorkerEnd(TimeStamp* _retval) { + MOZ_ASSERT(_retval); + *_retval = mLaunchServiceWorkerEnd; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::SetLaunchServiceWorkerEnd(TimeStamp aTimeStamp) { + mLaunchServiceWorkerEnd = aTimeStamp; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::GetDispatchFetchEventStart(TimeStamp* _retval) { + MOZ_ASSERT(_retval); + *_retval = mDispatchFetchEventStart; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::SetDispatchFetchEventStart(TimeStamp aTimeStamp) { + mDispatchFetchEventStart = aTimeStamp; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::GetDispatchFetchEventEnd(TimeStamp* _retval) { + MOZ_ASSERT(_retval); + *_retval = mDispatchFetchEventEnd; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::SetDispatchFetchEventEnd(TimeStamp aTimeStamp) { + mDispatchFetchEventEnd = aTimeStamp; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::GetHandleFetchEventStart(TimeStamp* _retval) { + MOZ_ASSERT(_retval); + *_retval = mHandleFetchEventStart; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::SetHandleFetchEventStart(TimeStamp aTimeStamp) { + mHandleFetchEventStart = aTimeStamp; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::GetHandleFetchEventEnd(TimeStamp* _retval) { + MOZ_ASSERT(_retval); + *_retval = mHandleFetchEventEnd; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::SetHandleFetchEventEnd(TimeStamp aTimeStamp) { + mHandleFetchEventEnd = aTimeStamp; + return NS_OK; +} + +NS_IMETHODIMP HttpBaseChannel::GetDomainLookupStart(TimeStamp* _retval) { *_retval = mTransactionTimings.domainLookupStart; return NS_OK; @@ -3520,6 +3634,12 @@ HttpBaseChannel::Get##name##Time(PRTime* _retval) { \ IMPL_TIMING_ATTR(ChannelCreation) IMPL_TIMING_ATTR(AsyncOpen) +IMPL_TIMING_ATTR(LaunchServiceWorkerStart) +IMPL_TIMING_ATTR(LaunchServiceWorkerEnd) +IMPL_TIMING_ATTR(DispatchFetchEventStart) +IMPL_TIMING_ATTR(DispatchFetchEventEnd) +IMPL_TIMING_ATTR(HandleFetchEventStart) +IMPL_TIMING_ATTR(HandleFetchEventEnd) IMPL_TIMING_ATTR(DomainLookupStart) IMPL_TIMING_ATTR(DomainLookupEnd) IMPL_TIMING_ATTR(ConnectStart) diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h index c8184a601..9aa696a70 100644 --- a/netwerk/protocol/http/HttpBaseChannel.h +++ b/netwerk/protocol/http/HttpBaseChannel.h @@ -506,7 +506,9 @@ protected: // the HTML file. nsString mInitiatorType; // Number of redirects that has occurred. - int16_t mRedirectCount; + int8_t mRedirectCount; + // Number of internal redirects that has occurred. + int8_t mInternalRedirectCount; // A time value equal to the starting time of the fetch that initiates the // redirect. mozilla::TimeStamp mRedirectStartTimeStamp; @@ -519,6 +521,12 @@ protected: TimeStamp mAsyncOpenTime; TimeStamp mCacheReadStart; TimeStamp mCacheReadEnd; + TimeStamp mLaunchServiceWorkerStart; + TimeStamp mLaunchServiceWorkerEnd; + TimeStamp mDispatchFetchEventStart; + TimeStamp mDispatchFetchEventEnd; + TimeStamp mHandleFetchEventStart; + TimeStamp mHandleFetchEventEnd; // copied from the transaction before we null out mTransaction // so that the timing can still be queried from OnStopRequest TimingStruct mTransactionTimings; diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index f0b9e2136..6d09135c4 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -2132,6 +2132,13 @@ HttpChannelChild::ContinueAsyncOpen() return NS_ERROR_FAILURE; } + openArgs.launchServiceWorkerStart() = mLaunchServiceWorkerStart; + openArgs.launchServiceWorkerEnd() = mLaunchServiceWorkerEnd; + openArgs.dispatchFetchEventStart() = mDispatchFetchEventStart; + openArgs.dispatchFetchEventEnd() = mDispatchFetchEventEnd; + openArgs.handleFetchEventStart() = mHandleFetchEventStart; + openArgs.handleFetchEventEnd() = mHandleFetchEventEnd; + // The socket transport in the chrome process now holds a logical ref to us // until OnStopRequest, or we do a redirect, or we hit an IPDL error. AddIPDLReference(); diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp index 5f0859f28..90ed597a6 100644 --- a/netwerk/protocol/http/HttpChannelParent.cpp +++ b/netwerk/protocol/http/HttpChannelParent.cpp @@ -130,7 +130,13 @@ HttpChannelParent::Init(const HttpChannelCreationArgs& aArgs) a.initialRwin(), a.blockAuthPrompt(), a.suspendAfterSynthesizeResponse(), a.allowStaleCacheContent(), a.contentTypeHint(), - a.channelId(), a.contentWindowId(), a.preferredAlternativeType()); + a.channelId(), a.contentWindowId(), a.preferredAlternativeType(), + a.launchServiceWorkerStart(), + a.launchServiceWorkerEnd(), + a.dispatchFetchEventStart(), + a.dispatchFetchEventEnd(), + a.handleFetchEventStart(), + a.handleFetchEventEnd()); } case HttpChannelCreationArgs::THttpChannelConnectArgs: { @@ -329,7 +335,13 @@ HttpChannelParent::DoAsyncOpen( const URIParams& aURI, const nsCString& aContentTypeHint, const nsCString& aChannelId, const uint64_t& aContentWindowId, - const nsCString& aPreferredAlternativeType) + const nsCString& aPreferredAlternativeType, + const TimeStamp& aLaunchServiceWorkerStart, + const TimeStamp& aLaunchServiceWorkerEnd, + const TimeStamp& aDispatchFetchEventStart, + const TimeStamp& aDispatchFetchEventEnd, + const TimeStamp& aHandleFetchEventStart, + const TimeStamp& aHandleFetchEventEnd) { nsCOMPtr<nsIURI> uri = DeserializeURI(aURI); if (!uri) { @@ -534,6 +546,13 @@ HttpChannelParent::DoAsyncOpen( const URIParams& aURI, mChannel->SetInitialRwin(aInitialRwin); mChannel->SetBlockAuthPrompt(aBlockAuthPrompt); + mChannel->SetLaunchServiceWorkerStart(aLaunchServiceWorkerStart); + mChannel->SetLaunchServiceWorkerEnd(aLaunchServiceWorkerEnd); + mChannel->SetDispatchFetchEventStart(aDispatchFetchEventStart); + mChannel->SetDispatchFetchEventEnd(aDispatchFetchEventEnd); + mChannel->SetHandleFetchEventStart(aHandleFetchEventStart); + mChannel->SetHandleFetchEventEnd(aHandleFetchEventEnd); + nsCOMPtr<nsIApplicationCacheChannel> appCacheChan = do_QueryObject(mChannel); nsCOMPtr<nsIApplicationCacheService> appCacheService = @@ -1159,7 +1178,7 @@ HttpChannelParent::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) nsCString secInfoSerialization; UpdateAndSerializeSecurityInfo(secInfoSerialization); - uint16_t redirectCount = 0; + uint8_t redirectCount = 0; chan->GetRedirectCount(&redirectCount); nsCOMPtr<nsISupports> cacheKey; diff --git a/netwerk/protocol/http/HttpChannelParent.h b/netwerk/protocol/http/HttpChannelParent.h index a3b377d49..56854bb55 100644 --- a/netwerk/protocol/http/HttpChannelParent.h +++ b/netwerk/protocol/http/HttpChannelParent.h @@ -143,7 +143,13 @@ protected: const nsCString& aContentTypeHint, const nsCString& aChannelId, const uint64_t& aContentWindowId, - const nsCString& aPreferredAlternativeType); + const nsCString& aPreferredAlternativeType, + const TimeStamp& aLaunchServiceWorkerStart, + const TimeStamp& aLaunchServiceWorkerEnd, + const TimeStamp& aDispatchFetchEventStart, + const TimeStamp& aDispatchFetchEventEnd, + const TimeStamp& aHandleFetchEventStart, + const TimeStamp& aHandleFetchEventEnd); virtual bool RecvSetPriority(const uint16_t& priority) override; virtual bool RecvSetClassOfService(const uint32_t& cos) override; diff --git a/netwerk/protocol/http/InterceptedChannel.cpp b/netwerk/protocol/http/InterceptedChannel.cpp index 9e38e2734..2dadbe760 100644 --- a/netwerk/protocol/http/InterceptedChannel.cpp +++ b/netwerk/protocol/http/InterceptedChannel.cpp @@ -10,6 +10,7 @@ #include "nsInputStreamPump.h" #include "nsIPipe.h" #include "nsIStreamListener.h" +#include "nsITimedChannel.h" #include "nsHttpChannel.h" #include "HttpChannelChild.h" #include "nsHttpResponseHead.h" @@ -134,6 +135,40 @@ InterceptedChannelBase::SetReleaseHandle(nsISupports* aHandle) return NS_OK; } +NS_IMETHODIMP +InterceptedChannelBase::SaveTimeStampsToUnderlyingChannel() +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsCOMPtr<nsIChannel> underlyingChannel; + nsresult rv = GetChannel(getter_AddRefs(underlyingChannel)); + MOZ_ASSERT(NS_SUCCEEDED(rv)); + + nsCOMPtr<nsITimedChannel> timedChannel = + do_QueryInterface(underlyingChannel); + MOZ_ASSERT(timedChannel); + + rv = timedChannel->SetLaunchServiceWorkerStart(mLaunchServiceWorkerStart); + MOZ_ASSERT(NS_SUCCEEDED(rv)); + + rv = timedChannel->SetLaunchServiceWorkerEnd(mLaunchServiceWorkerEnd); + MOZ_ASSERT(NS_SUCCEEDED(rv)); + + rv = timedChannel->SetDispatchFetchEventStart(mDispatchFetchEventStart); + MOZ_ASSERT(NS_SUCCEEDED(rv)); + + rv = timedChannel->SetDispatchFetchEventEnd(mDispatchFetchEventEnd); + MOZ_ASSERT(NS_SUCCEEDED(rv)); + + rv = timedChannel->SetHandleFetchEventStart(mHandleFetchEventStart); + MOZ_ASSERT(NS_SUCCEEDED(rv)); + + rv = timedChannel->SetHandleFetchEventEnd(mHandleFetchEventEnd); + MOZ_ASSERT(NS_SUCCEEDED(rv)); + + return rv; +} + /* static */ already_AddRefed<nsIURI> InterceptedChannelBase::SecureUpgradeChannelURI(nsIChannel* aChannel) diff --git a/netwerk/protocol/http/InterceptedChannel.h b/netwerk/protocol/http/InterceptedChannel.h index 688f211de..efab7abca 100644 --- a/netwerk/protocol/http/InterceptedChannel.h +++ b/netwerk/protocol/http/InterceptedChannel.h @@ -46,6 +46,13 @@ protected: nsresult DoSynthesizeStatus(uint16_t aStatus, const nsACString& aReason); nsresult DoSynthesizeHeader(const nsACString& aName, const nsACString& aValue); + TimeStamp mLaunchServiceWorkerStart; + TimeStamp mLaunchServiceWorkerEnd; + TimeStamp mDispatchFetchEventStart; + TimeStamp mDispatchFetchEventEnd; + TimeStamp mHandleFetchEventStart; + TimeStamp mHandleFetchEventEnd; + virtual ~InterceptedChannelBase(); public: explicit InterceptedChannelBase(nsINetworkInterceptController* aController); @@ -60,6 +67,50 @@ public: NS_IMETHOD GetConsoleReportCollector(nsIConsoleReportCollector** aCollectorOut) override; NS_IMETHOD SetReleaseHandle(nsISupports* aHandle) override; + NS_IMETHODIMP + SetLaunchServiceWorkerStart(TimeStamp aTimeStamp) override + { + mLaunchServiceWorkerStart = aTimeStamp; + return NS_OK; + } + + NS_IMETHODIMP + SetLaunchServiceWorkerEnd(TimeStamp aTimeStamp) override + { + mLaunchServiceWorkerEnd = aTimeStamp; + return NS_OK; + } + + NS_IMETHODIMP + SetDispatchFetchEventStart(TimeStamp aTimeStamp) override + { + mDispatchFetchEventStart = aTimeStamp; + return NS_OK; + } + + NS_IMETHODIMP + SetDispatchFetchEventEnd(TimeStamp aTimeStamp) override + { + mDispatchFetchEventEnd = aTimeStamp; + return NS_OK; + } + + NS_IMETHODIMP + SetHandleFetchEventStart(TimeStamp aTimeStamp) override + { + mHandleFetchEventStart = aTimeStamp; + return NS_OK; + } + + NS_IMETHODIMP + SetHandleFetchEventEnd(TimeStamp aTimeStamp) override + { + mHandleFetchEventEnd = aTimeStamp; + return NS_OK; + } + + NS_IMETHODIMP SaveTimeStampsToUnderlyingChannel() override; + static already_AddRefed<nsIURI> SecureUpgradeChannelURI(nsIChannel* aChannel); }; diff --git a/netwerk/protocol/http/NullHttpChannel.cpp b/netwerk/protocol/http/NullHttpChannel.cpp index 61efe3956..2954006ad 100644 --- a/netwerk/protocol/http/NullHttpChannel.cpp +++ b/netwerk/protocol/http/NullHttpChannel.cpp @@ -539,13 +539,25 @@ NullHttpChannel::SetTimingEnabled(bool aTimingEnabled) } NS_IMETHODIMP -NullHttpChannel::GetRedirectCount(uint16_t *aRedirectCount) +NullHttpChannel::GetRedirectCount(uint8_t *aRedirectCount) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetRedirectCount(uint16_t aRedirectCount) +NullHttpChannel::SetRedirectCount(uint8_t aRedirectCount) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP +NullHttpChannel::GetInternalRedirectCount(uint8_t *aRedirectCount) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP +NullHttpChannel::SetInternalRedirectCount(uint8_t aRedirectCount) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -565,6 +577,90 @@ NullHttpChannel::GetAsyncOpen(mozilla::TimeStamp *aAsyncOpen) } NS_IMETHODIMP +NullHttpChannel::GetLaunchServiceWorkerStart(mozilla::TimeStamp *_retval) +{ + MOZ_ASSERT(_retval); + *_retval = mAsyncOpenTime; + return NS_OK; +} + +NS_IMETHODIMP +NullHttpChannel::SetLaunchServiceWorkerStart(mozilla::TimeStamp aTimeStamp) +{ + return NS_OK; +} + +NS_IMETHODIMP +NullHttpChannel::GetLaunchServiceWorkerEnd(mozilla::TimeStamp *_retval) +{ + MOZ_ASSERT(_retval); + *_retval = mAsyncOpenTime; + return NS_OK; +} + +NS_IMETHODIMP +NullHttpChannel::SetLaunchServiceWorkerEnd(mozilla::TimeStamp aTimeStamp) +{ + return NS_OK; +} + +NS_IMETHODIMP +NullHttpChannel::GetDispatchFetchEventStart(mozilla::TimeStamp *_retval) +{ + MOZ_ASSERT(_retval); + *_retval = mAsyncOpenTime; + return NS_OK; +} + +NS_IMETHODIMP +NullHttpChannel::SetDispatchFetchEventStart(mozilla::TimeStamp aTimeStamp) +{ + return NS_OK; +} + +NS_IMETHODIMP +NullHttpChannel::GetDispatchFetchEventEnd(mozilla::TimeStamp *_retval) +{ + MOZ_ASSERT(_retval); + *_retval = mAsyncOpenTime; + return NS_OK; +} + +NS_IMETHODIMP +NullHttpChannel::SetDispatchFetchEventEnd(mozilla::TimeStamp aTimeStamp) +{ + return NS_OK; +} + +NS_IMETHODIMP +NullHttpChannel::GetHandleFetchEventStart(mozilla::TimeStamp *_retval) +{ + MOZ_ASSERT(_retval); + *_retval = mAsyncOpenTime; + return NS_OK; +} + +NS_IMETHODIMP +NullHttpChannel::SetHandleFetchEventStart(mozilla::TimeStamp aTimeStamp) +{ + return NS_OK; +} + +NS_IMETHODIMP +NullHttpChannel::GetHandleFetchEventEnd(mozilla::TimeStamp *_retval) +{ + MOZ_ASSERT(_retval); + *_retval = mAsyncOpenTime; + return NS_OK; +} + +NS_IMETHODIMP +NullHttpChannel::SetHandleFetchEventEnd(mozilla::TimeStamp aTimeStamp) +{ + return NS_OK; +} + +NS_IMETHODIMP NullHttpChannel::GetDomainLookupStart(mozilla::TimeStamp *aDomainLookupStart) { *aDomainLookupStart = mAsyncOpenTime; @@ -761,6 +857,12 @@ NullHttpChannel::Get##name##Time(PRTime* _retval) { \ IMPL_TIMING_ATTR(ChannelCreation) IMPL_TIMING_ATTR(AsyncOpen) +IMPL_TIMING_ATTR(LaunchServiceWorkerStart) +IMPL_TIMING_ATTR(LaunchServiceWorkerEnd) +IMPL_TIMING_ATTR(DispatchFetchEventStart) +IMPL_TIMING_ATTR(DispatchFetchEventEnd) +IMPL_TIMING_ATTR(HandleFetchEventStart) +IMPL_TIMING_ATTR(HandleFetchEventEnd) IMPL_TIMING_ATTR(DomainLookupStart) IMPL_TIMING_ATTR(DomainLookupEnd) IMPL_TIMING_ATTR(ConnectStart) diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 94b0d9bf9..05699df62 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -5402,7 +5402,7 @@ nsHttpChannel::AsyncProcessRedirection(uint32_t redirectType) if (NS_EscapeURL(location.get(), -1, esc_OnlyNonASCII, locationBuf)) location = locationBuf; - if (mRedirectionLimit == 0) { + if (mRedirectCount >= mRedirectionLimit || mInternalRedirectCount >= mRedirectionLimit) { LOG(("redirection limit reached!\n")); return NS_ERROR_REDIRECT_LOOP; } diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 67e29a029..f9bcc391d 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -848,31 +848,6 @@ nsHttpHandler::InitUserAgentComponents() } #endif // MOZ_MULET -#if defined(MOZ_WIDGET_GONK) - // Device model identifier should be a simple token, which can be composed - // of letters, numbers, hyphen ("-") and dot ("."). - // Any other characters means the identifier is invalid and ignored. - nsCString deviceId; - rv = Preferences::GetCString("general.useragent.device_id", &deviceId); - if (NS_SUCCEEDED(rv)) { - bool valid = true; - deviceId.Trim(" ", true, true); - for (size_t i = 0; i < deviceId.Length(); i++) { - char c = deviceId.CharAt(i); - if (!(isalnum(c) || c == '-' || c == '.')) { - valid = false; - break; - } - } - if (valid) { - mDeviceModelId = deviceId; - } else { - LOG(("nsHttpHandler: Ignore invalid device ID: [%s]\n", - deviceId.get())); - } - } -#endif - #ifndef MOZ_UA_OS_AGNOSTIC // Gather OS/CPU. #if defined(XP_WIN) diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp index 706710d89..8d837d172 100644 --- a/netwerk/protocol/http/nsHttpTransaction.cpp +++ b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -43,10 +43,6 @@ #include "sslerr.h" #include <algorithm> -#ifdef MOZ_WIDGET_GONK -#include "NetStatistics.h" -#endif - //----------------------------------------------------------------------------- static NS_DEFINE_CID(kMultiplexInputStream, NS_MULTIPLEXINPUTSTREAM_CID); @@ -266,15 +262,6 @@ nsHttpTransaction::Init(uint32_t caps, NS_GetAppInfo(channel, &mAppId, &mIsInIsolatedMozBrowser); } -#ifdef MOZ_WIDGET_GONK - if (mAppId != NECKO_NO_APP_ID) { - nsCOMPtr<nsINetworkInfo> activeNetworkInfo; - GetActiveNetworkInfo(activeNetworkInfo); - mActiveNetworkInfo = - new nsMainThreadPtrHolder<nsINetworkInfo>(activeNetworkInfo); - } -#endif - nsCOMPtr<nsIHttpChannelInternal> httpChannelInternal = do_QueryInterface(eventsink); if (httpChannelInternal) { @@ -937,40 +924,7 @@ nsHttpTransaction::WriteSegments(nsAHttpSegmentWriter *writer, nsresult nsHttpTransaction::SaveNetworkStats(bool enforce) { -#ifdef MOZ_WIDGET_GONK - // Check if active network and appid are valid. - if (!mActiveNetworkInfo || mAppId == NECKO_NO_APP_ID) { - return NS_OK; - } - - if (mCountRecv <= 0 && mCountSent <= 0) { - // There is no traffic, no need to save. - return NS_OK; - } - - // If |enforce| is false, the traffic amount is saved - // only when the total amount exceeds the predefined - // threshold. - uint64_t totalBytes = mCountRecv + mCountSent; - if (!enforce && totalBytes < NETWORK_STATS_THRESHOLD) { - return NS_OK; - } - - // Create the event to save the network statistics. - // the event is then dispatched to the main thread. - RefPtr<Runnable> event = - new SaveNetworkStatsEvent(mAppId, mIsInIsolatedMozBrowser, mActiveNetworkInfo, - mCountRecv, mCountSent, false); - NS_DispatchToMainThread(event); - - // Reset the counters after saving. - mCountSent = 0; - mCountRecv = 0; - - return NS_OK; -#else return NS_ERROR_NOT_IMPLEMENTED; -#endif } void diff --git a/netwerk/protocol/http/nsHttpTransaction.h b/netwerk/protocol/http/nsHttpTransaction.h index 5bf97d41e..262796d71 100644 --- a/netwerk/protocol/http/nsHttpTransaction.h +++ b/netwerk/protocol/http/nsHttpTransaction.h @@ -19,11 +19,6 @@ #include "ARefBase.h" #include "AlternateServices.h" -#ifdef MOZ_WIDGET_GONK -#include "nsINetworkInterface.h" -#include "nsProxyRelease.h" -#endif - //----------------------------------------------------------------------------- class nsIHttpActivityObserver; @@ -435,9 +430,6 @@ private: uint64_t mCountSent; uint32_t mAppId; bool mIsInIsolatedMozBrowser; -#ifdef MOZ_WIDGET_GONK - nsMainThreadPtrHandle<nsINetworkInfo> mActiveNetworkInfo; -#endif nsresult SaveNetworkStats(bool); void CountRecvBytes(uint64_t recvBytes) { diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index a6254a088..c6dc8d328 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -65,10 +65,6 @@ #include "zlib.h" #include <algorithm> -#ifdef MOZ_WIDGET_GONK -#include "NetStatistics.h" -#endif - // rather than slurp up all of nsIWebSocket.idl, which lives outside necko, just // dupe one constant we need from it #define CLOSE_GOING_AWAY 1001 @@ -1396,15 +1392,6 @@ WebSocketChannel::BeginOpenInternal() NS_GetAppInfo(localChannel, &mAppId, &mIsInIsolatedMozBrowser); } -#ifdef MOZ_WIDGET_GONK - if (mAppId != NECKO_NO_APP_ID) { - nsCOMPtr<nsINetworkInfo> activeNetworkInfo; - GetActiveNetworkInfo(activeNetworkInfo); - mActiveNetworkInfo = - new nsMainThreadPtrHolder<nsINetworkInfo>(activeNetworkInfo); - } -#endif - rv = NS_MaybeOpenChannelUsingAsyncOpen2(localChannel, this); if (NS_FAILED(rv)) { @@ -4063,42 +4050,7 @@ WebSocketChannel::OnDataAvailable(nsIRequest *aRequest, nsresult WebSocketChannel::SaveNetworkStats(bool enforce) { -#ifdef MOZ_WIDGET_GONK - // Check if the active network and app id are valid. - if(!mActiveNetworkInfo || mAppId == NECKO_NO_APP_ID) { - return NS_OK; - } - - uint64_t countRecv = 0; - uint64_t countSent = 0; - - mCountRecv.exchange(countRecv); - mCountSent.exchange(countSent); - - if (countRecv == 0 && countSent == 0) { - // There is no traffic, no need to save. - return NS_OK; - } - - // If |enforce| is false, the traffic amount is saved - // only when the total amount exceeds the predefined - // threshold. - uint64_t totalBytes = countRecv + countSent; - if (!enforce && totalBytes < NETWORK_STATS_THRESHOLD) { - return NS_OK; - } - - // Create the event to save the network statistics. - // the event is then dispatched to the main thread. - RefPtr<Runnable> event = - new SaveNetworkStatsEvent(mAppId, mIsInIsolatedMozBrowser, mActiveNetworkInfo, - countRecv, countSent, false); - NS_DispatchToMainThread(event); - - return NS_OK; -#else return NS_ERROR_NOT_IMPLEMENTED; -#endif } } // namespace net diff --git a/netwerk/protocol/websocket/WebSocketChannel.h b/netwerk/protocol/websocket/WebSocketChannel.h index e2f332dab..341a357a0 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.h +++ b/netwerk/protocol/websocket/WebSocketChannel.h @@ -21,11 +21,6 @@ #include "nsIStringStream.h" #include "BaseWebSocketChannel.h" -#ifdef MOZ_WIDGET_GONK -#include "nsINetworkInterface.h" -#include "nsProxyRelease.h" -#endif - #include "nsCOMPtr.h" #include "nsString.h" #include "nsDeque.h" @@ -307,9 +302,6 @@ private: Atomic<uint64_t, Relaxed> mCountSent; uint32_t mAppId; bool mIsInIsolatedMozBrowser; -#ifdef MOZ_WIDGET_GONK - nsMainThreadPtrHandle<nsINetworkInfo> mActiveNetworkInfo; -#endif nsresult SaveNetworkStats(bool); void CountRecvBytes(uint64_t recvBytes) { diff --git a/netwerk/standalone/moz.build b/netwerk/standalone/moz.build index 4c7366e3b..b5651da76 100644 --- a/netwerk/standalone/moz.build +++ b/netwerk/standalone/moz.build @@ -4,7 +4,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': +if CONFIG['OS_TARGET'] != 'WINNT': Library('necko_standalone') src_list = [ @@ -27,7 +27,6 @@ netwerk_dns_src = [ 'DNS.cpp', 'DNSListenerProxy.cpp', 'GetAddrInfo.cpp', - 'nameprep.c', 'nsDNSService2.cpp', 'nsIDNService.cpp', 'punycode.c', diff --git a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp index c0ec9d90e..4fc36928a 100644 --- a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp +++ b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp @@ -8,10 +8,8 @@ #include <fcntl.h> #include <poll.h> #include <errno.h> -#ifndef MOZ_WIDGET_GONK #include <ifaddrs.h> #include <net/if.h> -#endif #include "nsThreadUtils.h" #include "nsIObserverService.h" @@ -28,10 +26,6 @@ #include "mozilla/Sprintf.h" #include "mozilla/Telemetry.h" -#ifdef MOZ_WIDGET_GONK -#include <cutils/properties.h> -#endif - /* a shorter name that better explains what it does */ #define EINTR_RETRY(x) MOZ_TEMP_FAILURE_RETRY(x) @@ -210,9 +204,6 @@ void nsNotifyAddrListener::calculateNetworkId(void) // void nsNotifyAddrListener::checkLink(void) { -#ifdef MOZ_WIDGET_GONK - // b2g instead has NetworkManager.js which handles UP/DOWN -#else struct ifaddrs *list; struct ifaddrs *ifa; bool link = false; @@ -247,7 +238,6 @@ void nsNotifyAddrListener::checkLink(void) SendEvent(mLinkUp ? NS_NETWORK_LINK_DATA_UP : NS_NETWORK_LINK_DATA_DOWN); } -#endif } void nsNotifyAddrListener::OnNetlinkMessage(int aNetlinkSocket) diff --git a/netwerk/test/moz.build b/netwerk/test/moz.build index 3df865c3a..c83cca0eb 100644 --- a/netwerk/test/moz.build +++ b/netwerk/test/moz.build @@ -57,7 +57,7 @@ RESOURCE_FILES += [ USE_LIBS += ['static:js'] -if CONFIG['ENABLE_INTL_API'] and CONFIG['MOZ_ICU_DATA_ARCHIVE']: +if CONFIG['MOZ_ICU_DATA_ARCHIVE']: # The ICU libraries linked into libmozjs will not include the ICU data, # so link it directly. USE_LIBS += ['icudata'] diff --git a/netwerk/wifi/moz.build b/netwerk/wifi/moz.build index e3edb0842..28149cb78 100644 --- a/netwerk/wifi/moz.build +++ b/netwerk/wifi/moz.build @@ -16,14 +16,9 @@ UNIFIED_SOURCES += [ 'nsWifiAccessPoint.cpp', ] -if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - UNIFIED_SOURCES += [ - 'nsWifiMonitorGonk.cpp', - ] -else: - UNIFIED_SOURCES += [ - 'nsWifiMonitor.cpp', - ] +UNIFIED_SOURCES += [ + 'nsWifiMonitor.cpp', +] if CONFIG['OS_ARCH'] == 'Darwin': UNIFIED_SOURCES += [ diff --git a/netwerk/wifi/nsWifiMonitor.h b/netwerk/wifi/nsWifiMonitor.h index 665798efc..c44f6804b 100644 --- a/netwerk/wifi/nsWifiMonitor.h +++ b/netwerk/wifi/nsWifiMonitor.h @@ -48,7 +48,6 @@ class nsWifiListener bool mHasSentData; }; -#ifndef MOZ_WIDGET_GONK class nsWifiMonitor final : nsIRunnable, nsIWifiMonitor, nsIObserver { public: @@ -79,32 +78,5 @@ class nsWifiMonitor final : nsIRunnable, nsIWifiMonitor, nsIObserver nsAutoPtr<WinWifiScanner> mWinWifiScanner; #endif }; -#else -#include "nsIWifi.h" -class nsWifiMonitor final : nsIWifiMonitor, nsIWifiScanResultsReady, nsIObserver -{ - public: - NS_DECL_ISUPPORTS - NS_DECL_NSIWIFIMONITOR - NS_DECL_NSIOBSERVER - NS_DECL_NSIWIFISCANRESULTSREADY - nsWifiMonitor(); - - private: - ~nsWifiMonitor(); - - void ClearTimer() { - if (mTimer) { - mTimer->Cancel(); - mTimer = nullptr; - } - } - void StartScan(); - nsCOMArray<nsWifiAccessPoint> mLastAccessPoints; - nsTArray<nsWifiListener> mListeners; - nsCOMPtr<nsITimer> mTimer; -}; -#endif - -#endif +#endif // __nsWifiMonitor__ diff --git a/netwerk/wifi/nsWifiMonitorGonk.cpp b/netwerk/wifi/nsWifiMonitorGonk.cpp deleted file mode 100644 index 017750549..000000000 --- a/netwerk/wifi/nsWifiMonitorGonk.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsCOMPtr.h" -#include "nsComponentManagerUtils.h" -#include "nsServiceManagerUtils.h" -#include "nsThreadUtils.h" -#include "nsXPCOM.h" -#include "nsXPCOMCID.h" -#include "nsIObserver.h" -#include "nsIObserverService.h" -#include "nsWifiMonitor.h" -#include "nsWifiAccessPoint.h" - -#include "nsServiceManagerUtils.h" -#include "nsComponentManagerUtils.h" -#include "mozilla/Services.h" - -#include "nsIInterfaceRequestor.h" -#include "nsIInterfaceRequestorUtils.h" - -using namespace mozilla; - -LazyLogModule gWifiMonitorLog("WifiMonitor"); - -NS_IMPL_ISUPPORTS(nsWifiMonitor, - nsIWifiMonitor, - nsIObserver, - nsIWifiScanResultsReady) - -nsWifiMonitor::nsWifiMonitor() -{ - nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService(); - if (obsSvc) { - obsSvc->AddObserver(this, "xpcom-shutdown", false); - } - LOG(("@@@@@ wifimonitor created\n")); -} - -nsWifiMonitor::~nsWifiMonitor() -{ -} - -NS_IMETHODIMP -nsWifiMonitor::StartWatching(nsIWifiListener *aListener) -{ - LOG(("@@@@@ nsWifiMonitor::StartWatching\n")); - NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); - if (!aListener) { - return NS_ERROR_NULL_POINTER; - } - - mListeners.AppendElement(nsWifiListener(new nsMainThreadPtrHolder<nsIWifiListener>(aListener))); - - if (!mTimer) { - mTimer = do_CreateInstance("@mozilla.org/timer;1"); - mTimer->Init(this, 5000, nsITimer::TYPE_REPEATING_SLACK); - } - StartScan(); - return NS_OK; -} - -NS_IMETHODIMP -nsWifiMonitor::StopWatching(nsIWifiListener *aListener) -{ - LOG(("@@@@@ nsWifiMonitor::StopWatching\n")); - NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); - if (!aListener) { - return NS_ERROR_NULL_POINTER; - } - - for (uint32_t i = 0; i < mListeners.Length(); i++) { - if (mListeners[i].mListener == aListener) { - mListeners.RemoveElementAt(i); - break; - } - } - - if (mListeners.Length() == 0) { - ClearTimer(); - } - return NS_OK; -} - -void -nsWifiMonitor::StartScan() -{ - nsCOMPtr<nsIInterfaceRequestor> ir = do_GetService("@mozilla.org/telephony/system-worker-manager;1"); - nsCOMPtr<nsIWifi> wifi = do_GetInterface(ir); - if (!wifi) { - return; - } - wifi->GetWifiScanResults(this); -} - -NS_IMETHODIMP -nsWifiMonitor::Observe(nsISupports *subject, const char *topic, - const char16_t *data) -{ - if (!strcmp(topic, "timer-callback")) { - LOG(("timer callback\n")); - StartScan(); - return NS_OK; - } - - if (!strcmp(topic, "xpcom-shutdown")) { - LOG(("Shutting down\n")); - ClearTimer(); - return NS_OK; - } - - return NS_ERROR_UNEXPECTED; -} - -NS_IMETHODIMP -nsWifiMonitor::Onready(uint32_t count, nsIWifiScanResult **results) -{ - NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); - LOG(("@@@@@ About to send data to the wifi listeners\n")); - - nsCOMArray<nsWifiAccessPoint> accessPoints; - - for (uint32_t i = 0; i < count; i++) { - RefPtr<nsWifiAccessPoint> ap = new nsWifiAccessPoint(); - - nsString temp; - results[i]->GetBssid(temp); - // 00:00:00:00:00:00 --> 00-00-00-00-00-00 - for (int32_t x=0; x<6; x++) { - temp.ReplaceSubstring(NS_LITERAL_STRING(":"), NS_LITERAL_STRING("-")); // would it be too much to ask for a ReplaceAll()? - } - - nsCString mac; - mac.AssignWithConversion(temp); - - results[i]->GetSsid(temp); - - nsCString ssid; - ssid.AssignWithConversion(temp); - - uint32_t signal; - results[i]->GetSignalStrength(&signal); - - ap->setSignal(signal); - ap->setMacRaw(mac.get()); - ap->setSSIDRaw(ssid.get(), ssid.Length()); - - accessPoints.AppendObject(ap); - } - - bool accessPointsChanged = !AccessPointsEqual(accessPoints, mLastAccessPoints); - ReplaceArray(mLastAccessPoints, accessPoints); - - nsTArray<nsIWifiAccessPoint*> ac; - uint32_t resultCount = mLastAccessPoints.Count(); - for (uint32_t i = 0; i < resultCount; i++) { - ac.AppendElement(mLastAccessPoints[i]); - } - - for (uint32_t i = 0; i < mListeners.Length(); i++) { - if (!mListeners[i].mHasSentData || accessPointsChanged) { - mListeners[i].mHasSentData = true; - mListeners[i].mListener->OnChange(ac.Elements(), ac.Length()); - } - } - return NS_OK; -} - -NS_IMETHODIMP -nsWifiMonitor::Onfailure() -{ - NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); - LOG(("@@@@@ About to send error to the wifi listeners\n")); - for (uint32_t i = 0; i < mListeners.Length(); i++) { - mListeners[i].mListener->OnError(NS_ERROR_UNEXPECTED); - } - - ClearTimer(); - return NS_OK; -} |