a volume is stored in the volume root of a share in a directory
.AppleDB like in Netatalk 2. Defaults to false. From FR#84.
* FIX: Small fix in the DSI tickle handling. Bug #528.
+* UPD: Enhance handling of connection attempts when hitting the
+ connection limit. Bug #529.
Changes in 3.0.5
================
return AFPERR_NOTAUTH;
}
+ if (obj->cnx_cnt >= obj->cnx_max) {
+ LOG(log_error, logtype_dsi, "login: too many connections, limit: %d", obj->cnx_max);
+ return AFPERR_MAXSESS;
+ }
+
LOG(log_note, logtype_afpd, "%s Login by %s",
afp_versions[afp_version_index].av_name, pwd->pw_name);
#define AFPSRVRINFO_FASTBOZO (1<<15) /* fast copying */
#define AFP_OK 0
+#define AFPERR_MAXSESS -1068 /* maximum number of allowed sessions reached */
#define AFPERR_DID1 -4000 /* not an afp error DID is 1*/
#define AFPERR_ACCESS -5000 /* permission denied */
#define AFPERR_AUTHCONT -5001 /* logincont */
LOG(log_error, logtype_dsi, "dsi_getsess: %s", strerror(errno));
close(ipc_fds[0]);
dsi->header.dsi_flags = DSIFL_REPLY;
- dsi->header.dsi_data.dsi_code = DSIERR_SERVBUSY;
+ dsi->header.dsi_data.dsi_code = htonl(DSIERR_SERVBUSY);
dsi_send(dsi);
dsi->header.dsi_data.dsi_code = DSIERR_OK;
kill(pid, SIGKILL);
return 0;
}
- /* child: check number of open connections. this is one off the
- * actual count. */
- if ((serv_children->servch_count >= serv_children->servch_nsessions) &&
- (dsi->header.dsi_command == DSIFUNC_OPEN)) {
- LOG(log_info, logtype_dsi, "dsi_getsess: too many connections");
- dsi->header.dsi_flags = DSIFL_REPLY;
- dsi->header.dsi_data.dsi_code = DSIERR_TOOMANY;
- dsi_send(dsi);
- exit(EXITERR_CLNT);
- }
+ /* Save number of existing and maximum connections */
+ dsi->AFPobj->cnx_cnt = serv_children->servch_count;
+ dsi->AFPobj->cnx_max = serv_children->servch_nsessions;
/* get rid of some stuff */
dsi->AFPobj->ipc_fd = ipc_fds[1];