This repository was archived by the owner on Oct 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
Fix segment fault when swoole request header is empty. #374
Merged
Conversation
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
是否兼容fpm和swoole两种模式? |
fpm模式本来就有这个判断: SkyAPM-php-sdk/src/sky_utils.cc Line 51 in 4006b88
|
It should be reminded that the peer format is IP:PORT |
$request->server没有server_addr这个字段哦 |
Or hostname |
那就用 |
可以试试获取到的信息是什么。 |
比如你请求http://www.example.com/, 是不是应该 www.example.com:80 |
heyanlong
approved these changes
May 27, 2021
src/sky_module.cc
Outdated
peer = Z_STRVAL_P(peer_val); | ||
} else { | ||
peer_val = zend_hash_str_find(Z_ARRVAL_P(swoole_server), "server_port", sizeof("server_port") - 1); | ||
peer = ":" + std::to_string(Z_LVAL_P(peer_val)); |
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.
No ip?
heyanlong
added a commit
that referenced
this pull request
Jul 21, 2021
Feature: Redis bitpos/bitop/setbit/getbit/incrby/decrby/incrbyfloat/setrange/getrange/mset/msetnx/eval (#367) Fix: #372 (#373) Feature: gRPC static library (#375) Fix: sky_curl_setopt_handler (#378) Fix: segment fault when swoole request header is empty. (#374) Fix: #377 (#381) Feature: Skywalking-eyes (#368) Feature: Swoft (#395)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
某些情况下请求的header可能为空(比如rancher的探针),会导致程序segment fault,所以加上了判断。