Skip to content

Commit 8552e9b

Browse files
dschoGit for Windows Build Agent
authored andcommitted
Merge pull request #3864 from dscho/fix-win-build-with-gcc-12-on-top-of-v2.36.1
ci: fix `windows-build` with GCC v12.x
2 parents f21b66a + bc65862 commit 8552e9b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

http.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,32 @@ void run_active_slot(struct active_request_slot *slot)
14211421
select(max_fd+1, &readfds, &writefds, &excfds, &select_timeout);
14221422
}
14231423
}
1424+
1425+
/*
1426+
* The value of slot->finished we set before the loop was used
1427+
* to set our "finished" variable when our request completed.
1428+
*
1429+
* 1. The slot may not have been reused for another requst
1430+
* yet, in which case it still has &finished.
1431+
*
1432+
* 2. The slot may already be in-use to serve another request,
1433+
* which can further be divided into two cases:
1434+
*
1435+
* (a) If call run_active_slot() hasn't been called for that
1436+
* other request, slot->finished would have been cleared
1437+
* by get_active_slot() and has NULL.
1438+
*
1439+
* (b) If the request did call run_active_slot(), then the
1440+
* call would have updated slot->finished at the beginning
1441+
* of this function, and with the clearing of the member
1442+
* below, we would find that slot->finished is now NULL.
1443+
*
1444+
* In all cases, slot->finished has no useful information to
1445+
* anybody at this point. Some compilers warn us for
1446+
* attempting to smuggle a pointer that is about to become
1447+
* invalid, i.e. &finished. We clear it here to assure them.
1448+
*/
1449+
slot->finished = NULL;
14241450
}
14251451

14261452
static void release_active_slot(struct active_request_slot *slot)

0 commit comments

Comments
 (0)