[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: -add state, close sockets
From: |
gnunet |
Subject: |
[gnunet] branch master updated: -add state, close sockets |
Date: |
Thu, 06 Aug 2020 17:45:10 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new b12644f83 -add state, close sockets
b12644f83 is described below
commit b12644f83637c2508a11927490ae0b94d8ee4095
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Thu Aug 6 17:39:02 2020 +0200
-add state, close sockets
---
src/rest/gnunet-rest-server.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c
index 436b5b205..8a1c7e32f 100644
--- a/src/rest/gnunet-rest-server.c
+++ b/src/rest/gnunet-rest-server.c
@@ -208,6 +208,11 @@ struct AcceptedRequest
* Connection
*/
struct MhdConnectionHandle *con_handle;
+
+ /**
+ * State
+ */
+ int socket_with_mhd;
};
/**
@@ -310,7 +315,13 @@ cleanup_ar (struct AcceptedRequest *ar)
{
cleanup_handle (ar->con_handle);
}
- GNUNET_NETWORK_socket_free_memory_only_ (ar->sock);
+ if (GNUNET_YES == ar->socket_with_mhd)
+ {
+ GNUNET_NETWORK_socket_free_memory_only_ (ar->sock);
+ } else {
+ GNUNET_NETWORK_socket_close (ar->sock);
+ }
+ ar->sock = NULL;
GNUNET_CONTAINER_DLL_remove (req_list_head,
req_list_tail,
ar);
@@ -529,7 +540,7 @@ create_response (void *cls,
MHD_suspend_connection (con_handle->con);
return MHD_YES;
}
- MHD_resume_connection (con_handle->con);
+ //MHD_resume_connection (con_handle->con);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Queueing response from plugin with MHD\n");
// Handle Preflights for extensions
@@ -767,7 +778,7 @@ mhd_completed_cb (void *cls,
cleanup_handle (ar->con_handle);
ar->con_handle = NULL;
}
- schedule_httpd ();
+ ar->socket_with_mhd = GNUNET_YES;
*con_cls = NULL;
}
@@ -882,6 +893,7 @@ do_accept (void *cls)
else
GNUNET_assert (0);
ar = GNUNET_new (struct AcceptedRequest);
+ ar->socket_with_mhd = GNUNET_YES;
ar->sock = GNUNET_NETWORK_socket_accept (lsock, NULL, NULL);
if (NULL == ar->sock)
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: -add state, close sockets,
gnunet <=