Skip to content

Commit

Permalink
MINOR: to get message code from filter
Browse files Browse the repository at this point in the history
  • Loading branch information
krasnov committed Nov 24, 2008
1 parent 2dc436d commit 03a0479
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libvzsock.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ struct vzsock_ctx {
/* specific data */
void *data;
int debug;
// int code; /* reply code from server side, used on client only */
int code; /* reply code from server side, used on client only */
int errcode;
char errmsg[BUFSIZ];
int (*logger)(int level, const char *fmt, va_list pvar);
int (*readpwd)(const char *prompt, char *pass, size_t size);
int (*filter)(const char *buffer, char *data, size_t *size);
int (*filter)(const char *buffer, int *code, char *data, size_t *size);
char tmpdir[PATH_MAX+1];
char password[BUFSIZ];
long tmo;
Expand Down
4 changes: 2 additions & 2 deletions vzsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int vzsock_set(struct vzsock_ctx *ctx, int type, void *data, size_t size)
ctx->readpwd = (int (*)(const char *, char *, size_t))data;
break;
case VZSOCK_DATA_FILTER:
ctx->filter = (int (*)(const char *, char *, size_t *))data;
ctx->filter = (int (*)(const char *, int *, char *, size_t *))data;
break;
default:
return handlers->set(ctx, type, data, size);
Expand Down Expand Up @@ -303,7 +303,7 @@ int vzsock_recv(
memcpy(data, buffer, *size);
return 0;
}
ret = ctx->filter(buffer, data, size);
ret = ctx->filter(buffer, &ctx->code, data, size);
if (ret == 0) {
return 0;
} else if (ret < 0) {
Expand Down

0 comments on commit 03a0479

Please sign in to comment.