Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for interrupted (0.23 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt

       * operation, it will be re-interrupted after the list is read.
       */
      private fun readTheListUninterruptibly() {
        var interrupted = false
        try {
          while (true) {
            try {
              readTheList()
              return
            } catch (_: InterruptedIOException) {
              Thread.interrupted() // Temporarily clear the interrupted state.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt

                  socket.setReceiveBufferSize(SOCKET_BUFFER_SIZE)
                  return socket
                }
              },
            )
            .build()
      }
    
      @AfterEach
      fun tearDown() {
        Thread.interrupted() // Clear interrupted state.
      }
    
      @Test
      fun interruptWritingRequestBody() {
        server.enqueue(MockResponse())
        server.start()
        val call =
          client.newCall(
            Request.Builder()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  3. docs/changelogs/changelog_1x.md

    _2014-03-29_
    
     * Fix bug where the Content-Length header was not always dropped when
       following a redirect from a POST to a GET.
     * Implement basic support for `Thread.interrupt()`. OkHttp now checks
       for an interruption before doing a blocking call. If it is interrupted,
       it throws an `InterruptedIOException`.
    
    ## Version 1.5.2
    
    _2014-03-17_
    
     * Fix bug where deleting a file that was absent from the `HttpResponseCache`
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 6.4K bytes
    - Viewed (0)
  4. okhttp-testing-support/src/main/kotlin/okhttp3/internal/concurrent/TaskFaker.kt

              nanos: Long,
            ) {
              taskRunner.assertThreadHoldsLock()
              check(waitingCoordinatorTask == null)
              if (nanos == 0L) return
    
              // Yield until notified, interrupted, or the duration elapses.
              val waitUntil = nanoTime + nanos
              val self = currentTask
              waitingCoordinatorTask = self
              waitingCoordinatorNotified = false
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 29 00:33:04 GMT 2024
    - 12.6K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Stream.kt

      /**
       * Like [Object.wait], but throws an [InterruptedIOException] when interrupted instead of the more
       * awkward [InterruptedException].
       */
      @Throws(InterruptedIOException::class)
      internal fun waitForIo() {
        try {
          condition.await()
        } catch (_: InterruptedException) {
          Thread.currentThread().interrupt() // Retain interrupted status.
          throw InterruptedIOException()
        }
      }
    
      /**
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 23.2K bytes
    - Viewed (1)
  6. okhttp/src/test/java/okhttp3/internal/http/CancelTest.kt

                  }
                },
            ),
          )
        cancelLater(call, 500)
        assertFailsWith<IOException> {
          call.execute()
        }.also { expected ->
          assertEquals(cancelMode == INTERRUPT, Thread.interrupted())
        }
      }
    
      @ParameterizedTest
      @ArgumentsSource(CancelModelParamProvider::class)
      fun cancelReadingResponseBody(mode: Pair<CancelMode, ConnectionType>) {
        setUp(mode)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  7. docs/changelogs/changelog_3x.md

     *  Fix: Reverse suppression of connect exceptions. When both a call and its retry fail, we now
        throw the initial exception which is most likely to be actionable.
     *  Fix: Retain interrupted state when throwing `InterruptedIOException`. A single interrupt should
        now be sufficient to break out an in-flight OkHttp call.
     *  Fix: Don't drop a call to `EventListener.callEnd()` when the response body is consumed inside an
        interceptor.
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 14:55:54 GMT 2022
    - 50.8K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

      override fun request(): Request = originalRequest
    
      /**
       * Immediately closes the socket connection if it's currently held. Use this to interrupt an
       * in-flight request from any thread. It's the caller's responsibility to close the request body
       * and response body streams; otherwise resources may be leaked.
       *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 17.9K bytes
    - Viewed (2)
  9. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Connection.kt

                }
                condition.await() // Wait until we receive a WINDOW_UPDATE.
              }
            } catch (e: InterruptedException) {
              Thread.currentThread().interrupt() // Retain interrupted status.
              throw InterruptedIOException()
            }
    
            toWrite = minOf(byteCount, writeBytesMaximum - writeBytesTotal).toInt()
            toWrite = minOf(toWrite, writer.maxDataLength())
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 32.6K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/InterceptorTest.kt

            .body(uppercase(originalResponse.body))
            .addHeader("OkHttp-Intercepted", "yep")
            .build()
        }
        val request =
          Request.Builder()
            .url(server.url("/"))
            .build()
        val response = client.newCall(request).execute()
        assertThat(response.body.string()).isEqualTo("ABC")
        assertThat(response.header("OkHttp-Intercepted")).isEqualTo("yep")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 27.8K bytes
    - Viewed (0)
Back to top