Cache the app_server port lazily so we don't have to look it up every time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35681 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
2ee4113182
commit
099f9551c7
@ -45,6 +45,7 @@ class LinkSender {
|
||||
status_t FlushCompleted(size_t newBufferSize);
|
||||
|
||||
port_id fPort;
|
||||
port_id fAppServerPort;
|
||||
|
||||
char *fBuffer;
|
||||
size_t fBufferSize;
|
||||
|
@ -39,6 +39,7 @@ namespace BPrivate {
|
||||
LinkSender::LinkSender(port_id port)
|
||||
:
|
||||
fPort(port),
|
||||
fAppServerPort(-1),
|
||||
fBuffer(NULL),
|
||||
fBufferSize(0),
|
||||
|
||||
@ -167,9 +168,11 @@ LinkSender::Attach(const void *passedData, size_t passedSize)
|
||||
port_id port = -1;
|
||||
if (be_app == NULL)
|
||||
port = fPort;
|
||||
else
|
||||
port = get_app_server_port();
|
||||
|
||||
else {
|
||||
if (fAppServerPort < 0)
|
||||
fAppServerPort = get_app_server_port();
|
||||
port = fAppServerPort;
|
||||
}
|
||||
port_info info;
|
||||
status_t result = get_port_info(port, &info);
|
||||
if (result != B_OK)
|
||||
|
Loading…
Reference in New Issue
Block a user