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
cf8f47ea
Kaydet (Commit)
cf8f47ea
authored
Ara 11, 2002
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #650422: Use Posix AF_ constants instead of PF_ ones.
üst
6233c9b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
socketmodule.c
Modules/socketmodule.c
+7
-5
No files found.
Modules/socketmodule.c
Dosyayı görüntüle @
cf8f47ea
...
@@ -661,7 +661,7 @@ setipaddr(char *name, struct sockaddr *addr_ret, size_t addr_ret_size, int af)
...
@@ -661,7 +661,7 @@ setipaddr(char *name, struct sockaddr *addr_ret, size_t addr_ret_size, int af)
}
}
if
(
name
[
0
]
==
'<'
&&
strcmp
(
name
,
"<broadcast>"
)
==
0
)
{
if
(
name
[
0
]
==
'<'
&&
strcmp
(
name
,
"<broadcast>"
)
==
0
)
{
struct
sockaddr_in
*
sin
;
struct
sockaddr_in
*
sin
;
if
(
af
!=
PF_INET
&&
af
!=
P
F_UNSPEC
)
{
if
(
af
!=
AF_INET
&&
af
!=
A
F_UNSPEC
)
{
PyErr_SetString
(
socket_error
,
PyErr_SetString
(
socket_error
,
"address family mismatched"
);
"address family mismatched"
);
return
-
1
;
return
-
1
;
...
@@ -2350,7 +2350,7 @@ socket_gethostbyname_ex(PyObject *self, PyObject *args)
...
@@ -2350,7 +2350,7 @@ socket_gethostbyname_ex(PyObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"s:gethostbyname_ex"
,
&
name
))
if
(
!
PyArg_ParseTuple
(
args
,
"s:gethostbyname_ex"
,
&
name
))
return
NULL
;
return
NULL
;
if
(
setipaddr
(
name
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
),
P
F_INET
)
<
0
)
if
(
setipaddr
(
name
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
),
A
F_INET
)
<
0
)
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_GETHOSTBYNAME_R
#ifdef HAVE_GETHOSTBYNAME_R
...
@@ -2425,7 +2425,7 @@ socket_gethostbyaddr(PyObject *self, PyObject *args)
...
@@ -2425,7 +2425,7 @@ socket_gethostbyaddr(PyObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"s:gethostbyaddr"
,
&
ip_num
))
if
(
!
PyArg_ParseTuple
(
args
,
"s:gethostbyaddr"
,
&
ip_num
))
return
NULL
;
return
NULL
;
af
=
P
F_UNSPEC
;
af
=
A
F_UNSPEC
;
if
(
setipaddr
(
ip_num
,
sa
,
sizeof
(
addr
),
af
)
<
0
)
if
(
setipaddr
(
ip_num
,
sa
,
sizeof
(
addr
),
af
)
<
0
)
return
NULL
;
return
NULL
;
af
=
sa
->
sa_family
;
af
=
sa
->
sa_family
;
...
@@ -2774,7 +2774,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args)
...
@@ -2774,7 +2774,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args)
PyObject
*
single
=
(
PyObject
*
)
NULL
;
PyObject
*
single
=
(
PyObject
*
)
NULL
;
family
=
socktype
=
protocol
=
flags
=
0
;
family
=
socktype
=
protocol
=
flags
=
0
;
family
=
P
F_UNSPEC
;
family
=
A
F_UNSPEC
;
if
(
!
PyArg_ParseTuple
(
args
,
"zO|iiii:getaddrinfo"
,
if
(
!
PyArg_ParseTuple
(
args
,
"zO|iiii:getaddrinfo"
,
&
hptr
,
&
pobj
,
&
family
,
&
socktype
,
&
hptr
,
&
pobj
,
&
family
,
&
socktype
,
&
protocol
,
&
flags
))
{
&
protocol
,
&
flags
))
{
...
@@ -2861,7 +2861,7 @@ socket_getnameinfo(PyObject *self, PyObject *args)
...
@@ -2861,7 +2861,7 @@ socket_getnameinfo(PyObject *self, PyObject *args)
return
NULL
;
return
NULL
;
PyOS_snprintf
(
pbuf
,
sizeof
(
pbuf
),
"%d"
,
port
);
PyOS_snprintf
(
pbuf
,
sizeof
(
pbuf
),
"%d"
,
port
);
memset
(
&
hints
,
0
,
sizeof
(
hints
));
memset
(
&
hints
,
0
,
sizeof
(
hints
));
hints
.
ai_family
=
P
F_UNSPEC
;
hints
.
ai_family
=
A
F_UNSPEC
;
hints
.
ai_socktype
=
SOCK_DGRAM
;
/* make numeric port happy */
hints
.
ai_socktype
=
SOCK_DGRAM
;
/* make numeric port happy */
error
=
getaddrinfo
(
hostp
,
pbuf
,
&
hints
,
&
res
);
error
=
getaddrinfo
(
hostp
,
pbuf
,
&
hints
,
&
res
);
if
(
error
)
{
if
(
error
)
{
...
@@ -3250,8 +3250,10 @@ init_socket(void)
...
@@ -3250,8 +3250,10 @@ init_socket(void)
/* We have incomplete socket support. */
/* We have incomplete socket support. */
PyModule_AddIntConstant
(
m
,
"SOCK_RAW"
,
SOCK_RAW
);
PyModule_AddIntConstant
(
m
,
"SOCK_RAW"
,
SOCK_RAW
);
PyModule_AddIntConstant
(
m
,
"SOCK_SEQPACKET"
,
SOCK_SEQPACKET
);
PyModule_AddIntConstant
(
m
,
"SOCK_SEQPACKET"
,
SOCK_SEQPACKET
);
#if defined(SOCK_RDM)
PyModule_AddIntConstant
(
m
,
"SOCK_RDM"
,
SOCK_RDM
);
PyModule_AddIntConstant
(
m
,
"SOCK_RDM"
,
SOCK_RDM
);
#endif
#endif
#endif
#ifdef SO_DEBUG
#ifdef SO_DEBUG
PyModule_AddIntConstant
(
m
,
"SO_DEBUG"
,
SO_DEBUG
);
PyModule_AddIntConstant
(
m
,
"SO_DEBUG"
,
SO_DEBUG
);
...
...
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