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
88ed640f
Commit
88ed640f
authored
Apr 09, 2015
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23834: Fix the default socket timeout
Use -1 second by default, not -1 nanosecond.
parent
da5cbe65
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
Include/pytime.h
Include/pytime.h
+6
-1
Modules/socketmodule.c
Modules/socketmodule.c
+2
-1
No files found.
Include/pytime.h
View file @
88ed640f
...
...
@@ -67,7 +67,12 @@ PyAPI_FUNC(int) _PyTime_ObjectToTimespec(
/* Create a timestamp from a number of seconds. */
PyAPI_FUNC
(
_PyTime_t
)
_PyTime_FromSeconds
(
int
ns
);
PyAPI_FUNC
(
_PyTime_t
)
_PyTime_FromSeconds
(
int
seconds
);
/* Macro to create a timestamp from a number of seconds, no integer overflow.
Only use the macro for small values, prefer _PyTime_FromSeconds(). */
#define _PYTIME_FROMSECONDS(seconds) \
((_PyTime_t)(seconds) * (1000 * 1000 * 1000))
/* Create a timestamp from a number of nanoseconds. */
PyAPI_FUNC
(
_PyTime_t
)
_PyTime_FromNanoseconds
(
PY_LONG_LONG
ns
);
...
...
Modules/socketmodule.c
View file @
88ed640f
...
...
@@ -839,7 +839,8 @@ sock_call(PySocketSockObject *s,
/* Initialize a new socket object. */
static
_PyTime_t
defaulttimeout
=
-
1
;
/* Default timeout for new sockets */
/* Default timeout for new sockets */
static
_PyTime_t
defaulttimeout
=
_PYTIME_FROMSECONDS
(
-
1
);
static
void
init_sockobject
(
PySocketSockObject
*
s
,
...
...
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