1
0
mirror of https://github.com/golang/go synced 2024-10-01 09:48:32 -06:00
Commit Graph

18 Commits

Author SHA1 Message Date
Brad Fitzpatrick
7d72743fce playground/socket: deflake test, remove sleep
Fixes golang/go#18275

Change-Id: Iedb0a21a3fe0b383a2e51fc92076d7fd005d71e6
Reviewed-on: https://go-review.googlesource.com/34277
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-12-11 02:33:14 +00:00
Andrew Gerrand
8b178a93c1 playground/socket: fix message buffering
Use time.After to avoid the finnicky antics of
correctly resetting a time.Timer.

Fixes golang/go#13749

Change-Id: I3f1ed17a31d981996e2bb7a8155c3ba0ec723c7d
Reviewed-on: https://go-review.googlesource.com/19942
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2016-02-29 11:33:26 +00:00
Andrew Gerrand
823804e1ae playground/socket: only buffer messages of one kind, add tests
Change-Id: I38c2b39fb1090669f8ede7f681f7b1c800111f23
Reviewed-on: https://go-review.googlesource.com/16508
Reviewed-by: jcd . <jcd@golang.org>
2015-10-30 06:08:43 +00:00
Andrew Gerrand
14fd3daae1 playground/socket: fix race condition and goroutine leak
Fixes golang/go#11507

Change-Id: Ifa0a34df02433b3f8a5fb60c4df4eca47750646e
Reviewed-on: https://go-review.googlesource.com/16468
Reviewed-by: jcd . <jcd@golang.org>
2015-10-30 05:20:32 +00:00
Andrew Gerrand
e645bbf898 playground/socket: make output/end race less likely
This doesn't fix the race; doing that would require a bit of a redesign.
Since GopherCon is this week, just put in this stop-gap measure for now.

Update golang/go#11534

Change-Id: Ied6c5dd52778534a7a08b5ba3fa15c0352a65646
Reviewed-on: https://go-review.googlesource.com/11886
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-07-05 21:12:29 +00:00
David Symonds
24257c8cd2 tools: add import comments.
Change-Id: Idda6e64580432cb9a731e4ebf4005ee4ceb4202d
Reviewed-on: https://go-review.googlesource.com/1244
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 22:42:16 +00:00
Andrew Gerrand
5ebbcd132f go.tools: use golang.org/x/... import paths
Rewrite performed with this command:
  sed -i '' 's_code.google.com/p/go\._golang.org/x/_g' \
    $(grep -lr 'code.google.com/p/go.' *)

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/170920043
2014-11-10 08:50:40 +11:00
Francesc Campoy
cf8082eec5 go.tools/playground: return a better message for code starting with a shebang on non local mode
LGTM=adg, dan.kortschak
R=adg, dan.kortschak, campoy
CC=golang-codereviews
https://golang.org/cl/119160043
2014-08-01 15:04:49 -07:00
Shenghou Ma
daba707591 go.tools/playground/socket: fix nacl/arm command line.
nacl_helper_bootstrap_arm doesn't consult $PATH for sel_ldr_arm.

LGTM=adg
R=adg, dan.kortschak
CC=golang-codereviews
https://golang.org/cl/112010044
2014-07-10 00:46:43 -04:00
Robert Daniel Kortschak
ea9b1bd08b go.tools/playground/socket: add support for Native Client on arm
LGTM=minux
R=adg, minux
CC=golang-codereviews
https://golang.org/cl/110900043
2014-07-08 22:40:37 -04:00
Robert Daniel Kortschak
063db5971c go.tools/playground/socket: log connections and code snippet run requests
This logs all successful handshakes and all requests to run code snippets;
it is not immediately obvious how to limit this to non-localhost hosts, or
to instances where publicly available playgrounds are allowed without resorting
to addition of a new global. The level of noise on the log should not be too
great.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/112850043
2014-07-09 12:14:27 +10:00
Robert Daniel Kortschak
34a8e96191 go.tools/playground/socket: add Native Client wrapper handling
LGTM=adg
R=adg, dave, rsc, minux
CC=golang-codereviews
https://golang.org/cl/77240043
2014-07-08 10:44:34 +10:00
Mikio Hara
96cece04e7 go.tools/{cmd/present,playground/socket}: add orighost flag to handle the web origin more flexible
Also fixes the following nits;
- literal IPv6 address handling
- URL host component handling in the case of a wildcard listen
- URL port component handling in the case of no port component in origin

Fixes golang/go#8096.

LGTM=dan.kortschak, adg
R=adg, golang-codereviews, dan.kortschak
CC=golang-codereviews
https://golang.org/cl/102770046
2014-06-02 21:39:33 +09:00
Andrew Gerrand
3d0528640b go.tools/playground/socket: require origin to set up socket handler
This prevents cross-site request forgery attacks.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/95030044
2014-05-05 08:42:12 -07:00
Robert Daniel Kortschak
84fae1b215 go.tools/playground: provide script-safe option for playground
This change allows code to be sent safely to a partially sandboxed playground using the Native Client environment.

Execution of non-Go code is blocked when the RunScripts is false to prevent inclusion of code that might escape by virtue of being under a different runtime environment.

Two options for communicating whether to prevent non-Go code were considered: as has been done here and alternatively, using a message field. The latter was not chosen to close that as an attack option.

Another will be follow that adds a -nacl flag to the present command to allow sandboxing of playground code in presentations.

See discussion here: https://groups.google.com/d/topic/golang-dev/Hy-7PBP-T4Q/

LGTM=adg
R=adg, dave
CC=golang-codereviews
https://golang.org/cl/74740045
2014-03-17 16:57:36 +11:00
Francesc Campoy
ca8198c132 go.tools/playground: parse shebang correctly
Fixes golang/go#7321.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/63560043
2014-02-18 09:44:12 -08:00
Francesc Campoy
fea69e5bab go.tools/present: add support for non Go code execution
R=adg, r
CC=golang-dev
https://golang.org/cl/14615043
2013-10-14 14:14:08 -07:00
Andrew Gerrand
b605e38d5d go.tools/playground/socket: move package from go.talks
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/13244049
2013-09-19 10:59:00 +10:00