Added update_fd_at_index method

v3.0_unknown_param_crash_fix_4919
Rahim Kanji 10 months ago
parent 6f6d241bb1
commit 857e501ca3

@ -44,6 +44,7 @@ class ProxySQL_Poll {
ProxySQL_Poll();
~ProxySQL_Poll();
void add(uint32_t _events, int _fd, T *_myds, unsigned long long sent_time);
void update_fd_at_index(unsigned int idx, int _fd);
void remove_index_fast(unsigned int i);
int find_index(int fd);
};

@ -126,6 +126,21 @@ void ProxySQL_Poll<T>::add(uint32_t _events, int _fd, T *_myds, unsigned long lo
len++;
}
/**
* @brief Updates the file descriptor (FD) at a specific index in the ProxySQL_Poll object.
*
* This function updates the file descriptor (FD) at a specific index in the ProxySQL_Poll object.
* It does not modify any other associated data or metadata.
*
* @param idx The index of the file descriptor (FD) to update.
* @param _fd The new file descriptor (FD) value.
*/
template<class T>
void ProxySQL_Poll<T>::update_fd_at_index(unsigned int idx, int _fd) {
if ((int)idx == -1 || idx >= len) return;
fds[idx].fd = _fd;
}
/**
* @brief Removes a file descriptor (FD) and its associated MySQL_Data_Stream from the ProxySQL_Poll object.
*

Loading…
Cancel
Save