Skip to content

Commit c830e34

Browse files
committed
Fix bad check from old connection code.
Also remove a broken test, this should probably be replaced.
1 parent e68aefd commit c830e34

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

src/connection.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ int Connection_deliver(Connection *conn, bstring buf)
900900
check(conn->iob != NULL, "There's no IOBuffer to send to, Tell Zed.");
901901
/* The deliver task will free the buffer */
902902
rc = Connection_deliver_enqueue(conn,b64_buf);
903-
check_debug(rc == blength(b64_buf)+1, "Failed to write entire message to conn %d", IOBuf_fd(conn->iob));
903+
check_debug(rc == 0, "Failed to write message to conn %d", IOBuf_fd(conn->iob));
904904

905905
return 0;
906906

tests/connection_tests.c

-18
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,6 @@ char *test_Connection_create_destroy()
2020
return NULL;
2121
}
2222

23-
char *test_Connection_deliver()
24-
{
25-
bstring t1;
26-
const char remote[IPADDR_SIZE];
27-
Connection *conn = Connection_create(NULL, 1, 0, remote);
28-
mu_assert(conn != NULL, "Failed to create a connection.");
29-
30-
int rc = Connection_deliver(conn, t1 = bfromcstr("TEST"));
31-
// depending on the platform this will fail or not if send is allowed on files
32-
mu_assert(rc == -1, "Should NOT be able to write.");
33-
34-
Connection_destroy(conn);
35-
bdestroy(t1);
36-
37-
return NULL;
38-
}
39-
4023
int test_task_with_sample(const char *sample_file)
4124
{
4225
(void)sample_file;
@@ -99,7 +82,6 @@ char * all_tests() {
9982
Server_set_default_host(SRV, zedshaw_com);
10083

10184
mu_run_test(test_Connection_create_destroy);
102-
mu_run_test(test_Connection_deliver);
10385
mu_run_test(test_Connection_task);
10486

10587
Server_destroy(SRV);

0 commit comments

Comments
 (0)