aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_plugin_transport_https.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/transport/test_plugin_transport_https.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/transport/test_plugin_transport_https.c')
-rw-r--r--src/transport/test_plugin_transport_https.c67
1 files changed, 26 insertions, 41 deletions
diff --git a/src/transport/test_plugin_transport_https.c b/src/transport/test_plugin_transport_https.c
index e6e71c7f5..5b78f89b4 100644
--- a/src/transport/test_plugin_transport_https.c
+++ b/src/transport/test_plugin_transport_https.c
@@ -559,10 +559,9 @@ static void run_connection_tests (int phase, void *cls);
559static struct GNUNET_TIME_Relative 559static struct GNUNET_TIME_Relative
560receive (void *cls, const struct GNUNET_PeerIdentity *peer, 560receive (void *cls, const struct GNUNET_PeerIdentity *peer,
561 const struct GNUNET_MessageHeader *message, 561 const struct GNUNET_MessageHeader *message,
562 const struct GNUNET_TRANSPORT_ATS_Information *ats, 562 const struct GNUNET_TRANSPORT_ATS_Information *ats, uint32_t ats_count,
563 uint32_t ats_count, 563 struct Session *session, const char *sender_address,
564 struct Session *session, 564 uint16_t sender_address_len)
565 const char *sender_address, uint16_t sender_address_len)
566{ 565{
567 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 566 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
568 "Testcase recieved new message from peer `%s' with type %u and length %u, session %X\n", 567 "Testcase recieved new message from peer `%s' with type %u and length %u, session %X\n",
@@ -723,9 +722,8 @@ send_execute (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
723 722
724 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 723 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
725 _("curl failed for `%s' at %s:%d: `%s'\n"), 724 _("curl failed for `%s' at %s:%d: `%s'\n"),
726 "curl_multi_perform", 725 "curl_multi_perform", __FILE__, __LINE__,
727 __FILE__, 726 curl_easy_strerror (msg->data.result));
728 __LINE__, curl_easy_strerror (msg->data.result));
729 /* sending msg failed */ 727 /* sending msg failed */
730 curl_easy_cleanup (curl_handle); 728 curl_easy_cleanup (curl_handle);
731 curl_handle = NULL; 729 curl_handle = NULL;
@@ -826,8 +824,7 @@ send_prepare (struct HTTP_Transfer *result)
826 mret = curl_multi_fdset (multi_handle, &rs, &ws, &es, &max); 824 mret = curl_multi_fdset (multi_handle, &rs, &ws, &es, &max);
827 if (mret != CURLM_OK) 825 if (mret != CURLM_OK)
828 { 826 {
829 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 827 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%s failed at %s:%d: `%s'\n"),
830 _("%s failed at %s:%d: `%s'\n"),
831 "curl_multi_fdset", __FILE__, __LINE__, 828 "curl_multi_fdset", __FILE__, __LINE__,
832 curl_multi_strerror (mret)); 829 curl_multi_strerror (mret));
833 return -1; 830 return -1;
@@ -835,8 +832,7 @@ send_prepare (struct HTTP_Transfer *result)
835 mret = curl_multi_timeout (multi_handle, &to); 832 mret = curl_multi_timeout (multi_handle, &to);
836 if (mret != CURLM_OK) 833 if (mret != CURLM_OK)
837 { 834 {
838 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 835 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%s failed at %s:%d: `%s'\n"),
839 _("%s failed at %s:%d: `%s'\n"),
840 "curl_multi_timeout", __FILE__, __LINE__, 836 "curl_multi_timeout", __FILE__, __LINE__,
841 curl_multi_strerror (mret)); 837 curl_multi_strerror (mret));
842 return -1; 838 return -1;
@@ -955,8 +951,7 @@ notify_address (void *cls, int add_remove, const void *addr, size_t addrlen)
955} 951}
956 952
957static void 953static void
958plugin_env_session_end (void *cls, 954plugin_env_session_end (void *cls, const struct GNUNET_PeerIdentity *peer,
959 const struct GNUNET_PeerIdentity *peer,
960 struct Session *session) 955 struct Session *session)
961{ 956{
962 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 957 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1230,9 +1225,8 @@ run_connection_tests (int phase, void *cls)
1230 * @param c configuration to use 1225 * @param c configuration to use
1231 */ 1226 */
1232static void 1227static void
1233run (void *cls, 1228run (void *cls, char *const *args, const char *cfgfile,
1234 char *const *args, 1229 const struct GNUNET_CONFIGURATION_Handle *c)
1235 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
1236{ 1230{
1237 char *libname; 1231 char *libname;
1238 1232
@@ -1264,14 +1258,11 @@ run (void *cls,
1264 1258
1265 1259
1266 if ((GNUNET_OK != 1260 if ((GNUNET_OK !=
1267 GNUNET_CONFIGURATION_get_value_number (c, 1261 GNUNET_CONFIGURATION_get_value_number (c, "TRANSPORT", "NEIGHBOUR_LIMIT",
1268 "TRANSPORT",
1269 "NEIGHBOUR_LIMIT",
1270 &tneigh)) || 1262 &tneigh)) ||
1271 (GNUNET_OK != 1263 (GNUNET_OK !=
1272 GNUNET_CONFIGURATION_get_value_filename (c, 1264 GNUNET_CONFIGURATION_get_value_filename (c, "GNUNETD", "HOSTKEY",
1273 "GNUNETD", 1265 &keyfile)))
1274 "HOSTKEY", &keyfile)))
1275 { 1266 {
1276 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1267 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1277 _ 1268 _
@@ -1282,14 +1273,11 @@ run (void *cls,
1282 } 1273 }
1283 1274
1284 if ((GNUNET_OK != 1275 if ((GNUNET_OK !=
1285 GNUNET_CONFIGURATION_get_value_number (cfg, 1276 GNUNET_CONFIGURATION_get_value_number (cfg, "transport-https", "PORT",
1286 "transport-https", 1277 &port)) || (port > 65535) ||
1287 "PORT", 1278 (port == 0))
1288 &port)) ||
1289 (port > 65535) || (port == 0))
1290 { 1279 {
1291 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, 1280 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "https",
1292 "https",
1293 _ 1281 _
1294 ("Require valid port number for transport plugin `%s' in configuration!\n"), 1282 ("Require valid port number for transport plugin `%s' in configuration!\n"),
1295 "transport-http"); 1283 "transport-http");
@@ -1298,9 +1286,8 @@ run (void *cls,
1298 /* Get private key file from config */ 1286 /* Get private key file from config */
1299 if (GNUNET_CONFIGURATION_have_value (cfg, "transport-https", "KEY_FILE")) 1287 if (GNUNET_CONFIGURATION_have_value (cfg, "transport-https", "KEY_FILE"))
1300 { 1288 {
1301 GNUNET_CONFIGURATION_get_value_string (cfg, 1289 GNUNET_CONFIGURATION_get_value_string (cfg, "transport-https", "KEY_FILE",
1302 "transport-https", 1290 &key_file);
1303 "KEY_FILE", &key_file);
1304 } 1291 }
1305 if (key_file == NULL) 1292 if (key_file == NULL)
1306 GNUNET_asprintf (&key_file, "https.key"); 1293 GNUNET_asprintf (&key_file, "https.key");
@@ -1319,9 +1306,8 @@ run (void *cls,
1319 /* Get private key file from config */ 1306 /* Get private key file from config */
1320 if (GNUNET_CONFIGURATION_have_value (cfg, "transport-https", "CERT_FILE")) 1307 if (GNUNET_CONFIGURATION_have_value (cfg, "transport-https", "CERT_FILE"))
1321 { 1308 {
1322 GNUNET_CONFIGURATION_get_value_string (cfg, 1309 GNUNET_CONFIGURATION_get_value_string (cfg, "transport-https", "CERT_FILE",
1323 "transport-https", 1310 &cert_file);
1324 "CERT_FILE", &cert_file);
1325 } 1311 }
1326 if (cert_file == NULL) 1312 if (cert_file == NULL)
1327 GNUNET_asprintf (&cert_file, "https.cert"); 1313 GNUNET_asprintf (&cert_file, "https.cert");
@@ -1511,12 +1497,11 @@ main (int argc, char *const *argv)
1511 GNUNET_DISK_directory_remove (servicehome); 1497 GNUNET_DISK_directory_remove (servicehome);
1512 GNUNET_CONFIGURATION_destroy (cfg); 1498 GNUNET_CONFIGURATION_destroy (cfg);
1513 1499
1514 ret = (GNUNET_OK == 1500 ret =
1515 GNUNET_PROGRAM_run (5, 1501 (GNUNET_OK ==
1516 argv_prog, 1502 GNUNET_PROGRAM_run (5, argv_prog, "test_gnunet_transport_plugin.https",
1517 "test_gnunet_transport_plugin.https", 1503 "testcase", options, &run,
1518 "testcase", options, &run, 1504 NULL)) ? GNUNET_NO : GNUNET_YES;
1519 NULL)) ? GNUNET_NO : GNUNET_YES;
1520 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("\ndelete\n\n")); 1505 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("\ndelete\n\n"));
1521 if (servicehome != NULL) 1506 if (servicehome != NULL)
1522 { 1507 {