diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-06-17 20:09:52 +0200 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-06-25 08:01:47 +0000 |
commit | 8289ed69b7c77305a32ea1a9803d26f8f85898a1 (patch) | |
tree | 441e0302f2f3a339fb9b95096b52b9b7e1d1b78d | |
parent | 883c72f9a69ac3ccf591742327c3e425e47a8ea0 (diff) | |
download | libmicrohttpd-8289ed69b7c77305a32ea1a9803d26f8f85898a1.tar.gz libmicrohttpd-8289ed69b7c77305a32ea1a9803d26f8f85898a1.zip |
provide example for use of getsockopt to get MSS
-rw-r--r-- | src/microhttpd/mhd_send.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c index 4af5680c..70a9bc16 100644 --- a/src/microhttpd/mhd_send.c +++ b/src/microhttpd/mhd_send.c | |||
@@ -102,7 +102,7 @@ MHD_send_on_connection_ (struct MHD_Connection *connection, | |||
102 | { | 102 | { |
103 | opt1 = 1; | 103 | opt1 = 1; |
104 | opt2 = sizeof (int); | 104 | opt2 = sizeof (int); |
105 | /* | 105 | /* |
106 | * TODO: It is possible that Solaris/SunOS depending on | 106 | * TODO: It is possible that Solaris/SunOS depending on |
107 | * the linked library needs a different setsockopt usage: | 107 | * the linked library needs a different setsockopt usage: |
108 | * https://stackoverflow.com/questions/48670299/setsockopt-usage-in-linux-and-solaris-invalid-argument-in-solaris | 108 | * https://stackoverflow.com/questions/48670299/setsockopt-usage-in-linux-and-solaris-invalid-argument-in-solaris |
@@ -131,7 +131,7 @@ MHD_send_on_connection_ (struct MHD_Connection *connection, | |||
131 | */ | 131 | */ |
132 | if (! connection->sk_tcp_cork_nopush_on) | 132 | if (! connection->sk_tcp_cork_nopush_on) |
133 | { | 133 | { |
134 | /* | 134 | /* |
135 | * corking boolean is false. We want to enable | 135 | * corking boolean is false. We want to enable |
136 | * Corking then. | 136 | * Corking then. |
137 | */ | 137 | */ |
@@ -286,8 +286,19 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection, | |||
286 | // return -1 | 286 | // return -1 |
287 | // return numBytes | 287 | // return numBytes |
288 | // -- </pseudo> | 288 | // -- </pseudo> |
289 | struct tcp_info *tcp_; | 289 | struct tcp_info tcp_; |
290 | size_t opt1, opt2, length; | 290 | size_t opt1, opt2, length; |
291 | |||
292 | if (0 == | ||
293 | getsockopt (connection->socket, | ||
294 | TCP_INFO, | ||
295 | IPPROTO_TCP, | ||
296 | &tcp_, | ||
297 | sizeof (tcp_))) | ||
298 | { | ||
299 | // mss = tcp_.tcpi_snd_mss; | ||
300 | } | ||
301 | |||
291 | switch (MHD_SendSocketOptions) | 302 | switch (MHD_SendSocketOptions) |
292 | { | 303 | { |
293 | case MHD_SSO_NO_CORK: | 304 | case MHD_SSO_NO_CORK: |