projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7c8ac50
)
with -rev close connection if client sends "CLOSE"
author
Dr. Stephen Henson
<steve@openssl.org>
Mon, 19 Nov 2012 23:41:24 +0000
(23:41 +0000)
committer
Dr. Stephen Henson
<steve@openssl.org>
Mon, 19 Nov 2012 23:41:24 +0000
(23:41 +0000)
apps/s_server.c
patch
|
blob
|
history
diff --git
a/apps/s_server.c
b/apps/s_server.c
index 75cf0c34800233dcd15612260736ab13a76c1829..70cf5d766101a70a5702ceafdf0a1217fc9b69dd 100644
(file)
--- a/
apps/s_server.c
+++ b/
apps/s_server.c
@@
-300,6
+300,7
@@
static int cert_status_cb(SSL *s, void *arg);
static int no_resume_ephemeral = 0;
static int s_msg=0;
static int s_quiet=0;
static int no_resume_ephemeral = 0;
static int s_msg=0;
static int s_quiet=0;
+static int s_ign_eof=0;
static int s_brief=0;
static char *keymatexportlabel=NULL;
static int s_brief=0;
static char *keymatexportlabel=NULL;
@@
-1219,6
+1220,10
@@
int MAIN(int argc, char *argv[])
#endif
s_nbio_test=1;
}
#endif
s_nbio_test=1;
}
+ else if (strcmp(*argv,"-ign_eof") == 0)
+ s_ign_eof=1;
+ else if (strcmp(*argv,"-no_ign_eof") == 0)
+ s_ign_eof=0;
else if (strcmp(*argv,"-debug") == 0)
{ s_debug=1; }
#ifndef OPENSSL_NO_TLSEXT
else if (strcmp(*argv,"-debug") == 0)
{ s_debug=1; }
#ifndef OPENSSL_NO_TLSEXT
@@
-3257,6
+3262,12
@@
static int rev_body(char *hostname, int s, unsigned char *context)
p--;
i--;
}
p--;
i--;
}
+ if (!s_ign_eof && i == 5 && !strncmp(buf, "CLOSE", 5))
+ {
+ ret = 1;
+ BIO_printf(bio_err, "CONNECTION CLOSED\n");
+ goto end;
+ }
BUF_reverse((unsigned char *)buf, NULL, i);
buf[i] = '\n';
BIO_write(io, buf, i + 1);
BUF_reverse((unsigned char *)buf, NULL, i);
buf[i] = '\n';
BIO_write(io, buf, i + 1);