diff options
Diffstat (limited to 'src/util/test_connection.c')
-rw-r--r-- | src/util/test_connection.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/util/test_connection.c b/src/util/test_connection.c index 3519522ef..cb69f4036 100644 --- a/src/util/test_connection.c +++ b/src/util/test_connection.c | |||
@@ -75,9 +75,7 @@ open_listen_socket () | |||
75 | } | 75 | } |
76 | 76 | ||
77 | static void | 77 | static void |
78 | receive_check (void *cls, | 78 | receive_check (void *cls, const void *buf, size_t available, |
79 | const void *buf, | ||
80 | size_t available, | ||
81 | const struct sockaddr *addr, socklen_t addrlen, int errCode) | 79 | const struct sockaddr *addr, socklen_t addrlen, int errCode) |
82 | { | 80 | { |
83 | int *ok = cls; | 81 | int *ok = cls; |
@@ -93,11 +91,10 @@ receive_check (void *cls, | |||
93 | #if VERBOSE | 91 | #if VERBOSE |
94 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive needs more data\n"); | 92 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive needs more data\n"); |
95 | #endif | 93 | #endif |
96 | GNUNET_CONNECTION_receive (asock, | 94 | GNUNET_CONNECTION_receive (asock, 1024, |
97 | 1024, | ||
98 | GNUNET_TIME_relative_multiply | 95 | GNUNET_TIME_relative_multiply |
99 | (GNUNET_TIME_UNIT_SECONDS, 5), | 96 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, |
100 | &receive_check, cls); | 97 | cls); |
101 | } | 98 | } |
102 | else | 99 | else |
103 | { | 100 | { |
@@ -127,8 +124,7 @@ run_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
127 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 124 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
128 | "Test asks to receive on accepted socket\n"); | 125 | "Test asks to receive on accepted socket\n"); |
129 | #endif | 126 | #endif |
130 | GNUNET_CONNECTION_receive (asock, | 127 | GNUNET_CONNECTION_receive (asock, 1024, |
131 | 1024, | ||
132 | GNUNET_TIME_relative_multiply | 128 | GNUNET_TIME_relative_multiply |
133 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, | 129 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, |
134 | cls); | 130 | cls); |
@@ -162,15 +158,14 @@ task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
162 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test asks for write notification\n"); | 158 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test asks for write notification\n"); |
163 | #endif | 159 | #endif |
164 | GNUNET_assert (NULL != | 160 | GNUNET_assert (NULL != |
165 | GNUNET_CONNECTION_notify_transmit_ready (csock, | 161 | GNUNET_CONNECTION_notify_transmit_ready (csock, 12, |
166 | 12, | ||
167 | GNUNET_TIME_UNIT_SECONDS, | 162 | GNUNET_TIME_UNIT_SECONDS, |
168 | &make_hello, NULL)); | 163 | &make_hello, NULL)); |
169 | #if VERBOSE | 164 | #if VERBOSE |
170 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test prepares to accept\n"); | 165 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test prepares to accept\n"); |
171 | #endif | 166 | #endif |
172 | GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, | 167 | GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, ls, &run_accept, |
173 | ls, &run_accept, cls); | 168 | cls); |
174 | } | 169 | } |
175 | 170 | ||
176 | 171 | ||
@@ -185,8 +180,8 @@ check () | |||
185 | 180 | ||
186 | ok = 1; | 181 | ok = 1; |
187 | cfg = GNUNET_CONFIGURATION_create (); | 182 | cfg = GNUNET_CONFIGURATION_create (); |
188 | GNUNET_CONFIGURATION_set_value_string (cfg, | 183 | GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME", |
189 | "resolver", "HOSTNAME", "localhost"); | 184 | "localhost"); |
190 | GNUNET_SCHEDULER_run (&task, &ok); | 185 | GNUNET_SCHEDULER_run (&task, &ok); |
191 | GNUNET_CONFIGURATION_destroy (cfg); | 186 | GNUNET_CONFIGURATION_destroy (cfg); |
192 | return ok; | 187 | return ok; |