Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
43158cfe
Kaydet (Commit)
43158cfe
authored
Tem 13, 2016
tarafından
Aanand Prasad
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move read_loop() into docker.utils.socket.read_iter()
Signed-off-by:
Aanand Prasad
<
aanand.prasad@gmail.com
>
üst
b100666a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
client.py
docker/client.py
+4
-12
socket.py
docker/utils/socket.py
+7
-0
No files found.
docker/client.py
Dosyayı görüntüle @
43158cfe
...
...
@@ -32,7 +32,7 @@ from .ssladapter import ssladapter
from
.tls
import
TLSConfig
from
.transport
import
UnixAdapter
from
.utils
import
utils
,
check_resource
,
update_headers
,
kwargs_from_env
from
.utils.socket
import
read_socket
,
next_packet_size
from
.utils.socket
import
read_socket
,
next_packet_size
,
read_iter
try
:
from
.transport
import
NpipeAdapter
except
ImportError
:
...
...
@@ -310,20 +310,12 @@ class Client(
yield
out
def
_read_from_socket
(
self
,
response
,
stream
):
def
read_loop
(
socket
):
n
=
next_packet_size
(
socket
)
while
n
>
0
:
yield
read_socket
(
socket
,
n
)
n
=
next_packet_size
(
socket
)
socket
=
self
.
_get_raw_response_socket
(
response
)
if
stream
:
return
read_
loop
(
socket
)
return
read_
iter
(
socket
)
else
:
data
=
six
.
binary_type
()
for
d
in
read_loop
(
socket
):
data
+=
d
return
data
return
six
.
binary_type
()
.
join
(
read_iter
(
socket
))
def
_disable_socket_timeout
(
self
,
socket
):
""" Depending on the combination of python version and whether we're
...
...
docker/utils/socket.py
Dosyayı görüntüle @
43158cfe
...
...
@@ -47,3 +47,10 @@ def read_data(socket, packet_size):
assert
False
,
"Failed trying to read in the data"
data
+=
next_data
return
data
def
read_iter
(
socket
):
n
=
next_packet_size
(
socket
)
while
n
>
0
:
yield
read_socket
(
socket
,
n
)
n
=
next_packet_size
(
socket
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment