Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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
cpython
Commits
ea93ac01
Kaydet (Commit)
ea93ac01
authored
Haz 17, 2016
tarafından
Steve Dower
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #26536: socket.ioctl now supports SIO_LOOPBACK_FAST_PATH. Patch by Daniel Stokes.
üst
99d66f91
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
4 deletions
+57
-4
socket.rst
Doc/library/socket.rst
+12
-1
3.6.rst
Doc/whatsnew/3.6.rst
+8
-0
test_socket.py
Lib/test/test_socket.py
+10
-0
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
socketmodule.c
Modules/socketmodule.c
+23
-3
No files found.
Doc/library/socket.rst
Dosyayı görüntüle @
ea93ac01
...
...
@@ -329,12 +329,17 @@ Constants
.. versionadded:: 3.3
.. data:: SIO_*
.. data:: SIO_RCVALL
SIO_KEEPALIVE_VALS
SIO_LOOPBACK_FAST_PATH
RCVALL_*
Constants for Windows' WSAIoctl(). The constants are used as arguments to the
:meth:`~socket.socket.ioctl` method of socket objects.
.. versionchanged:: 3.6
``SIO_LOOPBACK_FAST_PATH`` was added.
.. data:: TIPC_*
...
...
@@ -996,6 +1001,12 @@ to sockets.
On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl`
functions may be used; they accept a socket object as their first argument.
Currently only the following control codes are supported:
``SIO_RCVALL``, ``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``.
.. versionchanged:: 3.6
``SIO_LOOPBACK_FAST_PATH`` was added.
.. method:: socket.listen([backlog])
Enable a server to accept connections. If *backlog* is specified, it must
...
...
Doc/whatsnew/3.6.rst
Dosyayı görüntüle @
ea93ac01
...
...
@@ -346,6 +346,14 @@ sqlite3
(Contributed by Alex LordThorsen in :issue:`16864`.)
socket
------
The :func:`~socket.socket.ioctl` function now supports the :data:`~socket.SIO_LOOPBACK_FAST_PATH`
control code.
(Contributed by Daniel Stokes in :issue:`26536`.)
socketserver
------------
...
...
Lib/test/test_socket.py
Dosyayı görüntüle @
ea93ac01
...
...
@@ -1217,6 +1217,16 @@ class GeneralModuleTests(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
s
.
ioctl
,
-
1
,
None
)
s
.
ioctl
(
socket
.
SIO_KEEPALIVE_VALS
,
(
1
,
100
,
100
))
@unittest.skipUnless
(
os
.
name
==
"nt"
,
"Windows specific"
)
@unittest.skipUnless
(
hasattr
(
socket
,
'SIO_LOOPBACK_FAST_PATH'
),
'Loopback fast path support required for this test'
)
def
test_sio_loopback_fast_path
(
self
):
s
=
socket
.
socket
()
self
.
addCleanup
(
s
.
close
)
s
.
ioctl
(
socket
.
SIO_LOOPBACK_FAST_PATH
,
True
)
self
.
assertRaises
(
TypeError
,
s
.
ioctl
,
socket
.
SIO_LOOPBACK_FAST_PATH
,
None
)
def
testGetaddrinfo
(
self
):
try
:
socket
.
getaddrinfo
(
'localhost'
,
80
)
...
...
Misc/ACKS
Dosyayı görüntüle @
ea93ac01
...
...
@@ -1431,6 +1431,7 @@ Victor Stinner
Richard Stoakley
Peter Stoehr
Casper Stoel
Daniel Stokes
Michael Stone
Serhiy Storchaka
Ken Stox
...
...
Misc/NEWS
Dosyayı görüntüle @
ea93ac01
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.6.0 alpha 3
Library
-------
- Issue #26536: socket.ioctl now supports SIO_LOOPBACK_FAST_PATH. Patch by
Daniel Stokes.
- Issue #27048: Prevents distutils failing on Windows when environment
variables contain non-ASCII characters
...
...
Modules/socketmodule.c
Dosyayı görüntüle @
ea93ac01
...
...
@@ -4053,6 +4053,17 @@ sock_ioctl(PySocketSockObject *s, PyObject *arg)
return
set_error
();
}
return
PyLong_FromUnsignedLong
(
recv
);
}
#if defined(SIO_LOOPBACK_FAST_PATH)
case
SIO_LOOPBACK_FAST_PATH
:
{
unsigned
int
option
;
if
(
!
PyArg_ParseTuple
(
arg
,
"kI:ioctl"
,
&
cmd
,
&
option
))
return
NULL
;
if
(
WSAIoctl
(
s
->
sock_fd
,
cmd
,
&
option
,
sizeof
(
option
),
NULL
,
0
,
&
recv
,
NULL
,
NULL
)
==
SOCKET_ERROR
)
{
return
set_error
();
}
return
PyLong_FromUnsignedLong
(
recv
);
}
#endif
default:
PyErr_Format
(
PyExc_ValueError
,
"invalid ioctl command %d"
,
cmd
);
return
NULL
;
...
...
@@ -4063,7 +4074,8 @@ PyDoc_STRVAR(sock_ioctl_doc,
\n
\
Control the socket with WSAIoctl syscall. Currently supported 'cmd' values are
\n
\
SIO_RCVALL: 'option' must be one of the socket.RCVALL_* constants.
\n
\
SIO_KEEPALIVE_VALS: 'option' is a tuple of (onoff, timeout, interval)."
);
SIO_KEEPALIVE_VALS: 'option' is a tuple of (onoff, timeout, interval).
\n
\
SIO_LOOPBACK_FAST_PATH: 'option' is a boolean value, and is disabled by default"
);
#endif
#if defined(MS_WINDOWS)
...
...
@@ -7274,8 +7286,16 @@ PyInit__socket(void)
#ifdef SIO_RCVALL
{
DWORD
codes
[]
=
{
SIO_RCVALL
,
SIO_KEEPALIVE_VALS
};
const
char
*
names
[]
=
{
"SIO_RCVALL"
,
"SIO_KEEPALIVE_VALS"
};
DWORD
codes
[]
=
{
SIO_RCVALL
,
SIO_KEEPALIVE_VALS
,
#if defined(SIO_LOOPBACK_FAST_PATH)
SIO_LOOPBACK_FAST_PATH
#endif
};
const
char
*
names
[]
=
{
"SIO_RCVALL"
,
"SIO_KEEPALIVE_VALS"
,
#if defined(SIO_LOOPBACK_FAST_PATH)
"SIO_LOOPBACK_FAST_PATH"
#endif
};
int
i
;
for
(
i
=
0
;
i
<
Py_ARRAY_LENGTH
(
codes
);
++
i
)
{
PyObject
*
tmp
;
...
...
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