Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 71 for Map (0.19 sec)

  1. okhttp-testing-support/src/main/kotlin/okhttp3/FakeDns.kt

      fun allocate(count: Int): List<InetAddress> {
        val from = nextAddress
        nextAddress += count
        return (from until nextAddress)
          .map {
            return@map InetAddress.getByAddress(
              Buffer().writeInt(it.toInt()).readByteArray(),
            )
          }
      }
    
      /** Allocates and returns `count` fake IPv6 addresses like [::ff00:64, ::ff00:65].  */
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  2. samples/tlssurvey/src/main/kotlin/okhttp3/survey/ssllabs/SslLabsScrape.kt

          .build()
    
      private val api = retrofit.create(SslLabsService::class.java)
    
      suspend fun query(): List<Client> {
        return api.clients().map { userAgent ->
          Client(userAgent.name, userAgent.version, userAgent.platform, enabled = userAgent.suiteNames.map { SuiteId(null, it) })
        }
      }
    }
    
    suspend fun main() {
      val client = OkHttpClient()
    
      val scraper = SslLabsScraper(client)
    
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/RecordingCookieJar.kt

      }
    
      fun takeResponseCookies(): List<Cookie> {
        return responseCookies.removeFirst()
      }
    
      fun assertResponseCookies(vararg cookies: String?) {
        assertThat(takeResponseCookies().map(Cookie::toString)).containsExactly(*cookies)
      }
    
      override fun saveFromResponse(
        url: HttpUrl,
        cookies: List<Cookie>,
      ) {
        responseCookies.add(cookies)
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/-HostnamesCommon.kt

    }
    
    internal fun idnToAscii(host: String): String? {
      val bufferA = Buffer().writeUtf8(host)
      val bufferB = Buffer()
    
      // 1. Map, from bufferA to bufferB.
      while (!bufferA.exhausted()) {
        val codePoint = bufferA.readUtf8CodePoint()
        if (!IDNA_MAPPING_TABLE.map(codePoint, bufferB)) return null
      }
    
      // 2. Normalize, from bufferB to bufferA.
      val normalized = normalizeNfc(bufferB.readUtf8())
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  5. okhttp-testing-support/src/main/kotlin/okhttp3/RecordingConnectionListener.kt

            TimeUnit.NANOSECONDS.toMillis(actualElapsedNs)
              .toDouble(),
          )
            .isCloseTo(elapsedMs.toDouble(), 100.0)
        }
    
        return result
      }
    
      fun recordedEventTypes() = eventSequence.map { it.name }
    
      fun clearAllEvents() {
        while (eventSequence.isNotEmpty()) {
          takeEvent()
        }
      }
    
      private fun logEvent(e: ConnectionEvent) {
        if (e.connection != null) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  6. okhttp-idna-mapping-table/src/main/kotlin/okhttp3/internal/idn/SimpleIdnaMappingTable.kt

     */
    class SimpleIdnaMappingTable internal constructor(
      internal val mappings: List<Mapping>,
    ) {
      /**
       * Returns true if the [codePoint] was applied successfully. Returns false if it was disallowed.
       */
      fun map(
        codePoint: Int,
        sink: BufferedSink,
      ): Boolean {
        val index =
          mappings.binarySearch {
            when {
              it.sourceCodePoint1 < codePoint -> -1
              it.sourceCodePoint0 > codePoint -> 1
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/platform/Platform.kt

        fun resetForTests(platform: Platform = findPlatform()) {
          this.platform = platform
        }
    
        fun alpnProtocolNames(protocols: List<Protocol>) = protocols.filter { it != Protocol.HTTP_1_0 }.map { it.toString() }
    
        // This explicit check avoids activating in Android Studio with Android specific classes
        // available when running plugins inside the IDE.
        val isAndroid: Boolean
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.8K bytes
    - Viewed (1)
  8. okhttp/src/test/java/okhttp3/HttpUrlTest.kt

      @Test
      fun hostnameTelephone() {
        // https://www.gosecure.net/blog/2020/10/27/weakness-in-java-tls-host-verification/
    
        // Map the single character telephone symbol (℡) to the string "tel".
        assertThat(parse("http://\u2121").host).isEqualTo("tel")
    
        // Map the Kelvin symbol (K) to the string "k".
        assertThat(parse("http://\u212A").host).isEqualTo("k")
      }
    
      @Test
      fun quirks() {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 67.9K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/idn/IdnaMappingTableTest.kt

      }
    
      @Test fun regularMappings() {
        assertThat("hello".map()).isEqualTo("hello")
        assertThat("hello-world".map()).isEqualTo("hello-world")
        assertThat("HELLO".map()).isEqualTo("hello")
        assertThat("Hello".map()).isEqualTo("hello")
    
        // These compound characters map their its components.
        assertThat("¼".map()).isEqualTo("1⁄4")
        assertThat("™".map()).isEqualTo("tm")
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/tls/BasicTrustRootIndex.kt

      private val subjectToCaCerts: Map<X500Principal, Set<X509Certificate>>
    
      init {
        val map = mutableMapOf<X500Principal, MutableSet<X509Certificate>>()
        for (caCert in caCerts) {
          map.getOrPut(caCert.subjectX500Principal) { mutableSetOf() }.add(caCert)
        }
        this.subjectToCaCerts = map
      }
    
      override fun findByIssuerAndSignature(cert: X509Certificate): X509Certificate? {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.8K bytes
    - Viewed (0)
Back to top