int sc_applet_sync_recv(struct stconn *sc);
void sc_applet_sync_send(struct stconn *sc);
+int sc_applet_sync_recv(struct stconn *sc);
+void sc_applet_sync_send(struct stconn *sc);
+
/* returns the channel which receives data from this stream connector (input channel) */
static inline struct channel *sc_ic(const struct stconn *sc)
sc->app_ops->chk_snd(sc);
}
+
+/* Perform a synchronous receive using the right version, depending the endpoing
+ * is a connection or an applet.
+ */
+static inline int sc_sync_recv(struct stconn *sc)
+{
+ if (sc_ep_test(sc, SE_FL_T_MUX))
+ return sc_conn_sync_recv(sc);
+ else if (sc_ep_test(sc, SE_FL_T_APPLET))
+ return sc_applet_sync_recv(sc);
+ return 0;
+}
+
+/* Perform a synchronous send using the right version, depending the endpoing is
+ * a connection or an applet.
+ */
+static inline void sc_sync_send(struct stconn *sc)
+{
+ if (sc_ep_test(sc, SE_FL_T_MUX))
+ sc_conn_sync_send(sc);
+ else if (sc_ep_test(sc, SE_FL_T_APPLET))
+ sc_applet_sync_send(sc);
+}
+
/* Combines both sc_update_rx() and sc_update_tx() at once */
static inline void sc_update(struct stconn *sc)
{
*/
int sc_applet_sync_recv(struct stconn *sc)
{
+ if (!(__sc_appctx(sc)->flags & APPCTX_FL_INOUT_BUFS))
+ return 0;
+
if (!sc_state_in(sc->state, SC_SB_RDY|SC_SB_EST))
return 0;
oc->flags &= ~CF_WRITE_EVENT;
+ if (!(__sc_appctx(sc)->flags & APPCTX_FL_INOUT_BUFS))
+ return;
+
if (sc->flags & SC_FL_SHUT_DONE)
return;