@@ -372,7 +372,7 @@ static int connect_handler(struct io_event *e) {
372372 // TODO check for will_topic != NULL
373373 struct topic * t = topic_get_or_create (& server , will_topic );
374374 if (!t )
375- log_critical ("connect_handler failed: Out of memory" );
375+ log_fatal ("connect_handler failed: Out of memory" );
376376 if (!topic_exists (& server , t -> name ))
377377 topic_put (& server , t );
378378 // I'm sure that the string will be NUL terminated by unpack function
@@ -391,15 +391,15 @@ static int connect_handler(struct io_event *e) {
391391 };
392392
393393 if (!cc -> session -> lwt_msg .publish .topic || !cc -> session -> lwt_msg .publish .payload )
394- log_critical ("connect_handler failed: Out of memory" );
394+ log_fatal ("connect_handler failed: Out of memory" );
395395
396396 cc -> session -> lwt_msg .header .bits .qos = c -> bits .will_qos ;
397397 // We must store the retained message in the topic
398398 if (c -> bits .will_retain == 1 ) {
399399 size_t publen = mqtt_size (& cc -> session -> lwt_msg , NULL );
400400 unsigned char * payload = xmalloc (publen );
401401 if (!payload )
402- log_critical ("connect_handler failed: Out of memory" )
402+ log_fatal ("connect_handler failed: Out of memory" )
403403 mqtt_pack (& cc -> session -> lwt_msg , payload );
404404 // We got a ready-to-be-sent bytestring in the retained message
405405 // field
@@ -449,11 +449,11 @@ static inline void add_wildcard(const char *topic, struct subscriber *s,
449449 bool wildcard ) {
450450 struct subscription * subscription = xmalloc (sizeof (* subscription ));
451451 if (!subscription )
452- log_critical ("add_wildcard failed: Out of memory" );
452+ log_fatal ("add_wildcard failed: Out of memory" );
453453 subscription -> subscriber = s ;
454454 subscription -> topic = xstrdup (topic );
455455 if (!subscription -> topic )
456- log_critical ("add_wildcard failed: Out of memory" );
456+ log_fatal ("add_wildcard failed: Out of memory" );
457457 subscription -> multilevel = wildcard ;
458458 INCREF (s , struct subscriber );
459459 server .wildcards = list_push (server .wildcards , subscription );
@@ -516,7 +516,7 @@ static int subscribe_handler(struct io_event *e) {
516516
517517 struct topic * t = topic_get_or_create (& server , topic );
518518 if (!t )
519- log_critical ("subscribe_handler failed: Out of memory" );
519+ log_fatal ("subscribe_handler failed: Out of memory" );
520520 /*
521521 * Let's explore two possible scenarios:
522522 * 1. Normal topic (no single level wildcard '+') which can end with
@@ -666,7 +666,7 @@ static int publish_handler(struct io_event *e) {
666666 */
667667 struct topic * t = topic_get_or_create (& server , topic );
668668 if (!t )
669- log_critical ("publish_handler failed: Out of memory" );
669+ log_fatal ("publish_handler failed: Out of memory" );
670670
671671 /* Check for # wildcards subscriptions */
672672 if (list_size (server .wildcards ) > 0 ) {
@@ -697,7 +697,7 @@ static int publish_handler(struct io_event *e) {
697697 if (hdr -> bits .retain == 1 ) {
698698 t -> retained_msg = xmalloc (mqtt_size (& e -> data , NULL ));
699699 if (!t -> retained_msg )
700- log_critical ("publish_handler failed: Out of memory" );
700+ log_fatal ("publish_handler failed: Out of memory" );
701701 mqtt_pack (& e -> data , t -> retained_msg );
702702 }
703703#if THREADSNR > 0
0 commit comments