X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=command.c;h=f4eeb524deaf87c303fec3ff78d4a56c278a8cff;hb=e74113b0e1a6ca1c047667218b089362372aa0f0;hp=8ea725de7898ef817a62c0ba2755c73a0f744572;hpb=7e60f73979da2e033eff54fd46eef63e6b70e07c;p=paraslash.git diff --git a/command.c b/command.c index 8ea725de..f4eeb524 100644 --- a/command.c +++ b/command.c @@ -717,8 +717,7 @@ EXPORT_SERVER_CMD_HANDLER(ff); static int com_jmp(struct command_context *cc, struct lls_parse_result *lpr) { - long unsigned int i; - int ret; + int i, ret; char *errctx; ret = lls(lls_check_arg_count(lpr, 1, 1, &errctx)); @@ -726,18 +725,16 @@ static int com_jmp(struct command_context *cc, struct lls_parse_result *lpr) send_errctx(cc, errctx); return ret; } - if (sscanf(lls_input(0, lpr), "%lu", &i) <= 0) + if (sscanf(lls_input(0, lpr), "%d", &i) <= 0) + return -ERRNO_TO_PARA_ERROR(EINVAL); + if (i < 0 || i > 100) return -ERRNO_TO_PARA_ERROR(EINVAL); mutex_lock(mmd_mutex); ret = -E_NO_AUDIO_FILE; if (!mmd->afd.afhi.chunks_total) goto out; - if (i > 100) - i = 100; - PARA_INFO_LOG("jumping to %lu%%\n", i); + PARA_INFO_LOG("jumping to %d%%\n", i); mmd->repos_request = (mmd->afd.afhi.chunks_total * i + 50) / 100; - PARA_INFO_LOG("sent: %lu, offset before jmp: %li\n", - mmd->chunks_sent, mmd->offset); mmd->new_vss_status_flags |= VSS_REPOS; mmd->new_vss_status_flags &= ~VSS_NEXT; ret = 1; @@ -790,6 +787,11 @@ static int parse_auth_request(char *buf, int len, const struct user **u, *p = '\0'; p++; create_argv(p, ",", &features); + /* + * Still accept sideband and AES feature requests (as a no-op) + * because some 0.6.x clients request them. The two checks + * below may be removed after 0.7.1. + */ for (i = 0; features[i]; i++) { if (strcmp(features[i], "sideband") == 0) continue; @@ -908,7 +910,7 @@ int handle_connect(int fd) /* send Welcome message */ ret = write_va_buffer(fd, "This is para_server, version " PACKAGE_VERSION ".\n" - "Features: sideband,aes_ctr128\n" + "Features:\n" ); if (ret < 0) goto net_err;