Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix timeout code

  • Loading branch information...
commit 0ac4aade6bdc3e7724b4d704ded05d46da2a92f9 1 parent 9937e6b
John Goerzen authored September 11, 2006

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. 8  pygopherd/initialization.py
8  pygopherd/initialization.py
@@ -21,7 +21,7 @@
21 21
 
22 22
 # Import lots of stuff so it's here before chrooting.
23 23
 import socket, os, sys, SocketServer, re, stat, os.path, UserDict, tempfile
24  
-import time, atexit, errno
  24
+import time, atexit, errno, struct
25 25
 
26 26
 from pygopherd import handlers, protocols, GopherExceptions, logger, sighandlers
27 27
 from pygopherd.protocols import *
@@ -105,11 +105,11 @@ def server_bind(self):
105 105
 
106 106
             # Set a timeout.
107 107
             if config.has_option('pygopherd', 'timeout'):
108  
-                mytimeout = int(config.get('pygopherd', 'timeout'))
  108
+                mytimeout = struct.pack("ll", long(config.get('pygopherd', 'timeout')), 0)
109 109
                 self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO,
110  
-                                       (mytimeout, 0))
  110
+                                       mytimeout)
111 111
                 self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDTIMEO,
112  
-                                       (mytimeout, 0))
  112
+                                       mytimeout)
113 113
                 #self.socket.settimeout(int(config.get('pygopherd', 'timeout')))
114 114
             host, port = self.socket.getsockname()
115 115
             if config.has_option("pygopherd", "servername"):

0 notes on commit 0ac4aad

Please sign in to comment.
Something went wrong with that request. Please try again.