mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 08:50:37 +00:00
Kernel: Let pending socket queue keep socket objects alive until accept()
This commit is contained in:
parent
54ceabd48d
commit
a53437aa06
Notes:
sideshowbarker
2024-07-19 12:48:41 +09:00
Author: https://github.com/deoxxa Commit: https://github.com/SerenityOS/serenity/commit/a53437aa066 Pull-request: https://github.com/SerenityOS/serenity/pull/421 Reviewed-by: https://github.com/awesomekling ✅
2 changed files with 4 additions and 4 deletions
|
@ -52,7 +52,7 @@ RefPtr<Socket> Socket::accept()
|
|||
return client;
|
||||
}
|
||||
|
||||
KResult Socket::queue_connection_from(Socket& peer)
|
||||
KResult Socket::queue_connection_from(NonnullRefPtr<Socket> peer)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
if (m_pending.size() >= m_backlog)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/HashTable.h>
|
||||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <Kernel/FileSystem/File.h>
|
||||
#include <Kernel/KResult.h>
|
||||
#include <Kernel/Lock.h>
|
||||
|
@ -68,7 +68,7 @@ public:
|
|||
protected:
|
||||
Socket(int domain, int type, int protocol);
|
||||
|
||||
KResult queue_connection_from(Socket&);
|
||||
KResult queue_connection_from(NonnullRefPtr<Socket>);
|
||||
|
||||
void load_receive_deadline();
|
||||
void load_send_deadline();
|
||||
|
@ -95,7 +95,7 @@ private:
|
|||
timeval m_receive_deadline { 0, 0 };
|
||||
timeval m_send_deadline { 0, 0 };
|
||||
|
||||
Vector<RefPtr<Socket>> m_pending;
|
||||
NonnullRefPtrVector<Socket> m_pending;
|
||||
};
|
||||
|
||||
class SocketHandle {
|
||||
|
|
Loading…
Reference in a new issue