Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion proxy/InkAPITest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ server_handler(TSCont contp, TSEvent event, void *data)
SDK_RPRINT(params->test, params->api, "ServerEvent EOS", TC_PASS, "ok");
*params->pstatus = REGRESSION_TEST_PASSED;
delete params;
} else if (event == TS_EVENT_VCONN_READ_READY) {
SDK_RPRINT(params->test, params->api, "ServerEvent READ_READY", TC_PASS, "ok");
} else {
SDK_RPRINT(params->test, params->api, "ServerEvent", TC_FAIL, "received unexpected event %d", event);
*params->pstatus = REGRESSION_TEST_FAILED;
Expand All @@ -321,12 +323,15 @@ client_handler(TSCont contp, TSEvent event, void *data)
// Fix me: how to deal with server side cont?
TSContDestroy(contp);
return 1;
} else {
} else if (TS_EVENT_NET_CONNECT == event) {
sockaddr const *addr = TSNetVConnRemoteAddrGet(static_cast<TSVConn>(data));
uint16_t input_server_port = ats_ip_port_host_order(addr);

sleep(1); // XXX this sleep ensures the server end gets the accept event.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the sleep should be after the write because the point is to give the kernel time to trigger the accept. I'll make that change as I merge this.


UnixNetVConnection* vc = static_cast<UnixNetVConnection*>(data);
::write(vc->con.fd, "Bob's your uncle", 16);

if (ats_is_ip_loopback(addr)) {
SDK_RPRINT(params->test, params->api, "TSNetVConnRemoteIPGet", TC_PASS, "ok");
} else {
Expand Down