Guest User

Untitled

a guest
Apr 24th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. buf[numbytes] = '';
  2. string received = buf;
  3. string reply;
  4. string username;
  5.  
  6. cout << "server: received '" << received << "'n";
  7. if(received == "AUTH"){
  8. if (send(new_fd, "334 dXNlcm5hbWU6 ", 17, 0) == -1)
  9. perror("send");
  10. if ((numbytes = recv(new_fd, buf, MAXDATASIZE-1, 0)) == -1) {
  11. perror("recv");
  12. exit(1);
  13. }
  14. buf[numbytes] = '';
  15. received = buf;
  16. ofstream outfile;
  17. username = received;
  18. outfile.open("user_pass.txt");
  19. if(outfile.is_open()){
  20. outfile << username << ":";
  21. outfile.close();
  22. }
Add Comment
Please, Sign In to add comment