X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libatalk%2Fdsi%2Fdsi_init.c;fp=libatalk%2Fdsi%2Fdsi_init.c;h=568f9ffdfd9f6565547f453f45a0f1ea49ed409e;hb=a2ddc8384c1881c66db1fbba6698bfd09da84b64;hp=ee75fcc71ebb26be21a7c3ca40241c352a1d2409;hpb=85eb0fd28ff87289d2f49a0230c07e7a7c56e101;p=netatalk.git diff --git a/libatalk/dsi/dsi_init.c b/libatalk/dsi/dsi_init.c index ee75fcc7..568f9ffd 100644 --- a/libatalk/dsi/dsi_init.c +++ b/libatalk/dsi/dsi_init.c @@ -15,32 +15,21 @@ #include #include "dsi_private.h" -DSI *dsi_init(const dsi_proto protocol, const char *program, - const char *hostname, const char *address, - const char *port, const int proxy, const uint32_t quantum) +DSI *dsi_init(AFPObj *obj, const char *hostname, const char *address, const char *port) { DSI *dsi; - if ((dsi = (DSI *) calloc(1, sizeof(DSI))) == NULL) { - return( NULL ); - } - dsi->attn_quantum = DSI_DEFQUANT; /* default quantum size */ - dsi->server_quantum = quantum; /* default server quantum */ - dsi->program = program; - - switch (protocol) { - /* currently the only transport protocol that exists for dsi */ - case DSI_TCPIP: - if (!dsi_tcp_init(dsi, hostname, address, port, proxy)) { - free(dsi); - dsi = NULL; - } - break; - - default: /* unknown protocol */ - free(dsi); - dsi = NULL; - break; + if ((dsi = (DSI *)calloc(1, sizeof(DSI))) == NULL) + return NULL; + + dsi->attn_quantum = DSI_DEFQUANT; + dsi->server_quantum = obj->options.server_quantum; + dsi->dsireadbuf = obj->options->dsireadbuf; + + /* currently the only transport protocol that exists for dsi */ + if (dsi_tcp_init(dsi, hostname, address, port) != 0) { + free(dsi); + dsi = NULL; } return dsi;