Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e54730

Browse files
committed
Repair badly formatted code.
1 parent 6fc13d9 commit 4e54730

1 file changed

Lines changed: 17 additions & 19 deletions

File tree

Modules/_ssl.c

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,40 +87,40 @@ PySSL_SetError(PySSLObject *obj, int ret)
8787
switch (err) {
8888
case SSL_ERROR_ZERO_RETURN:
8989
errstr = "TLS/SSL connection has been closed";
90-
p=PY_SSL_ERROR_ZERO_RETURN;
90+
p = PY_SSL_ERROR_ZERO_RETURN;
9191
break;
9292
case SSL_ERROR_WANT_READ:
9393
errstr = "The operation did not complete (read)";
94-
p=PY_SSL_ERROR_WANT_READ;
94+
p = PY_SSL_ERROR_WANT_READ;
9595
break;
9696
case SSL_ERROR_WANT_WRITE:
97-
p=PY_SSL_ERROR_WANT_WRITE;
97+
p = PY_SSL_ERROR_WANT_WRITE;
9898
errstr = "The operation did not complete (write)";
9999
break;
100100
case SSL_ERROR_WANT_X509_LOOKUP:
101-
p=PY_SSL_ERROR_WANT_X509_LOOKUP;
101+
p = PY_SSL_ERROR_WANT_X509_LOOKUP;
102102
errstr = "The operation did not complete (X509 lookup)";
103103
break;
104104
case SSL_ERROR_WANT_CONNECT:
105-
p=PY_SSL_ERROR_WANT_CONNECT;
105+
p = PY_SSL_ERROR_WANT_CONNECT;
106106
errstr = "The operation did not complete (connect)";
107107
break;
108108
case SSL_ERROR_SYSCALL:
109109
{
110110
unsigned long e = ERR_get_error();
111-
if(e==0){
112-
if(ret==0){
113-
p=PY_SSL_ERROR_EOF;
111+
if (e == 0) {
112+
if (ret == 0) {
113+
p = PY_SSL_ERROR_EOF;
114114
errstr = "EOF occurred in violation of protocol";
115-
}else if(ret==-1){
115+
} else if (ret == -1) {
116116
/* the underlying BIO reported an I/O error */
117117
return obj->Socket->errorhandler();
118-
}else{ /* possible? */
119-
p=PY_SSL_ERROR_SYSCALL;
118+
} else { /* possible? */
119+
p = PY_SSL_ERROR_SYSCALL;
120120
errstr = "Some I/O error occurred";
121121
}
122122
} else {
123-
p=PY_SSL_ERROR_SYSCALL;
123+
p = PY_SSL_ERROR_SYSCALL;
124124
/* XXX Protected by global interpreter lock */
125125
errstr = ERR_error_string(e, NULL);
126126
}
@@ -129,17 +129,17 @@ PySSL_SetError(PySSLObject *obj, int ret)
129129
case SSL_ERROR_SSL:
130130
{
131131
unsigned long e = ERR_get_error();
132-
p=PY_SSL_ERROR_SSL;
133-
if (e !=0) {
132+
p = PY_SSL_ERROR_SSL;
133+
if (e != 0)
134134
/* XXX Protected by global interpreter lock */
135135
errstr = ERR_error_string(e, NULL);
136-
} else { /* possible? */
137-
errstr="A failure in the SSL library occurred";
136+
else { /* possible? */
137+
errstr = "A failure in the SSL library occurred";
138138
}
139139
break;
140140
}
141141
default:
142-
p=PY_SSL_ERROR_INVALID_ERROR_CODE;
142+
p = PY_SSL_ERROR_INVALID_ERROR_CODE;
143143
errstr = "Invalid error code";
144144
}
145145
n = PyInt_FromLong((long) p);
@@ -162,7 +162,6 @@ PySSL_SetError(PySSLObject *obj, int ret)
162162
return NULL;
163163
}
164164

165-
/* This is a C function to be called for new object initialization */
166165
static PySSLObject *
167166
newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file)
168167
{
@@ -238,7 +237,6 @@ newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file)
238237
return NULL;
239238
}
240239

241-
/* This is the Python function called for new object initialization */
242240
static PyObject *
243241
PySocket_ssl(PyObject *self, PyObject *args)
244242
{

0 commit comments

Comments
 (0)