Même pb à régler au niveau du BUFFER post transaction
This commit is contained in:
parent
67fe286a03
commit
bfe3d33355
|
@ -169,7 +169,7 @@ void CONNECT_CLIENT(char* serverHost, char* serverPort, int* pSocket){
|
|||
|
||||
|
||||
void CLIENT_SEND(int* pSocket, char* pRequest, char** pAnswer){
|
||||
if( DEBUGMOD&HDR ) printf("====== CLIENT_SEND(%d, %s, %s) ======\n\n", *pSocket, pRequest, *pRequest);
|
||||
if( DEBUGMOD&HDR ) printf("====== CLIENT_SEND(%d, %s, %s) ======\n\n", *pSocket, pRequest, *pAnswer);
|
||||
char BUFFER[maxBuffLen] = {0};
|
||||
|
||||
/* [5] On écrit sur la socket
|
||||
|
|
19
dep/server.c
19
dep/server.c
|
@ -92,8 +92,8 @@ void DROP_SERVER(char* serverHost, char** givenPort, int* listenSocket){
|
|||
|
||||
if( getInfo == -1 ) return;
|
||||
|
||||
if( DEBUGMOD&SCKL ) printf("Server host: %s\n", infoHost);
|
||||
if( DEBUGMOD&SCKL ) printf("Server port: %s\n", infoPort);
|
||||
if( DEBUGMOD&SCK ) printf("Server host: %s\n", infoHost);
|
||||
if( DEBUGMOD&SCK ) printf("Server port: %s\n", infoPort);
|
||||
|
||||
|
||||
// on a plus besoin des infos de l'adresse
|
||||
|
@ -271,10 +271,8 @@ void MANAGE_RESPONSE(int* USER_SOCKET, int* FTP_SOCKET, char* pAnswer, int* DUSE
|
|||
char BUFFER[maxBuffLen];
|
||||
|
||||
/* 1. Envoi au client de l'écoute de la réponse (associée) du BUS DE DONNEES */
|
||||
sread(FTP_SOCKET, BUFFER);
|
||||
if( DEBUGMOD&CMD ) xPrint("F->P: %s\n", BUFFER);
|
||||
swrite(USER_SOCKET, "150 Connection établie!\n");
|
||||
if( DEBUGMOD&CMD ) xPrint("P->C: %s\n", "150 Connection établie!\n");
|
||||
// sread(FTP_SOCKET, BUFFER);
|
||||
// if( DEBUGMOD&CMD ) xPrint("F->P: %s\n", BUFFER);
|
||||
|
||||
/* 2. On lit la SOCKET FTP (BUS DE DONNEES)*/
|
||||
int nbRead = WAIT_SOCKET_UPDATE(DFTP_SOCKET, BUFFER);
|
||||
|
@ -299,10 +297,13 @@ void MANAGE_RESPONSE(int* USER_SOCKET, int* FTP_SOCKET, char* pAnswer, int* DUSE
|
|||
|
||||
|
||||
// on vide les SOCKET FTP des 2 BUS
|
||||
// WAIT_SOCKET_UPDATE(FTP_SOCKET, BUFFER); // command
|
||||
// WAIT_SOCKET_UPDATE(DFTP_SOCKET, BUFFER); // données
|
||||
// printf("")
|
||||
WAIT_SOCKET_UPDATE(FTP_SOCKET, BUFFER); // command
|
||||
if( DEBUGMOD&SCK ) printf("FTP[CMD] vidé: %s\n", BUFFER);
|
||||
WAIT_SOCKET_UPDATE(DFTP_SOCKET, BUFFER); // données
|
||||
if( DEBUGMOD&SCK ) printf("FTP[DAT] vidé: %s\n", BUFFER);
|
||||
|
||||
swrite(USER_SOCKET, "150 Connection établie!\n");
|
||||
if( DEBUGMOD&CMD ) xPrint("P->C: %s\n", "150 Connection établie!\n");
|
||||
|
||||
// fin de la transaction
|
||||
strcpy(response, "226 Données reçues!\n");
|
||||
|
|
|
@ -102,7 +102,7 @@ static void* testServer(char* localPort){
|
|||
|
||||
/* [5] Redirection vers le serveur FTP
|
||||
============================================================================*/
|
||||
xPrint("P->F: %s\n\n", BUFFER);
|
||||
if( DEBUGMOD&CMD ) xPrint("P->F: %s\n\n", BUFFER);
|
||||
CLIENT_SEND(&FTP_SOCKET, BUFFER, &ftp_response);
|
||||
if( DEBUGMOD&CMD ) xPrint("F->P: %s\n", ftp_response);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define BUF 0x10 // FILTRE pour ONLY_BUFFERS
|
||||
#define HDR 0x20 // FILTRE pour ONLY_HEADERS
|
||||
|
||||
#define DEBUGMOD ONLY_SOCKETS
|
||||
#define DEBUGMOD ONLY_REVEALS
|
||||
|
||||
|
||||
/* vars */
|
||||
|
|
Loading…
Reference in New Issue