/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "stream-provider.h"
#include "stream.h"
#include "timeval.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#ifdef _WIN32
/* Ref: https://www.openssl.org/support/faq.html#PROG2
}
}
-static int
-setsockopt_tcp_nodelay(int fd)
-{
- int on = 1;
- int retval;
-
- retval = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof on);
- if (retval) {
- retval = sock_errno();
- VLOG_ERR("setsockopt(TCP_NODELAY): %s", sock_strerror(retval));
- }
- return retval;
-}
-
static int
new_ssl_stream(const char *name, int fd, enum session_type type,
enum ssl_state state, struct stream **streamp)
{
- struct sockaddr_storage local;
- socklen_t local_len = sizeof local;
struct ssl_stream *sslv;
SSL *ssl = NULL;
int retval;
goto error;
}
- /* Get the local IP and port information */
- retval = getsockname(fd, (struct sockaddr *) &local, &local_len);
- if (retval) {
- memset(&local, 0, sizeof local);
- }
-
/* Disable Nagle.
* On windows platforms, this can only be called upon TCP connected.
*/
if (state == STATE_SSL_CONNECTING) {
- retval = setsockopt_tcp_nodelay(fd);
- if (retval) {
- goto error;
- }
+ setsockopt_tcp_nodelay(fd);
}
/* Create and configure OpenSSL stream. */
return retval;
}
sslv->state = STATE_SSL_CONNECTING;
- retval = setsockopt_tcp_nodelay(sslv->fd);
- if (retval) {
- return retval;
- }
+ setsockopt_tcp_nodelay(sslv->fd);
/* Fall through. */
case STATE_SSL_CONNECTING:
poll_fd_wait(pssl->fd, POLLIN);
}
-static int
-pssl_set_dscp(struct pstream *pstream, uint8_t dscp)
-{
- struct pssl_pstream *pssl = pssl_pstream_cast(pstream);
- return set_dscp(pssl->fd, dscp);
-}
-
const struct pstream_class pssl_pstream_class = {
"pssl",
true,
pssl_close,
pssl_accept,
pssl_wait,
- pssl_set_dscp,
};
\f
/*