[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 31/154: combine ifs, fix uninitialized var
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 31/154: combine ifs, fix uninitialized var error |
Date: |
Mon, 19 Aug 2019 10:15:43 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit 34c88c2244f91a4fd1e7feaf3b5b656cc66a25c9
Author: ng0 <address@hidden>
AuthorDate: Fri Jul 19 18:11:40 2019 +0000
combine ifs, fix uninitialized var error
---
src/microhttpd/mhd_send.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 5e529646..f087a326 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -80,7 +80,6 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
bool have_more;
bool use_corknopush;
bool using_tls = false;
- /* The socket. */
MHD_socket s = connection->socket_fd;
ssize_t ret;
const MHD_SCKT_OPT_BOOL_ off_val = 0;
@@ -135,9 +134,7 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
#endif
#if TCP_CORK
- if (use_corknopush)
- {
- if (have_cork && ! want_cork)
+ if ((use_corknopush) && (have_cork && ! want_cork))
{
if (0 == setsockopt (connection->socket_fd,
IPPROTO_TCP,
@@ -160,16 +157,13 @@ MHD_send_on_connection_ (struct MHD_Connection
*connection,
// at least since Linux 2.2 and both can be combined since
// Linux 2.5.71. See tcp(7). No other system in 2019-06 has TCP_CORK.
}
- }
#elif TCP_NOPUSH
/*
* TCP_NOPUSH on FreeBSD is equal to cork on Linux, with the
* exception that we know that TCP_NOPUSH will definitely
* exist and we can disregard TCP_NODELAY unless requested.
*/
- if (use_corknopush)
- {
- if (have_cork && ! want_cork)
+ if ((use_corknopush) && (have_cork && ! want_cork))
{
setsockopt (connection->socket_fd,
IPPROTO_TCP,
@@ -178,12 +172,9 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
sizeof (on_val));
connection->sk_tcp_nodelay_on = false;
}
- }
#endif
#if TCP_NODELAY
- if (! use_corknopush)
- {
- if (! have_cork && want_cork)
+ if ((! use_corknopush) && (! have_cork && want_cork))
{
setsockopt (connection->socket_fd,
IPPROTO_TCP,
@@ -192,12 +183,12 @@ MHD_send_on_connection_ (struct MHD_Connection
*connection,
sizeof (off_val));
connection->sk_tcp_nodelay_on = false;
}
- }
#endif
#ifdef HTTPS_SUPPORT
if (using_tls)
{
+ int i;
if (i > SSIZE_MAX)
i = SSIZE_MAX;
ret = gnutls_record_send (connection->tls_session,
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 10/154: mhd_send: Restructure., (continued)
- [GNUnet-SVN] [libmicrohttpd] 10/154: mhd_send: Restructure., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 27/154: fixes, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 32/154: setsockopt(): check return value., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 21/154: mhd_send.c: Use daemon from connection struct., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 45/154: fix compiler error., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 44/154: remove verbose comments in mhd_send.c, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 55/154: doxygen: MHD_SSO, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 30/154: comments, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 49/154: more OLDSOCK., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 59/154: sendfile and netbsd, comment., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 31/154: combine ifs, fix uninitialized var error,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 62/154: fix errors., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 35/154: use using_tls, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 36/154: implement TCP_NOPUSH branch content, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 34/154: Use s in setsockopt(), gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 38/154: check getsockopt's., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 64/154: move sendfile function work to connection.c, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 58/154: start SENDMSG/WRITEV., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 60/154: doxygen fix., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 57/154: cover the case of TCP_NOPUSH and TCP_CORK coexisting on the same OS., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 56/154: doxygen, links, gnunet, 2019/08/19