8000 bpo-42333: Port _ssl extension module to heap types (GH-23392) by tiran · Pull Request #23392 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-42333: Port _ssl extension module to heap types (GH-23392) #23392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 20, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move init socket API
  • Loading branch information
tiran committed Nov 19, 2020
commit a264a3c9c7f95d261580f55a1703d297cb5cd168
23 changes: 16 additions & 7 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -6023,6 +6023,20 @@ do { \
return -1;
}

static int
sslmodule_init_socketapi(PyObject *module)
{
PySocketModule_APIObject *socket_api;

/* Load _socket module and its C API */
socket_api = PySocketModule_ImportModuleAndAPI();
if (socket_api == NULL)
return -1;
PySocketModule = *socket_api;

return 0;
}

static int
sslmodule_init_errorcodes(PyObject *module)
{
Expand Down Expand Up @@ -6414,7 +6428,6 @@ PyMODINIT_FUNC
PyInit__ssl(void)
{
PyObject *m;
PySocketModule_APIObject *socket_api;

m = PyModule_Create(&_sslmodule);
if (m == NULL)
Expand All @@ -6424,19 +6437,15 @@ PyInit__ssl(void)
return NULL;
if (sslmodule_init_exceptions(m) != 0)
return NULL;
if (sslmodule_init_socketapi(m) != 0)
return NULL;
if (sslmodule_init_errorcodes(m) != 0)
return NULL;
if (sslmodule_init_constants(m) != 0)
return NULL;
if (sslmodule_init_versioninfo(m) != 0)
return NULL;

/* Load _socket module and its C API */
socket_api = PySocketModule_ImportModuleAndAPI();
if (!socket_api)
return NULL;
PySocketModule = *socket_api;

#ifndef OPENSSL_VERSION_1_1
/* Load all algorithms and initialize cpuid */
OPENSSL_add_all_algorithms_noconf();
Expand Down
0