Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sess_initialized is never reset #33

Closed
LeSpocky opened this issue Feb 16, 2017 · 0 comments
Closed

sess_initialized is never reset #33

LeSpocky opened this issue Feb 16, 2017 · 0 comments

Comments

@LeSpocky
Copy link
Collaborator

While testing a fix for #25 I saw it does not solve the problem I actually try to solve. 😥

In a classic CGI the process is started, some things are done, the process ends, everything not released by yourself is cleaned up by the operating system. Now if you want to use libcgi together with FastCGI (this requires patches not in mainline yet) the process never ends, but the whole thing is enclosed by an endless loop. In this case the library MUST do proper bookkeeping and cleanup.

So when using libcgi in such a loop the first call to cgi_session_start() sets sess_initialized to true, every following call fails, because sess_initialized is never reset to false, which makes the whole session thing unusable.

There is a second variable sess_finitialized which is never tested and only set to false in cgi_session_destroy(). So even if this is meant to be the same as sess_initialized it would not work, because cgi_session_destroy() is not called every time. Actually most of the time you don't want to destroy your session, but keep it.

So there needs to be a way for resetting those flags and find a proper name for this function.

@LeSpocky LeSpocky added the bug label Feb 16, 2017
@LeSpocky LeSpocky added this to the v1.2 milestone Feb 16, 2017
LeSpocky added a commit to LeSpocky/libcgi that referenced this issue Feb 16, 2017
The flag `sess_initialized` was never reset. After introducing
`cgi_session_free()` we can now reset it. While at it use `stdbool.h`
and make the variable a proper boolean, and also drop the not really
used `sess_finitialized` variable.

fixes rafaelsteil#33

Signed-off-by: Alexander Dahl <[email protected]>
LeSpocky added a commit to LeSpocky/libcgi that referenced this issue Jul 12, 2018
The flag `sess_initialized` was never reset. After introducing
`cgi_session_free()` we can now reset it. While at it use `stdbool.h`
and make the variable a proper boolean, and also drop the not really
used `sess_finitialized` variable.

fixes rafaelsteil#33

Signed-off-by: Alexander Dahl <[email protected]>
LeSpocky added a commit to LeSpocky/libcgi that referenced this issue Jul 12, 2018
The flag `sess_initialized` was never reset. After introducing
`cgi_session_free()` we can now reset it. While at it use `stdbool.h`
and make the variable a proper boolean, and also drop the not really
used `sess_finitialized` variable.

fixes rafaelsteil#33

Signed-off-by: Alexander Dahl <[email protected]>
LeSpocky added a commit to LeSpocky/libcgi that referenced this issue Jul 12, 2018
The flag `sess_initialized` was never reset. After introducing
`cgi_session_free()` we can now reset it. While at it use `stdbool.h`
and make the variable a proper boolean, and also drop the not really
used `sess_finitialized` variable.

fixes rafaelsteil#33

Signed-off-by: Alexander Dahl <[email protected]>
@LeSpocky LeSpocky mentioned this issue Jul 12, 2018
LeSpocky added a commit to LeSpocky/libcgi that referenced this issue Jul 12, 2018
The flag `sess_initialized` was never reset. After introducing
`cgi_session_free()` we can now reset it. While at it use `stdbool.h`
and make the variable a proper boolean, and also drop the not really
used `sess_finitialized` variable.

fixes rafaelsteil#33

Signed-off-by: Alexander Dahl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant