metadata

Check-in [a43eaed8f7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Bringup; CORS and comment updates
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:a43eaed8f7091b7b73f2b8f8ce8cdff99ba08beb9cf5941b70637631321557e2
User & Date: vandys 2018-06-24 18:07:40
Context
2018-06-24
21:31
Normalize station symbols check-in: d362b2ab54 user: vandys tags: trunk
18:07
Bringup; CORS and comment updates check-in: a43eaed8f7 user: vandys tags: trunk
13:19
Minor typo check-in: 6fca4f6c93 user: vandys tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to stream.py.

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
...
250
251
252
253
254
255
256





257
258
259
260
261
262
263

	# Request it
	sys.stderr.write("sending to %s\n" % (self.host,))
	args = Args + ("%s:%d" % (self.host, self.port)) + "\r\n"
	self.sock.send("GET %s HTTP/1.0\r\n%s\r\n" %
	    (self.path, args))

	# Assemble the HTTP response headers.  We'll likely have
	#  more than that, which will be passed down to the loop
	#  below.
	headers = {}
	while True:
	    l = self.readline()
	    sys.stderr.write(" line %s\n" % (l,))
	    if l is None:
		return
	    if not l:
................................................................................
	sys.exit(0)

    # We're running on a thread for a given HTTP request.
    # Send back metadata, now, or in the future when it
    #  changes (long polling)
    def serve(self, req, gen):






	# If we already have the answer they want, send it back
	# If there's an answer but no thread, this is an idle timeout
	#  from the past.  We wait until we get a new, relevant
	#  answer.
	if self.thread is not None:
	    if self.gen and (gen < self.gen):
		return True,req.send_result(self.json, "application/json")







|
|
<







 







>
>
>
>
>







101
102
103
104
105
106
107
108
109

110
111
112
113
114
115
116
...
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267

	# Request it
	sys.stderr.write("sending to %s\n" % (self.host,))
	args = Args + ("%s:%d" % (self.host, self.port)) + "\r\n"
	self.sock.send("GET %s HTTP/1.0\r\n%s\r\n" %
	    (self.path, args))

	# Assemble the HTTP response headers.  A body probably follows,
	#  which is handled below.

	headers = {}
	while True:
	    l = self.readline()
	    sys.stderr.write(" line %s\n" % (l,))
	    if l is None:
		return
	    if not l:
................................................................................
	sys.exit(0)

    # We're running on a thread for a given HTTP request.
    # Send back metadata, now, or in the future when it
    #  changes (long polling)
    def serve(self, req, gen):

	# We serve many origins
	req.extra_headers.append( ('access-control-allow-origin', '*') )
	req.extra_headers.append( ('access-control-allow-headers',
	 'Origin, Accept, X-Requested-With, Content-Type') )

	# If we already have the answer they want, send it back
	# If there's an answer but no thread, this is an idle timeout
	#  from the past.  We wait until we get a new, relevant
	#  answer.
	if self.thread is not None:
	    if self.gen and (gen < self.gen):
		return True,req.send_result(self.json, "application/json")