Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8dc2429b
Commit
8dc2429b
authored
Jun 28, 2003
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #751916: Check for signals, fix some refcounting errors.
parent
0315f47b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
Modules/_ssl.c
Modules/_ssl.c
+13
-2
No files found.
Modules/_ssl.c
View file @
8dc2429b
...
@@ -245,14 +245,17 @@ newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file)
...
@@ -245,14 +245,17 @@ newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file)
ret
=
SSL_connect
(
self
->
ssl
);
ret
=
SSL_connect
(
self
->
ssl
);
err
=
SSL_get_error
(
self
->
ssl
,
ret
);
err
=
SSL_get_error
(
self
->
ssl
,
ret
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
if
(
PyErr_CheckSignals
())
{
goto
fail
;
}
if
(
err
==
SSL_ERROR_WANT_READ
)
{
if
(
err
==
SSL_ERROR_WANT_READ
)
{
timedout
=
wait_for_timeout
(
Sock
,
0
);
timedout
=
wait_for_timeout
(
Sock
,
0
);
}
else
if
(
err
==
SSL_ERROR_WANT_WRITE
)
{
}
else
if
(
err
==
SSL_ERROR_WANT_WRITE
)
{
timedout
=
wait_for_timeout
(
Sock
,
1
);
timedout
=
wait_for_timeout
(
Sock
,
1
);
}
}
if
(
timedout
)
{
if
(
timedout
)
{
PyErr_SetString
(
PySSLErrorObject
,
"The connect operation timed out"
)
;
errstr
=
"The connect operation timed out"
;
return
NULL
;
goto
fail
;
}
}
}
while
(
err
==
SSL_ERROR_WANT_READ
||
err
==
SSL_ERROR_WANT_WRITE
);
}
while
(
err
==
SSL_ERROR_WANT_READ
||
err
==
SSL_ERROR_WANT_WRITE
);
if
(
ret
<=
0
)
{
if
(
ret
<=
0
)
{
...
@@ -387,6 +390,9 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
...
@@ -387,6 +390,9 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
len
=
SSL_write
(
self
->
ssl
,
data
,
len
);
len
=
SSL_write
(
self
->
ssl
,
data
,
len
);
err
=
SSL_get_error
(
self
->
ssl
,
len
);
err
=
SSL_get_error
(
self
->
ssl
,
len
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
if
(
PyErr_CheckSignals
())
{
return
NULL
;
}
if
(
err
==
SSL_ERROR_WANT_READ
)
{
if
(
err
==
SSL_ERROR_WANT_READ
)
{
timedout
=
wait_for_timeout
(
self
->
Socket
,
0
);
timedout
=
wait_for_timeout
(
self
->
Socket
,
0
);
}
else
if
(
err
==
SSL_ERROR_WANT_WRITE
)
{
}
else
if
(
err
==
SSL_ERROR_WANT_WRITE
)
{
...
@@ -434,6 +440,10 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
...
@@ -434,6 +440,10 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
count
=
SSL_read
(
self
->
ssl
,
PyString_AsString
(
buf
),
len
);
count
=
SSL_read
(
self
->
ssl
,
PyString_AsString
(
buf
),
len
);
err
=
SSL_get_error
(
self
->
ssl
,
count
);
err
=
SSL_get_error
(
self
->
ssl
,
count
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
if
(
PyErr_CheckSignals
())
{
Py_DECREF
(
buf
);
return
NULL
;
}
if
(
err
==
SSL_ERROR_WANT_READ
)
{
if
(
err
==
SSL_ERROR_WANT_READ
)
{
timedout
=
wait_for_timeout
(
self
->
Socket
,
0
);
timedout
=
wait_for_timeout
(
self
->
Socket
,
0
);
}
else
if
(
err
==
SSL_ERROR_WANT_WRITE
)
{
}
else
if
(
err
==
SSL_ERROR_WANT_WRITE
)
{
...
@@ -441,6 +451,7 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
...
@@ -441,6 +451,7 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
}
}
if
(
timedout
)
{
if
(
timedout
)
{
PyErr_SetString
(
PySSLErrorObject
,
"The read operation timed out"
);
PyErr_SetString
(
PySSLErrorObject
,
"The read operation timed out"
);
Py_DECREF
(
buf
);
return
NULL
;
return
NULL
;
}
}
}
while
(
err
==
SSL_ERROR_WANT_READ
||
err
==
SSL_ERROR_WANT_WRITE
);
}
while
(
err
==
SSL_ERROR_WANT_READ
||
err
==
SSL_ERROR_WANT_WRITE
);
...
...
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