jolly has uploaded this change for review.

View Change

FIXME: debug-code

Change-Id: Ib7dc6199cedd2cd24e6113675ec6bdeef801fa41
---
M include/osmocom/netif/stream.h
M src/stream_cli.c
M src/stream_srv.c
3 files changed, 23 insertions(+), 12 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/28/35928/1
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h
index 2e6aa97..837257d 100644
--- a/include/osmocom/netif/stream.h
+++ b/include/osmocom/netif/stream.h
@@ -10,14 +10,6 @@
* @{
*/

-/*! \brief Access SCTP flags from the msgb control buffer */
-#define OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION 0x80 /* sctp_recvmsg() flags=MSG_NOTIFICATION, msgb_data() contains "union sctp_notification*" */
-#define msgb_sctp_msg_flags(msg) (msg)->cb[2]
-
-/*! \brief Access the SCTP PPID from the msgb control buffer */
-#define msgb_sctp_ppid(msg) (msg)->cb[3]
-/*! \brief Access the SCTP Stream ID from the msgb control buffer */
-#define msgb_sctp_stream(msg) (msg)->cb[4]

/*! \brief Osmocom Stream Server Link: A server socket listening/accepting */
struct osmo_stream_srv_link;
diff --git a/src/stream_cli.c b/src/stream_cli.c
index 4a39166..832b06b 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -886,6 +886,7 @@

if (ret < 0) {
osmo_stream_cli_reconnect(cli);
+ printf("return after cli_reconnect\n");
return ret;
}

@@ -893,15 +894,19 @@

if (cli->flags & OSMO_STREAM_CLI_F_NODELAY) {
ret = stream_setsockopt_nodelay(fd, cli->proto, 1);
- if (ret < 0)
+ if (ret < 0) {
+ printf("return after nodelay\n");
goto error_close_socket;
+ }
}

switch (cli->mode) {
case OSMO_STREAM_MODE_OSMO_FD:
osmo_fd_setup(&cli->ofd, fd, OSMO_FD_READ | OSMO_FD_WRITE, osmo_stream_cli_fd_cb, cli, 0);
- if (osmo_fd_register(&cli->ofd) < 0)
+ if (osmo_fd_register(&cli->ofd) < 0) {
+ printf("return after fd_register\n");
goto error_close_socket;
+ }
break;
case OSMO_STREAM_MODE_OSMO_IO:
if (!cli->iofd) {
@@ -910,12 +915,16 @@
iofd_mode = OSMO_IO_FD_MODE_SCTP_RECVMSG_SEND;
cli->iofd = osmo_iofd_setup(cli, fd, cli->name, iofd_mode, &osmo_stream_cli_ioops, cli);
}
- if (!cli->iofd)
+ if (!cli->iofd) {
+ printf("return after iofd_setup\n");
goto error_close_socket;
+ }
configure_cli_segmentation_cb(cli->iofd, cli->segmentation_cb);

- if (osmo_iofd_register(cli->iofd, fd) < 0)
+ if (osmo_iofd_register(cli->iofd, fd) < 0) {
+ printf("return after iofd_register\n");
goto error_close_socket;
+ }
osmo_iofd_notify_connected(cli->iofd);
break;
default:
diff --git a/src/stream_srv.c b/src/stream_srv.c
index d493cdc..29ca910 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -897,6 +897,7 @@
default:
break;
}
+ OSMO_ASSERT(0);
return -EINVAL;
}


To view, visit change 35928. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ib7dc6199cedd2cd24e6113675ec6bdeef801fa41
Gerrit-Change-Number: 35928
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas@eversberg.eu>
Gerrit-MessageType: newchange