ofproto: Inline trivial functions.
[sliver-openvswitch.git] / lib / stream-ssl.c
index ddf388f..7a0d218 100644 (file)
@@ -60,8 +60,6 @@
  * compiled with /MD is not tested. */
 #include <openssl/applink.c>
 #define SHUT_RDWR SD_BOTH
-#else
-#define closesocket close
 #endif
 
 VLOG_DEFINE_THIS_MODULE(stream_ssl);
@@ -652,14 +650,15 @@ ssl_do_tx(struct stream *stream)
 
     for (;;) {
         int old_state = SSL_get_state(sslv->ssl);
-        int ret = SSL_write(sslv->ssl, sslv->txbuf->data, sslv->txbuf->size);
+        int ret = SSL_write(sslv->ssl,
+                            ofpbuf_data(sslv->txbuf), ofpbuf_size(sslv->txbuf));
         if (old_state != SSL_get_state(sslv->ssl)) {
             sslv->rx_want = SSL_NOTHING;
         }
         sslv->tx_want = SSL_NOTHING;
         if (ret > 0) {
             ofpbuf_pull(sslv->txbuf, ret);
-            if (sslv->txbuf->size == 0) {
+            if (ofpbuf_size(sslv->txbuf) == 0) {
                 return 0;
             }
         } else {
@@ -1416,18 +1415,6 @@ ssl_protocol_cb(int write_p, int version OVS_UNUSED, int content_type,
     ds_destroy(&details);
 }
 
-/* In Windows platform, errno is not set for socket calls.
- * The last error has to be gotten from WSAGetLastError(). */
-static int
-sock_errno(void)
-{
-#ifdef _WIN32
-    return WSAGetLastError();
-#else
-    return errno;
-#endif
-}
-
 static void
 clear_handle(int fd OVS_UNUSED, HANDLE wevent OVS_UNUSED)
 {