update: MSG_MORE flag for send function

This commit is contained in:
ngn 2024-08-09 03:18:03 +03:00
parent 7fc63f3693
commit cb9f5da339
4 changed files with 9 additions and 3 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-09 02:56+0300\n"
"POT-Creation-Date: 2024-08-09 03:16+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -74,7 +74,7 @@ bool lm_mptp_client_send(int sock, lm_mptp_t *packet) {
copy_to_buffer(buffer, packet->host, packet->header.host_size, &total, &used);
copy_to_buffer(buffer, packet->data, packet->header.data_size, &total, &used);
if (send(sock, buffer, sizeof(buffer), 0) < 0) {
if (send(sock, buffer, sizeof(buffer), MSG_MORE) < 0) {
lm_error_set(LM_ERR_MPTPSendFail);
return false;
}

View File

@ -97,6 +97,12 @@ bool lm_mptp_socket_opts(int sock){
return false;
}
if (setsockopt(sock, SOL_TCP, TCP_CORK, &flags, sizeof(int)) < 0) {
lm_error_set(LM_ERR_MPTPSetsockopt);
lm_mptp_close(sock);
return false;
}
return true;
}

View File

@ -120,7 +120,7 @@ bool lm_mptp_server_send(int sock, lm_mptp_t *packet) {
copy_to_buffer(buffer, packet->host, packet->header.host_size, &total, &used);
copy_to_buffer(buffer, packet->data, packet->header.data_size, &total, &used);
if (send(sock, buffer, buflen, 0) < 0) {
if (send(sock, buffer, buflen, MSG_MORE) < 0) {
lm_error_set(LM_ERR_MPTPSendFail);
return false;
}