Only look for socket connections to X server.#939
Merged
Lekensteyn merged 2 commits intoBumblebee-Project:developfrom Aug 12, 2018
Merged
Only look for socket connections to X server.#939Lekensteyn merged 2 commits intoBumblebee-Project:developfrom
Lekensteyn merged 2 commits intoBumblebee-Project:developfrom
Conversation
|
Please merge this. Spent the better part of two days trying to figure out why Bumblebee seemed to work only 20% of the time before finding this. For any other person looking for a workaround, adding |
Lekensteyn
requested changes
Aug 11, 2018
src/bbsecondary.c
Outdated
| time_t xtimer = time(0); | ||
| Display * xdisp = 0; | ||
| char unix_x_display[5 + sizeof(bb_config.x_display)] = "unix/"; | ||
| strcat(unix_x_display, bb_config.x_display); |
Member
There was a problem hiding this comment.
sizeof(bb_config.c_display) is not correct, it gives the size of a pointer. Also strcat should not be used due to the risk of a buffer overrun.
What about:
char unix_x_display[16];
snprintf(unix_x_display, sizeof(unix_x_display), "unix/%s", bb_config.x_display);Alternatively, you could set g_strdup_printf("unix/%s", bb_config.x_display), but that needs to be freed afterwards.
Author
There was a problem hiding this comment.
Thanks for catching that; I don't do much C.
Fixed as requested.
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XOpenDisplaytries all protocolls in turn (socket, IPv4, IPv6) [1]. This can lead to delays and timeouts, especially on systems with incomplete/etc/hosts(eg. missinglocalhost→127.0.0.1), due to the fact that the hostname has to be resolved.Since we start the X server not accepting TCP connections, we can pass the protocoll to
XOpenDisplay.Closes #782.
[1] http://xwindow.angelfire.com/page2.html