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
27 jobs for <span class="ref-name">tls1.3-resumption</span> in 86 minutes and 27 seconds (queued for 4 seconds)
Status Job ID Name Coverage
  Build
passed #286097
docker linux amd64
archive

00:00:39

passed #286098
docker linux amd64
build

00:00:47

passed #286099
docker linux amd64
build-asan

00:00:48

passed #286100
docker
kres-gen

00:00:45

 
  Test
passed #286101
docker delayed
build:darwin

00:01:09

passed #286102
docker linux amd64
deckard

00:02:21

passed #286103
docker delayed
doc

00:00:59

passed #286104
dind
docker

00:02:25

passed #286105
docker delayed
lint:other

00:00:57

passed #286106
docker linux amd64 delayed
lint:pedantic

00:00:59

passed #286107
docker linux amd64
lint:scan-build

00:02:25

passed #286108
docker linux amd64
lint:tidy

00:03:01

passed #286109
privileged
pkg:epel-7

00:02:16

passed #286110
privileged
pkg:fedora-29

00:02:49

passed #286111
docker linux amd64
respdiff:basic

00:02:37

passed #286112
docker linux amd64 delayed
test:valgrind

00:01:55

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

01:07:23

passed #286115
respdiff
fwd-udp6-kresd.udp6

01:00:23

passed #286119
respdiff
fwd-udp6-unbound.tcp6

01:12:26

passed #286120
respdiff
fwd-udp6-unbound.tls6

01:17:57

passed #286118
respdiff
fwd-udp6-unbound.udp6

01:21:27

passed #286117
respdiff
iter.tls6

01:17:26

passed #286116
respdiff
iter.udp6

01:02:25

passed #286113
docker linux amd64
pytests

00:04:03

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

01:03:21

failed #286122
respdiff
resperf:fwd-udp6.udp-asan

01:07:21

passed #286123
respdiff
resperf:iter.udp-asan

01:02:50

 
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=148280 revision=d0b76032 version=12.0.2
./j*: found 18 matching files
./*.png: found 2 matching files
./*histogram/*: found 6 matching files
Uploading artifacts to coordinator... ok id=286114 responseStatus=201 Created token=cEyccEPr
ERROR: Job failed: exit status 1
failed
resperf:fwd-udp6.udp-asan Extended
kresd_fwd_target_1  | SUMMARY: AddressSanitizer: 65600 byte(s) leaked in 4 allocation(s).
$ exit $EXITCODE
Running after script...
$ cp -t . resperf_commitdir/$RESPERF_TEST/j* ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=148243 revision=d0b76032 version=12.0.2
./j*: found 7 matching files
Uploading artifacts to coordinator... ok id=286122 responseStatus=201 Created token=ZBmqZnZx
ERROR: Job failed: exit status 1
failed
resperf:fwd-tls6.udp-asan Extended
Attaching to dir_11125_kresd_fwd_target_1, dir_11125_kresd_1
$ exit $EXITCODE
Running after script...
$ cp -t . resperf_commitdir/$RESPERF_TEST/j* ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=147633 revision=d0b76032 version=12.0.2
./j*: found 7 matching files
Uploading artifacts to coordinator... ok id=286121 responseStatus=201 Created token=au1zUn-Q
ERROR: Job failed: exit status 139