Skip to content

Commit

Permalink
Debugging recursive upload (client&server) and mkdir (client)
Browse files Browse the repository at this point in the history
  • Loading branch information
Organic-Code committed Nov 12, 2015
1 parent f4ebd1a commit a11dd57
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/client/createDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bool createDirectory( sf::TcpSocket& server, std::string const& current_director
spacket.clear();

server.receive( spacket );
sf::Int8 s_ans;
sf::Int32 s_ans;

if( !(spacket >> s_ans) ){

Expand Down
1 change: 1 addition & 0 deletions src/client/invite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ bool invite( sf::TcpSocket& server ){

if( !(spacket >> s_ans) ){
std::cout << "There was an error retrieving server answer." << std::endl;
std::cout << "The user creation might have failed." << std::endl;
return false;
}

Expand Down
14 changes: 5 additions & 9 deletions src/client/upload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,12 @@ bool recursiveUpload( sf::TcpSocket& server, std::string remote_directory, std::
spacket.clear();

server.receive( spacket );
sf::Int8 s_ans(0);
sf::Int32 s_ans(0);
spacket >> s_ans;
/*
switch( static_cast<char>(s_ans) ){
case Exist:
case AlreadyExist: break;
default: return false;
}
*/

if( static_cast<char>(s_ans) != Exist )
return false;

bool returned(true);

while( (pointed_elem = readdir( directory )) != NULL){
Expand Down
3 changes: 1 addition & 2 deletions src/client/userInputInterpret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ void userInputInterpret( sf::TcpSocket& server, std::string user_id ){
}
else if( user_input == "invite" ){

if( !invite( server ) )
std::cout << "Could not create the account" << std::endl;
invite( server );
}
else if( user_input == "version" ){

Expand Down
2 changes: 2 additions & 0 deletions src/server/a_createDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

bool a_createDirectory(Client& client) {

client.packet.clear();

switch(createDirectory(client.path)){

case AlreadyExist:
Expand Down

0 comments on commit a11dd57

Please sign in to comment.