-
-
Notifications
You must be signed in to change notification settings - Fork 596
Fix wrong file handler for response write #1049
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
Conversation
…en switching between PIPE_WAIT and PIPE_NO_WAIT. Indicate logged values are hex not decimal.
…c prefix, but do report the full path to logs.
src/base/ctrl_socket.c
Outdated
| SetNamedPipeHandleState(XG_BASE(control_socket_h), &lpMode, NULL, NULL); | ||
| lpMode = PIPE_TYPE_BYTE | PIPE_WAIT; | ||
| if (!SetNamedPipeHandleState(XG_BASE(control_socket_h), &lpMode, NULL, NULL)) { | ||
| xdebug_log_ex(XLOG_CHAN_CONFIG, XLOG_WARN, "CTRL-RECV", "Can't set NP handle state to 0x%x: 0x%x", lpMode, GetLastError()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a warning, and not an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as below. Changed.
src/base/ctrl_socket.c
Outdated
| SetNamedPipeHandleState(XG_BASE(control_socket_h), &lpMode, NULL, NULL); | ||
| lpMode = PIPE_TYPE_BYTE | PIPE_NOWAIT; | ||
| if (!SetNamedPipeHandleState(XG_BASE(control_socket_h), &lpMode, NULL, NULL)) { | ||
| xdebug_log_ex(XLOG_CHAN_CONFIG, XLOG_WARN, "CTRL-RECV", "Can't (post)set NP handle state to 0x%x: 0x%x", lpMode, GetLastError()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto: Why is this a warning, and not an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should never happen, and if it does, things might still work. But I changed to XLOG_ERR.
src/base/ctrl_socket.c
Outdated
| } | ||
|
|
||
| xdebug_log_ex(XLOG_CHAN_CONFIG, XLOG_INFO, "CTRL-OK", "Control socket set up successfully: '%s'", XG_BASE(control_socket_path)); | ||
| xdebug_log_ex(XLOG_CHAN_CONFIG, XLOG_INFO, "CTRL-OK", "Control socket set up successfully: '\\\\.\\pipe\\%s'", XG_BASE(control_socket_path)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you xdfree(name) after this, you don't have to re-introduce the \\\\.\\pipe\\ part, and you can just use name instead. But you also will have to free it before the return; in line 495/504.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code, your preferences. Changed.
* pr/1049: Reorder xdfree(name) and removing trailing whitespace Tweak comments to use /* .. */ style Reuse created \\.\pipe name Change log level for failing SetNamedPipeHandleState Store the control_socket_path internally without the platform specific prefix, but do report the full path to logs. Fix wrong usage of SetNamedPipeHandleState and log possible errors when switching between PIPE_WAIT and PIPE_NO_WAIT. Indicate logged values are hex not decimal. Fix wrong file handler for response write
|
I've merged this after a rebase and a few tweaks (I prefer use the Thanks! |
No description provided.