diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-07 08:48:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-07 08:48:43 +0000 |
commit | 3853037fa5690e42397cb6e171f8bfc010f405a5 (patch) | |
tree | b497bd14eb5cf2ee4cd1f39cbef2d393f3276cae /src/transport | |
parent | 87da62e2d7df26addf33263ef2b6ba4c27faa44b (diff) | |
download | gnunet-3853037fa5690e42397cb6e171f8bfc010f405a5.tar.gz gnunet-3853037fa5690e42397cb6e171f8bfc010f405a5.zip |
rename coreAPI to core_api to follow naming conventions better
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/plugin_transport_smtp.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c index c305578e0..fa0c787d1 100644 --- a/src/transport/plugin_transport_smtp.c +++ b/src/transport/plugin_transport_smtp.c | |||
@@ -95,7 +95,7 @@ GNUNET_NETWORK_STRUCT_END | |||
95 | /** | 95 | /** |
96 | * apis (our advertised API and the core api ) | 96 | * apis (our advertised API and the core api ) |
97 | */ | 97 | */ |
98 | static GNUNET_CoreAPIForTransport *coreAPI; | 98 | static GNUNET_CoreAPIForTransport *core_api; |
99 | 99 | ||
100 | static struct GNUNET_GE_Context *ectx; | 100 | static struct GNUNET_GE_Context *ectx; |
101 | 101 | ||
@@ -322,8 +322,8 @@ listenAndDistribute (void *unused) | |||
322 | if ( (retl == NULL) || (smtp_shutdown == GNUNET_YES)) {\ | 322 | if ( (retl == NULL) || (smtp_shutdown == GNUNET_YES)) {\ |
323 | goto END; \ | 323 | goto END; \ |
324 | }\ | 324 | }\ |
325 | if (coreAPI->load_monitor != NULL) \ | 325 | if (core_api->load_monitor != NULL) \ |
326 | GNUNET_network_monitor_notify_transmission(coreAPI->load_monitor, GNUNET_ND_DOWNLOAD, strlen(retl)); \ | 326 | GNUNET_network_monitor_notify_transmission(core_api->load_monitor, GNUNET_ND_DOWNLOAD, strlen(retl)); \ |
327 | } while (0) | 327 | } while (0) |
328 | 328 | ||
329 | 329 | ||
@@ -390,7 +390,7 @@ listenAndDistribute (void *unused) | |||
390 | "SMTP message passed to the core.\n"); | 390 | "SMTP message passed to the core.\n"); |
391 | #endif | 391 | #endif |
392 | 392 | ||
393 | coreAPI->receive (coreMP); | 393 | core_api->receive (coreMP); |
394 | } | 394 | } |
395 | END: | 395 | END: |
396 | #if DEBUG_SMTP | 396 | #if DEBUG_SMTP |
@@ -449,7 +449,7 @@ api_create_hello () | |||
449 | EmailAddress *haddr; | 449 | EmailAddress *haddr; |
450 | int i; | 450 | int i; |
451 | 451 | ||
452 | GNUNET_GC_get_configuration_value_string (coreAPI->cfg, "SMTP", "FILTER", | 452 | GNUNET_GC_get_configuration_value_string (core_api->cfg, "SMTP", "FILTER", |
453 | "X-mailer: GNUnet", &filter); | 453 | "X-mailer: GNUnet", &filter); |
454 | if (NULL == strstr (filter, ": ")) | 454 | if (NULL == strstr (filter, ": ")) |
455 | { | 455 | { |
@@ -614,7 +614,7 @@ api_send (GNUNET_TSession * tsession, const void *msg, const unsigned int size, | |||
614 | mp = (SMTPMessage *) &m[size]; | 614 | mp = (SMTPMessage *) &m[size]; |
615 | mp->header.size = htons (size + sizeof (SMTPMessage)); | 615 | mp->header.size = htons (size + sizeof (SMTPMessage)); |
616 | mp->header.type = htons (0); | 616 | mp->header.type = htons (0); |
617 | mp->sender = *coreAPI->my_identity; | 617 | mp->sender = *core_api->my_identity; |
618 | gm_cls.ebody = NULL; | 618 | gm_cls.ebody = NULL; |
619 | gm_cls.pos = 0; | 619 | gm_cls.pos = 0; |
620 | gm_cls.esize = base64_encode (m, size + sizeof (SMTPMessage), &gm_cls.ebody); | 620 | gm_cls.esize = base64_encode (m, size + sizeof (SMTPMessage), &gm_cls.ebody); |
@@ -665,8 +665,8 @@ api_send (GNUNET_TSession * tsession, const void *msg, const unsigned int size, | |||
665 | } | 665 | } |
666 | if (stats != NULL) | 666 | if (stats != NULL) |
667 | stats->change (stat_bytesSent, size); | 667 | stats->change (stat_bytesSent, size); |
668 | if (coreAPI->load_monitor != NULL) | 668 | if (core_api->load_monitor != NULL) |
669 | GNUNET_network_monitor_notify_transmission (coreAPI->load_monitor, | 669 | GNUNET_network_monitor_notify_transmission (core_api->load_monitor, |
670 | GNUNET_ND_UPLOAD, gm_cls.esize); | 670 | GNUNET_ND_UPLOAD, gm_cls.esize); |
671 | smtp_message_reset_status (message); /* this is needed to plug a 28-byte/message memory leak in libesmtp */ | 671 | smtp_message_reset_status (message); /* this is needed to plug a 28-byte/message memory leak in libesmtp */ |
672 | smtp_destroy_session (session); | 672 | smtp_destroy_session (session); |
@@ -790,21 +790,21 @@ inittransport_smtp (struct GNUNET_CoreAPIForTransport * core) | |||
790 | unsigned long long mtu; | 790 | unsigned long long mtu; |
791 | struct sigaction sa; | 791 | struct sigaction sa; |
792 | 792 | ||
793 | coreAPI = core; | 793 | core_api = core; |
794 | ectx = core->ectx; | 794 | ectx = core->ectx; |
795 | if (!GNUNET_GC_have_configuration_value (coreAPI->cfg, "SMTP", "EMAIL")) | 795 | if (!GNUNET_GC_have_configuration_value (core_api->cfg, "SMTP", "EMAIL")) |
796 | { | 796 | { |
797 | GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER, | 797 | GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER, |
798 | _ | 798 | _ |
799 | ("No email-address specified, can not start SMTP transport.\n")); | 799 | ("No email-address specified, can not start SMTP transport.\n")); |
800 | return NULL; | 800 | return NULL; |
801 | } | 801 | } |
802 | GNUNET_GC_get_configuration_value_number (coreAPI->cfg, "SMTP", "MTU", 1200, | 802 | GNUNET_GC_get_configuration_value_number (core_api->cfg, "SMTP", "MTU", 1200, |
803 | SMTP_MESSAGE_SIZE, | 803 | SMTP_MESSAGE_SIZE, |
804 | SMTP_MESSAGE_SIZE, &mtu); | 804 | SMTP_MESSAGE_SIZE, &mtu); |
805 | GNUNET_GC_get_configuration_value_number (coreAPI->cfg, "SMTP", "RATELIMIT", | 805 | GNUNET_GC_get_configuration_value_number (core_api->cfg, "SMTP", "RATELIMIT", |
806 | 0, 0, 1024 * 1024, &rate_limit); | 806 | 0, 0, 1024 * 1024, &rate_limit); |
807 | stats = coreAPI->service_request ("stats"); | 807 | stats = core_api->service_request ("stats"); |
808 | if (stats != NULL) | 808 | if (stats != NULL) |
809 | { | 809 | { |
810 | stat_bytesReceived = | 810 | stat_bytesReceived = |
@@ -813,7 +813,7 @@ inittransport_smtp (struct GNUNET_CoreAPIForTransport * core) | |||
813 | stat_bytesDropped = | 813 | stat_bytesDropped = |
814 | stats->create (gettext_noop ("# bytes dropped by SMTP (outgoing)")); | 814 | stats->create (gettext_noop ("# bytes dropped by SMTP (outgoing)")); |
815 | } | 815 | } |
816 | GNUNET_GC_get_configuration_value_filename (coreAPI->cfg, "SMTP", "PIPE", &pipename); | 816 | GNUNET_GC_get_configuration_value_filename (core_api->cfg, "SMTP", "PIPE", &pipename); |
817 | UNLINK (pipename); | 817 | UNLINK (pipename); |
818 | if (0 != mkfifo (pipename, S_IWUSR | S_IRUSR | S_IWGRP | S_IWOTH)) | 818 | if (0 != mkfifo (pipename, S_IWUSR | S_IRUSR | S_IWGRP | S_IWOTH)) |
819 | { | 819 | { |
@@ -821,7 +821,7 @@ inittransport_smtp (struct GNUNET_CoreAPIForTransport * core) | |||
821 | GNUNET_GE_ADMIN | GNUNET_GE_BULK | GNUNET_GE_FATAL, | 821 | GNUNET_GE_ADMIN | GNUNET_GE_BULK | GNUNET_GE_FATAL, |
822 | "mkfifo"); | 822 | "mkfifo"); |
823 | GNUNET_free (pipename); | 823 | GNUNET_free (pipename); |
824 | coreAPI->service_release (stats); | 824 | core_api->service_release (stats); |
825 | stats = NULL; | 825 | stats = NULL; |
826 | return NULL; | 826 | return NULL; |
827 | } | 827 | } |
@@ -831,10 +831,10 @@ inittransport_smtp (struct GNUNET_CoreAPIForTransport * core) | |||
831 | GNUNET_GE_LOG_STRERROR (ectx, | 831 | GNUNET_GE_LOG_STRERROR (ectx, |
832 | GNUNET_GE_ADMIN | GNUNET_GE_BULK | | 832 | GNUNET_GE_ADMIN | GNUNET_GE_BULK | |
833 | GNUNET_GE_WARNING, "chmod"); | 833 | GNUNET_GE_WARNING, "chmod"); |
834 | GNUNET_GC_get_configuration_value_string (coreAPI->cfg, "SMTP", "EMAIL", NULL, | 834 | GNUNET_GC_get_configuration_value_string (core_api->cfg, "SMTP", "EMAIL", NULL, |
835 | &email); | 835 | &email); |
836 | lock = GNUNET_mutex_create (GNUNET_NO); | 836 | lock = GNUNET_mutex_create (GNUNET_NO); |
837 | GNUNET_GC_get_configuration_value_string (coreAPI->cfg, "SMTP", "SERVER", | 837 | GNUNET_GC_get_configuration_value_string (core_api->cfg, "SMTP", "SERVER", |
838 | "localhost:25", &smtp_server_name); | 838 | "localhost:25", &smtp_server_name); |
839 | sa.sa_handler = SIG_IGN; | 839 | sa.sa_handler = SIG_IGN; |
840 | sigemptyset (&sa.sa_mask); | 840 | sigemptyset (&sa.sa_mask); |
@@ -864,7 +864,7 @@ donetransport_smtp () | |||
864 | GNUNET_free (smtp_server_name); | 864 | GNUNET_free (smtp_server_name); |
865 | if (stats != NULL) | 865 | if (stats != NULL) |
866 | { | 866 | { |
867 | coreAPI->service_release (stats); | 867 | core_api->service_release (stats); |
868 | stats = NULL; | 868 | stats = NULL; |
869 | } | 869 | } |
870 | GNUNET_mutex_destroy (lock); | 870 | GNUNET_mutex_destroy (lock); |