tuyau

Client/server for transfering files (like cp)
git clone https://noulin.net/git/tuyau.git
Log | Files | Refs | README

commit 0f8ace70814d23c4764edce4eb843fd411a31628
parent 2942d44a51881b74a16907f083c4e0c08228fd07
Author: Remy Noulin <loader2x@gmail.com>
Date:   Wed, 31 Aug 2022 01:46:21 -0400

make sure all data is sent in client

package.yml | 2 +-
sclient.c   | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)

Diffstat:
Mpackage.yml | 2+-
Msclient.c | 9++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/package.yml b/package.yml @@ -1,6 +1,6 @@ --- name: tuyau - version: 0.0.4 + version: 0.0.5 description: "Client for copying files to tuyauServer" bin: ./tuyau.c #cflags: -DA -g3 -std=gnu11 -fPIC -pipe diff --git a/sclient.c b/sclient.c @@ -396,10 +396,17 @@ int main(int ARGC, char** ARGV) { } // isReceive - close(sock); // release SSL state SSL_free(ssl); SSL_CTX_free(ssl_ctx); + // some data needs to be received in order to send all data to the server, SSL_write says all the data is sent but it is not true, why? + // 478 bytes are received. It seems to be encrypted. + // SSL_shutdown() and shutdown() don't help + int r = recv(sock, buf, sizeof(buf), 0); + if (r == -1) { + logE("recv before closing the socket"); + } + close(sock); }