aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hpcu/main.go6
-rw-r--r--hswc/main.go2
2 files changed, 5 insertions, 3 deletions
diff --git a/hpcu/main.go b/hpcu/main.go
index 3508f63..68d65b2 100644
--- a/hpcu/main.go
+++ b/hpcu/main.go
@@ -3,10 +3,11 @@ package main
import (
"errors"
+ "log"
+
"janouch.name/haven/nexgb"
"janouch.name/haven/nexgb/xfixes"
"janouch.name/haven/nexgb/xproto"
- "log"
)
type selectionState struct {
@@ -288,7 +289,8 @@ func handleSelectionRequest(e xproto.SelectionRequestEvent) {
}
if typ == 0 || len(data) > int(setup.MaximumRequestLength)*4-64 ||
- state.owning == 0 || e.Time < state.owning {
+ state.owning == 0 ||
+ (e.Time != xproto.TimeCurrentTime && e.Time < state.owning) {
// TODO: Use the INCR mechanism for large data transfers instead
// of refusing the request, or at least use PropModeAppend.
//
diff --git a/hswc/main.go b/hswc/main.go
index 275aac6..53725a5 100644
--- a/hswc/main.go
+++ b/hswc/main.go
@@ -31,7 +31,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
return
}
text := r.FormValue("text")
- if len(text) > 64<<10 {
+ if text == "" || len(text) > 64<<10 {
w.WriteHeader(http.StatusBadRequest)
return
}