daemon/tls: fix handling of GNUTLS_E_AGAIN

The code incorrectly assumes GNUTLS_E_AGAIN can only be caused
by reading the entire libuv buffer. Legitime causes of GNUTLS_E_AGAIN
wouldn't be processed correctly. These could be caused by a new
session ticket sent by the server.

Fixes #489
32 jobs for tls1.3-resumption in 66 minutes and 59 seconds (queued for 5 seconds)
Status Job ID Name Coverage
  Build
passed #286515
amd64 linux docker
archive

00:00:38

passed #286516
amd64 linux docker
build

00:00:46

passed #286517
amd64 linux docker
build-asan

00:00:48

passed #286518
docker
kres-gen

00:00:45

 
  Test
passed #286519
docker delayed
build:darwin

00:01:09

passed #286520
amd64 linux docker
deckard

00:02:16

passed #286521
docker delayed
doc

00:00:58

passed #286522
dind
docker

00:02:15

passed #286523
docker delayed
lint:other

00:00:53

passed #286524
amd64 linux docker delayed
lint:pedantic

00:01:06

passed #286525
amd64 linux docker
lint:scan-build

00:02:17

passed #286526
amd64 linux docker
lint:tidy

00:02:58

passed #286527
privileged
pkg:epel-7

00:02:07

passed #286528
privileged
pkg:fedora-29

00:02:42

passed #286529
amd64 linux docker
respdiff:basic

00:02:23

passed #286530
amd64 linux docker delayed
test:valgrind

00:01:53

 
  Extended
failed #286544
respdiff
fwd-tls6-kresd.udp6

00:17:42

failed #286533
respdiff
fwd-udp6-kresd.udp6

00:12:23

failed #286537
respdiff
fwd-udp6-unbound.tcp6

00:45:25

failed #286538
respdiff
fwd-udp6-unbound.tls6

00:32:55

failed #286536
respdiff
fwd-udp6-unbound.udp6

00:29:54

failed #286543
respdiff
iter.tls6

00:11:43

failed #286534
respdiff
iter.udp6

00:31:25

passed #286531
amd64 linux docker
pytests

00:04:00

failed #286539
respdiff
resperf:fwd-tls6.udp-asan

00:22:19

passed #286540
respdiff
resperf:fwd-udp6.udp-asan

00:17:19

passed #286694
respdiff
resperf:iter.udp-asan

00:00:08

failed #286542
respdiff
fwd-tls6-kresd.udp6

00:12:42

failed #286532
respdiff
fwd-tls6-kresd.udp6

00:20:54

failed #286535
respdiff
iter.tls6

00:41:26

passed #286693
respdiff
resperf:iter.udp-asan

00:00:07

failed #286541
respdiff
resperf:iter.udp-asan

00:21:49

 
Name Stage Failure
failed
fwd-tls6-kresd.udp6 Extended
$ cp -t . respdiff_commitdir/*$RESPDIFF_TEST*.png ||:
$ tar xf respdiff_commitdir/$RESPDIFF_TEST/*histogram.tar.gz ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=95641 revision=de7731dd version=12.1.0
./j*: found 18 matching files

./*.png: found 2 matching files

./*histogram/*: found 6 matching files

Uploading artifacts to coordinator... ok
id=286544 responseStatus=201 Created token=2pzYAMyc
ERROR: Job failed: exit status 1
failed
iter.tls6 Extended
$ cp -t . respdiff_commitdir/*$RESPDIFF_TEST*.png ||:
$ tar xf respdiff_commitdir/$RESPDIFF_TEST/*histogram.tar.gz ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=90877 revision=de7731dd version=12.1.0
./j*: found 19 matching files

./*.png: found 2 matching files

./*histogram/*: found 7 matching files

Uploading artifacts to coordinator... ok
id=286543 responseStatus=201 Created token=KiwVaP1d
ERROR: Job failed: exit status 1
failed
fwd-udp6-unbound.tcp6 Extended
$ cp -t . respdiff_commitdir/*$RESPDIFF_TEST*.png ||:
$ tar xf respdiff_commitdir/$RESPDIFF_TEST/*histogram.tar.gz ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=89778 revision=de7731dd version=12.1.0
./j*: found 18 matching files

./*.png: found 2 matching files

./*histogram/*: found 6 matching files

Uploading artifacts to coordinator... ok
id=286537 responseStatus=201 Created token=s-yw-1aA
ERROR: Job failed: exit status 1
failed
fwd-udp6-unbound.tls6 Extended
$ cp -t . respdiff_commitdir/*$RESPDIFF_TEST*.png ||:
$ tar xf respdiff_commitdir/$RESPDIFF_TEST/*histogram.tar.gz ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=87263 revision=de7731dd version=12.1.0
./j*: found 18 matching files

./*.png: found 2 matching files

./*histogram/*: found 6 matching files

Uploading artifacts to coordinator... ok
id=286538 responseStatus=201 Created token=k4ezeGKh
ERROR: Job failed: exit status 1
failed
iter.udp6 Extended
$ cp -t . respdiff_commitdir/*$RESPDIFF_TEST*.png ||:
$ tar xf respdiff_commitdir/$RESPDIFF_TEST/*histogram.tar.gz ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=87029 revision=de7731dd version=12.1.0
./j*: found 19 matching files

./*.png: found 2 matching files

./*histogram/*: found 7 matching files

Uploading artifacts to coordinator... ok
id=286534 responseStatus=201 Created token=xrzERUyv
ERROR: Job failed: exit status 1
failed
fwd-udp6-unbound.udp6 Extended
$ cp -t . respdiff_commitdir/*$RESPDIFF_TEST*.png ||:
$ tar xf respdiff_commitdir/$RESPDIFF_TEST/*histogram.tar.gz ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=86373 revision=de7731dd version=12.1.0
./j*: found 18 matching files

./*.png: found 2 matching files

./*histogram/*: found 6 matching files

Uploading artifacts to coordinator... ok
id=286536 responseStatus=201 Created token=zDALrBiG
ERROR: Job failed: exit status 1
failed
resperf:fwd-tls6.udp-asan Extended
kresd_fwd_target_1  | SUMMARY: AddressSanitizer: 81952 byte(s) leaked in 2 allocation(s).
$ exit $EXITCODE
Running after script...
$ cp -t . resperf_commitdir/$RESPERF_TEST/j* ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=85389 revision=de7731dd version=12.1.0
./j*: found 7 matching files

Uploading artifacts to coordinator... ok
id=286539 responseStatus=201 Created token=XyyzdRUq
ERROR: Job failed: exit status 1
failed
fwd-udp6-kresd.udp6 Extended
$ cp -t . respdiff_commitdir/*$RESPDIFF_TEST*.png ||:
$ tar xf respdiff_commitdir/$RESPDIFF_TEST/*histogram.tar.gz ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=83888 revision=de7731dd version=12.1.0
./j*: found 18 matching files

./*.png: found 2 matching files

./*histogram/*: found 6 matching files

Uploading artifacts to coordinator... ok
id=286533 responseStatus=201 Created token=J_3dmGU8
ERROR: Job failed: exit status 1