Browse files

Removing the sending of the QUIT command to the server: The server do…

…es not have an implementation of this.

Causes an issue of the server throwing Connection reset by peer

Client establishes socket
Client sends command (next, update, peek, etc)
Client waits for response
Server sends response (+OK, -ERROR, etc)
Client receives response
Client sends QUIT
Client closes socket
Server receives QUIT 
Server responds -ERROR (valid error handling because QUIT is not a valid command)
  - Socket is closed so server throws ECONNECTRESET (and a SIGPIPE I think)

Server handles a few of these alright, but if the server is being sent commands a lot then the errors get stacked quickly and the eventual effect is a Seg Fault
  • Loading branch information...
1 parent f2e27af commit 9d95fa5f509bac8a5208cbe532a3bc1b231703bf @dwayn dwayn committed with Jun 18, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 clients/php/barbershop.c
2 clients/php/barbershop.c
@@ -235,7 +235,7 @@ PHPAPI int barbershop_sock_server_open(BarbershopSock *barbershop_sock, int forc
PHPAPI int barbershop_sock_disconnect(BarbershopSock *barbershop_sock TSRMLS_DC) {
int res = 0;
if (barbershop_sock->stream != NULL) {
- barbershop_sock_write(barbershop_sock, "QUIT", sizeof("QUIT") - 1);
+ //barbershop_sock_write(barbershop_sock, "QUIT", sizeof("QUIT") - 1);
barbershop_sock->stream = NULL;

0 comments on commit 9d95fa5

Please sign in to comment.