Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-99813: Start usingSSL_sendfile when available#99907

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
illia-v wants to merge54 commits intopython:main
base:main
Choose a base branch
Loading
fromillia-v:SSL_sendfile
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
54 commits
Select commitHold shift + click to select a range
a018beb
Add methods for checking whether kTLS is used
illia-vSep 11, 2022
72e7f5e
Start using `SSL_sendfile` when available
illia-vNov 30, 2022
cf24d78
Try fixing warnings
illia-vDec 5, 2022
e9ef747
Use unsigned `size_t` instead of `Py_ssize_t`
illia-vDec 5, 2022
646d328
Merge branch 'main' into SSL_sendfile
illia-vDec 5, 2022
76353c7
Merge branch 'main'
illia-vMar 13, 2023
14832de
Make `sendfile_impl` more similar to `write_impl`
illia-vMar 13, 2023
6b41d31
Modify `test_ssl` to test `SSL_sendfile` calls
illia-vMar 13, 2023
8ac6ff9
Modify documentation and add a news entry
illia-vMar 13, 2023
5cf9483
Fix a test
illia-vMar 13, 2023
fc8e82f
Rename `uses_ktls_for_write` to `uses_ktls_for_send`
illia-vMar 13, 2023
7fc9b50
Merge branch 'main' into SSL_sendfile
illia-vJul 25, 2023
1ba04ae
Update `versionchanged`
illia-vJul 25, 2023
365e0c0
Update a test to get successful HTTP responses
illia-vJul 25, 2023
8fbc955
Add setting errors
illia-vJul 25, 2023
21ea0ca
Fix conditions
illia-vJul 25, 2023
17d9685
Add handling of `SSL_R_UNINITIALIZED`
illia-vJul 26, 2023
a92ae7e
Merge branch 'main' into SSL_sendfile
illia-vJul 26, 2023
4e8b6d8
Modify `test_sendfile` to avoid the internet
illia-vJul 26, 2023
379d242
Refactor `test_sendfile` a bit
illia-vJul 26, 2023
7de3dcb
Merge branch 'main' into SSL_sendfile
illia-vOct 4, 2023
bbe21c0
Merge branch 'main' into SSL_sendfile
illia-vOct 19, 2023
7323ec0
Try to fix new warnings
illia-vOct 19, 2023
2dc6947
Merge branch 'main' into SSL_sendfile
illia-vFeb 27, 2024
6e902ad
Merge branch 'main' into SSL_sendfile
illia-vMar 27, 2024
e435b9a
Apply a change from ea9a296fce2f786b4cf43c7924e5de01061f27ca
illia-vMar 27, 2024
ac1b2b2
Merge branch 'main' into SSL_sendfile
illia-vJun 6, 2024
7d11a59
Merge branch 'main' into SSL_sendfile
illia-vJul 31, 2024
99e89d3
Merge branch 'main' into SSL_sendfile
illia-vSep 28, 2024
dc626c8
Merge branch 'main' into SSL_sendfile
illia-vDec 27, 2024
291a5b7
Set `versionchanged` to next in docs
illia-vDec 27, 2024
3193ba4
Merge branch 'main' into SSL_sendfile
illia-vFeb 3, 2025
d870f92
Merge branch 'main' into SSL_sendfile
illia-vApr 10, 2025
94e522e
Apply some suggestions from code review
illia-vApr 12, 2025
25bde6f
Apply suggestions to Python code
illia-vApr 12, 2025
9a6a120
Improve style of `_ssl__SSLSocket_sendfile_impl`
illia-vApr 12, 2025
eaa0b2c
Merge branch 'main' into SSL_sendfile
illia-vApr 12, 2025
05a0c6c
Drop `_sendfile_use_ssl_sendfile`
illia-vApr 13, 2025
6b4eed6
Merge remote-tracking branch 'python/main' into SSL_sendfile
illia-vApr 13, 2025
31ed52d
Apply suggestions from code review
illia-vApr 18, 2025
5a22e6b
Merge branch 'main' into SSL_sendfile
illia-vApr 18, 2025
ada3f30
Improve kTLS checks for older OpenSSL
illia-vApr 18, 2025
3350854
Merge branch 'main' into SSL_sendfile
illia-vApr 28, 2025
3339673
Rename `uses_ktls_for_read` to `uses_ktls_for_recv`
illia-vApr 28, 2025
ee573ad
Apply PEP 7
illia-vApr 28, 2025
6795f62
Use an alternative method of returning booleans
illia-vApr 28, 2025
6a35ac6
Mark new functions with `critical_section`
illia-vMay 2, 2025
9dffdbd
Merge two if blocks
illia-vMay 2, 2025
19d5746
Reword docs
illia-vMay 2, 2025
ef3744e
Update the news entry
illia-vMay 2, 2025
e64f329
Use `Py_RETURN_FALSE` again
illia-vMay 2, 2025
028067a
Merge remote-tracking branch 'python/main' into SSL_sendfile
illia-vMay 2, 2025
6e099fa
Merge branch 'main' into SSL_sendfile
illia-vMay 5, 2025
f363ec3
Merge branch 'main' into SSL_sendfile
illia-vMay 19, 2025
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
NextNext commit
Add methods for checking whether kTLS is used
  • Loading branch information
@illia-v
illia-v committedNov 30, 2022
commita018beb537a1a6ac0c1bad6283da371d052b193c
38 changes: 38 additions & 0 deletionsModules/_ssl.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2277,6 +2277,42 @@ PySSL_select(PySocketSockObject *s, int writing, _PyTime_t timeout)
return rc == 0 ? SOCKET_HAS_TIMED_OUT : SOCKET_OPERATION_OK;
}

/*[clinic input]
_ssl._SSLSocket.uses_ktls_for_write

Check if the Kernel TLS data-path is used for sending.
[clinic start generated code]*/

static PyObject *
_ssl__SSLSocket_uses_ktls_for_write_impl(PySSLSocket *self)
/*[clinic end generated code: output=a6c2a790ffd0587e input=156f67420e69b2f9]*/
{
#ifdef BIO_get_ktls_send
int uses = BIO_get_ktls_send(SSL_get_wbio(self->ssl));
return PyBool_FromLong((long)uses);
#else
return Py_False;
#endif
}

/*[clinic input]
_ssl._SSLSocket.uses_ktls_for_read

Check if the Kernel TLS data-path is used for receiving.
[clinic start generated code]*/

static PyObject *
_ssl__SSLSocket_uses_ktls_for_read_impl(PySSLSocket *self)
/*[clinic end generated code: output=140a75033c8316a6 input=0296846b94a57932]*/
{
#ifdef BIO_get_ktls_recv
int uses = BIO_get_ktls_recv(SSL_get_rbio(self->ssl));
return PyBool_FromLong((long)uses);
#else
return Py_False;
#endif
}

/*[clinic input]
_ssl._SSLSocket.write
b: Py_buffer
Expand DownExpand Up@@ -2892,6 +2928,8 @@ static PyGetSetDef ssl_getsetlist[] = {

static PyMethodDef PySSLMethods[] = {
_SSL__SSLSOCKET_DO_HANDSHAKE_METHODDEF
_SSL__SSLSOCKET_USES_KTLS_FOR_WRITE_METHODDEF
_SSL__SSLSOCKET_USES_KTLS_FOR_READ_METHODDEF
_SSL__SSLSOCKET_WRITE_METHODDEF
_SSL__SSLSOCKET_READ_METHODDEF
_SSL__SSLSOCKET_PENDING_METHODDEF
Expand Down
38 changes: 37 additions & 1 deletionModules/clinic/_ssl.c.h
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.


[8]ページ先頭

©2009-2025 Movatter.jp