Skip to content
Snippets Groups Projects
Commit 3711e03a authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use volatile keyword to (maybe) fix CID 488122: Data race condition

Ideally, I'd use atomic_bool instead, but we're using an older WinSDK for Win7
compatibility and so... can't.

Perhaps an xpdev 'protected_bool_t' should be created.
parent 3c69875a
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
...@@ -256,7 +256,7 @@ typedef struct { ...@@ -256,7 +256,7 @@ typedef struct {
char host_ip[INET6_ADDRSTRLEN]; char host_ip[INET6_ADDRSTRLEN];
char host_name[128]; /* Resolved remote host */ char host_name[128]; /* Resolved remote host */
int http_ver; /* Request HTTP version. 0 = HTTP/0.9, 1=HTTP/1.0, 2=HTTP/1.1 */ int http_ver; /* Request HTTP version. 0 = HTTP/0.9, 1=HTTP/1.0, 2=HTTP/1.1 */
bool send_failed; volatile bool send_failed;
bool finished; /* Do not accept any more input from client */ bool finished; /* Do not accept any more input from client */
enum parsed_vpath parsed_vpath; /* file area/base access */ enum parsed_vpath parsed_vpath; /* file area/base access */
int libnum; int libnum;
...@@ -640,7 +640,7 @@ static bool session_check(http_session_t *session, bool *rd, bool *wr, unsigned ...@@ -640,7 +640,7 @@ static bool session_check(http_session_t *session, bool *rd, bool *wr, unsigned
return socket_check(session->socket, rd, wr, timeout); return socket_check(session->socket, rd, wr, timeout);
} }
static int sess_sendbuf(http_session_t *session, const char *buf, size_t len, bool *failed) static int sess_sendbuf(http_session_t *session, const char *buf, size_t len, volatile bool *failed)
{ {
size_t sent=0; size_t sent=0;
int tls_sent; int tls_sent;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment