@@ -370,7 +370,7 @@ static void client_init(struct client *client)
370370 client -> connected = false;
371371 client -> clean_session = true;
372372 client -> client_id [0 ] = '\0' ;
373- client -> status = WAITING_HEADER ;
373+ client -> state = WAITING_HEADER ;
374374 client -> rc = 0 ;
375375 client -> rpos = 0 ;
376376 client -> read = 0 ;
@@ -446,8 +446,8 @@ static ssize_t recv_packet(struct client *c)
446446 unsigned opcode = 0 , pos = 0 ;
447447 unsigned int pktlen = 0LL ;
448448
449- // Base status , we have read 0 to 2 bytes
450- if (c -> status == WAITING_HEADER ) {
449+ // Base state , we have read 0 to 2 bytes
450+ if (c -> state == WAITING_HEADER ) {
451451
452452 /*
453453 * Read the first two bytes, the first should contain the message
@@ -463,7 +463,7 @@ static ssize_t recv_packet(struct client *c)
463463 if (errno == EAGAIN && c -> read < 2 )
464464 return - ERREAGAIN ;
465465
466- c -> status = WAITING_LENGTH ;
466+ c -> state = WAITING_LENGTH ;
467467 }
468468
469469 /*
@@ -473,7 +473,7 @@ static ssize_t recv_packet(struct client *c)
473473 * case of ACK type packet or PINGREQ/PINGRESP and DISCONNECT, the
474474 * entire packet
475475 */
476- if (c -> status == WAITING_LENGTH ) {
476+ if (c -> state == WAITING_LENGTH ) {
477477
478478 if (c -> read == 2 ) {
479479 opcode = * c -> rbuf >> 4 ;
@@ -538,11 +538,11 @@ static ssize_t recv_packet(struct client *c)
538538 if (pktlen <= 4 )
539539 goto exit ;
540540
541- c -> status = WAITING_DATA ;
541+ c -> state = WAITING_DATA ;
542542 }
543543
544544 /*
545- * Last status , we have access to the length of the packet and we know
545+ * Last state , we have access to the length of the packet and we know
546546 * for sure that it's not a PINGREQ/PINGRESP/DISCONNECT packet.
547547 */
548548 nread = recv_data (& c -> conn , c -> rbuf + c -> read , c -> toread - c -> read );
@@ -649,9 +649,9 @@ static void write_callback(struct ev_ctx *ctx, void *arg)
649649 /*
650650 * Rearm descriptor making it ready to receive input,
651651 * read_callback will be the callback to be used; also reset the
652- * read buffer status for the client.
652+ * read buffer state for the client.
653653 */
654- client -> status = WAITING_HEADER ;
654+ client -> state = WAITING_HEADER ;
655655 ev_fire_event (ctx , client -> conn .fd , EV_READ , read_callback , client );
656656 break ;
657657 case - ERREAGAIN :
@@ -728,7 +728,7 @@ static void accept_callback(struct ev_ctx *ctx, void *data)
728728static void read_callback (struct ev_ctx * ctx , void * data )
729729{
730730 struct client * c = data ;
731- if (c -> status == SENDING_DATA )
731+ if (c -> state == SENDING_DATA )
732732 return ;
733733 /*
734734 * Received a bunch of data from a client, after the creation
@@ -745,7 +745,7 @@ static void read_callback(struct ev_ctx *ctx, void *data)
745745 */
746746 /* Record last action as of now */
747747 c -> last_seen = time (NULL );
748- c -> status = SENDING_DATA ;
748+ c -> state = SENDING_DATA ;
749749 process_message (ctx , c );
750750 break ;
751751 case - ERRCLIENTDC :
@@ -839,7 +839,7 @@ static void process_message(struct ev_ctx *ctx, struct client *c)
839839 log_error (solerr (c -> rc ));
840840 break ;
841841 default :
842- c -> status = WAITING_HEADER ;
842+ c -> state = WAITING_HEADER ;
843843 if (io .data .header .bits .type != PUBLISH )
844844 mqtt_packet_destroy (& io .data );
845845 break ;
0 commit comments