summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--bounce.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/bounce.c b/bounce.c
index 703c566..b96326b 100644
--- a/bounce.c
+++ b/bounce.c
@@ -174,10 +174,17 @@ int main(int argc, char *argv[]) {
 			if (i < binds) {
 				int fd;
 				struct tls *tls = listenAccept(&fd, event.fds[i].fd);
-				eventAdd(fd, clientAlloc(tls));
-				// FIXME: This should only be done after a successful client
-				// registration.
-				if (!clients++) serverFormat("AWAY\r\n");
+				int error = tls_handshake(tls);
+				if (error) {
+					warnx("tls_handshake: %s", tls_error(tls));
+					tls_free(tls);
+					close(fd);
+				} else {
+					eventAdd(fd, clientAlloc(tls));
+					// FIXME: This should only be done after a successful
+					// client registration.
+					if (!clients++) serverFormat("AWAY\r\n");
+				}
 				continue;
 			}
 
91b2b9865&follow=1'>Color rubyStringDelimiter as StringJune McEnroe 2016-08-24Highlight rubyDefine as StructureJune McEnroe 2016-08-23Remove scroll bindings from nvim configJune McEnroe 2016-08-17Highlight Search with black foregroundJune McEnroe 2016-08-15Remove gruvboxJune McEnroe 2016-08-04Remove march from SSH configJune McEnroe 2016-08-01Disable tab indicators in iTermJune McEnroe 2016-07-30Color PreProc DarkGreenJune McEnroe 2016-07-29Color Structure and Typedef in grayJune McEnroe 2016-07-27Color comments DarkBlue and LightBlueJune McEnroe 2016-07-27Color macros in yellowJune McEnroe 2016-07-26Colorscheme colors and schemesJune McEnroe 2016-07-26Add ''subtle'' colorschemeJune McEnroe 2016-07-26Add htoprcJune McEnroe 2016-07-24Add may and refactor ssh configJune McEnroe 2016-07-18Disable cursorlineJune McEnroe 2016-07-18Use hard constrast gruvbox darkJune McEnroe 2016-07-15Remove vim configurationJune McEnroe 2016-07-15Add readline to README configurations listJune McEnroe 2016-07-15Add vendor script to READMEJune McEnroe 2016-07-15Pull latest pathogen and gruvboxJune McEnroe