cf-socket: improve SO_SNDBUF update for Winsock

- Rename: Curl_sndbufset => Curl_sndbuf_init

- Rename: win_update_buffer_size => win_update_sndbuf_size

- Save the last set SO_SNDBUF size to compare against so that we can
  avoid setsockopt calls every second.

This is a follow-up to 0b520e12 which moved the SO_SNDBUF update check
into cf-socket. This change improves it further by making the function
names easier to understand and reducing the amount of setsockopt calls.

Closes https://github.com/curl/curl/pull/13827
This commit is contained in:
Jay Satiro 2024-05-26 14:56:24 -04:00
parent dace891e38
commit acb9effcdd
3 changed files with 35 additions and 31 deletions

View file

@ -81,9 +81,9 @@ int Curl_socket_close(struct Curl_easy *data, struct connectdata *conn,
Buffer Size
*/
void Curl_sndbufset(curl_socket_t sockfd);
void Curl_sndbuf_init(curl_socket_t sockfd);
#else
#define Curl_sndbufset(y) Curl_nop_stmt
#define Curl_sndbuf_init(y) Curl_nop_stmt
#endif
/**